From 66ac0f3f92435fd884fd68e5de1974266db956f2 Mon Sep 17 00:00:00 2001 From: "Sergey Levchenko (GitHub)" Date: Fri, 12 May 2017 14:42:20 +0300 Subject: Fix SDL does not return URLs in response of GetURLs RPC Fixed absence of URLs in response of GetURLs RPC, which been caused due to wrong URLs processing. --- .../src/commands/hmi/get_urls.cc | 36 +++++++++------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc index e7c5244ddc..482c7d5ef1 100644 --- a/src/components/application_manager/src/commands/hmi/get_urls.cc +++ b/src/components/application_manager/src/commands/hmi/get_urls.cc @@ -34,6 +34,7 @@ #include "application_manager/message.h" #include "application_manager/application_manager.h" #include "application_manager/policies/policy_handler.h" +#include "utils/helpers.h" namespace application_manager { namespace commands { @@ -190,32 +191,25 @@ void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) { object[msg_params][hmi_response::urls] = SmartObject(SmartType_Array); SmartObject& urls = object[msg_params][hmi_response::urls]; const std::string mobile_app_id = app->policy_app_id(); - std::string default_url = "URL is not found"; - // Will use only one URL for particular application if it will be found - // Otherwise URL from default section will used - SmartObject service_info = SmartObject(SmartType_Map); + size_t index = 0; + for (size_t i = 0; i < endpoints.size(); ++i) { + using namespace helpers; - for (size_t e = 0; e < endpoints.size(); ++e) { - if (mobile_app_id == endpoints[e].app_id) { - if (endpoints[e].url.size()) { - service_info[url] = endpoints[e].url[0]; - SendResponseToHMI(Common_Result::SUCCESS); - return; - } - } - if (policy::kDefaultId == endpoints[e].app_id) { - if (endpoints[e].url.size()) { - default_url = endpoints[e].url[0]; + const bool to_add = Compare( + endpoints[i].app_id, mobile_app_id, policy::kDefaultId); + const bool is_default = policy::kDefaultId == endpoints[i].app_id; + + if (to_add) { + for (size_t k = 0; k < endpoints[i].url.size(); ++k) { + if (!is_default) { + urls[index][strings::app_id] = app_id_to_send_to; + } + urls[index][strings::url] = endpoints[i].url[k]; + ++index; } } } - - service_info[strings::app_id] = app->app_id(); - service_info[strings::url] = default_url; - urls[0] = service_info; - // TODO(AOleynik): Issue with absent policy_app_id. Need to fix later on. - // Possibly related to smart schema SendResponseToHMI(Common_Result::SUCCESS); return; } -- cgit v1.2.1 From 37714a5b02eebebff30a3c8a6ecec864c72db186 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 2 Jun 2017 11:51:31 +0300 Subject: Fix string formatting in MB debug messages to avoid warnings The problem is that size_t is not a %d in printf command. This produces a warnings which are treated as errors. Was replaced with %zu --- .../message_broker/src/client/mb_controller.cpp | 12 +++++----- .../src/lib_messagebroker/CMessageBroker.cpp | 8 +++---- .../lib_messagebroker/CMessageBrokerRegistry.cpp | 10 ++++---- .../src/lib_messagebroker/websocket_handler.cpp | 28 +++++++++++----------- .../message_broker/src/server/mb_tcpserver.cpp | 4 ++-- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/3rd_party-static/message_broker/src/client/mb_controller.cpp b/src/3rd_party-static/message_broker/src/client/mb_controller.cpp index 8a4a77cf30..dde2290bb6 100644 --- a/src/3rd_party-static/message_broker/src/client/mb_controller.cpp +++ b/src/3rd_party-static/message_broker/src/client/mb_controller.cpp @@ -6,7 +6,7 @@ #include "mb_controller.hpp" -#include "MBDebugHelper.h" +#include "MBDebugHelper.h" #include "CMessageBroker.hpp" namespace NsMessageBroker @@ -45,7 +45,7 @@ namespace NsMessageBroker return recv; } std::string wmes = m_receiverWriter.write(root); - DBG_MSG(("Parsed JSON string:%s; length: %d\n", wmes.c_str(), wmes.length())); + DBG_MSG(("Parsed JSON string:%s; length: %zu\n", wmes.c_str(), wmes.length())); DBG_MSG(("Buffer is:%s\n", m_receivingBuffer.c_str())); ssize_t beginpos = m_receivingBuffer.find(wmes); if (-1 != beginpos) @@ -125,7 +125,7 @@ namespace NsMessageBroker } int bytesSent = Send(mes); bytesSent = bytesSent; // to prevent compiler warnings in case DBG_MSG off - DBG_MSG(("Length:%d, Sent: %d bytes\n", mes.length(), bytesSent)); + DBG_MSG(("Length: %zu, Sent: %d bytes\n", mes.length(), bytesSent)); } std::string CMessageBrokerController::findMethodById(std::string id) @@ -153,7 +153,7 @@ namespace NsMessageBroker return mControllersIdCurrent = mControllersIdStart; } } - + void CMessageBrokerController::prepareMessage(Json::Value& root) { root["jsonrpc"] = "2.0"; @@ -286,11 +286,11 @@ namespace NsMessageBroker { DBG_MSG(("CMessageBrokerController::checkMessage()\n")); Json::Value err; - + try { /* check the JSON-RPC version => 2.0 */ - if (!root.isObject() || !root.isMember("jsonrpc") || root["jsonrpc"] != "2.0") + if (!root.isObject() || !root.isMember("jsonrpc") || root["jsonrpc"] != "2.0") { error["id"] = Json::Value::null; error["jsonrpc"] = "2.0"; diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp index 3b14489a8c..3749a249dd 100644 --- a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp +++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp @@ -444,13 +444,13 @@ void CMessageBroker::onMessageReceived(int fd, std::string& aJSONData, bool tryH while (! aJSONData.empty()) { Json::Value root; if ((! p->m_reader.parse(aJSONData, root)) || root.isNull()) { - DBG_MSG_ERROR(("Unable to parse JSON!")); + DBG_MSG_ERROR(("Unable to parse JSON!\n")); if (! tryHard) { return; } uint8_t first_byte = static_cast(aJSONData[0]); if ((first_byte <= 0x08) || ((first_byte >= 0x80) && (first_byte <= 0x88))) { - DBG_MSG((" There is an unparsed websocket header probably.\n")); + DBG_MSG(("There is an unparsed websocket header probably.\n")); /* Websocket headers can have FIN flag set in the first byte (0x80). * Then there are 3 zero bits and 4 bits for opcode (from 0x00 to 0x0A). * But actually we don't use opcodes above 0x08. @@ -505,7 +505,7 @@ void CMessageBroker::Test() { return; } std::string wmes = p->m_recieverWriter.write(root); - DBG_MSG(("Parsed JSON string:%s; length: %d\n", wmes.c_str(), wmes.length())); + DBG_MSG(("Parsed JSON string:%s; length: %zu\n", wmes.c_str(), wmes.length())); DBG_MSG(("Buffer is:%s\n", ReceivingBuffer.c_str())); ssize_t beginpos = ReceivingBuffer.find(wmes); ReceivingBuffer.erase(0, beginpos + wmes.length()); @@ -853,7 +853,7 @@ void CMessageBroker_Private::sendJsonMessage(int fd, Json::Value message) { DBG_MSG_ERROR(("Message hasn't been sent!\n")); return; } - DBG_MSG(("Length:%d, Sent: %d bytes\n", mes.length(), retVal)); + DBG_MSG(("Length: %zu, Sent: %d bytes\n", mes.length(), retVal)); } else { DBG_MSG_ERROR(("mpSender NULL pointer\n")); } diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp index fb24d08f1c..e32145058f 100644 --- a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp +++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBrokerRegistry.cpp @@ -10,7 +10,7 @@ #include #include -namespace NsMessageBroker +namespace NsMessageBroker { CMessageBrokerRegistry::CMessageBrokerRegistry() { @@ -43,7 +43,7 @@ namespace NsMessageBroker DBG_MSG(("Controller already exists!\n")); } - DBG_MSG(("Count of controllers: %d\n", mControllersList.size())); + DBG_MSG(("Count of controllers: %zu\n", mControllersList.size())); return result; } @@ -64,7 +64,7 @@ namespace NsMessageBroker DBG_MSG(("No such controller in the list!\n")); return; } - DBG_MSG(("Count of controllers: %d\n", mControllersList.size())); + DBG_MSG(("Count of controllers: %zu\n", mControllersList.size())); } removeSubscribersByDescriptor(fd); } @@ -124,7 +124,7 @@ namespace NsMessageBroker mSubscribersList.insert(std::map ::value_type(name, fd)); } - DBG_MSG(("Count of subscribers: %d\n", mSubscribersList.size())); + DBG_MSG(("Count of subscribers: %zu\n", mSubscribersList.size())); return result; } @@ -146,7 +146,7 @@ namespace NsMessageBroker } } - DBG_MSG(("Count of subscribers: %d\n", mSubscribersList.size())); + DBG_MSG(("Count of subscribers: %zu\n", mSubscribersList.size())); } int CMessageBrokerRegistry::getDestinationFd(std::string name) diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp index 7d3890b7a8..17c2dd92ae 100644 --- a/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp +++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp @@ -19,7 +19,7 @@ #include "libMBDebugHelper.h" #include "md5.h" -namespace NsMessageBroker +namespace NsMessageBroker { unsigned int CWebSocketHandler::parseWebSocketDataLength( @@ -576,43 +576,43 @@ namespace NsMessageBroker return 0; } - + rawBytes CWebSocketHandler::handshake_hybi00(const std::string &key1, const std::string &key2, const rawBytes &key3) { if (key3.size() < 8) { - DBG_MSG_ERROR(("key3's size is %d, less than 8 bytes\n", key3.size())); + DBG_MSG_ERROR(("key3's size is %zu, less than 8 bytes\n", key3.size())); return rawBytes(); } - + unsigned long number1 = extractNumber(key1); unsigned long number2 = extractNumber(key2); DBG_MSG(("number1 is %ld, number2 is %ld\n", number1, number2)); - + if ((number1 == 0) || (number2 == 0)) { return rawBytes(); } - + // represent the numbers in big-endian format (network-byte order) unsigned long bigEndianNumber1 = htonl(number1); unsigned long bigEndianNumber2 = htonl(number2); - + // the temporary key consists of bytes of the first and second numbers // and the key3 rawBytes key(8); memcpy(&key[0], &bigEndianNumber1, 4); memcpy(&key[4], &bigEndianNumber2, 4); key.insert(key.end(), key3.begin(), key3.begin() + 8); - + MD5 md5(std::string(key.begin(), key.end())); char digest[16]; md5.getdigest(digest); rawBytes resultBytes(&digest[0], &digest[16]); - + return resultBytes; } - + unsigned long CWebSocketHandler::extractNumber(const std::string &key) const { // leave digits only @@ -631,9 +631,9 @@ namespace NsMessageBroker keyDigits += keyChar; } } - + unsigned long result = 0; - + // convert string to number long long numberKey; if (std::stringstream(keyDigits) >> numberKey) @@ -659,9 +659,9 @@ namespace NsMessageBroker { // couldn't convert } - + return result; } - + } /* namespace NsMessageBroker */ diff --git a/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp b/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp index bdd7b2bfdf..bd8fa341b0 100644 --- a/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp +++ b/src/3rd_party-static/message_broker/src/server/mb_tcpserver.cpp @@ -64,7 +64,7 @@ bool TcpServer::Recv(int fd) { std::vector buf; buf.reserve(RECV_BUFFER_LENGTH + pReceivingBuffer->size()); - DBG_MSG(("Left in pReceivingBuffer: %d \n", + DBG_MSG(("Left in pReceivingBuffer: %zu\n", pReceivingBuffer->size())); buf.assign(pReceivingBuffer->c_str(), pReceivingBuffer->c_str() + pReceivingBuffer->size()); @@ -102,7 +102,7 @@ bool TcpServer::Recv(int fd) { } *pReceivingBuffer = std::string(&buf[0], nb); - DBG_MSG(("pReceivingBuffer before onMessageReceived:%d : %s\n", + DBG_MSG(("pReceivingBuffer before onMessageReceived: %zu: %s\n", pReceivingBuffer->size(), pReceivingBuffer->c_str())); // we need to check for websocket handshake -- cgit v1.2.1 From 2e33280a1c6cb077fa5a301f967c859318501e24 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 2 Jun 2017 11:54:17 +0300 Subject: Fix CMessageBroker invalid JSON object processing Fixed CMessageBroker invalid JSON object processing. The root cause of the problem is that CMessageBroker drops whole message buffer when it receives some invalid json objects. It seems to be not correct because message buffer could contain also some valid json objects. For example CMessageBroker receives buffer where {valid_response_1}{invalid_response_2}{valid_response_3}... Then it parse JSON objects one by one until buffer become empty. valid_response_1 will be parsed OK and SDL will receive parsed message, but {invalid_response_2} will not be parsed OK and CMessageBroker will not continue parsing objects after that. Then if CMessageBroker receives some {new_valid_response} and parse it OK, it will drop the whole buffer with {invalid_response_2}{valid_response_3}... so SDL will not receive messages for {valid_response_3} and all others in buffer and this is a reason why SDL will not react on them. In this commit: - In case of invalid JSON object received CMessageBroker tries to find next JSON object after current invalid and if it was found, current invalid JSON object will be dropped and parsing will be continued --- .../src/lib_messagebroker/CMessageBroker.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp index 3749a249dd..b1c29cb0ef 100644 --- a/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp +++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/CMessageBroker.cpp @@ -458,12 +458,22 @@ void CMessageBroker::onMessageReceived(int fd, std::string& aJSONData, bool tryH * It can be a coincidence of course, but we have to give it a try. */ return; } else if ('{' == aJSONData[0]) { - DBG_MSG_ERROR((" Incomplete JSON object probably.\n")); + const bool is_object = true; + const size_t next_object_pos = + p->jumpOverJSONObjectOrArray(is_object, aJSONData); + + if (next_object_pos != std::string::npos) { + DBG_MSG_ERROR(("Invalid JSON object probably. Skipping.\n")); + aJSONData.erase(0, next_object_pos); + DBG_MSG(("Buffer after cut is: '%s'\n", aJSONData.c_str())); + continue; + } + DBG_MSG_ERROR(("Incomplete JSON object probably.\n")); return; } else { - DBG_MSG_ERROR((" Step in the buffer and try again...\n")); + DBG_MSG_ERROR(("Step in the buffer and try again...\n")); aJSONData.erase(0, 1); - DBG_MSG_ERROR(("Buffer after cut is: '%s'\n", aJSONData.c_str())); + DBG_MSG(("Buffer after cut is: '%s'\n", aJSONData.c_str())); continue; } -- cgit v1.2.1 From 1c4401564b88724e1ce0e783b8ada8703d493a35 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 5 Jun 2017 11:25:52 +0300 Subject: Moves hash update logic into base class, checks UI interface state now In case RPC is expected to update application hash but UI component is not available, i.e. UI.IsReady returned 'false', hash update must be skipped. Changes move logic of hash updating into base class instead of duplicating it inside every related command class. --- .../commands/command_request_impl.h | 52 +++++++++++++++++++--- .../commands/mobile/add_command_request.h | 13 ++++-- .../commands/mobile/add_sub_menu_request.h | 11 +++-- .../mobile/create_interaction_choice_set_request.h | 17 ++++--- .../commands/mobile/delete_command_request.h | 11 +++-- .../mobile/delete_interaction_choice_set_request.h | 9 +++- .../commands/mobile/delete_sub_menu_request.h | 11 +++-- .../mobile/reset_global_properties_request.h | 11 +++-- .../mobile/set_global_properties_request.h | 11 +++-- .../commands/mobile/subscribe_button_request.h | 9 +++- .../mobile/subscribe_vehicle_data_request.h | 11 +++-- .../commands/mobile/subscribe_way_points_request.h | 11 +++-- .../commands/mobile/unsubscribe_button_request.h | 9 +++- .../mobile/unsubscribe_vehicle_data_request.h | 16 +++---- .../mobile/unsubscribe_way_points_request.h | 12 +++-- .../src/commands/command_request_impl.cc | 50 ++++++++++++++++++++- .../src/commands/mobile/add_command_request.cc | 9 ++-- .../src/commands/mobile/add_sub_menu_request.cc | 8 ++-- .../create_interaction_choice_set_request.cc | 13 +++--- .../src/commands/mobile/delete_command_request.cc | 8 ++-- .../delete_interaction_choice_set_request.cc | 8 ++-- .../src/commands/mobile/delete_sub_menu_request.cc | 8 ++-- .../mobile/reset_global_properties_request.cc | 15 ++----- .../mobile/set_global_properties_request.cc | 12 ++--- .../commands/mobile/subscribe_button_request.cc | 7 +-- .../mobile/subscribe_vehicle_data_request.cc | 9 ++-- .../mobile/subscribe_way_points_request.cc | 9 ++-- .../commands/mobile/unsubscribe_button_request.cc | 6 ++- .../mobile/unsubscribe_vehicle_data_request.cc | 23 +++------- .../mobile/unsubscribe_way_points_request.cc | 8 ++-- 30 files changed, 278 insertions(+), 129 deletions(-) diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h index f585410e97..5fa676263c 100644 --- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h @@ -112,13 +112,36 @@ class CommandRequestImpl : public CommandImpl, public: enum RequestState { kAwaitingHMIResponse = 0, kTimedOut, kCompleted }; + /** + * @brief The HashUpdateMode enum defines whether request has to update + * hash after its execution is finished + */ + enum HashUpdateMode { kSkipHashUpdate, kDoHashUpdate }; + CommandRequestImpl(const MessageSharedPtr& message, ApplicationManager& application_manager); - virtual ~CommandRequestImpl(); - virtual bool CheckPermissions(); - virtual bool Init(); - virtual bool CleanUp(); - virtual void Run(); + + ~CommandRequestImpl(); + + /** + * @brief Checks command permissions according to policy table + */ + bool CheckPermissions() OVERRIDE; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() OVERRIDE; + + /** + * @brief Cleanup all resources used by command + **/ + bool CleanUp() OVERRIDE; + + /** + * @brief Execute corresponding command by calling the action on reciever + **/ + void Run() OVERRIDE; /* * @brief Function is called by RequestController when request execution time @@ -271,6 +294,12 @@ class CommandRequestImpl : public CommandImpl, CommandParametersPermissions parameters_permissions_; CommandParametersPermissions removed_parameters_permissions_; + /** + * @brief hash_update_mode_ Defines whether request must update hash value of + * application or not + */ + HashUpdateMode hash_update_mode_; + private: DISALLOW_COPY_AND_ASSIGN(CommandRequestImpl); @@ -292,6 +321,19 @@ class CommandRequestImpl : public CommandImpl, bool ProcessHMIInterfacesAvailability( const uint32_t hmi_correlation_id, const hmi_apis::FunctionID::eType& function_id); + + /** + * @brief UpdateHash updates hash field for application and sends + * OnHashChanged notification to mobile side in case of approriate hash mode + * is set + */ + void UpdateHash(); + + /** + * @brief is_success_result_ Defines whether request succeded, at the moment + * it is value of 'success' field of appropriate response sent to mobile + */ + bool is_success_result_; }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h index 854ea7f21f..2aed94c448 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h @@ -60,25 +60,30 @@ class AddCommandRequest : public CommandRequestImpl { /** * @brief AddCommandRequest class destructor **/ - virtual ~AddCommandRequest(); + ~AddCommandRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; /** * @brief Function is called by RequestController when request execution time * has exceed it's limit */ - virtual void onTimeOut(); + void onTimeOut() FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: /* diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h index 10e2628035..36b0b38464 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h @@ -57,19 +57,24 @@ class AddSubMenuRequest : public CommandRequestImpl { /** * @brief AddSubMenuRequest class destructor **/ - virtual ~AddSubMenuRequest(); + ~AddSubMenuRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: /* diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h index fffbab567f..6d792fd64b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h @@ -64,31 +64,36 @@ class CreateInteractionChoiceSetRequest : public CommandRequestImpl { /** * @brief CreateInteractionChoiceSetRequest class destructor **/ - virtual ~CreateInteractionChoiceSetRequest(); + ~CreateInteractionChoiceSetRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - virtual void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; /** * @brief Function is called by RequestController when request execution time * has exceed it's limit */ - virtual void onTimeOut(); + void onTimeOut() FINAL; + /** - * @brief DeleteChoices allows to walk through the sent commands collection - * in order to sent appropriate DeleteCommand request. + * @brief Init sets hash update mode for request */ + bool Init() FINAL; private: + /** + * @brief DeleteChoices allows to walk through the sent commands collection + * in order to sent appropriate DeleteCommand request. + */ void DeleteChoices(); /** diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h index 3483aea1d6..afb2e226f6 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h @@ -59,19 +59,24 @@ class DeleteCommandRequest : public CommandRequestImpl { /** * @brief DeleteCommandRequest class destructor **/ - virtual ~DeleteCommandRequest(); + ~DeleteCommandRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest); diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h index 12c80138b4..ead60be1af 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h @@ -58,12 +58,17 @@ class DeleteInteractionChoiceSetRequest : public CommandRequestImpl { /** * @brief DeleteInteractionChoiceSetRequest class destructor **/ - virtual ~DeleteInteractionChoiceSetRequest(); + ~DeleteInteractionChoiceSetRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: /* diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h index b9c27ba294..37863598ac 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h @@ -58,19 +58,24 @@ class DeleteSubMenuRequest : public CommandRequestImpl { /** * @brief DeleteSubMenuRequest class destructor **/ - virtual ~DeleteSubMenuRequest(); + ~DeleteSubMenuRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: /* diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h index 49e5fe34ff..eb955df197 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h @@ -58,19 +58,24 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl { /** * @brief ResetGlobalPropertiesRequest class destructor **/ - virtual ~ResetGlobalPropertiesRequest(); + ~ResetGlobalPropertiesRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: /* diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h index 0300245af8..da28d33de8 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h @@ -57,19 +57,24 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl { /** * @brief SetGlobalPropertiesRequest class destructor **/ - virtual ~SetGlobalPropertiesRequest(); + ~SetGlobalPropertiesRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: // Verify correctness VrHelptitle value diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h index b5a22d40a9..3e135e4f9b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h @@ -58,12 +58,17 @@ class SubscribeButtonRequest : public CommandRequestImpl { /** * @brief SubscribeButtonRequest class destructor **/ - virtual ~SubscribeButtonRequest(); + ~SubscribeButtonRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: /** diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h index fb21823b3a..eb360b50d8 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h @@ -58,19 +58,24 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl { /** * @brief SubscribeButtonCommandRequest class destructor **/ - virtual ~SubscribeVehicleDataRequest(); + ~SubscribeVehicleDataRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - virtual void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; #ifdef HMI_DBUS_API private: diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h index 50b3a6f2cb..f392dd6dd1 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h @@ -53,18 +53,23 @@ class SubscribeWayPointsRequest : public CommandRequestImpl { /** * \brief SubscribeWayPointsRequest class destructor **/ - virtual ~SubscribeWayPointsRequest(); + ~SubscribeWayPointsRequest(); /** * @brief Execute command **/ - virtual void Run() OVERRIDE; + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - virtual void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest); diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h index 62600d51d7..b0206c4407 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h @@ -57,12 +57,17 @@ class UnsubscribeButtonRequest : public CommandRequestImpl { /** * @brief UnsubscribeButtonRequest class destructor **/ - virtual ~UnsubscribeButtonRequest(); + ~UnsubscribeButtonRequest() FINAL; /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: /** diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h index a6bade2fd6..1c7d80797d 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h @@ -58,19 +58,24 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl { /** * @brief UnsubscribeVehicleDataRequest class destructor **/ - virtual ~UnsubscribeVehicleDataRequest(); + ~UnsubscribeVehicleDataRequest(); /** * @brief Execute command **/ - virtual void Run(); + void Run() FINAL; /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - virtual void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; #ifdef HMI_DBUS_API private: @@ -102,11 +107,6 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl { */ void AddAlreadyUnsubscribedVI(smart_objects::SmartObject& response) const; - /** - * @brief Allows to update hash after sending response to mobile. - */ - void UpdateHash() const; - /** * @brief VI parameters which still being subscribed by another apps after * particular app had been unsubscribed from these parameters diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h index 2831551667..0b5462b7b5 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h @@ -50,18 +50,24 @@ class UnSubscribeWayPointsRequest : public CommandRequestImpl { /** * \brief UnSubscribeWayPointsRequest class destructor **/ - virtual ~UnSubscribeWayPointsRequest(); + ~UnSubscribeWayPointsRequest(); /** * @brief Execute command **/ - virtual void Run() OVERRIDE; + void Run() FINAL; + /** * @brief Interface method that is called whenever new event received * * @param event The received event */ - virtual void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) FINAL; + + /** + * @brief Init sets hash update mode for request + */ + bool Init() FINAL; private: DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsRequest); diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index cea5412587..41495f8692 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -147,11 +147,15 @@ CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandImpl(message, application_manager) , EventObserver(application_manager.event_dispatcher()) - , current_state_(kAwaitingHMIResponse) {} + , current_state_(kAwaitingHMIResponse) + , is_success_result_(false) {} -CommandRequestImpl::~CommandRequestImpl() {} +CommandRequestImpl::~CommandRequestImpl() { + UpdateHash(); +} bool CommandRequestImpl::Init() { + hash_update_mode_ = kSkipHashUpdate; return true; } @@ -249,6 +253,8 @@ void CommandRequestImpl::SendResponse( response[strings::msg_params][strings::success] = success; response[strings::msg_params][strings::result_code] = result_code; + is_success_result_ = success; + application_manager_.ManageMobileCommand(result, ORIGIN_SDL); } @@ -308,6 +314,46 @@ bool CommandRequestImpl::ProcessHMIInterfacesAvailability( return true; } +void CommandRequestImpl::UpdateHash() { + LOG4CXX_AUTO_TRACE(logger_); + if (hash_update_mode_ == kSkipHashUpdate) { + LOG4CXX_DEBUG(logger_, "Hash update is disabled for " << function_id()); + return; + } + + if (HmiInterfaces::InterfaceState::STATE_NOT_RESPONSE == + application_manager_.hmi_interfaces().GetInterfaceState( + HmiInterfaces::InterfaceID::HMI_INTERFACE_UI)) { + LOG4CXX_ERROR(logger_, + "UI interface has not responded. Hash won't be updated."); + return; + } + + if (!is_success_result_) { + LOG4CXX_WARN(logger_, "Command is not succeeded. Hash won't be updated."); + return; + } + + ApplicationSharedPtr application = + application_manager_.application(connection_key()); + if (!application) { + LOG4CXX_ERROR(logger_, + "Application with connection key " + << connection_key() + << " not found. Not able to update hash."); + return; + } + + LOG4CXX_DEBUG( + logger_, + "Updating hash for application with connection key " + << connection_key() << " while processing function id " + << MessageHelper::StringifiedFunctionID( + static_cast(function_id()))); + + application->UpdateHash(); +} + uint32_t CommandRequestImpl::SendHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject* msg_params, diff --git a/src/components/application_manager/src/commands/mobile/add_command_request.cc b/src/components/application_manager/src/commands/mobile/add_command_request.cc index a76f537a24..c748ddcbb6 100644 --- a/src/components/application_manager/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/src/commands/mobile/add_command_request.cc @@ -64,6 +64,11 @@ void AddCommandRequest::onTimeOut() { CommandRequestImpl::onTimeOut(); } +bool AddCommandRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; +} + void AddCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -492,10 +497,6 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { result_code, info.empty() ? NULL : info.c_str(), &(message[strings::msg_params])); - - if (result) { - application->UpdateHash(); - } } bool AddCommandRequest::IsPendingResponseExist() { diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc index 6838d1af7d..a5491481dc 100644 --- a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc +++ b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc @@ -128,9 +128,6 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) { MessageHelper::HMIToMobileResult(result_code), response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); - if (result) { - application->UpdateHash(); - } break; } default: { @@ -140,6 +137,11 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) { } } +bool AddSubMenuRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; +} + bool AddSubMenuRequest::CheckSubMenuName() { LOG4CXX_AUTO_TRACE(logger_); const char* str = NULL; diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc index 8876ffa2e8..e591efbeed 100644 --- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc @@ -384,6 +384,11 @@ void CreateInteractionChoiceSetRequest::onTimeOut() { connection_key(), correlation_id(), function_id()); } +bool CreateInteractionChoiceSetRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; +} + void CreateInteractionChoiceSetRequest::DeleteChoices() { LOG4CXX_AUTO_TRACE(logger_); @@ -419,14 +424,6 @@ void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() { if (!error_from_hmi_) { SendResponse(true, mobile_apis::Result::SUCCESS); - - ApplicationSharedPtr application = - application_manager_.application(connection_key()); - if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); - return; - } - application->UpdateHash(); } else { DeleteChoices(); } diff --git a/src/components/application_manager/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/src/commands/mobile/delete_command_request.cc index 103e87fa00..cfc8e12144 100644 --- a/src/components/application_manager/src/commands/mobile/delete_command_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_command_request.cc @@ -201,9 +201,11 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { } SendResponse( result, result_code, info.empty() ? NULL : info.c_str(), &msg_params); - if (result) { - application->UpdateHash(); - } +} + +bool DeleteCommandRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; } bool DeleteCommandRequest::IsPendingResponseExist() { diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc index 6ef8e5d9da..bfbb2429ac 100644 --- a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc @@ -90,9 +90,11 @@ void DeleteInteractionChoiceSetRequest::Run() { // Checking of HMI responses will be implemented with APPLINK-14600 const bool result = true; SendResponse(result, mobile_apis::Result::SUCCESS); - if (result) { - app->UpdateHash(); - } +} + +bool DeleteInteractionChoiceSetRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; } bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse( diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc index 57748e6feb..21c7ecce90 100644 --- a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc @@ -171,9 +171,6 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) { MessageHelper::HMIToMobileResult(result_code), response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); - if (result) { - application->UpdateHash(); - } break; } default: { @@ -183,6 +180,11 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) { } } +bool DeleteSubMenuRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; +} + } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc index ebc0e43838..6be3b1425d 100644 --- a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc @@ -242,9 +242,6 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); const smart_objects::SmartObject& message = event.smart_object(); - ApplicationSharedPtr application = - application_manager_.application(connection_key()); - switch (event.id()) { case hmi_apis::FunctionID::UI_SetGlobalProperties: { LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event"); @@ -281,15 +278,11 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { static_cast(result_code), response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); +} - if (!application) { - LOG4CXX_ERROR(logger_, "NULL pointer"); - return; - } - - if (result) { - application->UpdateHash(); - } +bool ResetGlobalPropertiesRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; } bool ResetGlobalPropertiesRequest::PrepareResponseParameters( diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc index fcfea5e744..096c4ed783 100644 --- a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc @@ -265,15 +265,11 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { result_code, response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); +} - if (!application) { - LOG4CXX_DEBUG(logger_, "NULL pointer."); - return; - } - - if (result) { - application->UpdateHash(); - } +bool SetGlobalPropertiesRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; } bool SetGlobalPropertiesRequest::PrepareResponseParameters( diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc index eb6bbf545e..afd86cd5b4 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc @@ -86,10 +86,11 @@ void SubscribeButtonRequest::Run() { const bool is_succedeed = true; SendResponse(is_succedeed, mobile_apis::Result::SUCCESS); +} - if (is_succedeed) { - app->UpdateHash(); - } +bool SubscribeButtonRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; } bool SubscribeButtonRequest::IsSubscriptionAllowed( diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc index 56027bacaf..fc839a43f4 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc @@ -264,13 +264,14 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { result_code, response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); - - if (is_succeeded) { - app->UpdateHash(); - } #endif // #ifdef HMI_DBUS_API } +bool SubscribeVehicleDataRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; +} + void SubscribeVehicleDataRequest::AddAlreadySubscribedVI( smart_objects::SmartObject& msg_params) const { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc index 29cc8e6541..0e0d760228 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc @@ -33,7 +33,6 @@ void SubscribeWayPointsRequest::Run() { if (application_manager_.IsAnyAppSubscribedForWayPoints()) { application_manager_.SubscribeAppForWayPoints(app->app_id()); SendResponse(true, mobile_apis::Result::SUCCESS); - app->UpdateHash(); return; } @@ -62,9 +61,6 @@ void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) { MessageHelper::HMIToMobileResult(result_code), response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); - if (result) { - app->UpdateHash(); - } break; } default: { @@ -74,6 +70,11 @@ void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) { } } +bool SubscribeWayPointsRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; +} + } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc index e1bdba61a0..f88fa07f73 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc @@ -70,7 +70,11 @@ void UnsubscribeButtonRequest::Run() { SendUnsubscribeButtonNotification(); SendResponse(true, mobile_apis::Result::SUCCESS); - app->UpdateHash(); +} + +bool UnsubscribeButtonRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; } void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() { diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc index 9b0c0a673f..fa3a9ad400 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc @@ -342,11 +342,17 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); if (result) { - UpdateHash(); + application_manager_.TerminateRequest( + connection_key(), correlation_id(), function_id()); } #endif // #ifdef HMI_DBUS_API } +bool UnsubscribeVehicleDataRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; +} + struct SubscribedToIVIPredicate { int32_t vehicle_info_; SubscribedToIVIPredicate(int32_t vehicle_info) @@ -387,20 +393,5 @@ void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI( } } -void UnsubscribeVehicleDataRequest::UpdateHash() const { - LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr application = - application_manager_.application(connection_key()); - if (application) { - application->UpdateHash(); - } else { - LOG4CXX_ERROR(logger_, - "Application with connection_key = " << connection_key() - << " doesn't exist."); - } - application_manager_.TerminateRequest( - connection_key(), correlation_id(), function_id()); -} - } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc index 728209fcf2..953bbc7a12 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc @@ -55,9 +55,6 @@ void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) { MessageHelper::HMIToMobileResult(result_code), response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); - if (result) { - app->UpdateHash(); - } break; } default: { @@ -67,6 +64,11 @@ void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) { } } +bool UnSubscribeWayPointsRequest::Init() { + hash_update_mode_ = HashUpdateMode::kDoHashUpdate; + return true; +} + } // namespace commands } // namespace application_manager -- cgit v1.2.1 From 2f0982fbc76a5f5bc756e37508dd95fc0cd84a23 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Wed, 7 Jun 2017 18:09:32 +0300 Subject: Enabled CommandRequestImpl tests and added new unit tests --- .../test/commands/CMakeLists.txt | 1 + .../test/commands/command_request_impl_test.cc | 199 ++++++++++++++------- 2 files changed, 136 insertions(+), 64 deletions(-) diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt index e22d1434a7..6006ccbc36 100644 --- a/src/components/application_manager/test/commands/CMakeLists.txt +++ b/src/components/application_manager/test/commands/CMakeLists.txt @@ -44,6 +44,7 @@ include_directories( set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands) file(GLOB SOURCES + ${COMMANDS_TEST_DIR}/* ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc ${COMMANDS_TEST_DIR}/hmi/* diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc index 2471ec1165..7f1e1955b7 100644 --- a/src/components/application_manager/test/commands/command_request_impl_test.cc +++ b/src/components/application_manager/test/commands/command_request_impl_test.cc @@ -64,6 +64,7 @@ using ::testing::_; using ::testing::Return; using ::testing::SaveArg; using ::testing::DoAll; +using ::testing::Mock; using ::utils::SharedPtr; using am::commands::MessageSharedPtr; @@ -121,13 +122,18 @@ class CommandRequestImplTest CommandParametersPermissions& removed_parameters_permissions() { return removed_parameters_permissions_; } + + void SetHashUpdateMode(HashUpdateMode mode) { + hash_update_mode_ = mode; + } }; - CommandRequestImplTest() { - mock_message_helper_ = am::MockMessageHelper::message_helper_mock(); + CommandRequestImplTest() + : mock_message_helper_(*am::MockMessageHelper::message_helper_mock()) { + Mock::VerifyAndClearExpectations(&mock_message_helper_); } ~CommandRequestImplTest() { - mock_message_helper_ = NULL; + Mock::VerifyAndClearExpectations(&mock_message_helper_); } MockAppPtr InitAppSetDataAccessor(SharedPtr& app_set) { @@ -141,7 +147,7 @@ class CommandRequestImplTest } sync_primitives::Lock app_set_lock_; - am::MockMessageHelper* mock_message_helper_; + am::MockMessageHelper& mock_message_helper_; }; typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl; @@ -173,7 +179,7 @@ TEST_F(CommandRequestImplTest, OnTimeOut_StateAwaitingHMIResponse_SUCCESS) { CommandPtr command = CreateCommand(msg); MessageSharedPtr dummy_msg(CreateMessage()); - EXPECT_CALL(*mock_message_helper_, CreateNegativeResponse(_, _, _, _)) + EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _)) .WillOnce(Return(dummy_msg)); EXPECT_CALL( app_mngr_, @@ -269,12 +275,11 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_NoUseEvent_SUCCESS) { EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .WillOnce(Return(kCorrelationId)); - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceFromFunction(_)) - .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)) - .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_)) + .WillRepeatedly( + Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) + .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); // Return `true` prevents call of `SendResponse` method; EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true)); @@ -287,12 +292,11 @@ TEST_F(CommandRequestImplTest, SendHMIRequest_UseEvent_SUCCESS) { EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .WillOnce(Return(kCorrelationId)); - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceFromFunction(_)) - .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)) - .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_)) + .WillRepeatedly( + Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) + .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); // Return `true` prevents call of `SendResponse` method; EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true)); @@ -307,7 +311,7 @@ TEST_F(CommandRequestImplTest, RemoveDisallowedParameters_SUCCESS) { vehicle_data.insert( am::VehicleData::value_type(kMissedParam, am::VehicleDataType::MYKEY)); - EXPECT_CALL(*mock_message_helper_, vehicle_data()) + EXPECT_CALL(mock_message_helper_, vehicle_data()) .WillOnce(ReturnRef(vehicle_data)); MessageSharedPtr msg = CreateMessage(); @@ -348,33 +352,24 @@ TEST_F(CommandRequestImplTest, } TEST_F(CommandRequestImplTest, - CheckAllowedParameters_NoAppWithSameConnectionKey_SUCCESS) { - MessageSharedPtr msg = CreateMessage(); - (*msg)[strings::params][strings::connection_key] = kConnectionKey; - - CommandPtr command = CreateCommand(msg); - - SharedPtr app_set; - MockAppPtr app(InitAppSetDataAccessor(app_set)); - EXPECT_CALL(*app, app_id()).WillOnce(Return(6u)); - EXPECT_TRUE(command->CheckPermissions()); + CheckAllowedParameters_NoAppWithSameConnectionKey_UNSUCCESS) { + MessageSharedPtr message = CreateMessage(); + CommandPtr command = CreateCommand(message); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(MockAppPtr())); + EXPECT_FALSE(command->CheckPermissions()); } TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) { - MessageSharedPtr msg = CreateMessage(); - (*msg)[strings::params][strings::connection_key] = kConnectionKey; - (*msg)[strings::msg_params] = 0u; + MockAppPtr mock_app = CreateMockApp(); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); - CommandPtr command = CreateCommand(msg); + MessageSharedPtr message = CreateMessage(); + (*message)[strings::msg_params] = + smart_objects::SmartObject(smart_objects::SmartType_Map); - SharedPtr app_set; - MockAppPtr app(InitAppSetDataAccessor(app_set)); - EXPECT_CALL(*app, app_id()).WillOnce(Return(kConnectionKey)); - EXPECT_CALL(*app, policy_app_id()).WillOnce(Return(kPolicyAppId)); - EXPECT_CALL(*app, hmi_level()) - .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + CommandPtr command = CreateCommand(message); - EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _)) + EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _)) .WillOnce(Return(kMobResultSuccess)); EXPECT_TRUE(command->CheckPermissions()); @@ -382,32 +377,31 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_NoMsgParamsMap_SUCCESS) { TEST_F(CommandRequestImplTest, CheckAllowedParameters_WrongPolicyPermissions_UNSUCCESS) { - MessageSharedPtr msg = CreateMessage(); - (*msg)[strings::params][strings::connection_key] = kConnectionKey; - (*msg)[strings::msg_params] = 0u; + MockAppPtr mock_app = CreateMockApp(); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); - CommandPtr command = CreateCommand(msg); + MessageSharedPtr message = CreateMessage(); + (*message)[strings::msg_params] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + CommandPtr command = CreateCommand(message); - SharedPtr app_set; - MockAppPtr app(InitAppSetDataAccessor(app_set)); - EXPECT_CALL(*app, app_id()).Times(2).WillRepeatedly(Return(kConnectionKey)); - EXPECT_CALL(*app, policy_app_id()).WillOnce(Return(kPolicyAppId)); - EXPECT_CALL(*app, hmi_level()) - .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + EXPECT_CALL(*mock_app, app_id()) + .Times(1) + .WillRepeatedly(Return(kConnectionKey)); - EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _)) + EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _)) .WillOnce(Return(mobile_apis::Result::INVALID_ENUM)); - MessageSharedPtr dummy_msg; - EXPECT_CALL(*mock_message_helper_, - CreateBlockedByPoliciesResponse(_, _, _, _)) - .WillOnce(Return(dummy_msg)); + EXPECT_CALL(mock_message_helper_, CreateBlockedByPoliciesResponse(_, _, _, _)) + .WillOnce(Return(smart_objects::SmartObjectSPtr())); + EXPECT_CALL(app_mngr_, SendMessageToMobile(_, _)); EXPECT_FALSE(command->CheckPermissions()); } ACTION_P(GetArg3, output) { - *output = arg3; + *output = arg2; } TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) { @@ -417,15 +411,11 @@ TEST_F(CommandRequestImplTest, CheckAllowedParameters_MsgParamsMap_SUCCESS) { CommandPtr command = CreateCommand(msg); - SharedPtr app_set; - MockAppPtr app(InitAppSetDataAccessor(app_set)); - EXPECT_CALL(*app, app_id()).WillOnce(Return(kConnectionKey)); - EXPECT_CALL(*app, policy_app_id()).WillOnce(Return(kPolicyAppId)); - EXPECT_CALL(*app, hmi_level()) - .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + MockAppPtr app = CreateMockApp(); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app)); RPCParams params; - EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _, _)) + EXPECT_CALL(app_mngr_, CheckPolicyPermissions(_, _, _, _)) .WillOnce(DoAll(GetArg3(¶ms), Return(kMobResultSuccess))); EXPECT_TRUE(command->CheckPermissions()); @@ -438,7 +428,7 @@ TEST_F(CommandRequestImplTest, AddDisallowedParameters_SUCCESS) { vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1, am::VehicleDataType::MYKEY)); - EXPECT_CALL(*mock_message_helper_, vehicle_data()) + EXPECT_CALL(mock_message_helper_, vehicle_data()) .WillOnce(ReturnRef(vehicle_data)); MessageSharedPtr msg; @@ -476,6 +466,9 @@ TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) { EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + MockAppPtr mock_app; + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); + // Args do not affect on anything in this case; command->SendResponse(true, kMobResultSuccess, NULL, NULL); @@ -490,7 +483,7 @@ TEST_F(CommandRequestImplTest, vehicle_data.insert(am::VehicleData::value_type(kDisallowedParam1, am::VehicleDataType::MYKEY)); - EXPECT_CALL(*mock_message_helper_, vehicle_data()) + EXPECT_CALL(mock_message_helper_, vehicle_data()) .WillOnce(ReturnRef(vehicle_data)); MessageSharedPtr msg = CreateMessage(); @@ -506,6 +499,9 @@ TEST_F(CommandRequestImplTest, EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + MockAppPtr mock_app; + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); + command->SendResponse(true, kMobResultSuccess, NULL, NULL); EXPECT_EQ(RequestState::kCompleted, command->current_state()); @@ -515,6 +511,81 @@ TEST_F(CommandRequestImplTest, (*result)[strings::msg_params][strings::info].asString().empty()); } +TEST_F(CommandRequestImplTest, HashUpdateAllowed_UpdateExpected) { + MessageSharedPtr msg; + CommandPtr command = CreateCommand(msg); + command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate); + + MessageSharedPtr result; + EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + + const bool is_succedeed = true; + command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL); + + MockAppPtr mock_app = CreateMockApp(); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); + EXPECT_CALL(*mock_app, UpdateHash()); + + command.reset(); +} + +TEST_F(CommandRequestImplTest, HashUpdateDisallowed_HashUpdateNotExpected) { + MessageSharedPtr msg; + CommandPtr command = CreateCommand(msg); + command->SetHashUpdateMode( + CommandRequestImpl::HashUpdateMode::kSkipHashUpdate); + + MessageSharedPtr result; + EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + + const bool is_succedeed = true; + command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL); + + MockAppPtr mock_app = CreateMockApp(); + EXPECT_CALL(*mock_app, UpdateHash()).Times(0); + + command.reset(); +} + +TEST_F(CommandRequestImplTest, RequestFailed_HashUpdateNotExpected) { + MessageSharedPtr msg; + CommandPtr command = CreateCommand(msg); + command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate); + + MessageSharedPtr result; + EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + + const bool is_succedeed = false; + command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL); + + MockAppPtr mock_app = CreateMockApp(); + EXPECT_CALL(*mock_app, UpdateHash()).Times(0); + + command.reset(); +} + +TEST_F(CommandRequestImplTest, AppNotFound_HashUpdateNotExpected) { + MessageSharedPtr msg; + CommandPtr command = CreateCommand(msg); + command->SetHashUpdateMode(CommandRequestImpl::HashUpdateMode::kDoHashUpdate); + + MessageSharedPtr result; + EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + + const bool is_succedeed = true; + command->SendResponse(is_succedeed, kMobResultSuccess, NULL, NULL); + + MockAppPtr mock_app = CreateMockApp(); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(MockAppPtr())); + EXPECT_CALL(*mock_app, UpdateHash()).Times(0); + + command.reset(); +} + } // namespace command_request_impl } // namespace commands_test } // namespace components -- cgit v1.2.1 From 9a18ea234d717fbf05891b533e49daa897c423f1 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Wed, 7 Jun 2017 18:15:52 +0300 Subject: Fixes unit tests after hash update logic change Removes duplicated local instances of hmi_interfaces mock with the one from base class, fixes missing expectations and updates existing. --- .../hmi/navi_audio_start_stream_request_test.cc | 3 - .../commands/hmi/navi_is_ready_request_test.cc | 3 - .../commands/hmi/navi_start_stream_request_test.cc | 3 - .../commands/hmi/navi_stop_stream_requests_test.cc | 1 - .../test/commands/hmi/ui_is_ready_request_test.cc | 1 - .../test/commands/hmi/vi_is_ready_request_test.cc | 1 - .../test/commands/hmi/vr_is_ready_request_test.cc | 1 - .../commands/mobile/add_command_request_test.cc | 4 - .../commands/mobile/add_sub_menu_request_test.cc | 7 -- .../commands/mobile/alert_maneuver_request_test.cc | 13 +-- .../test/commands/mobile/alert_request_test.cc | 8 +- .../commands/mobile/change_registration_test.cc | 52 ++++----- .../mobile/create_interaction_choice_set_test.cc | 42 ++++---- .../commands/mobile/delete_command_request_test.cc | 20 ++-- .../test/commands/mobile/delete_file_test.cc | 2 +- .../mobile/delete_interaction_choice_set_test.cc | 20 ++-- .../test/commands/mobile/delete_sub_menu_test.cc | 27 ++--- .../mobile/diagnostic_message_request_test.cc | 3 + .../commands/mobile/dial_number_request_test.cc | 18 ++-- .../mobile/end_audio_pass_thru_request_test.cc | 10 +- .../test/commands/mobile/get_dtcs_request_test.cc | 6 +- .../commands/mobile/get_way_points_request_test.cc | 58 ++++++---- .../mobile/perform_audio_pass_thru_test.cc | 62 +++++------ .../commands/mobile/perform_interaction_test.cc | 16 +-- .../test/commands/mobile/read_did_request_test.cc | 3 + .../mobile/register_app_interface_request_test.cc | 6 -- .../mobile/reset_global_properties_test.cc | 30 +++--- .../commands/mobile/scrollable_message_test.cc | 11 -- .../commands/mobile/send_location_request_test.cc | 8 ++ .../test/commands/mobile/set_app_icon_test.cc | 17 +-- .../commands/mobile/set_display_layout_test.cc | 16 ++- .../commands/mobile/set_global_properties_test.cc | 120 +++++++++------------ .../commands/mobile/set_media_clock_timer_test.cc | 17 ++- .../test/commands/mobile/show_test.cc | 12 +-- .../test/commands/mobile/slider_test.cc | 6 -- .../test/commands/mobile/speak_request_test.cc | 7 +- .../unregister_app_interface_request_test.cc | 2 +- .../mobile/unsubscribe_button_request_test.cc | 2 +- .../mobile/unsubscribe_vehicle_request_test.cc | 13 ++- .../mobile/unsubscribe_way_points_request_test.cc | 2 +- .../mobile/update_turn_list_request_test.cc | 6 ++ 41 files changed, 290 insertions(+), 369 deletions(-) diff --git a/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc index e590412204..c187cc75d9 100644 --- a/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_audio_start_stream_request_test.cc @@ -67,8 +67,6 @@ class AudioStartStreamRequestTest : public CommandRequestTest { public: AudioStartStreamRequestTest() { - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(mock_hmi_interfaces_)); ON_CALL(app_mngr_settings_, start_stream_retry_amount()) .WillByDefault(ReturnRef(start_stream_retry_amount_)); msg_ = CreateMessage(); @@ -78,7 +76,6 @@ class AudioStartStreamRequestTest std::pair start_stream_retry_amount_; MessageSharedPtr msg_; SharedPtr command_; - MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_; }; TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) { diff --git a/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc index b08bf6e515..825cca9185 100644 --- a/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_is_ready_request_test.cc @@ -69,12 +69,9 @@ class NaviIsReadyRequestTest NaviIsReadyRequestTest() : command_(CreateCommand()) { ON_CALL(app_mngr_, hmi_capabilities()) .WillByDefault(ReturnRef(mock_hmi_capabilities_)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(mock_hmi_interfaces_)); } NaviIsReadyRequestPtr command_; - MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_; MOCK(application_manager_test::MockHMICapabilities) mock_hmi_capabilities_; }; diff --git a/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc index 8a157c9a0f..1327ff6dd6 100644 --- a/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_start_stream_request_test.cc @@ -67,8 +67,6 @@ class NaviStartStreamRequestTest : public CommandRequestTest { public: NaviStartStreamRequestTest() { - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(mock_hmi_interfaces_)); ON_CALL(app_mngr_settings_, start_stream_retry_amount()) .WillByDefault(ReturnRef(start_stream_retry_amount_)); msg_ = CreateMessage(); @@ -78,7 +76,6 @@ class NaviStartStreamRequestTest std::pair start_stream_retry_amount_; MessageSharedPtr msg_; SharedPtr command_; - MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_; }; TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) { diff --git a/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc index 91b781c1ff..18f82cd645 100644 --- a/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_stop_stream_requests_test.cc @@ -73,7 +73,6 @@ class NaviStopStreamRequestsTest MessageSharedPtr msg_; SharedPtr command_; - MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_; }; typedef testing::Typeson_event(event); } @@ -541,7 +539,6 @@ TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) { EXPECT_CALL(*mock_app_, commands_map()) .WillRepeatedly( Return(DataAccessor(commands_map, lock_))); - EXPECT_CALL(*mock_app_, UpdateHash()); EXPECT_CALL( app_mngr_, ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) @@ -668,7 +665,6 @@ TEST_F(AddCommandRequestTest, event_ui.set_smart_object(*msg_); Event event_vr(hmi_apis::FunctionID::VR_AddCommand); event_vr.set_smart_object(*msg_); - EXPECT_CALL(*mock_app_, UpdateHash()); request_ptr->on_event(event_ui); request_ptr->on_event(event_vr); } diff --git a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc index 95bcede5fa..bef00384a7 100644 --- a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc @@ -54,7 +54,6 @@ namespace am = ::application_manager; using am::commands::AddSubMenuRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockHmiInterfaces; using am::MockMessageHelper; using ::testing::_; using ::testing::Mock; @@ -98,12 +97,6 @@ TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { Event event(hmi_apis::FunctionID::UI_AddSubMenu); event.set_smart_object(*ev_msg); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, - GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) - .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); diff --git a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc index a835239a90..ee0662e5c6 100644 --- a/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/alert_maneuver_request_test.cc @@ -63,7 +63,6 @@ namespace am = ::application_manager; using am::commands::AlertManeuverRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockHmiInterfaces; using am::MockMessageHelper; typedef SharedPtr CommandPtr; @@ -93,10 +92,7 @@ class AlertManeuverRequestTest EXPECT_CALL(*mock_message_helper, HMIToMobileResult(_)) .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillRepeatedly(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(state)); MessageSharedPtr response_to_mobile; @@ -213,13 +209,10 @@ TEST_F(AlertManeuverRequestTest, Run_ProcessingResult_SUCCESS) { ProcessSoftButtons(_, _, _, _)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillRepeatedly(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceFromFunction(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_)) .WillRepeatedly( Return(am::HmiInterfaces::InterfaceID::HMI_INTERFACE_TTS)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), diff --git a/src/components/application_manager/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_request_test.cc index 43151c2d98..ed20ff94d6 100644 --- a/src/components/application_manager/test/commands/mobile/alert_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/alert_request_test.cc @@ -56,7 +56,6 @@ using am::commands::AlertRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::utils::SharedPtr; using am::event_engine::Event; using policy_test::MockPolicyHandlerInterface; @@ -125,15 +124,13 @@ class AlertRequestTest : public CommandRequestTest { ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(hmi_interfaces_)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault( Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault( Return(am::HmiInterfaces::InterfaceState::STATE_NOT_AVAILABLE)); @@ -199,7 +196,6 @@ class AlertRequestTest : public CommandRequestTest { MockAppPtr mock_app_; MessageSharedPtr msg_; MockPolicyHandlerInterface mock_policy_handler_; - NiceMock hmi_interfaces_; }; TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) { diff --git a/src/components/application_manager/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/test/commands/mobile/change_registration_test.cc index 0c76a08fe9..2fd43a6353 100644 --- a/src/components/application_manager/test/commands/mobile/change_registration_test.cc +++ b/src/components/application_manager/test/commands/mobile/change_registration_test.cc @@ -65,7 +65,6 @@ using am::ApplicationManager; using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::testing::_; using ::testing::Mock; using ::utils::SharedPtr; @@ -118,28 +117,28 @@ class ChangeRegistrationRequestTest .WillOnce(Return(supported_languages_.get())); EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillRepeatedly(ReturnRef(hmi_interfaces_)); + .WillRepeatedly(ReturnRef(mock_hmi_interfaces_)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - EXPECT_CALL(hmi_interfaces_, + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_VR)); - EXPECT_CALL(hmi_interfaces_, + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR)) .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - EXPECT_CALL(hmi_interfaces_, + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); } @@ -185,10 +184,7 @@ class ChangeRegistrationRequestTest (*tts_response)[strings::params][hmi_response::code] = hmi_response; (*tts_response)[strings::msg_params] = 0; - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillRepeatedly(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(state)); am::event_engine::Event event_ui( @@ -251,8 +247,6 @@ class ChangeRegistrationRequestTest ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(hmi_interfaces_)); ON_CALL(app_mngr_, hmi_capabilities()) .WillByDefault(ReturnRef(hmi_capabilities_)); } @@ -288,7 +282,6 @@ class ChangeRegistrationRequestTest MockHMICapabilities; sync_primitives::Lock app_set_lock_; MockHMICapabilities hmi_capabilities_; - NiceMock hmi_interfaces_; MockMessageHelper& mock_message_helper_; MockAppPtr mock_app_; MessageSharedPtr supported_languages_; @@ -322,25 +315,25 @@ TEST_F(ChangeRegistrationRequestTest, ExpectationsHmiCapabilities(supported_languages); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_RESPONSE)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); command->Run(); @@ -367,10 +360,7 @@ TEST_F(ChangeRegistrationRequestTest, hmi_apis::FunctionID::TTS_ChangeRegistration); event_tts.set_smart_object(*tts_response); - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillRepeatedly(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); MessageSharedPtr response_to_mobile; @@ -478,25 +468,25 @@ TEST_F(ChangeRegistrationRequestTest, ExpectationsHmiCapabilities(supported_languages); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_ChangeRegistration)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::VR_ChangeRegistration)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_ChangeRegistration)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); diff --git a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc index a0b0dc32ff..0c69b5b9f7 100644 --- a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc +++ b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc @@ -64,7 +64,6 @@ using am::ApplicationManager; using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::testing::_; using ::testing::Mock; using ::utils::SharedPtr; @@ -213,11 +212,10 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { utils::SharedPtr req_vr = CreateCommand(msg_vr); - MockAppPtr mock_app = CreateMockApp(); - ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); - ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey)); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_)); + smart_objects::SmartObject* null_obj = NULL; - ON_CALL(*mock_app, FindChoiceSet(_)).WillByDefault(Return(null_obj)); + ON_CALL(*app_, FindChoiceSet(_)).WillByDefault(Return(null_obj)); MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); (*msg)[strings::params][hmi_response::code] = @@ -229,25 +227,21 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { event.set_smart_object(*msg); smart_objects::SmartObject* ptr = NULL; - ON_CALL(*mock_app, FindCommand(kCmdId)).WillByDefault(Return(ptr)); + ON_CALL(*app_, FindCommand(kCmdId)).WillByDefault(Return(ptr)); EXPECT_EQ(NULL, ptr); - MockMessageHelper* mock_message_helper = - MockMessageHelper::message_helper_mock(); - ON_CALL(*mock_message_helper, HMIToMobileResult(_)) + ON_CALL(message_helper_mock_, HMIToMobileResult(_)) .WillByDefault(Return(mobile_apis::Result::SUCCESS)); am::CommandsMap commands_map; - ON_CALL(*mock_app, commands_map()) + ON_CALL(*app_, commands_map()) .WillByDefault( Return(DataAccessor(commands_map, lock_))); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - ON_CALL(hmi_interfaces, GetInterfaceFromFunction(_)) + + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_)) .WillByDefault( Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication)); - ON_CALL(hmi_interfaces, GetInterfaceState(_)) - .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); + EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true)); req_vr->Run(); @@ -724,34 +718,36 @@ TEST_F(CreateInteractionChoiceSetRequestTest, (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] = kChoiceSetId; - EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_)); - EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) - .WillOnce(Return(choice_set_id)); + EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); + + EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + .WillOnce(Return(choice_set_id)); + EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + command_->Run(); FillMessageFieldsItem2(message_); + EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); + Event event(hmi_apis::FunctionID::VR_AddCommand); event.set_smart_object(*message_); - MockAppPtr invalid_app; - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(invalid_app)); command_->on_event(event); + EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_)); EXPECT_CALL(*app_, RemoveChoiceSet(_)); + command_->onTimeOut(); } diff --git a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc index 1e03dcaaf1..efa889a2c1 100644 --- a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc @@ -61,7 +61,6 @@ using am::commands::DeleteCommandRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; using am::MockMessageHelper; -using am::MockHmiInterfaces; typedef SharedPtr DeleteCommandPtr; @@ -130,15 +129,12 @@ class DeleteCommandRequestTest ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(hmi_interfaces_)); } void TearDown() OVERRIDE { Mock::VerifyAndClearExpectations(&mock_message_helper_); } - NiceMock hmi_interfaces_; MockMessageHelper& mock_message_helper_; MockAppPtr mock_app_; }; @@ -158,12 +154,12 @@ TEST_F(DeleteCommandRequestTest, (*test_msg)[am::strings::vr_commands] = 0; (*test_msg)[am::strings::menu_params] = 0; - ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_VR)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); ON_CALL(*mock_app_, FindCommand(kCommandId)) @@ -189,8 +185,6 @@ TEST_F(DeleteCommandRequestTest, EXPECT_CALL(*mock_app_, RemoveCommand(kCommandId)); - EXPECT_CALL(*mock_app_, UpdateHash()); - MessageSharedPtr vr_command_result; EXPECT_CALL( app_mngr_, @@ -218,12 +212,12 @@ TEST_F(DeleteCommandRequestTest, (*test_msg)[am::strings::vr_commands] = 0; (*test_msg)[am::strings::menu_params] = 0; - ON_CALL(hmi_interfaces_, GetInterfaceFromFunction(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(_)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); ON_CALL(*app, FindCommand(kCommandId)).WillByDefault(Return(test_msg.get())); @@ -248,8 +242,6 @@ TEST_F(DeleteCommandRequestTest, EXPECT_CALL(*app, RemoveCommand(kCommandId)); - EXPECT_CALL(*app, UpdateHash()); - MessageSharedPtr result_msg( CatchMobileCommandResult(CallOnEvent(*command, event_ui))); diff --git a/src/components/application_manager/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/test/commands/mobile/delete_file_test.cc index 6af9a62bf0..3692f7298e 100644 --- a/src/components/application_manager/test/commands/mobile/delete_file_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_file_test.cc @@ -159,7 +159,7 @@ TEST_F(DeleteFileRequestTest, Run_ValidFileName_SUCCESS) { kConnectionKey; EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app_)); + .WillRepeatedly(Return(mock_app_)); EXPECT_CALL(*mock_app_, hmi_level()) .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL)); diff --git a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc index 64c2fae1d3..036b0cfeb3 100644 --- a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc @@ -191,8 +191,10 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, [am::strings::interaction_choice_set_id]); smart_objects::SmartObject* invalid_choice_set_id = NULL; + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillRepeatedly(Return(app_)); + InSequence seq; - EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_)); EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); @@ -206,8 +208,10 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId)); EXPECT_CALL(*app_, UpdateHash()); - command_->Run(); - EXPECT_TRUE(Mock::VerifyAndClearExpectations(app_.get())); + DeleteInteractionChoiceSetRequestPtr command = + CreateCommand(message_); + + command->Run(); } TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) { @@ -221,8 +225,10 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) { smart_objects::SmartObject* choice_set_id = &((*message_)[am::strings::msg_params]); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillRepeatedly(Return(app_)); + InSequence seq; - EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_)); EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); @@ -238,8 +244,10 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) { EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId)); EXPECT_CALL(*app_, UpdateHash()); - command_->Run(); - EXPECT_TRUE(Mock::VerifyAndClearExpectations(app_.get())); + DeleteInteractionChoiceSetRequestPtr command = + CreateCommand(message_); + + command->Run(); } TEST_F(DeleteInteractionChoiceSetResponseTest, Run_SuccessFalse_UNSUCCESS) { diff --git a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc index dd57d5f8c6..8373601480 100644 --- a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc @@ -58,7 +58,6 @@ using ::testing::InSequence; namespace am = ::application_manager; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockHmiInterfaces; using am::MockMessageHelper; using am::commands::DeleteSubMenuRequest; @@ -143,12 +142,6 @@ TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) { Event event(hmi_apis::FunctionID::UI_DeleteSubMenu); event.set_smart_object(*ev_msg); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, - GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) - .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); @@ -270,8 +263,9 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) { commands_map_.insert( std::make_pair(0, &((*message_)[am::strings::msg_params]))); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); + InSequence seq; - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); EXPECT_CALL(*app_, commands_map()).WillOnce(Return(accessor_)); EXPECT_CALL(*app_, app_id()).WillOnce(Return(kConnectionKey)); EXPECT_CALL(*app_, get_grammar_id()).WillOnce(Return(kGrammarId)); @@ -282,8 +276,11 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) { EXPECT_CALL(*app_, RemoveSubMenu(_)); EXPECT_CALL(*app_, UpdateHash()); - command_->on_event(event); - EXPECT_TRUE(Mock::VerifyAndClearExpectations(app_.get())); + + DeleteSubMenuRequestPtr command = + CreateCommand(message_); + + command->on_event(event); } TEST_F(DeleteSubMenuResponseTest, Run_SUCCESS) { @@ -311,7 +308,10 @@ TEST_F(DeleteSubMenuRequestTest, commands_map_.insert( std::make_pair(0, &((*message_)[am::strings::msg_params]))); - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) + .WillRepeatedly(Return(am::mobile_api::Result::SUCCESS)); + + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0); EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_)); EXPECT_CALL(*app_, RemoveCommand(_)).Times(0); @@ -334,7 +334,10 @@ TEST_F(DeleteSubMenuRequestTest, commands_map_.insert( std::make_pair(0, &((*message_)[am::strings::msg_params]))); - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) + .WillRepeatedly(Return(am::mobile_api::Result::SUCCESS)); + + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0); EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_)); EXPECT_CALL(*app_, RemoveCommand(_)).Times(0); diff --git a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc index 60697446f2..afdf5af3d2 100644 --- a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc @@ -189,6 +189,9 @@ TEST_F(DiagnosticMessageRequestTest, OnEvent_SUCCESS) { app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app)); + command->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc index 2f7415c98e..33c84d305a 100644 --- a/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/dial_number_request_test.cc @@ -156,15 +156,6 @@ TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) { } TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) { - MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); - (*command_msg)[am::strings::params][am::strings::connection_key] = - kConnectionKey; - - DialNumberRequestPtr command(CreateCommand(command_msg)); - - MockAppPtr app(CreateMockApp()); - EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app)); - MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map)); (*event_msg)[am::strings::params][am::hmi_response::code] = mobile_apis::Result::SUCCESS; @@ -173,10 +164,19 @@ TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) { Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber); event.set_smart_object(*event_msg); + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillRepeatedly(Return(app)); + EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _)); + MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); + (*command_msg)[am::strings::params][am::strings::connection_key] = + kConnectionKey; + + DialNumberRequestPtr command(CreateCommand(command_msg)); command->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc index ceb5e3b916..b8c0ed23f3 100644 --- a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc @@ -59,7 +59,6 @@ using ::testing::ReturnRef; using am::commands::MessageSharedPtr; using am::commands::EndAudioPassThruRequest; using am::event_engine::Event; -using am::MockHmiInterfaces; using am::MockMessageHelper; typedef SharedPtr EndAudioPassThruRequestPtr; @@ -90,12 +89,6 @@ TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) { Event event(hmi_apis::FunctionID::UI_EndAudioPassThru); event.set_smart_object(*event_msg); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - ON_CALL(hmi_interfaces, - GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) - .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); @@ -108,6 +101,9 @@ TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) { ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app)); + command->on_event(event); EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success] diff --git a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc index 31d406d959..8d0363294d 100644 --- a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc @@ -112,8 +112,6 @@ TEST_F(GetDTCsRequestTest, OnEvent_UnknownEvent_UNSUCCESS) { } TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) { - GetDTCsRequestPtr command(CreateCommand()); - MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map)); (*event_msg)[am::strings::msg_params] = 0; (*event_msg)[am::strings::params][am::hmi_response::code] = @@ -130,6 +128,10 @@ TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) { app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _)); + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app)); + + GetDTCsRequestPtr command(CreateCommand()); command->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc index 4b13576a39..e80f53a8e1 100644 --- a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc @@ -57,7 +57,6 @@ using ::testing::Mock; using ::testing::_; using application_manager::commands::GetWayPointsRequest; using application_manager::MockMessageHelper; -using application_manager::MockHmiInterfaces; typedef SharedPtr CommandPtr; typedef mobile_apis::Result::eType MobileResult; @@ -76,6 +75,7 @@ class GetWayPointsRequestTest : message_helper_mock_(*am::MockMessageHelper::message_helper_mock()) { Mock::VerifyAndClearExpectations(&message_helper_mock_); } + ~GetWayPointsRequestTest() { Mock::VerifyAndClearExpectations(&message_helper_mock_); } @@ -90,6 +90,9 @@ class GetWayPointsRequestTest message_); mock_app_ = CreateMockApp(); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_)); + + ON_CALL(message_helper_mock_, HMIToMobileResult(_)) + .WillByDefault(Return(mobile_apis::Result::SUCCESS)); } MockMessageHelper& message_helper_mock_; @@ -127,6 +130,12 @@ class GetWayPointsRequestOnEventTest event.set_smart_object(*event_msg); + EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_)) + .WillOnce(Return(ResultCode)); + + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app)); + MessageSharedPtr result_msg( CatchMobileCommandResult(CallOnEvent(*command, event))); EXPECT_EQ( @@ -142,7 +151,6 @@ class GetWayPointsRequestOnEventTest protected: MockMessageHelper& message_helper_mock_; MockAppPtr app_; - MockHmiInterfaces hmi_interfaces_; }; TEST_F(GetWayPointsRequestTest, @@ -195,7 +203,7 @@ TEST_F(GetWayPointsRequestTest, Run_ApplicationRegistered_Success) { } TEST_F(GetWayPointsRequestTest, - OnEvent_NavigationGetWayPointsEvent_SendResponce) { + OnEvent_NavigationGetWayPointsEvent_SendResponse) { am::event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints); (*message_)[am::strings::params][am::hmi_response::code] = @@ -248,42 +256,46 @@ TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_SUCCESS_Case3) { } TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case1) { - EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces_)); - EXPECT_CALL(hmi_interfaces_, + EXPECT_CALL(mock_hmi_interfaces_, + GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) + .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation)) - .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_)) - .WillOnce(Return(mobile_apis::Result::GENERIC_ERROR)); + .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); + CheckOnEventResponse(" ", GENERIC_ERROR, false); } TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case2) { - EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces_)); - EXPECT_CALL(hmi_interfaces_, + EXPECT_CALL(mock_hmi_interfaces_, + GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) + .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation)) - .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_)) - .WillOnce(Return(mobile_apis::Result::GENERIC_ERROR)); + .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); + CheckOnEventResponse("test\t", GENERIC_ERROR, false); } TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case3) { - EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces_)); - EXPECT_CALL(hmi_interfaces_, + EXPECT_CALL(mock_hmi_interfaces_, + GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) + .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation)) - .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_)) - .WillOnce(Return(mobile_apis::Result::GENERIC_ERROR)); + .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); + CheckOnEventResponse("test\n", GENERIC_ERROR, false); } TEST_F(GetWayPointsRequestOnEventTest, OnEvent_Expect_GENERIC_ERROR_Case4) { - EXPECT_CALL(app_mngr_, hmi_interfaces()).WillOnce(ReturnRef(hmi_interfaces_)); - EXPECT_CALL(hmi_interfaces_, + EXPECT_CALL(mock_hmi_interfaces_, + GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) + .WillRepeatedly(Return(am::HmiInterfaces::STATE_AVAILABLE)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_Navigation)) - .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_)) - .WillOnce(Return(mobile_apis::Result::GENERIC_ERROR)); + .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); + CheckOnEventResponse("test\t\n", GENERIC_ERROR, false); } diff --git a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc index 9126e43050..e2adc38f50 100644 --- a/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc +++ b/src/components/application_manager/test/commands/mobile/perform_audio_pass_thru_test.cc @@ -55,7 +55,6 @@ using am::commands::PerformAudioPassThruRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::utils::SharedPtr; using ::testing::_; using ::testing::Mock; @@ -131,8 +130,6 @@ class PerformAudioPassThruRequestTest ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(hmi_interfaces_)); command_sptr_ = CreateCommand(message_); @@ -156,7 +153,6 @@ class PerformAudioPassThruRequestTest } sync_primitives::Lock lock_; - NiceMock hmi_interfaces_; MockMessageHelper& mock_message_helper_; MockAppPtr mock_app_; MessageSharedPtr message_; @@ -217,10 +213,10 @@ TEST_F(PerformAudioPassThruRequestTest, am::event_engine::Event event(hmi_apis::FunctionID::UI_PerformAudioPassThru); event.set_smart_object(*msg); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -312,10 +308,10 @@ TEST_F(PerformAudioPassThruRequestTest, // Send speak request sending ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true))); @@ -324,10 +320,10 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); @@ -359,10 +355,10 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_StopSpeaking)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0); @@ -395,10 +391,10 @@ TEST_F(PerformAudioPassThruRequestTest, InSequence dummy; ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true))); @@ -407,10 +403,10 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); @@ -463,10 +459,10 @@ TEST_F(PerformAudioPassThruRequestTest, InSequence dummy; ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true))); @@ -475,10 +471,10 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); @@ -506,10 +502,10 @@ TEST_F( ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); // Perform audio path thru request sending EXPECT_CALL(app_mngr_, ManageHMICommand(_)) @@ -518,10 +514,10 @@ TEST_F( // Perform audio path thru request sending ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_OnRecordStart)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); // Start recording notification sending EXPECT_CALL(app_mngr_, ManageHMICommand(_)) @@ -583,7 +579,7 @@ TEST_F(PerformAudioPassThruRequestTest, EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) @@ -609,7 +605,7 @@ TEST_F(PerformAudioPassThruRequestTest, hmi_apis::Common_Result::SUCCESS; event_perform.set_smart_object(*message_); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); // First call on_event for setting result_tts_speak_ to UNSUPPORTED_RESOURCE EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); @@ -619,7 +615,7 @@ TEST_F(PerformAudioPassThruRequestTest, // Second call for test correct behavior of UI_PerformAudioPassThru event EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false)); EXPECT_CALL(app_mngr_, StopAudioPassThru(_)).Times(0); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); CallOnEvent caller_perform(*command_sptr_, event_perform); @@ -648,7 +644,7 @@ TEST_F(PerformAudioPassThruRequestTest, StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _)); EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); ON_CALL(mock_message_helper_, HMIToMobileResult(_)) .WillByDefault(Return(am::mobile_api::Result::SUCCESS)); @@ -673,7 +669,7 @@ TEST_F(PerformAudioPassThruRequestTest, app_mngr_, StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _)); EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); CallOnEvent caller(*command_sptr_, event); caller(); @@ -732,10 +728,10 @@ TEST_F(PerformAudioPassThruRequestTest, MessageSharedPtr perform_result_msg; ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_Speak)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&speak_reqeust_result_msg), Return(true))); @@ -744,10 +740,10 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_PerformAudioPassThru)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, GetInterfaceState(_)) + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&perform_result_msg), Return(true))); diff --git a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc index 22ce735c61..84a0e0b354 100644 --- a/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc +++ b/src/components/application_manager/test/commands/mobile/perform_interaction_test.cc @@ -62,7 +62,6 @@ using am::ApplicationManager; using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::testing::_; using ::testing::Mock; using ::utils::SharedPtr; @@ -91,8 +90,6 @@ class PerformInteractionRequestTest ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(hmi_interfaces_)); } void TearDown() OVERRIDE { @@ -111,7 +108,6 @@ class PerformInteractionRequestTest } sync_primitives::Lock lock_; - NiceMock hmi_interfaces_; MockMessageHelper& mock_message_helper_; MockAppPtr mock_app_; }; @@ -174,10 +170,6 @@ TEST_F(PerformInteractionRequestTest, MockAppPtr mock_app; EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app)); - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillRepeatedly(ReturnRef(hmi_interfaces)); - MessageSharedPtr response_msg_vr = CreateMessage(smart_objects::SmartType_Map); (*response_msg_vr)[strings::params][hmi_response::code] = @@ -197,10 +189,10 @@ TEST_F(PerformInteractionRequestTest, am::event_engine::Event event_ui(hmi_apis::FunctionID::UI_PerformInteraction); event_ui.set_smart_object(*response_msg_ui); - EXPECT_CALL(hmi_interfaces, + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - EXPECT_CALL(hmi_interfaces, + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -228,10 +220,10 @@ TEST_F(PerformInteractionRequestTest, utils::SharedPtr command = CreateCommand(msg_from_mobile); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_VR)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); diff --git a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc index 334f559ae6..7e46f6942f 100644 --- a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc @@ -98,6 +98,9 @@ TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) { EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app)); + command->on_event(event); testing::Mock::VerifyAndClearExpectations(&mock_message_helper); diff --git a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc index 96b3cb067b..844f87d57e 100644 --- a/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/register_app_interface_request_test.cc @@ -151,8 +151,6 @@ class RegisterAppInterfaceRequestTest .WillByDefault(Return(policy::DeviceConsent::kDeviceAllowed)); ON_CALL(app_mngr_, GetDeviceTransportType(_)) .WillByDefault(Return(hmi_apis::Common_TransportType::WIFI)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(mock_hmi_interfaces_)); ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); ON_CALL( @@ -191,15 +189,11 @@ class RegisterAppInterfaceRequestTest typedef IsNiceMock::Result MockHMICapabilities; - typedef IsNiceMock::Result - MockHmiInterfaces; - MockPolicyHandlerInterface mock_policy_handler_; MockResumeCtrl mock_resume_crt_; MockConnectionHandler mock_connection_handler_; MockSessionObserver mock_session_observer_; MockHMICapabilities mock_hmi_capabilities_; - MockHmiInterfaces mock_hmi_interfaces_; }; TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) { diff --git a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc index 29c52bb0d5..0291de6258 100644 --- a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc +++ b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc @@ -280,7 +280,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, reset_vr_help_title()); EXPECT_CALL(*mock_app_, reset_vr_help()); - EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true)); smart_objects::SmartObjectSPtr vr_help = @@ -297,7 +296,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), am::commands::Command::ORIGIN_SDL)); - EXPECT_CALL(*mock_app_, UpdateHash()); command_->on_event(event); } @@ -344,7 +342,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::WARNINGS), am::commands::Command::ORIGIN_SDL)); - EXPECT_CALL(*mock_app_, UpdateHash()); command_->on_event(event); } @@ -368,8 +365,7 @@ TEST_F(ResetGlobalPropertiesResponseTest, Run_Sendmsg_SUCCESS) { command->Run(); } -TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_UNSUCCESS) { - Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); +TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) { (*msg_)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::eType::SUCCESS; @@ -387,22 +383,28 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_UNSUCCESS) { EXPECT_CALL(*mock_message_helper_, CreateAppVrHelp(_)) .WillOnce(Return(vr_help)); - command_->Run(); + MockAppPtr invalid_app; + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillOnce(Return(mock_app_)) + .WillOnce(Return(invalid_app)); - event.set_smart_object(*msg_); + EXPECT_CALL(*mock_app_, UpdateHash()).Times(0); + + ResetGlobalPropertiesRequestPtr command = + CreateCommand(msg_); + command->Run(); + + EXPECT_CALL(*mock_message_helper_, HMIToMobileResult(_)) + .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL(app_mngr_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), am::commands::Command::ORIGIN_SDL)); - MockAppPtr invalid_app; - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(invalid_app)); - - EXPECT_CALL(*mock_app_, UpdateHash()).Times(0); - - command_->on_event(event); + Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); + event.set_smart_object(*msg_); + command->on_event(event); } } // namespace reset_global_properties diff --git a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc index aba549eb34..d9fac769e5 100644 --- a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc +++ b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc @@ -61,7 +61,6 @@ using am::commands::ScrollableMessageRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::utils::SharedPtr; using ::testing::_; using ::testing::Eq; @@ -146,11 +145,6 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { .WillByDefault(Return(mock_app)); ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey)); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, - GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) - .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); MockHMICapabilities hmi_capabilities; ON_CALL(app_mngr_, hmi_capabilities()) @@ -298,11 +292,6 @@ TEST_F(ScrollableMessageRequestTest, EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)) - .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL( app_mngr_, ManageMobileCommand( diff --git a/src/components/application_manager/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc index df412695fd..03cc715188 100644 --- a/src/components/application_manager/test/commands/mobile/send_location_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc @@ -351,11 +351,19 @@ TEST_F(SendLocationRequestTest, Run_HMIUINotCoop_Cancelled) { TEST_F(SendLocationRequestTest, OnEvent_Success) { mobile_apis::Result::eType response_code = mobile_apis::Result::SUCCESS; (*message_)[strings::params][hmi_response::code] = response_code; + (*message_)[strings::params][strings::connection_key] = kConnectionKey; + Event event(hmi_apis::FunctionID::Navigation_SendLocation); event.set_smart_object(*message_); + EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); + + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillRepeatedly(Return(app)); + command_->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc index b51b7c83ea..60b01f2cfa 100644 --- a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc @@ -55,7 +55,6 @@ using am::commands::SetAppIconRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::utils::SharedPtr; using ::testing::_; using ::testing::Mock; @@ -73,6 +72,15 @@ class SetAppIconRequestTest public: SetAppIconRequestTest() : mock_message_helper_(*MockMessageHelper::message_helper_mock()) {} + + void SetUp() OVERRIDE { + Mock::VerifyAndClearExpectations(&mock_message_helper_); + } + + void TearDown() OVERRIDE { + Mock::VerifyAndClearExpectations(&mock_message_helper_); + } + MockMessageHelper& mock_message_helper_; MessageSharedPtr CreateFullParamsUISO() { @@ -118,12 +126,6 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(*mock_app, set_app_icon_path(_)).WillByDefault(Return(true)); ON_CALL(*mock_app, app_icon_path()).WillByDefault(ReturnRef(file_path)); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, - GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) - .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); - MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); (*msg)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE; @@ -158,7 +160,6 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { .asString() .empty()); } - Mock::VerifyAndClearExpectations(&mock_message_helper_); } } // namespace set_app_icon_request diff --git a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc index 0518b325ea..ec069e4825 100644 --- a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc @@ -57,7 +57,6 @@ using am::commands::SetDisplayLayoutRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::utils::SharedPtr; using ::testing::_; using ::testing::Mock; @@ -89,8 +88,6 @@ class SetDisplayLayoutRequestTest ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(hmi_interfaces_)); } ~SetDisplayLayoutRequestTest() { @@ -133,7 +130,6 @@ class SetDisplayLayoutRequestTest } sync_primitives::Lock lock_; - NiceMock hmi_interfaces_; MockMessageHelper& mock_message_helper_; MockAppPtr mock_app_; }; @@ -164,7 +160,7 @@ TEST_F(SetDisplayLayoutRequestTest, Event event(hmi_apis::FunctionID::UI_SetDisplayLayout); event.set_smart_object(*msg); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -186,6 +182,7 @@ TEST_F(SetDisplayLayoutRequestTest, Run_InvalidApp_UNSUCCESS) { MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map)); (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; CommandPtr command(CreateCommand(msg)); + MockAppPtr invalid_mock_app; EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(invalid_mock_app)); @@ -209,8 +206,6 @@ TEST_F(SetDisplayLayoutRequestTest, Run_SUCCESS) { EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .WillOnce(Return(kCorrelationKey)); - EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillOnce(ReturnRef(mock_hmi_interfaces_)); EXPECT_CALL( mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetDisplayLayout)) @@ -236,14 +231,13 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_InvalidEventId_UNSUCCESS) { } TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) { - CommandPtr command(CreateCommand()); - am::event_engine::Event event(hmi_apis::FunctionID::UI_SetDisplayLayout); MessageSharedPtr msg = CreateMessage(); (*msg)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::SUCCESS; (*msg)[am::strings::msg_params][am::hmi_response::display_capabilities] = 0; + (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; event.set_smart_object(*msg); MockHMICapabilities hmi_capabilities; @@ -251,6 +245,9 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) { (*dispaly_capabilities_msg)[am::hmi_response::templates_available] = "templates_available"; + EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) + .WillOnce(Return(mobile_apis::Result::SUCCESS)); + EXPECT_CALL(app_mngr_, hmi_capabilities()) .WillOnce(ReturnRef(hmi_capabilities)); @@ -262,6 +259,7 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) { ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), am::commands::Command::CommandOrigin::ORIGIN_SDL)); + CommandPtr command(CreateCommand(msg)); command->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc index 0908b54ba7..7143bdf71a 100644 --- a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc @@ -55,7 +55,6 @@ using am::commands::SetGlobalPropertiesRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using am::CommandsMap; using utils::custom_string::CustomString; using ::utils::SharedPtr; @@ -119,8 +118,6 @@ class SetGlobalPropertiesRequestTest vr_help_array[0][am::strings::text] = kText; vr_help_array[0][am::strings::position] = kPosition; (*msg)[am::strings::msg_params][am::strings::vr_help] = vr_help_array; - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app_)); } void OnEventUISetupHelper(MessageSharedPtr msg, @@ -155,8 +152,6 @@ class SetGlobalPropertiesRequestTest (*msg)[am::strings::msg_params][am::strings::timeout_prompt] = timeout_prompt; - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app_)); EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0); EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey)); @@ -216,8 +211,9 @@ class SetGlobalPropertiesRequestTest ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(hmi_interfaces_)); + ON_CALL(mock_hmi_interfaces_, + GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) + .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); } void TearDown() OVERRIDE { @@ -237,22 +233,21 @@ class SetGlobalPropertiesRequestTest void ExpectationsHmiInterface_Run() { EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); } sync_primitives::Lock lock_; - NiceMock hmi_interfaces_; MockMessageHelper& mock_message_helper_; MockAppPtr mock_app_; }; @@ -297,8 +292,6 @@ TEST_F(SetGlobalPropertiesRequestTest, ON_CALL(mock_message_helper_, VerifyImage(_, _, _)) .WillByDefault(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL(*mock_app_, UpdateHash()); - (*msg_vr)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::SUCCESS; Event event_vr(hmi_apis::FunctionID::TTS_SetGlobalProperties); @@ -330,9 +323,6 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) { utils::SharedPtr command = CreateCommand(response); - MockAppPtr mock_app(CreateMockApp()); - ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); - EXPECT_CALL( app_mngr_, ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) @@ -345,6 +335,8 @@ TEST_F(SetGlobalPropertiesRequestTest, MessageSharedPtr response = CreateMessage(smart_objects::SmartType_Map); (*response)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::SUCCESS; + (*response)[am::strings::params][am::strings::connection_key] = + kConnectionKey; (*response)[am::strings::msg_params][am::strings::info] = "qwe"; am::event_engine::Event event_tts( @@ -356,16 +348,10 @@ TEST_F(SetGlobalPropertiesRequestTest, utils::SharedPtr command = CreateCommand(response); - MockAppPtr mock_app(CreateMockApp()); - ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) .WillByDefault(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillRepeatedly(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); MessageSharedPtr response_to_mobile; @@ -393,11 +379,11 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) { SharedPtr command( CreateCommand(msg)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -434,11 +420,11 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_SUCCESS) { EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -595,10 +581,10 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVR_SUCCESS) { EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -667,10 +653,10 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataNoDefault_Canceled) { EXPECT_CALL(*mock_app_, app_id()); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -712,10 +698,10 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataDefaultCreated_SUCCESS) { EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties)); EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -757,10 +743,10 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataFromSynonyms_SUCCESS) { EXPECT_CALL(*mock_app_, set_keyboard_props(keyboard_properties)); EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); SharedPtr command( @@ -791,10 +777,10 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) { EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -822,10 +808,10 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) { EXPECT_CALL(*mock_app_, timeout_prompt()).Times(0); EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); SharedPtr command( @@ -852,10 +838,10 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) { EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(&timeout_prompt)); EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); EXPECT_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties)) .WillOnce(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); SharedPtr command( @@ -1060,16 +1046,16 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) { hmi_apis::Common_Result::SUCCESS; (*msg)[am::strings::params][am::hmi_response::code] = response_code; - SharedPtr command( - CreateCommand(msg)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); + SharedPtr command( + CreateCommand(msg)); OnEventUISetupHelper(msg, command); Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); @@ -1077,11 +1063,8 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) { EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app_)); - EXPECT_CALL(*mock_app_, UpdateHash()); - EXPECT_CALL(hmi_interfaces_, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); EXPECT_CALL(app_mngr_, @@ -1100,23 +1083,20 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) { SharedPtr command( CreateCommand(msg)); ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); OnEventUISetupHelper(msg, command); EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)).Times(0); - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app_)); - EXPECT_CALL(*mock_app_, UpdateHash()); Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); event.set_smart_object(*msg); - EXPECT_CALL(hmi_interfaces_, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); @@ -1133,23 +1113,25 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) { hmi_apis::Common_Result::WARNINGS; (*msg)[am::strings::params][am::hmi_response::code] = response_code; ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetGlobalProperties)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); SharedPtr command( CreateCommand(msg)); OnEventUISetupHelper(msg, command); - EXPECT_CALL(hmi_interfaces_, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(MockAppPtr())); + .WillRepeatedly(Return(MockAppPtr())); + EXPECT_CALL(*mock_app_, UpdateHash()).Times(0); Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); @@ -1181,17 +1163,17 @@ TEST_F(SetGlobalPropertiesRequestTest, hmi_apis::Common_Result::SUCCESS; (*msg)[am::strings::params][am::hmi_response::code] = response_code; ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); SharedPtr command( CreateCommand(msg)); OnEventTTSSetupHelper(msg, command); - EXPECT_CALL(hmi_interfaces_, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); EXPECT_CALL(app_mngr_, @@ -1200,9 +1182,6 @@ TEST_F(SetGlobalPropertiesRequestTest, EXPECT_CALL(mock_message_helper_, HMIToMobileResult(response_code)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app_)); - EXPECT_CALL(*mock_app_, UpdateHash()); Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties); event.set_smart_object(*msg); @@ -1217,10 +1196,10 @@ TEST_F(SetGlobalPropertiesRequestTest, hmi_apis::Common_Result::WARNINGS; (*msg)[am::strings::params][am::hmi_response::code] = response_code; ON_CALL( - hmi_interfaces_, + mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::TTS_SetGlobalProperties)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_TTS)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); SharedPtr command( @@ -1228,7 +1207,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEventTTSSetupHelper(msg, command); - EXPECT_CALL(hmi_interfaces_, GetInterfaceState(_)) + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); EXPECT_CALL(app_mngr_, @@ -1237,9 +1216,6 @@ TEST_F(SetGlobalPropertiesRequestTest, EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app_)); - EXPECT_CALL(*mock_app_, UpdateHash()); Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties); event.set_smart_object(*msg); diff --git a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc index da6f29cf5e..3056d0e9fc 100644 --- a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc @@ -53,7 +53,6 @@ namespace am = ::application_manager; using am::commands::SetMediaClockRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using am::MockHmiInterfaces; using am::MockMessageHelper; using ::testing::_; using ::testing::Mock; @@ -84,8 +83,6 @@ class SetMediaClockRequestTest ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app_)); ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kConnectionKey)); - ON_CALL(app_mngr_, hmi_interfaces()) - .WillByDefault(ReturnRef(hmi_interfaces_)); } void TearDown() OVERRIDE { @@ -117,7 +114,6 @@ class SetMediaClockRequestTest EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)); } - NiceMock hmi_interfaces_; MockMessageHelper& mock_message_helper_; MockAppPtr mock_app_; }; @@ -140,7 +136,7 @@ TEST_F(SetMediaClockRequestTest, Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer); event.set_smart_object(*ev_msg); - EXPECT_CALL(hmi_interfaces_, + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_RESPONSE)); @@ -183,10 +179,10 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) { EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID)); EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .WillOnce(Return(kCorrelationId)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true)); @@ -218,10 +214,10 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) { EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppID)); EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .WillOnce(Return(kCorrelationId)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceFromFunction(hmi_apis::FunctionID::UI_SetMediaClockTimer)) .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_UI)); - ON_CALL(hmi_interfaces_, + ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillOnce(Return(true)); @@ -340,6 +336,9 @@ TEST_F(SetMediaClockRequestTest, OnEvent_Success) { EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)); + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app)); + Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer); event.set_smart_object(*msg); diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc index 2d2e19cbf2..e0ba409957 100644 --- a/src/components/application_manager/test/commands/mobile/show_test.cc +++ b/src/components/application_manager/test/commands/mobile/show_test.cc @@ -56,7 +56,6 @@ using am::commands::ShowRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using test::components::policy_test::MockPolicyHandlerInterface; using ::utils::SharedPtr; using ::testing::_; @@ -177,13 +176,6 @@ TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_, application(kConnectionKey)) .WillByDefault(Return(mock_app)); ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey)); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - ON_CALL(hmi_interfaces, GetInterfaceFromFunction(_)) - .WillByDefault( - Return(am::HmiInterfaces::HMI_INTERFACE_BasicCommunication)); - ON_CALL(hmi_interfaces, GetInterfaceState(_)) - .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); (*msg)[am::strings::params][am::hmi_response::code] = @@ -770,6 +762,8 @@ TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) { Event event(hmi_apis::FunctionID::UI_Show); event.set_smart_object(*msg); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_)); + command->on_event(event); } @@ -787,6 +781,8 @@ TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) { Event event(hmi_apis::FunctionID::UI_Show); event.set_smart_object(*msg); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_)); + command->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc index 7f260f7ddb..20262ed35a 100644 --- a/src/components/application_manager/test/commands/mobile/slider_test.cc +++ b/src/components/application_manager/test/commands/mobile/slider_test.cc @@ -56,7 +56,6 @@ using am::commands::SliderRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using policy_test::MockPolicyHandlerInterface; using ::utils::SharedPtr; using ::testing::_; @@ -159,11 +158,6 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { .WillByDefault(Return(mock_app)); ON_CALL(*mock_app, app_id()).WillByDefault(Return(kConnectionKey)); - MockHmiInterfaces hmi_interfaces; - ON_CALL(app_mngr_, hmi_interfaces()).WillByDefault(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, - GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) - .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); (*msg)[am::strings::params][am::hmi_response::code] = diff --git a/src/components/application_manager/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/test/commands/mobile/speak_request_test.cc index 58eec42902..f8a7d22b40 100644 --- a/src/components/application_manager/test/commands/mobile/speak_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/speak_request_test.cc @@ -67,7 +67,6 @@ using am::ApplicationManager; using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; -using am::MockHmiInterfaces; using ::testing::_; using ::utils::SharedPtr; using ::testing::Return; @@ -113,10 +112,8 @@ class SpeakRequestTest : public CommandRequestTest { ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); MessageSharedPtr response_to_mobile; - MockHmiInterfaces hmi_interfaces; - EXPECT_CALL(app_mngr_, hmi_interfaces()) - .WillOnce(ReturnRef(hmi_interfaces)); - EXPECT_CALL(hmi_interfaces, GetInterfaceState(_)).WillOnce(Return(state)); + EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) + .WillRepeatedly(Return(state)); MockMessageHelper* mock_message_helper = MockMessageHelper::message_helper_mock(); EXPECT_CALL(*mock_message_helper, HMIToMobileResult(_)) diff --git a/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc index 7cc5e59470..ae4e46d40b 100644 --- a/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unregister_app_interface_request_test.cc @@ -84,7 +84,7 @@ TEST_F(UnregisterAppInterfaceRequestTest, Run_SUCCESS) { MockAppPtr mock_app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app)); + .WillRepeatedly(Return(mock_app)); const mobile_apis::AppInterfaceUnregisteredReason::eType kUnregisterReason = mobile_apis::AppInterfaceUnregisteredReason::INVALID_ENUM; diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc index a71f8a43c8..6cf52adba3 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc @@ -81,7 +81,7 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) { MockAppPtr mock_app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app)); + .WillRepeatedly(Return(mock_app)); EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId)) .WillOnce(Return(true)); diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc index eae368347e..ecc2f8e8a5 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc @@ -181,22 +181,26 @@ void UnsubscribeVehicleRequestTest::UnsubscribeSuccessfully() { (*command_msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; (*command_msg)[am::strings::msg_params][kMsgParamKey] = true; + am::VehicleData vehicle_data; vehicle_data.insert(am::VehicleData::value_type(kMsgParamKey, kVehicleType)); + EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), vehicle_data()) .WillOnce(ReturnRef(vehicle_data)); - CommandPtr command(CreateCommand(command_msg)); am::ApplicationSet application_set_; MockAppPtr mock_app(CreateMockApp()); application_set_.insert(mock_app); DataAccessor accessor(application_set_, app_set_lock_); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app)); - EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); + .WillRepeatedly(Return(mock_app)); + + EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor)); EXPECT_CALL(*mock_app, IsSubscribedToIVI(kVehicleType)) .WillRepeatedly(Return(true)); + EXPECT_CALL(*mock_app, UnsubscribeFromIVI(kVehicleType)) .WillRepeatedly(Return(true)); @@ -204,6 +208,7 @@ void UnsubscribeVehicleRequestTest::UnsubscribeSuccessfully() { app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); + CommandPtr command(CreateCommand(command_msg)); command->Run(); } @@ -281,8 +286,6 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataUnsubscribed_SUCCESS) { app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); - EXPECT_CALL(*mock_app, UpdateHash()); - command->on_event(test_event); } diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc index 738cf35553..50567a7c62 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc @@ -152,7 +152,7 @@ TEST_F(UnSubscribeWayPointsRequestTest, OnEvent_ReceivedNavigationUnSubscribeWayPointsEvent_SUCCESS) { MockAppPtr mock_app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app)); + .WillRepeatedly(Return(mock_app)); MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map)); (*event_msg)[am::strings::msg_params] = 0; diff --git a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc index cab67e641c..6b363f6aca 100644 --- a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc @@ -281,6 +281,9 @@ TEST_F(UpdateTurnListRequestTest, OnEvent_UnsupportedResource_SUCCESS) { EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); + MockAppPtr mock_app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); + command_->on_event(event); } @@ -303,6 +306,9 @@ TEST_F(UpdateTurnListRequestTest, EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); + MockAppPtr mock_app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); + command_->on_event(event); } -- cgit v1.2.1 From c47a0b2211006af851ac2490250cb6fc26009a54 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Thu, 8 Jun 2017 16:01:11 +0300 Subject: Renames member variable according to common style --- .../mobile/create_interaction_choice_set_test.cc | 92 +++++++++++----------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc index 0c69b5b9f7..a627740588 100644 --- a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc +++ b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc @@ -115,7 +115,7 @@ class CreateInteractionChoiceSetRequestTest : message_helper_mock_(*am::MockMessageHelper::message_helper_mock()) , message_(CreateMessage()) , command_(CreateCommand(message_)) - , app_(CreateMockApp()) { + , mock_app_(CreateMockApp()) { Mock::VerifyAndClearExpectations(&message_helper_mock_); } ~CreateInteractionChoiceSetRequestTest() { @@ -165,7 +165,7 @@ class CreateInteractionChoiceSetRequestTest MockMessageHelper& message_helper_mock_; MessageSharedPtr message_; CreateInteractionChoiceSetRequestPtr command_; - MockAppPtr app_; + MockAppPtr mock_app_; sync_primitives::Lock lock_; }; @@ -212,10 +212,10 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { utils::SharedPtr req_vr = CreateCommand(msg_vr); - ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_)); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_)); smart_objects::SmartObject* null_obj = NULL; - ON_CALL(*app_, FindChoiceSet(_)).WillByDefault(Return(null_obj)); + ON_CALL(*mock_app_, FindChoiceSet(_)).WillByDefault(Return(null_obj)); MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); (*msg)[strings::params][hmi_response::code] = @@ -227,14 +227,14 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { event.set_smart_object(*msg); smart_objects::SmartObject* ptr = NULL; - ON_CALL(*app_, FindCommand(kCmdId)).WillByDefault(Return(ptr)); + ON_CALL(*mock_app_, FindCommand(kCmdId)).WillByDefault(Return(ptr)); EXPECT_EQ(NULL, ptr); ON_CALL(message_helper_mock_, HMIToMobileResult(_)) .WillByDefault(Return(mobile_apis::Result::SUCCESS)); am::CommandsMap commands_map; - ON_CALL(*app_, commands_map()) + ON_CALL(*mock_app_, commands_map()) .WillByDefault( Return(DataAccessor(commands_map, lock_))); @@ -281,7 +281,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_VerifyImageFail_UNSUCCESS) { (*message_)[am::strings::msg_params][am::strings::choice_set][0] [am::strings::secondary_image] = kSecondImage; - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::INVALID_DATA)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0); @@ -297,14 +297,14 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_FindChoiceSetFail_UNSUCCESS) { (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] = kChoiceSetId; - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* invalid_choice_set_id = &((*message_)[am::strings::msg_params] [am::strings::interaction_choice_set_id]); - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(invalid_choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0); command_->Run(); @@ -331,13 +331,13 @@ TEST_F(CreateInteractionChoiceSetRequestTest, (*message_)[am::strings::msg_params][am::strings::choice_set][1] [am::strings::vr_commands][0] = kVrCommands1; - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).Times(0); @@ -366,9 +366,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest, kChoiceSetId; smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillRepeatedly(Return(choice_set_id)); - EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); @@ -437,17 +437,17 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_ValidAmountVrCommands_SUCCESS) { FillMessageFieldsItem1(message_); FillMessageFieldsItem2(message_); - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)); EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) .Times(AtLeast(2)) .WillOnce(Return(kConnectionKey)) @@ -476,16 +476,16 @@ TEST_F(CreateInteractionChoiceSetRequestTest, (*message_)[am::strings::msg_params][am::strings::choice_set][1] [am::strings::vr_commands][0] = kVrCommands2; - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)); command_->Run(); } @@ -522,17 +522,17 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_ValidVrNoError_SUCCESS) { FillMessageFieldsItem1(message_); FillMessageFieldsItem2(message_); - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); command_->Run(); @@ -555,17 +555,17 @@ TEST_F(CreateInteractionChoiceSetRequestTest, FillMessageFieldsItem1(message_); FillMessageFieldsItem2(message_); - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); command_->Run(); @@ -589,17 +589,17 @@ TEST_F(CreateInteractionChoiceSetRequestTest, (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] = kChoiceSetId; - ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_)); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); command_->Run(); @@ -614,7 +614,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidErrorFromHMI_UNSUCCESS) { - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); EXPECT_CALL(app_mngr_, ManageMobileCommand( @@ -636,17 +636,17 @@ TEST_F(CreateInteractionChoiceSetRequestTest, (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] = kChoiceSetId; - ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_)); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); command_->Run(); @@ -658,7 +658,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, event.set_smart_object(*message_); command_->on_event(event); - EXPECT_CALL(*app_, RemoveChoiceSet(kChoiceSetId)); + EXPECT_CALL(*mock_app_, RemoveChoiceSet(kChoiceSetId)); EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); command_->onTimeOut(); @@ -676,17 +676,17 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) { (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] = kChoiceSetId; - EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); + EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); command_->Run(); @@ -701,7 +701,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) { MockAppPtr invalid_app; EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(invalid_app)); - EXPECT_CALL(*app_, RemoveChoiceSet(_)).Times(0); + EXPECT_CALL(*mock_app_, RemoveChoiceSet(_)).Times(0); command_->onTimeOut(); } @@ -723,14 +723,15 @@ TEST_F(CreateInteractionChoiceSetRequestTest, smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_)); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillOnce(Return(mock_app_)); EXPECT_CALL(app_mngr_, GenerateGrammarID()).WillOnce(Return(kGrammarId)); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillOnce(Return(choice_set_id)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)); command_->Run(); @@ -745,8 +746,9 @@ TEST_F(CreateInteractionChoiceSetRequestTest, command_->on_event(event); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); - EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app_)); - EXPECT_CALL(*app_, RemoveChoiceSet(_)); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_app_, RemoveChoiceSet(_)); command_->onTimeOut(); } @@ -787,18 +789,18 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) { (*message_)[am::strings::msg_params][am::strings::interaction_choice_set_id] = kChoiceSetId; - ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_)); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_)); EXPECT_CALL(message_helper_mock_, VerifyImage(_, _, _)) .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR)); smart_objects::SmartObject* choice_set_id = NULL; - EXPECT_CALL(*app_, FindChoiceSet(kChoiceSetId)) + EXPECT_CALL(*mock_app_, FindChoiceSet(kChoiceSetId)) .WillRepeatedly(Return(choice_set_id)); EXPECT_CALL(app_mngr_, GenerateGrammarID()) .WillRepeatedly(Return(kGrammarId)); - EXPECT_CALL(*app_, AddChoiceSet(kChoiceSetId, _)).Times(2); + EXPECT_CALL(*mock_app_, AddChoiceSet(kChoiceSetId, _)).Times(2); ON_CALL(app_mngr_, GetNextHMICorrelationID()) .WillByDefault(Return(kCorrelationId)); command_->Run(); -- cgit v1.2.1 From 5ba351b575d5f831c2058a7a1dca578713ba66c0 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Thu, 15 Jun 2017 14:39:58 +0300 Subject: Fix consumer friendly messages removing from PT In case PTU comes with omitted consumer_friendly_messages param SDL should maintain current consumer_friendly_messages section in Local PT. --- src/components/policy/policy_regular/src/sql_pt_representation.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index e94c853414..18d8975d15 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -1177,9 +1177,11 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( // the policy table. So it won't be changed/updated if (messages.messages.is_initialized()) { utils::dbms::SQLQuery query(db()); - if (!query.Exec(sql_pt::kDeleteMessageString)) { - LOG4CXX_WARN(logger_, "Incorrect delete from message."); - return false; + if (!messages.messages->empty()) { + if (!query.Exec(sql_pt::kDeleteMessageString)) { + LOG4CXX_WARN(logger_, "Incorrect delete from message."); + return false; + } } if (query.Prepare(sql_pt::kUpdateVersion)) { -- cgit v1.2.1 From 045a313b4d99b6141ae99e71ff0e9d1d20520a1c Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Thu, 15 Jun 2017 15:55:14 +0300 Subject: Refactoring in SaveConsumerFriendlyMessages function Removed nested if's. --- .../policy_external/src/sql_pt_representation.cc | 68 +++++++++++----------- .../policy_regular/src/sql_pt_representation.cc | 67 +++++++++++---------- 2 files changed, 70 insertions(+), 65 deletions(-) diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 48985fa835..5a3233b67d 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -1264,46 +1264,48 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( // According CRS-2419 If there is no “consumer_friendly_messages” key, // the current local consumer_friendly_messages section shall be maintained in // the policy table. So it won't be changed/updated - if (messages.messages.is_initialized()) { - utils::dbms::SQLQuery query(db()); - if (!messages.messages->empty()) { - if (!query.Exec(sql_pt::kDeleteMessageString)) { - LOG4CXX_WARN(logger_, "Incorrect delete from message."); - return false; - } - } + if (!messages.messages.is_initialized()) { + LOG4CXX_INFO(logger_, "Messages list is empty"); + return true; + } - if (query.Prepare(sql_pt::kUpdateVersion)) { - query.Bind(0, messages.version); - if (!query.Exec()) { - LOG4CXX_WARN(logger_, "Incorrect update into version."); - return false; - } - } else { - LOG4CXX_WARN(logger_, "Incorrect update statement for version."); + utils::dbms::SQLQuery query(db()); + bool delete_query_exec_result = true; + if (!messages.messages->empty()) { + delete_query_exec_result = query.Exec(sql_pt::kDeleteMessageString); + } + + if (!delete_query_exec_result) { + LOG4CXX_WARN(logger_, "Incorrect delete from message."); + return false; + } + + if (!query.Prepare(sql_pt::kUpdateVersion)) { + LOG4CXX_WARN(logger_, "Incorrect update statement for version."); + return false; + } + + query.Bind(0, messages.version); + if (!query.Exec()) { + LOG4CXX_WARN(logger_, "Incorrect update into version."); + return false; + } + + policy_table::Messages::const_iterator it; + for (it = messages.messages->begin(); it != messages.messages->end(); ++it) { + if (!SaveMessageType(it->first)) { return false; } - - policy_table::Messages::const_iterator it; - // TODO(IKozyrenko): Check logic if optional container is missing - for (it = messages.messages->begin(); it != messages.messages->end(); - ++it) { - if (!SaveMessageType(it->first)) { + const policy_table::Languages& langs = it->second.languages; + policy_table::Languages::const_iterator lang_it; + for (lang_it = langs.begin(); lang_it != langs.end(); ++lang_it) { + if (!SaveLanguage(lang_it->first)) { return false; } - const policy_table::Languages& langs = it->second.languages; - policy_table::Languages::const_iterator lang_it; - for (lang_it = langs.begin(); lang_it != langs.end(); ++lang_it) { - if (!SaveLanguage(lang_it->first)) { - return false; - } - if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) { - return false; - } + if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) { + return false; } } - } else { - LOG4CXX_INFO(logger_, "Messages list is empty"); } return true; diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 18d8975d15..e0c8747c16 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -1175,45 +1175,48 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( // According CRS-2419 If there is no “consumer_friendly_messages” key, // the current local consumer_friendly_messages section shall be maintained in // the policy table. So it won't be changed/updated - if (messages.messages.is_initialized()) { - utils::dbms::SQLQuery query(db()); - if (!messages.messages->empty()) { - if (!query.Exec(sql_pt::kDeleteMessageString)) { - LOG4CXX_WARN(logger_, "Incorrect delete from message."); - return false; - } - } + if (!messages.messages.is_initialized()) { + LOG4CXX_INFO(logger_, "Messages list is empty"); + return true; + } - if (query.Prepare(sql_pt::kUpdateVersion)) { - query.Bind(0, messages.version); - if (!query.Exec()) { - LOG4CXX_WARN(logger_, "Incorrect update into version."); - return false; - } - } else { - LOG4CXX_WARN(logger_, "Incorrect update statement for version."); + utils::dbms::SQLQuery query(db()); + bool delete_query_exec_result = true; + if (!messages.messages->empty()) { + delete_query_exec_result = query.Exec(sql_pt::kDeleteMessageString); + } + + if (!delete_query_exec_result) { + LOG4CXX_WARN(logger_, "Incorrect delete from message."); + return false; + } + + if (!query.Prepare(sql_pt::kUpdateVersion)) { + LOG4CXX_WARN(logger_, "Incorrect update statement for version."); + return false; + } + + query.Bind(0, messages.version); + if (!query.Exec()) { + LOG4CXX_WARN(logger_, "Incorrect update into version."); + return false; + } + + policy_table::Messages::const_iterator it; + for (it = messages.messages->begin(); it != messages.messages->end(); ++it) { + if (!SaveMessageType(it->first)) { return false; } - - policy_table::Messages::const_iterator it; - for (it = messages.messages->begin(); it != messages.messages->end(); - ++it) { - if (!SaveMessageType(it->first)) { + const policy_table::Languages& langs = it->second.languages; + policy_table::Languages::const_iterator lang_it; + for (lang_it = langs.begin(); lang_it != langs.end(); ++lang_it) { + if (!SaveLanguage(lang_it->first)) { return false; } - const policy_table::Languages& langs = it->second.languages; - policy_table::Languages::const_iterator lang_it; - for (lang_it = langs.begin(); lang_it != langs.end(); ++lang_it) { - if (!SaveLanguage(lang_it->first)) { - return false; - } - if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) { - return false; - } + if (!SaveMessageString(it->first, lang_it->first, lang_it->second)) { + return false; } } - } else { - LOG4CXX_INFO(logger_, "Messages list is empty"); } return true; -- cgit v1.2.1 From e2761de79ff76ad2e0a50179e1e4caec03f8c072 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 15 Jun 2017 14:59:54 -0400 Subject: Added mandatory flag to all parameters in Mobile and HMI APIs --- src/components/interfaces/HMI_API.xml | 54 +-- src/components/interfaces/MOBILE_API.xml | 512 ++++++++++----------- .../interfaces/v4_protocol_v1_2_no_extra.xml | 186 ++++---- .../generator/parsers/RPCBase.py | 8 +- 4 files changed, 382 insertions(+), 378 deletions(-) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 0d6d5fad3d..ad21241ad6 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1279,16 +1279,16 @@ - + The name that identifies the field. See TextFieldName. - + The character set that is supported in this field. See CharacterSet. - + The number of characters in one row of this field. - + The number of rows of this field. @@ -1311,10 +1311,10 @@ Individual published data request result - + Defined published data element type. - + Published data result code. @@ -1924,73 +1924,73 @@ - + References signal "eCallNotification_4A". See VehicleDataNotificationStatus. - + References signal "eCallNotification". See VehicleDataNotificationStatus. - + References signal "eCallConfirmation". See ECallConfirmationStatus. - + References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsEvntType_D_Ltchd". See EmergencyEventType. - + References signal "RCM_FuelCutoff". See FuelCutoffStatus. - + References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsMaxDeltaV_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus. - + References signal "PowerMode_UB". - + References signal "PowerModeQF". See PowerModeQualificationStatus. - + References signal "CarMode". See CarMode. - + References signal "PowerMode". See PowerMode. @@ -2317,7 +2317,7 @@ Request from SDL to call a specific number. - + The number to dial. Only the character + and numbers are allowed. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 953f270741..40c4db62cc 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -449,9 +449,9 @@ Describes different audio type configurations for PerformAudioPassThru. e.g. {8kHz,8-bit,PCM} - - - + + + @@ -806,16 +806,16 @@ - + Either the static hex icon value or the binary image file name identifier (sent by PutFile). - + Describes, whether it is a static or dynamic image. - + Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType @@ -830,7 +830,7 @@ False, if not highlighted - + Value which is returned via OnButtonPress / OnButtonEvent @@ -840,9 +840,9 @@ A choice is an option given to the user, which can be selected either by menu, or through voice recognition system. - - - + + + Optional secondary text to display; e.g. address of POI in a search result entry @@ -856,13 +856,13 @@ - + Text to display for VR Help item Image struct for VR Help item - + Position to display item in VR Help list @@ -870,10 +870,10 @@ Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application - + The major version indicates versions that is not-compatible to previous versions. - + The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality) @@ -997,7 +997,7 @@ - + See ComponentVolumeStatus. @@ -1168,61 +1168,61 @@ - + References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus. - + References signal "PrkBrkActv_B_Actl". - + References signal "Ignition_Switch_Stable". See IgnitionStableStatus. - + References signal "Ignition_status". See IgnitionStatus. @@ -1240,46 +1240,46 @@ - + References signal "CPM_VoiceRec_STAT". - + References signal "BT_ICON". - + References signal "CPM_Call_Active_STAT". - + References signal "CPM_Phone_Roaming_STAT". - + References signal "CPM_TextMsg_AVAL". - + Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus. - + References signal "CPM_Stereo_Audio_Output". - + References signal "CPM_Mono_Audio_Output". - + Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus. - + References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource. - + References signal "eCall_Event". - + Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat". - + Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat". @@ -1415,84 +1415,84 @@ - + References signal "eCallNotification_4A". See VehicleDataNotificationStatus. - + References signal "eCallNotification". See VehicleDataNotificationStatus. - + References signal "eCallConfirmation". See ECallConfirmationStatus. - + References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsEvntType_D_Ltchd". See EmergencyEventType. - + References signal "RCM_FuelCutoff". See FuelCutoffStatus. - + References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus. - + References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values: 0x00 No event 0xFE Not supported 0xFF Fault - + References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus. - + References signal "PowerMode_UB". - + References signal "PowerModeQF". See PowerModeQualificationStatus. - + References signal "CarMode". See CarMode. - + References signal "PowerMode". See PowerMode. - + Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus. @@ -1535,101 +1535,101 @@ The status and pressure of the tires. - + Status of the Tire Pressure Telltale. See WarningLightStatus. - + The status of the left front tire. - + The status of the right front tire. - + The status of the left rear tire. - + The status of the right rear tire. - + The status of the inner left rear. - + The status of the inner right rear. Struct with the GPS data. - + - + - + The current UTC year. - + The current UTC month. - + The current UTC day. - + The current UTC hour. - + The current UTC minute. - + The current UTC second. - + See CompassDirection. - + PDOP. If undefined or unavailable, then value shall be set to 0. - + HDOP. If value is unknown, value shall be set to 0. - + VDOP. If value is unknown, value shall be set to 0. - + True, if actual. False, if infered. - + Number of satellites in view - + See Dimension - + Altitude in meters - + The heading. North is 0. Resolution is 0.01 - + The speed in KPH Individual published data request result - + Defined published data element type. - + Published data result code. Individual requested DID result and data - + Individual DID result code. @@ -1641,45 +1641,45 @@ - + The hour of the media clock. Some radios only support a max of 19 hours. If out of range, it will be rejected. - - + + - + The name that identifies the field. See TextFieldName. - + The character set that is supported in this field. See CharacterSet. - + The number of characters in one row of this field. - + The number of rows of this field. - + The image resolution width. - + The image resolution height. - + The name that identifies the field. See ImageFieldName. - + The image types that are supported in this field. See FileType. @@ -1749,46 +1749,46 @@ - + A set of all HMI levels that are permitted for this given RPC. - + A set of all HMI levels that are prohibited for this given RPC. - + A set of all parameters that are permitted for this given RPC. - + A set of all parameters that are prohibited for this given RPC. - + Name of the individual RPC in the policy table. - - + + Contains information about the display capabilities. - + The type of the display. See DisplayType - + A set of all fields that support text data. See TextField A set of all fields that support images. See ImageField - + A set of all supported formats of the media clock. See MediaClockFormat - + The display's persistent screen supports referencing a static or dynamic image. @@ -1806,22 +1806,22 @@ Contains information about a button's capabilities. - + The name of the button. See ButtonName. - + The button supports a short press. Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked. - + The button supports a LONG press. Whenever the button is pressed long, onButtonPressed( LONG) will be invoked. - + The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent( DOWN) will be invoked. @@ -1832,33 +1832,33 @@ Contains information about a SoftButton's capabilities. - + The button supports a short press. Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked. - + The button supports a LONG press. Whenever the button is pressed long, onButtonPressed( LONG) will be invoked. - + The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent( DOWN) will be invoked. Whenever the button is released, onButtonEvent( UP) will be invoked. - + The button supports referencing a static or dynamic image. Contains information about on-screen preset capabilities. - + Onscreen custom presets are available. @@ -1890,20 +1890,20 @@ - + Text to show in the menu for this sub menu. A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI) - + The text or phonemes to speak. May not be empty. - + Describes, whether it is text or a specific phoneme set. See SpeechCapabilities @@ -2386,11 +2386,11 @@ Before registerAppInterface no other commands will be accepted/executed. - + See SyncMsgVersion - + The mobile application name, e.g. "Ford Drive Green". Needs to be unique over all applications. @@ -2429,7 +2429,7 @@ - + Indicates if the application is a media or a non-media application. Only media applications will be able to stream audio to Sync that is audible outside of the BT media source. @@ -2483,11 +2483,11 @@ The response to registerAppInterface - + true if successful; false, if failed - + See Result @@ -2596,11 +2596,11 @@ - + true if successful; false, if failed - + See Result @@ -2666,11 +2666,11 @@ - + true if successful; false, if failed - + See Result @@ -2693,18 +2693,18 @@ Allows resetting global properties. - + Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default) - + true if successful; false, if failed - + See Result @@ -2753,11 +2753,11 @@ - + true if successful; false, if failed - + See Result @@ -2782,18 +2782,18 @@ Deletes all commands from the in-application menu with the specified command id. - + ID of the command(s) to delete. - + true if successful; false, if failed - + See Result @@ -2815,7 +2815,7 @@ Adds a sub menu to the in-application menu. - + unique ID of the sub menu to add. @@ -2830,17 +2830,17 @@ - + Text to show in the menu for this sub menu. - + true if successful; false, if failed - + See Result @@ -2861,7 +2861,7 @@ Deletes a submenu from the in-application menu. - + The "menuID" of the submenu to delete. (See addSubMenu.menuID) @@ -2869,11 +2869,11 @@ - + true if successful; false, if failed - + See Result @@ -2895,19 +2895,19 @@ creates interaction choice set to be used later by performInteraction - + Unique ID used for this interaction choice set. - + - + true if successful; false, if failed - + See Result @@ -2929,7 +2929,7 @@ Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow). - + Text to be displayed first. @@ -2943,11 +2943,11 @@ - + See InteractionMode. - + List of interaction choice set IDs to use with an interaction. @@ -2990,11 +2990,11 @@ - + true if successful; false, if failed - + See Result @@ -3042,17 +3042,17 @@ Deletes interaction choice set that has been created with "CreateInteractionChoiceSet". The interaction may only be deleted when not currently in use by a "performInteraction". - + ID of the interaction choice set to delete. - + true if successful; false, if failed - + See Result @@ -3124,11 +3124,11 @@ - + true if successful; false, if failed - + See Result @@ -3252,11 +3252,11 @@ - + true if successful; false, if failed - + See Result @@ -3279,7 +3279,7 @@ Speaks a text. - + An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item. @@ -3290,11 +3290,11 @@ - + true if successful; false, if failed - + See Result @@ -3345,11 +3345,11 @@ - + true if successful; false, if failed - + See Result @@ -3403,11 +3403,11 @@ - + true if successful; false, if failed - + See Result @@ -3432,11 +3432,11 @@ - + true if successful; false, if failed - + See Result @@ -3460,17 +3460,17 @@ To unsubscribe the notifications, use unsubscribeButton. - + Name of the button to subscribe. - + true if successful; false, if failed - + See Result @@ -3491,17 +3491,17 @@ Unsubscribes from built-in HMI buttons. - + Name of the button to unsubscribe. - + true if successful; false, if failed - + See Result @@ -3607,11 +3607,11 @@ - + true, if successful; false, if failed - + See Result @@ -3790,11 +3790,11 @@ - + true, if successful; false, if failed - + See Result @@ -3976,11 +3976,11 @@ - + true, if successful; false, if failed - + See Result @@ -4092,11 +4092,11 @@ - + true, if successful; false, if failed - + See Result @@ -4135,11 +4135,11 @@ - + true, if successful; false, if failed - + See Result @@ -4190,11 +4190,11 @@ - + true, if successful; false, if failed - + See Result @@ -4222,7 +4222,7 @@ Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined - + Body of text that can include newlines and tabs. @@ -4237,11 +4237,11 @@ - + true, if successful; false, if failed - + See Result @@ -4291,11 +4291,11 @@ - + true, if successful; false, if failed - + See Result @@ -4365,10 +4365,10 @@ - + true, if successful; false, if failed - + See Result @@ -4396,10 +4396,10 @@ - + true, if successful; false, if failed - + See Result @@ -4429,10 +4429,10 @@ - + true, if successful; false, if failed - + See Result @@ -4476,14 +4476,14 @@ - + true, if successful false, if failed - + See Result @@ -4506,11 +4506,11 @@ Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error. Currently, only resultCode INVALID_DATA is used. - + true, if successful; false, if failed - + See Result @@ -4568,11 +4568,11 @@ Response is sent, when the file data was copied (success case). Or when an error occured. Not supported on First generation SYNC vehicles. - + true, if successful; false, if failed - + See Result @@ -4584,7 +4584,7 @@ - + Provides the total local space available in SDL Core for the registered app. If the transfer has systemFile enabled, then the value will be set to 0 automatically. @@ -4613,11 +4613,11 @@ Response is sent, when the file data was deleted (success case). Or when an error occured. Not supported on First generation SYNC vehicles. - + true if successful; false, if failed - + See Result @@ -4629,7 +4629,7 @@ - + Provides the total local space available on SYNC for the registered app. @@ -4650,11 +4650,11 @@ Returns the current list of resident filenames for the registered app along with the current space available Not supported on First generation SYNC vehicles. - + true, if successful; false, if failed - + See Result @@ -4673,7 +4673,7 @@ - + Provides the total local space available on SYNC for the registered app. @@ -4700,11 +4700,11 @@ Not supported on First generation SYNC vehicles. - + true, if successful; false, if failed - + See Result @@ -4739,11 +4739,11 @@ - + true, if successful; false, if failed - + See Result @@ -4795,11 +4795,11 @@ - + true, if successful; false, if failed - + See Result @@ -4866,11 +4866,11 @@ - + true, if successful; false, if failed - + See Result @@ -4891,7 +4891,7 @@ Dials a phone number and switches to phone application. - + Phone number is a string, which can be up to 40 chars. All characters shall be stripped from string except digits 0-9 and * # , ; + @@ -4900,12 +4900,12 @@ - + true, if successful false, if failed - + See Result @@ -4926,10 +4926,10 @@ - + true, if successful; false, if failed - + See Result @@ -4952,10 +4952,10 @@ - + true, if successful; false, if failed - + See Result @@ -4980,10 +4980,10 @@ - + true, if successful; false, if failed - + See Result @@ -5004,29 +5004,29 @@ - + See HMILevel - + See AudioStreamingState - + See SystemContext - + See AppInterfaceUnregisteredReason Notifies application of UP/DOWN events for buttons to which the application is subscribed. - - + + Indicates whether this is an UP or DOWN event. @@ -5036,8 +5036,8 @@ Notifies application of LONG/SHORT press events for buttons to which the application is subscribed. - - + + Indicates whether this is a LONG or SHORT button press event. @@ -5129,32 +5129,32 @@ - + Command ID, which is related to a specific menu entry - + See TriggerSource Provides applications with notifications specific to the current TBT client status on the module - + Current State of TBT client Provides driver distraction state to mobile applications - + Current State of Driver Distraction Provides update to app of which policy-table-enabled functions are available - + Change in permissions for a given set of RPCs @@ -5164,10 +5164,10 @@ - + Current SYNC voice engine (VR+TTS) language - + Current display language @@ -5267,11 +5267,11 @@ - + true, if successful; false, if failed - + See Result @@ -5296,11 +5296,11 @@ - + true, if successful; false, if failed - + See Result diff --git a/src/components/interfaces/v4_protocol_v1_2_no_extra.xml b/src/components/interfaces/v4_protocol_v1_2_no_extra.xml index ead8596ee6..cc522d9f1c 100644 --- a/src/components/interfaces/v4_protocol_v1_2_no_extra.xml +++ b/src/components/interfaces/v4_protocol_v1_2_no_extra.xml @@ -326,16 +326,16 @@ A choice is an option given to the user, which can be selected either by menu, or through voice recognition system. - - - + + + Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application - + The major version indicates versions that is not-compatible to previous versions. - + The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality) @@ -349,53 +349,53 @@ - + The hour of the media clock. Some radios only support a max of 19 hours. If out of range, it will be rejected. - - + + - + The name that identifies the field. See TextFieldName. - + The character set that is supported in this field. See CharacterSet. - + The number of characters in one row of this field. - + The number of rows of this field. Contains information about the display capabilities. - + The type of the display. See DisplayType - + A set of all fields that support text data. See TextField - + A set of all supported formats of the media clock. See MediaClockFormat Contains information about a buttons capabilities. - + The name of the button. See ButtonName. - + The button supports a short press. Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked. - + The button supports a LONG press. Whenever the button is pressed long, onButtonPressed( LONG) will be invoked. - + The button supports "button down" and "button up". Whenever the button is pressed, onButtonEvent( DOWN) will be invoked. Whenever the button is released, onButtonEvent( UP) will be invoked. @@ -413,17 +413,17 @@ if position is greater or equal than the number of items on top level, the sub menu will be appended to the end. If this param was omitted the entry will be added at the end. - + Text to show in the menu for this sub menu. A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI) - + The text or phonemes to speak. May not be empty. - + Describes, whether it is text or a specific phoneme set. See SpeechCapabilities @@ -431,10 +431,10 @@ Establishes an interface with a mobile application. Before registerAppInterface no other commands will be accepted/executed. - + See SyncMsgVersion - + The mobile application name, e.g. "Ford Drive Green". Needs to be unique over all applications. May not be empty. @@ -457,11 +457,11 @@ If not provided, the default is equal to False" Indicates if the mobile application wants to use vehicle data like GPS or speed. - + Indicates if the application is a media or a non-media application. Only media applications will be able to stream audio to Sync that is audible outside of the BT media source. - + See Language If the language doesn't match the active language on Sync, it will be rejected. If the language is changed, while an app is registered, it will get disconnected. @@ -475,11 +475,11 @@ The response to registerAppInterface - + true, if successful false, if failed - + See Result @@ -527,11 +527,11 @@ Will fail, if no registerAppInterface was completed successfully before. - + true, if successful false, if failed - + See Result @@ -559,11 +559,11 @@ Do we want to add VR threshold params? - + true, if successful false, if failed - + See Result @@ -579,16 +579,16 @@ Allows resetting global properties. - + Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default) - + true, if successful false, if failed - + See Result @@ -605,7 +605,7 @@ Adds a command to the in application menu. Either menuParams or vrCommands must be provided. - + unique ID of the command to add. @@ -617,11 +617,11 @@ - + true, if successful false, if failed - + See Result @@ -639,16 +639,16 @@ Deletes all commands from the in-application menu with the specified command id. - + ID of the command(s) to delete. - + true, if successful false, if failed - + See Result @@ -666,7 +666,7 @@ Adds a sub menu to the in-application menu. - + unique ID of the sub menu to add. @@ -677,16 +677,16 @@ Position of any submenu will always be located before the return and exit options If this param was omitted the entry will be added at the end. - + Text to show in the menu for this sub menu. - + true, if successful false, if failed - + See Result @@ -704,16 +704,16 @@ Deletes a submenu from the in-application menu. - + The "menuID" of the submenu to delete. (See addSubMenu.menuID) - + true, if successful false, if failed - + See Result @@ -731,17 +731,17 @@ creates interaction choice set to be used later by performInteraction - + Unique ID used for this interaction choice set. - + - + true, if successful false, if failed - + See Result @@ -759,18 +759,18 @@ Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow). - + Text to be displayed first. - + This is the intial prompt spoken to the user at the start of an interaction An array of text chunks of type TTSChunk. See TTSChunk The array must have at least one item - + See InteractionMode. - + List of interaction choice set IDs to use with an interaction. @@ -789,11 +789,11 @@ - + true, if successful false, if failed - + See Result @@ -819,16 +819,16 @@ Deletes interaction choice set that has been created with "CreateInteractionChoiceSet". The interaction may only be deleted when not currently in use by a "performInteraction". - + ID of the interaction choice set to delete. - + true, if successful false, if failed - + See Result @@ -867,11 +867,11 @@ - + true, if successful false, if failed - + See Result @@ -917,11 +917,11 @@ - + true, if successful false, if failed - + See Result @@ -937,17 +937,17 @@ Speaks a text. - + An array of text chunks of type TTSChunk. See TTSChunk The array must have at least one item - + true, if successful false, if failed - + See Result @@ -969,17 +969,17 @@ startTime must be provided for "run" startTime will be ignored for "pause" and "resum" - + Enumeration to control the media clock. In case of pause or resume, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused. - + true, if successful false, if failed - + See Result @@ -1002,11 +1002,11 @@ - + true, if successful false, if failed - + See Result @@ -1024,16 +1024,16 @@ Subscribes to built-in HMI buttons. The application will be notified by the OnButtonEvent and OnButtonPress. To unsubscribe the notifications, use unsubscribeButton. - + Name of the button to subscribe. - + true, if successful false, if failed - + See Result @@ -1051,16 +1051,16 @@ Unsubscribes from built-in HMI buttons. - + Name of the button to unsubscribe. - + true, if successful false, if failed - + See Result @@ -1079,11 +1079,11 @@ Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error. Currently, only resultCode INVALID_DATA is used. - + true, if successful false, if failed - + See Result @@ -1093,40 +1093,40 @@ - + See HMILevel - + See AudioStreamingState - + See SystemContext - + See AppInterfaceUnregisteredReason Notifies application of UP/DOWN events for buttons to which the application is subscribed. - - + + Indicates whether this is an UP or DOWN event. Notifies application of LONG/SHORT press events for buttons to which the application is subscribed. - - + + Indicates whether this is a LONG or SHORT button press event. - + Command ID, which is related to a specific menu entry. - + See TriggerSource @@ -1138,13 +1138,13 @@ Provides applications with notifications specific to the current TBT client status on the module - + Current State of TBT client Provides driver distraction state to mobile applications - + Current State of Driver Distraction diff --git a/tools/InterfaceGenerator/generator/parsers/RPCBase.py b/tools/InterfaceGenerator/generator/parsers/RPCBase.py index 22f3fd2c2d..59edf4a9b3 100755 --- a/tools/InterfaceGenerator/generator/parsers/RPCBase.py +++ b/tools/InterfaceGenerator/generator/parsers/RPCBase.py @@ -548,8 +548,12 @@ class Parser(object): """ params, subelements, attrib = self._parse_base_item(element, "") - params["is_mandatory"] = self._extract_optional_bool_attrib( - attrib, "mandatory", True) + is_mandatory = self._extract_attrib(attrib, "mandatory") + if is_mandatory is None: + raise ParseError("'mandatory' is not specified for parameter '" + + params["name"] + "'") + + params["is_mandatory"] = self._get_bool_from_string(is_mandatory) scope = self._extract_attrib(attrib, "scope") if scope is not None: -- cgit v1.2.1 From 36a37e964f03b3c01decee10c80a67b8c5ec1590 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 16 Jun 2017 15:29:03 +0300 Subject: Fixed logger messages context --- .../policy/policy_external/src/sql_pt_representation.cc | 8 ++++---- src/components/policy/policy_regular/src/sql_pt_representation.cc | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 5a3233b67d..95c07e6aef 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -1265,7 +1265,7 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( // the current local consumer_friendly_messages section shall be maintained in // the policy table. So it won't be changed/updated if (!messages.messages.is_initialized()) { - LOG4CXX_INFO(logger_, "Messages list is empty"); + LOG4CXX_INFO(logger_, "ConsumerFriendlyMessages messages list is empty"); return true; } @@ -1276,18 +1276,18 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( } if (!delete_query_exec_result) { - LOG4CXX_WARN(logger_, "Incorrect delete from message."); + LOG4CXX_WARN(logger_, "Failed to delete messages from DB."); return false; } if (!query.Prepare(sql_pt::kUpdateVersion)) { - LOG4CXX_WARN(logger_, "Incorrect update statement for version."); + LOG4CXX_WARN(logger_, "Invalid update messages version statement."); return false; } query.Bind(0, messages.version); if (!query.Exec()) { - LOG4CXX_WARN(logger_, "Incorrect update into version."); + LOG4CXX_WARN(logger_, "Failed to update messages version number in DB."); return false; } diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index e0c8747c16..a9ecc87053 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -1176,7 +1176,7 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( // the current local consumer_friendly_messages section shall be maintained in // the policy table. So it won't be changed/updated if (!messages.messages.is_initialized()) { - LOG4CXX_INFO(logger_, "Messages list is empty"); + LOG4CXX_INFO(logger_, "ConsumerFriendlyMessages messages list is empty"); return true; } @@ -1187,18 +1187,18 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( } if (!delete_query_exec_result) { - LOG4CXX_WARN(logger_, "Incorrect delete from message."); + LOG4CXX_WARN(logger_, "Failed to delete messages from DB."); return false; } if (!query.Prepare(sql_pt::kUpdateVersion)) { - LOG4CXX_WARN(logger_, "Incorrect update statement for version."); + LOG4CXX_WARN(logger_, "Invalid update messages version statement."); return false; } query.Bind(0, messages.version); if (!query.Exec()) { - LOG4CXX_WARN(logger_, "Incorrect update into version."); + LOG4CXX_WARN(logger_, "Failed to update messages version number in DB."); return false; } -- cgit v1.2.1 From 179ae6551c650636c64cc7fbc55c3a80388d9d96 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Mon, 19 Jun 2017 12:34:15 +0300 Subject: Fix Policy Table validation in case group subsection is empty/invalid This issue was already fixed for external policy, but still was not fixed for regular policy. In this commit was added validation checks for empty and upper bound of group subsection. --- .../policy_regular/src/policy_table/validation.cc | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc index e7a981e559..27efdce515 100644 --- a/src/components/policy/policy_regular/src/policy_table/validation.cc +++ b/src/components/policy/policy_regular/src/policy_table/validation.cc @@ -115,8 +115,13 @@ bool ApplicationPoliciesSection::Validate() const { } bool ApplicationParams::Validate() const { + // Check for empty "groups" sub-sections + if (groups.empty()) { + return false; + } return true; } + bool RpcParameters::Validate() const { return true; } @@ -178,20 +183,40 @@ bool UsageAndErrorCounts::Validate() const { } return true; } + bool DeviceParams::Validate() const { return true; } + bool PolicyTable::Validate() const { - if (PT_PRELOADED == GetPolicyTableType() || - PT_UPDATE == GetPolicyTableType()) { + const PolicyTableType policy_table_type = GetPolicyTableType(); + + if (PT_PRELOADED == policy_table_type || PT_UPDATE == policy_table_type) { if (device_data.is_initialized()) { return false; } } + + if (PT_PRELOADED == policy_table_type || PT_SNAPSHOT == policy_table_type) { + // Check upper bound of each "groups" sub section in the app policies + const FunctionalGroupings::size_type functional_groupings_count = + functional_groupings.size(); + for (ApplicationPolicies::const_iterator app_policiies_it = + app_policies_section.apps.begin(); + app_policies_section.apps.end() != app_policiies_it; + ++app_policiies_it) { + if (app_policiies_it->second.groups.size() > functional_groupings_count) { + return false; + } + } + } + return true; } + bool Table::Validate() const { return true; } + } // namespace policy_table_interface_base } // namespace rpc -- cgit v1.2.1 From 60f57672d36c84b805d2e40481be1555e3e6ffa8 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Mon, 19 Jun 2017 16:26:36 +0300 Subject: Fix Consumer friendly message default language checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If “en-us” is not present for any message, the table shall be rejected, PM should log error and shut SDL down. However this works only for external policies. Added missed checks for regular policies. kMandatoryLanguage was renamed to default_language_ --- .../policy_external/include/policy/policy_table/types.h | 2 +- .../policy/policy_external/src/policy_table/types.cc | 11 ++++++----- .../policy/policy_regular/include/policy/policy_table/types.h | 1 + .../policy/policy_regular/src/policy_table/types.cc | 11 +++++++++++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index 774ef3ee59..8785f4d8e9 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -360,7 +360,7 @@ struct MessageLanguages : CompositeType { private: bool Validate() const; - static const std::string kMandatoryLanguage_; + static const std::string default_language_; }; struct ConsumerFriendlyMessages : CompositeType { diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index d7dd986abc..a02f1efe9d 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -890,7 +890,7 @@ void MessageString::SetPolicyTableType(PolicyTableType pt_type) { } // MessageLanguages methods -const std::string MessageLanguages::kMandatoryLanguage_("en-us"); +const std::string MessageLanguages::default_language_("en-us"); MessageLanguages::MessageLanguages() : CompositeType(kUninitialized) {} @@ -914,7 +914,7 @@ bool MessageLanguages::is_valid() const { return false; } // Each RPC must have message in english - if (languages.end() == languages.find(kMandatoryLanguage_)) { + if (languages.end() == languages.find(default_language_)) { return false; } return Validate(); @@ -947,9 +947,10 @@ void MessageLanguages::ReportErrors(rpc::ValidationReport* report__) const { if (!languages.is_valid()) { languages.ReportErrors(&report__->ReportSubobject("languages")); } - if (languages.end() == languages.find(kMandatoryLanguage_)) { - report__->set_validation_info("no mandatory language '" + - kMandatoryLanguage_ + "' is present"); + if (languages.end() == languages.find(default_language_)) { + report__->set_validation_info( + "this message does not support the default language '" + + default_language_ + "'"); } } diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 66fddee592..f6dceb30ed 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -298,6 +298,7 @@ struct MessageLanguages : CompositeType { virtual void SetPolicyTableType(PolicyTableType pt_type); private: + static const std::string default_language_; bool Validate() const; }; diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index 7928973919..c448167e53 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -737,6 +737,8 @@ void MessageString::SetPolicyTableType(PolicyTableType pt_type) { } // MessageLanguages methods +const std::string MessageLanguages::default_language_("en-us"); + MessageLanguages::MessageLanguages() : CompositeType(kUninitialized) {} MessageLanguages::MessageLanguages(const Languages& languages) : CompositeType(kUninitialized), languages(languages) {} @@ -753,6 +755,10 @@ bool MessageLanguages::is_valid() const { if (!languages.is_valid()) { return false; } + // Each RPC must have message in english + if (languages.end() == languages.find(default_language_)) { + return false; + } return Validate(); } bool MessageLanguages::is_initialized() const { @@ -781,6 +787,11 @@ void MessageLanguages::ReportErrors(rpc::ValidationReport* report__) const { if (!languages.is_valid()) { languages.ReportErrors(&report__->ReportSubobject("languages")); } + if (languages.end() == languages.find(default_language_)) { + report__->set_validation_info( + "this message does not support the default language '" + + default_language_ + "'"); + } } void MessageLanguages::SetPolicyTableType(PolicyTableType pt_type) { -- cgit v1.2.1 From e5fb4510b64635d824bbb48a205b7c3e4ed0e92c Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 16 Jun 2017 18:01:32 +0300 Subject: Fix UnsubscribeButton wrong result code in case of UNSUPPORTED_RESOURCE Fixed UnsubscribeButton wrong result code in case of UNSUPPORTED_RESOURCE. This checking was already implemented for SubscribeButton rpc, but not implemented for UnsubscribeButton. In this commit: - Function CheckHMICapabilities(), which responsible for HMI capabilities permissions checking, was moved to CommandRequestImpl class to use from both SubscribeButton/UnsubscribeButton. - Added logs and minor changes in CheckHMICapabilities() function - Added checking HMI capabilities for UnsubscribeButton --- .../commands/command_request_impl.h | 8 +++++ .../commands/mobile/subscribe_button_request.h | 6 ---- .../src/commands/command_request_impl.cc | 38 ++++++++++++++++++++++ .../commands/mobile/subscribe_button_request.cc | 28 ---------------- .../commands/mobile/unsubscribe_button_request.cc | 14 ++++++-- 5 files changed, 57 insertions(+), 37 deletions(-) diff --git a/src/components/application_manager/include/application_manager/commands/command_request_impl.h b/src/components/application_manager/include/application_manager/commands/command_request_impl.h index f585410e97..362a3566da 100644 --- a/src/components/application_manager/include/application_manager/commands/command_request_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_request_impl.h @@ -192,6 +192,14 @@ class CommandRequestImpl : public CommandImpl, */ bool CheckAllowedParameters(); + /** + * @brief Checks HMI capabilities for specified button support + * @param button Button to check + * @return true if button is present in HMI capabilities + * otherwise returns false + */ + bool CheckHMICapabilities(const mobile_apis::ButtonName::eType button) const; + /** * @brief Remove from current message parameters disallowed by policy table */ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h index b5a22d40a9..d92c4b636d 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h @@ -85,12 +85,6 @@ class SubscribeButtonRequest : public CommandRequestImpl { */ void SendSubscribeButtonNotification(); - /** - * @brief Checks HMI capabilities for specified button support - * @param button Button to check - */ - bool CheckHMICapabilities(mobile_apis::ButtonName::eType button); - DISALLOW_COPY_AND_ASSIGN(SubscribeButtonRequest); }; diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index cea5412587..6ecb2bf3a2 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -550,6 +550,44 @@ bool CommandRequestImpl::CheckAllowedParameters() { return true; } +bool CommandRequestImpl::CheckHMICapabilities( + const mobile_apis::ButtonName::eType button) const { + LOG4CXX_AUTO_TRACE(logger_); + + using namespace smart_objects; + using namespace mobile_apis; + + const HMICapabilities& hmi_capabilities = + application_manager_.hmi_capabilities(); + if (!hmi_capabilities.is_ui_cooperating()) { + LOG4CXX_ERROR(logger_, "UI is not supported by HMI"); + return false; + } + + const SmartObject* button_capabilities_so = + hmi_capabilities.button_capabilities(); + if (!button_capabilities_so) { + LOG4CXX_ERROR(logger_, "Invalid button capabilities object"); + return false; + } + + const SmartObject& button_capabilities = *button_capabilities_so; + for (size_t i = 0; i < button_capabilities.length(); ++i) { + const SmartObject& capabilities = button_capabilities[i]; + const ButtonName::eType current_button = static_cast( + capabilities.getElement(hmi_response::button_name).asInt()); + if (current_button == button) { + LOG4CXX_DEBUG(logger_, + "Button capabilities for " << button << " was found"); + return true; + } + } + + LOG4CXX_DEBUG(logger_, + "Button capabilities for " << button << " was not found"); + return false; +} + void CommandRequestImpl::RemoveDisallowedParameters() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc index eb6bbf545e..472b9223b0 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc @@ -104,34 +104,6 @@ bool SubscribeButtonRequest::IsSubscriptionAllowed( return true; } -bool SubscribeButtonRequest::CheckHMICapabilities( - mobile_apis::ButtonName::eType button) { - using namespace smart_objects; - using namespace mobile_apis; - LOG4CXX_AUTO_TRACE(logger_); - - const HMICapabilities& hmi_caps = application_manager_.hmi_capabilities(); - if (!hmi_caps.is_ui_cooperating()) { - LOG4CXX_ERROR(logger_, "UI is not supported by HMI."); - return false; - } - - const SmartObject* button_caps_ptr = hmi_caps.button_capabilities(); - if (button_caps_ptr) { - const SmartObject& button_caps = *button_caps_ptr; - const size_t length = button_caps.length(); - for (size_t i = 0; i < length; ++i) { - const SmartObject& caps = button_caps[i]; - const ButtonName::eType name = static_cast( - caps.getElement(hmi_response::button_name).asInt()); - if (name == button) { - return true; - } - } - } - return false; -} - void SubscribeButtonRequest::SendSubscribeButtonNotification() { using namespace smart_objects; using namespace hmi_apis; diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc index e1bdba61a0..45caaee54c 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc @@ -58,8 +58,16 @@ void UnsubscribeButtonRequest::Run() { return; } - const uint32_t btn_id = - (*message_)[str::msg_params][str::button_name].asUInt(); + const mobile_apis::ButtonName::eType btn_id = + static_cast( + (*message_)[str::msg_params][str::button_name].asInt()); + + if (!CheckHMICapabilities(btn_id)) { + LOG4CXX_ERROR(logger_, + "Button " << btn_id << " isn't allowed by HMI capabilities"); + SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); + return; + } if (!app->UnsubscribeFromButton( static_cast(btn_id))) { @@ -81,7 +89,7 @@ void UnsubscribeButtonRequest::SendUnsubscribeButtonNotification() { SmartObject msg_params = SmartObject(SmartType_Map); msg_params[strings::app_id] = connection_key(); msg_params[strings::name] = static_cast( - (*message_)[strings::msg_params][strings::button_name].asUInt()); + (*message_)[strings::msg_params][strings::button_name].asInt()); msg_params[strings::is_suscribed] = false; CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params); } -- cgit v1.2.1 From 8080c4a3bef0b132c5ed9590b3826c216104de36 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Mon, 19 Jun 2017 10:50:48 +0300 Subject: Add UT for covering new test case and fix existing --- .../mobile/unsubscribe_button_request_test.cc | 61 ++++++++++++++++++++-- 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc index a71f8a43c8..2c47e58054 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc @@ -6,6 +6,7 @@ #include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" +#include "application_manager/mock_hmi_capabilities.h" #include "application_manager/commands/mobile/unsubscribe_button_request.h" namespace test { @@ -30,7 +31,13 @@ const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK; } // namespace class UnsubscribeButtonRequestTest - : public CommandRequestTest {}; + : public CommandRequestTest { + public: + typedef TypeIf, + application_manager_test::MockHMICapabilities>::Result + MockHMICapabilities; +}; TEST_F(UnsubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) { CommandPtr command(CreateCommand()); @@ -55,13 +62,21 @@ TEST_F(UnsubscribeButtonRequestTest, CommandPtr command(CreateCommand(command_msg)); + UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities; + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(hmi_capabilities)); + EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true)); + + MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map)); + (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId; + EXPECT_CALL(hmi_capabilities, button_capabilities()) + .WillOnce(Return(button_caps_ptr.get())); + MockAppPtr mock_app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app)); - EXPECT_CALL(*mock_app, UnsubscribeFromButton(kButtonId)) .WillOnce(Return(false)); - EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _)); @@ -69,9 +84,35 @@ TEST_F(UnsubscribeButtonRequestTest, command->Run(); } -TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) { - const mobile_apis::ButtonName::eType kButtonId = mobile_apis::ButtonName::OK; +TEST_F(UnsubscribeButtonRequestTest, + Run_UnsubscribeNotAllowedByHmiCapabilities_UNSUCCESS) { + MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); + (*command_msg)[am::strings::params][am::strings::connection_key] = + kConnectionKey; + (*command_msg)[am::strings::msg_params][am::strings::button_name] = kButtonId; + CommandPtr command(CreateCommand(command_msg)); + MockAppPtr mock_app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillOnce(Return(mock_app)); + + UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities; + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(hmi_capabilities)); + EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true)); + + MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map)); + EXPECT_CALL(hmi_capabilities, button_capabilities()) + .WillOnce(Return(button_caps_ptr.get())); + + EXPECT_CALL(app_mngr_, + ManageMobileCommand( + MobileResultCodeIs(mobile_result::UNSUPPORTED_RESOURCE), _)); + + command->Run(); +} + +TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; @@ -79,6 +120,16 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) { CommandPtr command(CreateCommand(command_msg)); + UnsubscribeButtonRequestTest::MockHMICapabilities hmi_capabilities; + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(hmi_capabilities)); + EXPECT_CALL(hmi_capabilities, is_ui_cooperating()).WillOnce(Return(true)); + + MessageSharedPtr button_caps_ptr(CreateMessage(smart_objects::SmartType_Map)); + (*button_caps_ptr)[0][am::hmi_response::button_name] = kButtonId; + EXPECT_CALL(hmi_capabilities, button_capabilities()) + .WillOnce(Return(button_caps_ptr.get())); + MockAppPtr mock_app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app)); -- cgit v1.2.1 From d4aa621768d568d6dc563fbdf620155875bd6257 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Wed, 14 Jun 2017 13:13:38 +0300 Subject: Fix policy table loading with functional_group RPCs greater than 50 --- .../policy/policy_external/include/policy/policy_table/types.h | 2 +- .../policy/policy_regular/include/policy/policy_table/types.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index 774ef3ee59..15560552c0 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -69,7 +69,7 @@ typedef Array, 0, 4> HmiLevels; typedef Array, 0, 100> Parameters; -typedef Map Rpc; +typedef Map Rpc; typedef Array, 1, 3> URL; diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 66fddee592..7502cd27a1 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -67,7 +67,7 @@ typedef Array, 0, 4> HmiLevels; typedef Array, 0, 24> Parameters; -typedef Map Rpc; +typedef Map Rpc; typedef Array, 1, 255> URL; -- cgit v1.2.1 From f050b8f14ed2f3e048d7a4a0b2f1c424255649ac Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Thu, 15 Jun 2017 10:24:20 +0300 Subject: Fixed RPC response in case filename contains forbidden symbols According to requirements SDL must respond with INVALID_DATA to RPC request, which contains some filename param, which contains '/' symbol. The main idea here is to prevent access to files outside SDL working folder using such RPCs. In this commit: - Added IsFileNameValid function to check filename symbols - Added checking filename param for: DeleteFile, PutFile, SetAppIcon, SystemRequest --- .../src/commands/mobile/delete_file_request.cc | 7 +++++++ .../src/commands/mobile/put_file_request.cc | 11 +++++++++++ .../src/commands/mobile/set_app_icon_request.cc | 7 +++++++ .../src/commands/mobile/system_request.cc | 14 ++++++++++++++ src/components/utils/include/utils/file_system.h | 8 ++++++++ src/components/utils/src/file_system.cc | 4 ++++ 6 files changed, 51 insertions(+) diff --git a/src/components/application_manager/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/src/commands/mobile/delete_file_request.cc index 31ca29cb51..984c7a1725 100644 --- a/src/components/application_manager/src/commands/mobile/delete_file_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_file_request.cc @@ -73,6 +73,13 @@ void DeleteFileRequest::Run() { const std::string& sync_file_name = (*message_)[strings::msg_params][strings::sync_file_name].asString(); + if (!file_system::IsFileNameValid(sync_file_name)) { + const std::string err_msg = "Sync file name contains forbidden symbols."; + LOG4CXX_ERROR(logger_, err_msg); + SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); + return; + } + std::string full_file_path = application_manager_.get_settings().app_storage_folder() + "/"; full_file_path += application->folder_name(); diff --git a/src/components/application_manager/src/commands/mobile/put_file_request.cc b/src/components/application_manager/src/commands/mobile/put_file_request.cc index 68e7ad60d1..602b420ba0 100644 --- a/src/components/application_manager/src/commands/mobile/put_file_request.cc +++ b/src/components/application_manager/src/commands/mobile/put_file_request.cc @@ -110,6 +110,17 @@ void PutFileRequest::Run() { } sync_file_name_ = (*message_)[strings::msg_params][strings::sync_file_name].asString(); + + if (!file_system::IsFileNameValid(sync_file_name_)) { + const std::string err_msg = "Sync file name contains forbidden symbols."; + LOG4CXX_ERROR(logger_, err_msg); + SendResponse(false, + mobile_apis::Result::INVALID_DATA, + err_msg.c_str(), + &response_params); + return; + } + file_type_ = static_cast( (*message_)[strings::msg_params][strings::file_type].asInt()); const std::vector binary_data = diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc index 5d70a2fb5b..8a595ee564 100644 --- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc @@ -71,6 +71,13 @@ void SetAppIconRequest::Run() { const std::string& sync_file_name = (*message_)[strings::msg_params][strings::sync_file_name].asString(); + if (!file_system::IsFileNameValid(sync_file_name)) { + const std::string err_msg = "Sync file name contains forbidden symbols."; + LOG4CXX_ERROR(logger_, err_msg); + SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); + return; + } + std::string full_file_path = application_manager_.get_settings().app_storage_folder() + "/"; full_file_path += app->folder_name(); diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc index 74d25508e0..b9eb1a3a72 100644 --- a/src/components/application_manager/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/src/commands/mobile/system_request.cc @@ -466,6 +466,20 @@ void SystemRequest::Run() { file_name = kSYNC; } + if (!CheckSyntax(file_name)) { + LOG4CXX_ERROR(logger_, + "Incoming request contains \t\n \\t \\n or whitespace"); + SendResponse(false, mobile_apis::Result::INVALID_DATA); + return; + } + + if (!file_system::IsFileNameValid(file_name)) { + const std::string err_msg = "Sync file name contains forbidden symbols."; + LOG4CXX_ERROR(logger_, err_msg); + SendResponse(false, mobile_apis::Result::INVALID_DATA, err_msg.c_str()); + return; + } + bool is_system_file = std::string::npos != file_name.find(kSYNC) || std::string::npos != file_name.find(kIVSU); diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h index 5862241c9c..a46135a47b 100644 --- a/src/components/utils/include/utils/file_system.h +++ b/src/components/utils/include/utils/file_system.h @@ -152,6 +152,14 @@ std::string CurrentWorkingDirectory(); */ std::string GetAbsolutePath(const std::string& path); +/** + * @brief Checks if file name contains invalid symbols e.g. '/' + * @param file_name file name to check + * @return true if file name does not contain any invalid symbol otherwise + * returns false + */ +bool IsFileNameValid(const std::string& file_name); + /** * @brief Removes file * diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc index 91ff0c3b07..224fc36003 100644 --- a/src/components/utils/src/file_system.cc +++ b/src/components/utils/src/file_system.cc @@ -222,6 +222,10 @@ std::string file_system::GetAbsolutePath(const std::string& path) { return std::string(abs_path); } +bool file_system::IsFileNameValid(const std::string& file_name) { + return file_name.end() == std::find(file_name.begin(), file_name.end(), '/'); +} + bool file_system::DeleteFile(const std::string& name) { if (FileExists(name) && IsAccessible(name, W_OK)) { return !remove(name.c_str()); -- cgit v1.2.1 From 259302189fc77a42848144353c9acee9207a667d Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Mon, 19 Jun 2017 13:46:59 +0300 Subject: Fixed Policy endpoints validation For regular policies there was a wrong upper bound for endpoints which allows for each endpoint to have a list with more than 3 items. This issue was fixed for external policies. The second part of issue is that PM does not check endpoints for containing default group. This check was added for all policies flows. --- .../policy_external/include/policy/policy_table/types.h | 2 +- .../policy/policy_external/src/policy_table/validation.cc | 13 +++++++++++++ .../policy_regular/include/policy/policy_table/types.h | 2 +- .../policy/policy_regular/src/policy_table/validation.cc | 13 +++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index 774ef3ee59..e077bf0aea 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -71,7 +71,7 @@ typedef Array, 0, 100> Parameters; typedef Map Rpc; -typedef Array, 1, 3> URL; +typedef Array, 1, 3> URL; typedef Map URLList; diff --git a/src/components/policy/policy_external/src/policy_table/validation.cc b/src/components/policy/policy_external/src/policy_table/validation.cc index 45034c6fe8..b7e6dcc337 100644 --- a/src/components/policy/policy_external/src/policy_table/validation.cc +++ b/src/components/policy/policy_external/src/policy_table/validation.cc @@ -177,6 +177,19 @@ bool ModuleConfig::Validate() const { default: break; } + + for (ServiceEndpoints::const_iterator it_endpoints = endpoints.begin(); + it_endpoints != endpoints.end(); + ++it_endpoints) { + const URLList& endpoint_list = it_endpoints->second; + if (endpoint_list.end() == endpoint_list.find(kDefaultApp)) { + LOG4CXX_ERROR(logger_, + "Endpoint " << it_endpoints->first + << "does not contain default group"); + return false; + } + } + return true; } diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 66fddee592..b90e630c41 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -69,7 +69,7 @@ typedef Array, 0, 24> Parameters; typedef Map Rpc; -typedef Array, 1, 255> URL; +typedef Array, 1, 3> URL; typedef Map URLList; diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc index e7a981e559..2226b42c49 100644 --- a/src/components/policy/policy_regular/src/policy_table/validation.cc +++ b/src/components/policy/policy_regular/src/policy_table/validation.cc @@ -136,6 +136,19 @@ bool ModuleConfig::Validate() const { return false; } } + + for (ServiceEndpoints::const_iterator it_endpoints = endpoints.begin(); + it_endpoints != endpoints.end(); + ++it_endpoints) { + const URLList& endpoint_list = it_endpoints->second; + if (endpoint_list.end() == endpoint_list.find(kDefaultApp)) { + LOG4CXX_ERROR(logger_, + "Endpoint " << it_endpoints->first + << "does not contain default group"); + return false; + } + } + return true; } -- cgit v1.2.1 From bbb0146f5fecf0acc2e91b6546ce034c809923df Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Tue, 20 Jun 2017 13:03:51 +0300 Subject: Fix seconds_between_retries upper bound for regular policy Fixed seconds_between_retries upper bound parameter for regular policy. According to requirements maximum size for this param is 5. In this commit: - Fixed SecondsBetweenRetries template parameter for regular policy as it's done for external policy --- .../policy/policy_regular/include/policy/policy_table/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 66fddee592..b7b3c88a74 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -79,7 +79,7 @@ typedef uint8_t NumberOfNotificationsType; typedef Map, 0, 6> NumberOfNotificationsPerMinute; -typedef Array, 0, 10> SecondsBetweenRetries; +typedef Array, 0, 5> SecondsBetweenRetries; typedef Map Languages; -- cgit v1.2.1 From c1669c0d89363a1b973cc21d15c4e181ec3d62b1 Mon Sep 17 00:00:00 2001 From: okozlovlux Date: Thu, 23 Mar 2017 11:43:40 +0200 Subject: Fix incorrect behaviour of SDL during respose ACK whenr video and audio services starts - added condition in SendStartSessionAck to avoid sending max supported protocol version when video or audio services start. SDL must send negotiated protocol_version from message from mobile app Related to Issue-1365 --- src/components/protocol_handler/src/protocol_handler_impl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index aa2910722d..33df7a21c7 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -176,14 +176,17 @@ void set_hash_id(uint32_t hash_id, protocol_handler::ProtocolPacket& packet) { void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id, uint8_t session_id, - uint8_t, + uint8_t protocol_version, uint32_t hash_id, uint8_t service_type, bool protection) { LOG4CXX_AUTO_TRACE(logger_); - uint8_t protocolVersion = SupportedSDLProtocolVersion(); + if (kRpc != service_type) { + protocolVersion = protocol_version; + } + ProtocolFramePtr ptr( new protocol_handler::ProtocolPacket(connection_id, protocolVersion, -- cgit v1.2.1 From aa8f324664a9a8e06e598387511282b8a4846e4b Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Wed, 21 Jun 2017 10:40:47 +0300 Subject: Fix GetWayPoints request OnResetTimeout processing Fixed GetWayPoints request UI.OnResetTimeout processing. The root cause of this problem is that GetWayPoints was not subscribed on OnResetTimeout notifications from HMI and does not react on this notifications. This is a reason why this RPC does not reset own timeout. In this commit: - Added subscription to UI_OnResetTimeout event - Implemented logic for processing this event in on_event() --- .../src/commands/mobile/get_way_points_request.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc index 198964a333..c313d74d4b 100644 --- a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc @@ -8,7 +8,9 @@ namespace commands { GetWayPointsRequest::GetWayPointsRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) {} + : CommandRequestImpl(message, application_manager) { + subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); +} GetWayPointsRequest::~GetWayPointsRequest() {} @@ -38,6 +40,12 @@ void GetWayPointsRequest::on_event(const event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { + case hmi_apis::FunctionID::UI_OnResetTimeout: { + LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event"); + application_manager_.updateRequestTimeout( + connection_key(), correlation_id(), default_timeout()); + break; + } case hmi_apis::FunctionID::Navigation_GetWayPoints: { LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event"); const hmi_apis::Common_Result::eType result_code = -- cgit v1.2.1 From ae2ed9ce91e90de876290b5aba00bc404d8a2169 Mon Sep 17 00:00:00 2001 From: "Sergey Levchenko (GitHub)" Date: Wed, 29 Mar 2017 10:27:44 +0300 Subject: Add limitation of size for deviceList in BC.UpdateDeviceList RPC According to requirements, SDL should send info about 100 devices at maximum, even if SDL has more devices connected. --- .../application_manager/src/message_helper/message_helper.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 19bb658bca..efed06e313 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -637,9 +637,12 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO( smart_objects::SmartObject(smart_objects::SmartType_Array); smart_objects::SmartObject& list_so = (*device_list_so)[strings::device_list]; - int32_t index = 0; + uint32_t index = 0; + // According to requirements, SDL should send info about 100 devices at + // maximum, even if SDL has more devices connected. + const uint32_t max_device_count = 100; for (connection_handler::DeviceMap::const_iterator it = devices.begin(); - devices.end() != it; + devices.end() != it && index < max_device_count; ++it) { const connection_handler::Device& d = static_cast(it->second); -- cgit v1.2.1 From 038ac30079f202885895bebc1f229df918b6929f Mon Sep 17 00:00:00 2001 From: Veronica Veremjova Date: Tue, 28 Feb 2017 16:30:28 +0200 Subject: Fix SDL behavior in case of MASTER_RESET & FACTORY_DEFAULTS After SDL receives - BC.OnExitAllApplications(MASTER_RESET) : SDL should clear stored persistent data of all registered applications and revert local PT to preloaded state. - BC.OnExitAllApplications(FACTORY_DEFAULTS): SDL should clear stored persistent data of all registered applications and remove all user consents from local PT. --- .../application_manager/application_manager_impl.h | 5 +++ .../src/application_manager_impl.cc | 51 ++++++++++++++++++++-- .../hmi/on_exit_all_applications_notification.cc | 1 - .../include/config_profile/profile.h | 2 +- .../application_manager_settings.h | 1 + .../mock_application_manager_settings.h | 1 + .../policy_external/src/policy_manager_impl.cc | 5 +-- .../policy_regular/src/policy_manager_impl.cc | 4 +- 8 files changed, 57 insertions(+), 13 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 0e6f598a9c..c38141bf7f 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1145,6 +1145,11 @@ class ApplicationManagerImpl return is_stopping_; } + /** + * @brief Clears all applications' persistent data + */ + void ClearAppsPersistentData(); + StateController& state_controller() OVERRIDE; const ApplicationManagerSettings& get_settings() const OVERRIDE; virtual event_engine::EventDispatcher& event_dispatcher() OVERRIDE; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 26dd131856..56a9ff6bcf 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -2409,32 +2409,38 @@ void ApplicationManagerImpl::RemovePolicyObserver( void ApplicationManagerImpl::SetUnregisterAllApplicationsReason( mobile_api::AppInterfaceUnregisteredReason::eType reason) { + LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_TRACE(logger_, "reason = " << reason); unregister_reason_ = reason; } void ApplicationManagerImpl::HeadUnitReset( mobile_api::AppInterfaceUnregisteredReason::eType reason) { + LOG4CXX_AUTO_TRACE(logger_); stopping_application_mng_lock_.Acquire(); is_stopping_ = true; stopping_application_mng_lock_.Release(); switch (reason) { case mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET: { + LOG4CXX_TRACE(logger_, "Performing MASTER_RESET"); UnregisterAllApplications(); GetPolicyHandler().ResetPolicyTable(); GetPolicyHandler().UnloadPolicyLibrary(); resume_controller().StopSavePersistentDataTimer(); - file_system::remove_directory_content( - get_settings().app_storage_folder()); + + const std::string storage_folder = get_settings().app_storage_folder(); + file_system::RemoveDirectory(storage_folder, true); + ClearAppsPersistentData(); break; } case mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS: { + LOG4CXX_TRACE(logger_, "Performing FACTORY_DEFAULTS"); GetPolicyHandler().ClearUserConsent(); resume_controller().StopSavePersistentDataTimer(); - file_system::remove_directory_content( - get_settings().app_storage_folder()); + + ClearAppsPersistentData(); break; } default: { @@ -2444,6 +2450,43 @@ void ApplicationManagerImpl::HeadUnitReset( } } +void ApplicationManagerImpl::ClearAppsPersistentData() { + LOG4CXX_AUTO_TRACE(logger_); + typedef std::vector FilesList; + const std::string apps_info_storage_file = get_settings().app_info_storage(); + file_system::DeleteFile(apps_info_storage_file); + + const std::string storage_folder = get_settings().app_storage_folder(); + + FilesList files = file_system::ListFiles(storage_folder); + FilesList::iterator element_to_skip = + std::find(files.begin(), files.end(), "policy.sqlite"); + if (element_to_skip != files.end()) { + files.erase(element_to_skip); + } + + FilesList::iterator it = files.begin(); + for (; it != files.end(); ++it) { + const std::string path_to_item = storage_folder + "/"; + const std::string item_to_remove = path_to_item + (*it); + LOG4CXX_TRACE(logger_, "Removing : " << item_to_remove); + if (file_system::IsDirectory(item_to_remove)) { + LOG4CXX_TRACE(logger_, + "Removal result : " << file_system::RemoveDirectory( + item_to_remove, true)); + } else { + LOG4CXX_TRACE( + logger_, + "Removal result : " << file_system::DeleteFile(item_to_remove)); + } + } + + const std::string apps_icons_folder = get_settings().app_icons_folder(); + if (storage_folder != apps_icons_folder) { + file_system::RemoveDirectory(apps_icons_folder, true); + } +} + void ApplicationManagerImpl::SendOnSDLClose() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc index 682093cef9..07a95adcea 100644 --- a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc @@ -110,5 +110,4 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() { } } // namespace commands - } // namespace application_manager diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index 42b0d10ceb..1302643f31 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -323,7 +323,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, /* * @brief Returns file name for storing applications data */ - const std::string& app_info_storage() const; + const std::string& app_info_storage() const OVERRIDE; /* * @brief Path to preloaded policy file diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h index fa01b34783..5bd8e5d208 100644 --- a/src/components/include/application_manager/application_manager_settings.h +++ b/src/components/include/application_manager/application_manager_settings.h @@ -63,6 +63,7 @@ class ApplicationManagerSettings : public RequestControlerSettings, virtual bool launch_hmi() const = 0; virtual const uint32_t& delete_file_in_none() const = 0; virtual const std::vector& supported_diag_modes() const = 0; + virtual const std::string& app_info_storage() const = 0; virtual const uint32_t& list_files_in_none() const = 0; virtual const std::string& tts_delimiter() const = 0; virtual const uint32_t& put_file_in_none() const = 0; diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h index fd9e2aa8a3..44cb0db29c 100644 --- a/src/components/include/test/application_manager/mock_application_manager_settings.h +++ b/src/components/include/test/application_manager/mock_application_manager_settings.h @@ -57,6 +57,7 @@ class MockApplicationManagerSettings const std::pair&()); MOCK_CONST_METHOD0(hash_string_size, uint32_t()); MOCK_CONST_METHOD0(app_storage_folder, const std::string&()); + MOCK_CONST_METHOD0(app_info_storage, const std::string&()); MOCK_CONST_METHOD0(app_dir_quota, const uint32_t&()); MOCK_CONST_METHOD0(stop_streaming_timeout, uint32_t()); MOCK_CONST_METHOD0(application_list_update_timeout, uint32_t()); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 0a774f6b79..2cc3f833b1 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -713,10 +713,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, } bool PolicyManagerImpl::ResetUserConsent() { - bool result = true; - result = cache_->ResetUserConsent(); - - return result; + return cache_->ResetUserConsent(); } policy_table::Strings PolicyManagerImpl::GetGroupsNames( diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index bb7c68d22d..e1dd7cc5e0 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -392,9 +392,7 @@ void PolicyManagerImpl::CheckPermissions(const PTString& device_id, } bool PolicyManagerImpl::ResetUserConsent() { - bool result = true; - - return result; + return cache_->ResetUserConsent(); } void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( -- cgit v1.2.1 From 279eb04aba4ff3547212c75b8a8675118e430111 Mon Sep 17 00:00:00 2001 From: atimchenko Date: Tue, 21 Mar 2017 16:44:08 +0200 Subject: Fix SDL not send Stop A/V Stream by unregistering SDL does not send StopStream/StopAudioStream to HMI after unregistering app during streaming Related to Issue-1010 --- .../src/commands/mobile/unregister_app_interface_request.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc index d7056a624e..d40ad9c870 100644 --- a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc @@ -53,6 +53,7 @@ void UnregisterAppInterfaceRequest::Run() { connection_key(), mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM), commands::Command::ORIGIN_SDL); + application_manager_.EndNaviServices(connection_key()); application_manager_.UnregisterApplication(connection_key(), mobile_apis::Result::SUCCESS); SendResponse(true, mobile_apis::Result::SUCCESS); -- cgit v1.2.1 From 5850a6840bab9630ede9a2fe9260a128e79c4093 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Wed, 21 Jun 2017 14:44:07 +0300 Subject: Fix SSL certificate output information in log The problem was that SDL prints out to log full information about SSL certificates including CN and serial number. According to requirements It is correct for FS project, but incorrect for GENIVI. In this commit: - Added RemoveDisallowedInfo() function to filter disallowed params from input data - Added string filtering for subject and issuer data - C-style casts were replaced with C++ casts for ASN1_TIME - Small code refactoring in PrintCertData() function --- .../include/security_manager/crypto_manager_impl.h | 9 +++ .../security_manager/src/ssl_context_impl.cc | 89 ++++++++++++++++------ 2 files changed, 73 insertions(+), 25 deletions(-) diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h index 6aea2e28b1..4daf58b004 100644 --- a/src/components/security_manager/include/security_manager/crypto_manager_impl.h +++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h @@ -80,6 +80,15 @@ class CryptoManagerImpl : public CryptoManager { private: void PrintCertInfo(); + + /** + * @brief Removes disallowed for printing certificate information from input + * data + * @param in_data input data with certificate information + * @return filtered string with allowed for printing information + */ + const std::string RemoveDisallowedInfo(X509_NAME* in_data) const; + HandshakeResult CheckCertContext(); bool ReadHandshakeData(const uint8_t** const out_data, size_t* out_data_size); diff --git a/src/components/security_manager/src/ssl_context_impl.cc b/src/components/security_manager/src/ssl_context_impl.cc index 6f53234867..860305c118 100644 --- a/src/components/security_manager/src/ssl_context_impl.cc +++ b/src/components/security_manager/src/ssl_context_impl.cc @@ -32,12 +32,14 @@ #include "security_manager/crypto_manager_impl.h" #include -#include -#include -#include #include #include #include +#include + +#include +#include +#include #include "utils/macro.h" @@ -136,32 +138,69 @@ std::map CryptoManagerImpl::SSLContextImpl::max_block_sizes = CryptoManagerImpl::SSLContextImpl::create_max_block_sizes(); +const std::string CryptoManagerImpl::SSLContextImpl::RemoveDisallowedInfo( + X509_NAME* in_data) const { + if (!in_data) { + return std::string(); + } + + char* tmp_char_str = X509_NAME_oneline(in_data, NULL, 0); + std::string out_str(tmp_char_str); + OPENSSL_free(tmp_char_str); + + typedef std::vector StringVector; + StringVector disallowed_params; + disallowed_params.push_back("CN"); + disallowed_params.push_back("serialNumber"); + + const char str_delimiter = '/', param_delimiter = '='; + for (StringVector::const_iterator it = disallowed_params.begin(); + it != disallowed_params.end(); + ++it) { + const std::string search_str = str_delimiter + (*it) + param_delimiter; + const size_t occurence_start = out_str.find(search_str); + if (std::string::npos == occurence_start) { + continue; + } + + const size_t occurence_end = + out_str.find(str_delimiter, occurence_start + 1); + out_str.erase(occurence_start, occurence_end - occurence_start); + } + + return out_str; +} + void CryptoManagerImpl::SSLContextImpl::PrintCertData( X509* cert, const std::string& cert_owner) { - if (cert) { - X509_NAME* subj_name = X509_get_subject_name(cert); - char* subj = X509_NAME_oneline(subj_name, NULL, 0); - if (subj) { - std::replace(subj, subj + strlen(subj), '/', ' '); - LOG4CXX_DEBUG(logger_, cert_owner << " subject:" << subj); - OPENSSL_free(subj); - } - char* issuer = X509_NAME_oneline(X509_get_issuer_name(cert), NULL, 0); - if (issuer) { - std::replace(issuer, issuer + strlen(issuer), '/', ' '); - LOG4CXX_DEBUG(logger_, cert_owner << " issuer:" << issuer); - OPENSSL_free(issuer); - } + if (!cert) { + LOG4CXX_DEBUG(logger_, "Empty certificate data"); + return; + } - ASN1_TIME* notBefore = X509_get_notBefore(cert); - ASN1_TIME* notAfter = X509_get_notAfter(cert); + std::string subj = RemoveDisallowedInfo(X509_get_subject_name(cert)); + if (!subj.empty()) { + std::replace(subj.begin(), subj.end(), '/', ' '); + LOG4CXX_DEBUG(logger_, cert_owner << " subject:" << subj); + } - if (notBefore) { - LOG4CXX_DEBUG(logger_, " Start date: " << (char*)notBefore->data); - } - if (notAfter) { - LOG4CXX_DEBUG(logger_, " End date: " << (char*)notAfter->data); - } + std::string issuer = RemoveDisallowedInfo(X509_get_issuer_name(cert)); + if (!issuer.empty()) { + std::replace(issuer.begin(), issuer.end(), '/', ' '); + LOG4CXX_DEBUG(logger_, cert_owner << " issuer:" << issuer); + } + + ASN1_TIME* not_before = X509_get_notBefore(cert); + if (not_before) { + LOG4CXX_DEBUG( + logger_, + "Start date: " << static_cast(not_before->data)); + } + + ASN1_TIME* not_after = X509_get_notAfter(cert); + if (not_after) { + LOG4CXX_DEBUG(logger_, + "End date: " << static_cast(not_after->data)); } } -- cgit v1.2.1 From 661e26609e4c6ba2bb6b6241e9d8fcbba4e52c27 Mon Sep 17 00:00:00 2001 From: "Sergey Levchenko (GitHub)" Date: Tue, 21 Mar 2017 12:07:26 +0200 Subject: Update generate_test_certificates.py script Previously SDL was implemented in the way to support certificate in PKCS12 Now it has been changed to simple PEM format according to the new requirements. - generate_test_certificates.py updated - unit tests updated --- .../security_manager/src/crypto_manager_impl.cc | 32 ++++++---------------- .../test/crypto_manager_impl_test.cc | 26 ++++++++---------- .../test/ssl_certificate_handshake_test.cc | 8 +++--- .../security_manager/test/ssl_context_test.cc | 4 +-- tools/Utils/generate_test_certificates.py | 31 +++++++++++++-------- 5 files changed, 44 insertions(+), 57 deletions(-) diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc index f44198953b..a8a77cc5a1 100644 --- a/src/components/security_manager/src/crypto_manager_impl.cc +++ b/src/components/security_manager/src/crypto_manager_impl.cc @@ -300,36 +300,20 @@ bool CryptoManagerImpl::set_certificate(const std::string& cert_data) { return false; } - BIO* bio = BIO_new(BIO_f_base64()); - BIO* bmem = BIO_new_mem_buf((char*)cert_data.c_str(), cert_data.length()); - bmem = BIO_push(bio, bmem); - - char* buf = new char[cert_data.length()]; - int len = BIO_read(bmem, buf, cert_data.length()); - - BIO* bio_cert = BIO_new(BIO_s_mem()); - if (NULL == bio_cert) { - LOG4CXX_WARN(logger_, "Unable to update certificate. BIO not created"); - return false; - } + BIO* bio_cert = BIO_new_mem_buf(const_cast(cert_data.c_str()), cert_data.length()); utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert); UNUSED(bio_guard) - int k = 0; - if ((k = BIO_write(bio_cert, buf, len)) <= 0) { - LOG4CXX_WARN(logger_, "Unable to write into BIO"); - return false; - } - PKCS12* p12 = d2i_PKCS12_bio(bio_cert, NULL); - if (NULL == p12) { - LOG4CXX_ERROR(logger_, "Unable to parse certificate"); - return false; - } + X509* cert = NULL; + PEM_read_bio_X509(bio_cert, &cert,0, 0); EVP_PKEY* pkey = NULL; - X509* cert = NULL; - PKCS12_parse(p12, NULL, &pkey, &cert, NULL); + if (1 == BIO_reset(bio_cert)) { + PEM_read_bio_PrivateKey(bio_cert, &pkey, 0,0); + } else { + LOG4CXX_WARN(logger_, "Unabled to reset BIO in order to read private key, " << LastError()); + } if (NULL == cert || NULL == pkey) { LOG4CXX_WARN(logger_, "Either certificate or key not valid."); diff --git a/src/components/security_manager/test/crypto_manager_impl_test.cc b/src/components/security_manager/test/crypto_manager_impl_test.cc index 7fef33f1df..b30684e5f6 100644 --- a/src/components/security_manager/test/crypto_manager_impl_test.cc +++ b/src/components/security_manager/test/crypto_manager_impl_test.cc @@ -39,6 +39,7 @@ #include #include +#include "utils/make_shared.h" #include "gtest/gtest.h" #include "security_manager/crypto_manager_impl.h" #include "security_manager/mock_security_manager_settings.h" @@ -64,10 +65,14 @@ namespace test { namespace components { namespace crypto_manager_test { +using security_manager::CryptoManagerImpl; + class CryptoManagerTest : public testing::Test { protected: + typedef NiceMock + MockCryptoManagerSettings; static void SetUpTestCase() { - std::ifstream certificate_file("server/spt_credential.p12.enc"); + std::ifstream certificate_file("server/spt_credential.pem"); ASSERT_TRUE(certificate_file.is_open()) << "Could not open certificate data file"; @@ -81,16 +86,9 @@ class CryptoManagerTest : public testing::Test { void SetUp() OVERRIDE { ASSERT_FALSE(certificate_data_base64_.empty()); mock_security_manager_settings_ = - new NiceMock(); - utils::SharedPtr scrypto = - utils::SharedPtr:: - static_pointer_cast( - mock_security_manager_settings_); - crypto_manager_ = new security_manager::CryptoManagerImpl(scrypto); - } - - void TearDown() OVERRIDE { - delete mock_security_manager_settings_; + utils::MakeShared(); + crypto_manager_ = + utils::MakeShared(mock_security_manager_settings_); } void InitSecurityManager() { @@ -117,11 +115,9 @@ class CryptoManagerTest : public testing::Test { .WillByDefault(Return(false)); } - security_manager::CryptoManager* crypto_manager_; + utils::SharedPtr crypto_manager_; + utils::SharedPtr mock_security_manager_settings_; static std::string certificate_data_base64_; - - NiceMock* - mock_security_manager_settings_; }; std::string CryptoManagerTest::certificate_data_base64_; diff --git a/src/components/security_manager/test/ssl_certificate_handshake_test.cc b/src/components/security_manager/test/ssl_certificate_handshake_test.cc index 3d62dd5d6a..9375d6cc32 100644 --- a/src/components/security_manager/test/ssl_certificate_handshake_test.cc +++ b/src/components/security_manager/test/ssl_certificate_handshake_test.cc @@ -56,12 +56,12 @@ namespace custom_str = utils::custom_string; namespace { const std::string server_ca_cert_filename = "server"; const std::string client_ca_cert_filename = "client"; -const std::string client_certificate = "client/client_credential.p12.enc"; -const std::string server_certificate = "server/spt_credential.p12.enc"; +const std::string client_certificate = "client/client_credential.pem"; +const std::string server_certificate = "server/spt_credential.pem"; const std::string server_unsigned_cert_file = - "server/spt_credential_unsigned.p12.enc"; + "server/spt_credential_unsigned.pem"; const std::string server_expired_cert_file = - "server/spt_credential_expired.p12.enc"; + "server/spt_credential_expired.pem"; const bool verify_peer = true; const bool skip_peer_verification = false; diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc index 9223a74505..945059e58c 100644 --- a/src/components/security_manager/test/ssl_context_test.cc +++ b/src/components/security_manager/test/ssl_context_test.cc @@ -88,9 +88,9 @@ struct ProtocolAndCipher { class SSLTest : public testing::Test { protected: static void SetUpTestCase() { - SetCertificate("server/spt_credential_unsigned.p12.enc", + SetCertificate("server/spt_credential_unsigned.pem", server_certificate_data_base64_); - SetCertificate("client/client_credential_unsigned.p12.enc", + SetCertificate("client/client_credential_unsigned.pem", client_certificate_data_base64_); } diff --git a/tools/Utils/generate_test_certificates.py b/tools/Utils/generate_test_certificates.py index 73b6f53cc8..2c1d2cddbf 100755 --- a/tools/Utils/generate_test_certificates.py +++ b/tools/Utils/generate_test_certificates.py @@ -118,12 +118,13 @@ def gen_pkcs12(out, key_file, cert_file, verification_certificate) : "-name 'SPT key and certificates'", "-CAfile ", verification_certificate, \ " -passout pass:") - """ - Encode certificate $out to base 64 - """ - with open(out, "rb") as cert: - with open(out + ".enc", "wb") as enc_cert: - enc_cert.write(cert.read().encode("base64")) +def gen_pem_file(out, key_file, cert_file, verification_certificate) : + """Join $key_file, $cert_file, $verification_certificate in pem file named $out""" + files = [key_file, cert_file, verification_certificate] + with open(out, "wb") as cert: + for fl in files: + with open(fl) as infile: + cert.write(infile.read()) def answers(name, app_id, country, state, locality, organization, unit, email) : """Answer string generator @@ -228,47 +229,53 @@ def main(): server_key_file = os.path.join(server_dir, "server.key") server_cert_file = os.path.join(server_dir, "server.crt") server_pkcs12_file = os.path.join(server_dir, "spt_credential.p12") + server_pem_file = os.path.join(server_dir, "spt_credential.pem") gen_rsa_key(server_key_file, 2048) gen_cert(server_cert_file, server_key_file, ford_server_cert_file, ford_server_key_file, days, server_answer) gen_pkcs12(server_pkcs12_file, server_key_file, server_cert_file, client_verification_ca_cert_file) + gen_pem_file(server_pem_file, server_key_file, server_cert_file, client_verification_ca_cert_file) print print " --== Server unsigned certificate generating ==-- " server_unsigned_cert_file = os.path.join(server_dir, "server_unsigned.crt") server_pkcs12_unsigned_file = os.path.join(server_dir, "spt_credential_unsigned.p12") + server_pem_unsigned_file = os.path.join(server_dir, "spt_credential_unsigned.pem") gen_root_cert(server_unsigned_cert_file, server_key_file, days, server_unsigned_answer) gen_pkcs12(server_pkcs12_unsigned_file, server_key_file, server_unsigned_cert_file, client_verification_ca_cert_file) + gen_pem_file(server_pem_unsigned_file, server_key_file, server_unsigned_cert_file, client_verification_ca_cert_file) print print " --== Server expired certificate generating ==-- " server_expired_cert_file = os.path.join(server_dir, "server_expired.crt") server_pkcs12_expired_file = os.path.join(server_dir, "spt_credential_expired.p12") + server_pem_expired_file = os.path.join(server_dir, "spt_credential_expired.pem") gen_expire_cert(server_expired_cert_file, server_key_file, ford_server_cert_file, ford_server_key_file, days, server_expired_answer) gen_pkcs12(server_pkcs12_expired_file, server_key_file, server_expired_cert_file, client_verification_ca_cert_file) + gen_pem_file(server_pem_expired_file, server_key_file, server_expired_cert_file, client_verification_ca_cert_file) print print " --== Client pkcs12 certificate generating ==-- " client_key_file = os.path.join(client_dir, "client.key") client_cert_file = os.path.join(client_dir, "client.crt") - client_pkcs12_file = os.path.join(client_dir, "client_credential.p12") + client_pkcs12_file = os.path.join(client_dir, "client_credential.pem") gen_rsa_key(client_key_file, 2048) gen_cert(client_cert_file, client_key_file, ford_client_cert_file, ford_client_key_file, days, client_answer) - gen_pkcs12(client_pkcs12_file, client_key_file, client_cert_file, server_verification_ca_cert_file) + gen_pem_file(client_pkcs12_file, client_key_file, client_cert_file, server_verification_ca_cert_file) print print " --== Client pkcs12 unsigned certificate generating ==-- " client_unsigned_cert_file = os.path.join(client_dir, "client_unsigned.crt") - client_pkcs12_unsigned_file = os.path.join(client_dir, "client_credential_unsigned.p12") + client_pkcs12_unsigned_file = os.path.join(client_dir, "client_credential_unsigned.pem") gen_root_cert(client_unsigned_cert_file, client_key_file, days, client_unsigned_answer) - gen_pkcs12(client_pkcs12_unsigned_file, client_key_file, client_unsigned_cert_file, server_verification_ca_cert_file) + gen_pem_file(client_pkcs12_unsigned_file, client_key_file, client_unsigned_cert_file, server_verification_ca_cert_file) print print " --== Client pkcs12 expired certificate generating ==-- " client_expired_cert_file = os.path.join(client_dir, "client_expired.crt") - client_pkcs12_expired_file = os.path.join(client_dir, "client_credential_expired.p12") + client_pkcs12_expired_file = os.path.join(client_dir, "client_credential_expired.pem") gen_expire_cert(client_expired_cert_file, client_key_file, ford_client_cert_file, ford_client_key_file, days, client_expired_answer) - gen_pkcs12(client_pkcs12_expired_file, client_key_file, client_expired_cert_file, server_verification_ca_cert_file) + gen_pem_file(client_pkcs12_expired_file, client_key_file, client_expired_cert_file, server_verification_ca_cert_file) subprocess.call(["c_rehash", server_dir]) subprocess.call(["c_rehash", client_dir]) -- cgit v1.2.1 From bff6e483eb80a0563159d825dd7ba636815c402d Mon Sep 17 00:00:00 2001 From: Alex Kutsan Date: Fri, 23 Jun 2017 12:10:45 +0300 Subject: fixup! Fix incorrect behaviour of SDL during respose ACK whenr video and audio services starts --- .../include/protocol_handler/protocol_handler_impl.h | 2 +- src/components/protocol_handler/src/protocol_handler_impl.cc | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index b18ee07d4d..ce37148451 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -245,7 +245,7 @@ class ProtocolHandlerImpl */ void SendStartSessionAck(ConnectionID connection_id, uint8_t session_id, - uint8_t protocol_version, + uint8_t input_protocol_version, uint32_t hash_code, uint8_t service_type, bool protection); diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 33df7a21c7..039399b46d 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -176,20 +176,23 @@ void set_hash_id(uint32_t hash_id, protocol_handler::ProtocolPacket& packet) { void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id, uint8_t session_id, - uint8_t protocol_version, + uint8_t input_protocol_version, uint32_t hash_id, uint8_t service_type, bool protection) { LOG4CXX_AUTO_TRACE(logger_); - uint8_t protocolVersion = SupportedSDLProtocolVersion(); + uint8_t ack_protocol_version = SupportedSDLProtocolVersion(); if (kRpc != service_type) { - protocolVersion = protocol_version; + // In case if input protocol version os bigger then supported, SDL should respond with maximum supported protocol version + ack_protocol_version = input_protocol_version < ack_protocol_version + ? input_protocol_version + : ack_protocol_version; } ProtocolFramePtr ptr( new protocol_handler::ProtocolPacket(connection_id, - protocolVersion, + ack_protocol_version, protection, FRAME_TYPE_CONTROL, service_type, -- cgit v1.2.1 From b453e3b7f800a2ebcbd40a458ad4a8b7334a147e Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 12 Jul 2017 11:10:06 -0400 Subject: Add system capabilities to hmi_capabilities.json --- src/appMain/hmi_capabilities.json | 884 ++++++++++----------- src/appMain/sdl_preloaded_pt.json | 5 + .../mobile/get_system_capability_request.h | 63 ++ .../mobile/get_system_capability_response.h | 62 ++ .../application_manager/hmi_capabilities_impl.h | 10 + .../application_manager/smart_object_keys.h | 2 + .../mobile/get_system_capability_request.cc | 42 + .../mobile/get_system_capability_response.cc | 22 + .../src/hmi_capabilities_impl.cc | 44 +- .../src/mobile_command_factory.cc | 13 + .../application_manager/src/smart_object_keys.cc | 2 + .../include/application_manager/hmi_capabilities.h | 8 + src/components/interfaces/MOBILE_API.xml | 71 ++ 13 files changed, 766 insertions(+), 462 deletions(-) create mode 100644 src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h create mode 100644 src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h create mode 100644 src/components/application_manager/src/commands/mobile/get_system_capability_request.cc create mode 100644 src/components/application_manager/src/commands/mobile/get_system_capability_response.cc diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index 2369543e32..a849dc86d7 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -1,466 +1,428 @@ { - "UI": - { - "language":"EN-US", - "languages":[ - "EN-US","ES-MX","FR-CA","DE-DE","ES-ES","EN-GB","RU-RU","TR-TR","PL-PL","FR-FR","IT-IT","SV-SE","PT-PT","NL-NL","ZH-TW", -"JA-JP","AR-SA","KO-KR","PT-BR","CS-CZ","DA-DK","NO-NO" - ], - "displayCapabilities": - { - "displayType":"GEN2_8_DMA", - "textFields": [{ - "name": "mainField1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField3", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField4", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "statusBar", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mediaClock", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mediaTrack", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText3", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "scrollableMessageBody", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "initialInteractionText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "ETA", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "totalDistance", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "audioPassThruDisplayText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "audioPassThruDisplayText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "sliderHeader", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "sliderFooter", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "notificationText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "menuName", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "secondaryText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "tertiaryText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "timeToDestination", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "turnText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "menuTitle", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - } - ], - "imageFields": - [ - { - "name":"softButtonImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"choiceImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"choiceSecondaryImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"menuIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"cmdIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"appIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"graphic", - "imageTypeSupported": - [ - - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"locationImage", - "imageTypeSupported": - [ - "GRAPHIC_PNG" - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - } - - ], - "mediaClockFormats": - [ - "CLOCK1","CLOCK2","CLOCK3","CLOCKTEXT1","CLOCKTEXT2","CLOCKTEXT3","CLOCKTEXT4" - ], - "graphicSupported":true, - "templatesAvailable": - [ - - "DEFAULT","MEDIA","NON-MEDIA","ONSCREEN_PRESETS","NAV_FULLSCREEN_MAP","NAV_KEYBOARD", - "GRAPHIC_WITH_TEXT","TEXT_WITH_GRAPHIC","TILES_ONLY","TEXTBUTTONS_ONLY", - "GRAPHIC_WITH_TILES","TILES_WITH_GRAPHIC","GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", - "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC","GRAPHIC_WITH_TEXTBUTTONS", - "TEXTBUTTONS_WITH_GRAPHIC","LARGE_GRAPHIC_WITH_SOFTBUTTONS", - "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS","LARGE_GRAPHIC_ONLY" - ], - "screenParams": - { - "resolution": - { - "resolutionWidth":800, - "resolutionHeight":350 - }, - "touchEventAvailable": - { - "pressAvailable":true, - "multiTouchAvailable":false, - "doublePressAvailable":false - } - }, - "numCustomPresetsAvailable":8, - "imageCapabilities": - [ - "DYNAMIC", - "STATIC" - ] - }, - "audioPassThruCapabilities": - { - "samplingRate" : "44KHZ", - "bitsPerSample" : "RATE_8_BIT", - "audioType" : "PCM" - }, - "pcmStreamCapabilities": - { - "samplingRate" : "16KHZ", - "bitsPerSample" : "RATE_16_BIT", - "audioType" : "PCM" - }, - "hmiZoneCapabilities":"FRONT", - "softButtonCapabilities": - [ - { - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true, - "imageSupported" :true - } + "UI": { + "language": "EN-US", + "languages": [ + "EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB", "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", "ZH-TW", + "JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO" + ], + "displayCapabilities": { + "displayType": "GEN2_8_DMA", + "textFields": [{ + "name": "mainField1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField3", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField4", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "statusBar", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mediaClock", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mediaTrack", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText3", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "scrollableMessageBody", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "initialInteractionText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "ETA", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "totalDistance", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "audioPassThruDisplayText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "audioPassThruDisplayText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "sliderHeader", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "sliderFooter", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "notificationText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "menuName", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "secondaryText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "tertiaryText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "timeToDestination", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "turnText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "menuTitle", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + } + ], + "imageFields": [{ + "name": "softButtonImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "choiceImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "choiceSecondaryImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "menuIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "cmdIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "appIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "graphic", + "imageTypeSupported": [ + + ], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "locationImage", + "imageTypeSupported": [ + "GRAPHIC_PNG" + ], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + } + + ], + "mediaClockFormats": [ + "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4" + ], + "graphicSupported": true, + "templatesAvailable": [ + + "DEFAULT", "MEDIA", "NON-MEDIA", "ONSCREEN_PRESETS", "NAV_FULLSCREEN_MAP", "NAV_KEYBOARD", + "GRAPHIC_WITH_TEXT", "TEXT_WITH_GRAPHIC", "TILES_ONLY", "TEXTBUTTONS_ONLY", + "GRAPHIC_WITH_TILES", "TILES_WITH_GRAPHIC", "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", + "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC", "GRAPHIC_WITH_TEXTBUTTONS", + "TEXTBUTTONS_WITH_GRAPHIC", "LARGE_GRAPHIC_WITH_SOFTBUTTONS", + "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS", "LARGE_GRAPHIC_ONLY" + ], + "screenParams": { + "resolution": { + "resolutionWidth": 800, + "resolutionHeight": 350 + }, + "touchEventAvailable": { + "pressAvailable": true, + "multiTouchAvailable": false, + "doublePressAvailable": false + } + }, + "numCustomPresetsAvailable": 8, + "imageCapabilities": [ + "DYNAMIC", + "STATIC" + ] + }, + "audioPassThruCapabilities": { + "samplingRate": "44KHZ", + "bitsPerSample": "RATE_8_BIT", + "audioType": "PCM" + }, + "pcmStreamCapabilities": { + "samplingRate": "16KHZ", + "bitsPerSample": "RATE_16_BIT", + "audioType": "PCM" + }, + "hmiZoneCapabilities": "FRONT", + "softButtonCapabilities": [{ + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true, + "imageSupported": true + }] + }, + "VR": { + "capabilities": ["TEXT"], + "language": "EN-US", + "languages": [ + "EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB", "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", "ZH-TW", + "JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO" + ] + }, + "TTS": { + "capabilities": ["TEXT"], + "language": "EN-US", + "languages": [ + "EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB", "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", "ZH-TW", + "JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO" ] }, - "VR": - { - "capabilities":["TEXT"], - "language":"EN-US", - "languages": - [ - "EN-US","ES-MX","FR-CA","DE-DE","ES-ES","EN-GB","RU-RU","TR-TR","PL-PL","FR-FR","IT-IT","SV-SE","PT-PT","NL-NL","ZH-TW", -"JA-JP","AR-SA","KO-KR","PT-BR","CS-CZ","DA-DK","NO-NO" - ] -}, - "TTS": - { - "capabilities":["TEXT"], - "language":"EN-US", - "languages": - [ - "EN-US","ES-MX","FR-CA","DE-DE","ES-ES","EN-GB","RU-RU","TR-TR","PL-PL","FR-FR","IT-IT","SV-SE","PT-PT","NL-NL","ZH-TW", -"JA-JP","AR-SA","KO-KR","PT-BR","CS-CZ","DA-DK","NO-NO" - ] + "Buttons": { + "capabilities": [{ + "name": "PRESET_0", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_1", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_2", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_3", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_4", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_5", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_6", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_7", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_8", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_9", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "OK", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "SEEKLEFT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "SEEKRIGHT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "TUNEUP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "TUNEDOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + } + ], + "presetBankCapabilities": { + "onScreenPresetsAvailable": true + } + }, + "VehicleInfo": { + "make": "Ford", + "model": "Fiesta", + "modelYear": "2013", + "trim": "SE" }, - "Buttons": - { - "capabilities": - [ - { - "name":"PRESET_0", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_1", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_2", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_3", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_4", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_5", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_6", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_7", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_8", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"PRESET_9", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"OK", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"SEEKLEFT", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"SEEKRIGHT", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"TUNEUP", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - }, - { - "name":"TUNEDOWN", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true - } - ], - "presetBankCapabilities": - { - "onScreenPresetsAvailable":true - } + "SyncMessageVersion": { + "majorVersion": 3, + "minorVersion": 0 }, - "VehicleInfo": - { - "make" :"Ford", - "model" :"Fiesta", - "modelYear" :"2013", - "trim" :"SE" - }, - "SyncMessageVersion": - { - "majorVersion": 3, - "minorVersion": 0 - } -} + "SystemCapabilities": { + "NavigationCapability": { + "sendLocationEnabled": true, + "getWayPointsEnabled": true + }, + "PhoneCapability": { + "dialNumberEnabled": true + } + } +} \ No newline at end of file diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index 10f1303ec7..e2c3ab805c 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -99,6 +99,11 @@ "FULL", "LIMITED"] }, + "GetSystemCapability": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, "ListFiles": { "hmi_levels": ["BACKGROUND", "FULL", diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h new file mode 100644 index 0000000000..e74af559b6 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h @@ -0,0 +1,63 @@ +/* + + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_ + +#include "application_manager/commands/command_request_impl.h" + +namespace application_manager { + +namespace commands { + +class GetSystemCapabilityRequest : public CommandRequestImpl { +public: + GetSystemCapabilityRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + virtual ~GetSystemCapabilityRequest(); + + virtual void Run() OVERRIDE; + + virtual void on_event(const event_engine::Event& event); + +private: + DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest); + + + +};//GetSystemCapabilityRequest +}//commands +}//application_manager + +#endif //SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_ \ No newline at end of file diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h new file mode 100644 index 0000000000..14fe5be8b9 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h @@ -0,0 +1,62 @@ +/* + + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_ + +#include "application_manager/commands/command_response_impl.h" +#include "utils/macro.h" + +namespace application_manager { + +namespace commands { + +class GetSystemCapabilityResponse : public CommandResponseImpl { +public: + GetSystemCapabilityResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + virtual ~GetSystemCapabilityResponse(); + + virtual void Run() OVERRIDE; + +private: + DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityResponse); + + + +};//GetSystemCapabilityResponse +}//commands +}//application_manager + +#endif //SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_ \ No newline at end of file diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h index 7a85c49027..080503e314 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h @@ -407,6 +407,14 @@ class HMICapabilitiesImpl : public HMICapabilities { */ bool phone_call_supported() const OVERRIDE; + void set_navigation_capability(const smart_objects::SmartObject& navigation_capability) OVERRIDE; + + const smart_objects::SmartObject* navigation_capability() const OVERRIDE; + + void set_phone_capability(const smart_objects::SmartObject& phone_capability) OVERRIDE; + + const smart_objects::SmartObject* phone_capability() const OVERRIDE; + void Init(resumption::LastState* last_state) OVERRIDE; /* @@ -484,6 +492,8 @@ class HMICapabilitiesImpl : public HMICapabilities { bool is_navigation_supported_; bool is_phone_call_supported_; std::string ccpu_version_; + smart_objects::SmartObject* navigation_capability_; + smart_objects::SmartObject* phone_capability_; ApplicationManager& app_mngr_; HMILanguageHandler hmi_language_handler_; diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 38c1b1d9cc..9f9cee99cf 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -167,6 +167,8 @@ extern const char* audio_pass_thru_capabilities; extern const char* pcm_stream_capabilities; extern const char* audio_pass_thru_icon; extern const char* way_points; +extern const char* system_capability; +extern const char* system_capability_type; // PutFile extern const char* sync_file_name; diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc new file mode 100644 index 0000000000..9867e8b741 --- /dev/null +++ b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc @@ -0,0 +1,42 @@ +#include "application_manager/commands/mobile/get_system_capability_request.h" + +namespace application_manager { + +namespace commands { + +GetSystemCapabilityRequest::GetSystemCapabilityRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} + +GetSystemCapabilityRequest::~GetSystemCapabilityRequest() {} + +void GetSystemCapabilityRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not registered"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + if ((*message_)[strings::msg_params].empty()) { + LOG4CXX_ERROR(logger_, strings::msg_params << " is empty."); + SendResponse(false, mobile_apis::Result::INVALID_DATA); + return; + } + smart_objects::SmartObject response_params(smart_objects::SmartType_Map); + + response_params[strings::system_capability][strings::system_capability_type] = mobile_apis::SystemCapabilityType::PHONE_CALL; + LOG4CXX_INFO(logger_ ,"Sanity " << response_params[strings::system_capability_type].asInt()); + SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params); +} + +void GetSystemCapabilityRequest::on_event(const event_engine::Event& event){ + LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest onEVENTs"); +} + +} // namespace commands + +} // namespace application_manager \ No newline at end of file diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc new file mode 100644 index 0000000000..91c2562cd3 --- /dev/null +++ b/src/components/application_manager/src/commands/mobile/get_system_capability_response.cc @@ -0,0 +1,22 @@ +#include "application_manager/application_manager.h" +#include "application_manager/commands/mobile/get_system_capability_response.h" + +namespace application_manager { + +namespace commands { + +GetSystemCapabilityResponse::GetSystemCapabilityResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} + +GetSystemCapabilityResponse::~GetSystemCapabilityResponse() {} + +void GetSystemCapabilityResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + application_manager_.SendMessageToMobile(message_); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index 9d52cc98db..6ffc501439 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -363,6 +363,8 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr) , prerecorded_speech_(NULL) , is_navigation_supported_(false) , is_phone_call_supported_(false) + , navigation_capability_(NULL) + , phone_capability_(NULL) , app_mngr_(app_mngr) , hmi_language_handler_(app_mngr) { InitCapabilities(); @@ -390,6 +392,8 @@ HMICapabilitiesImpl::~HMICapabilitiesImpl() { delete audio_pass_thru_capabilities_; delete pcm_stream_capabilities_; delete prerecorded_speech_; + delete navigation_capability_; + delete phone_capability_; } bool HMICapabilitiesImpl::VerifyImageType(const int32_t image_type) const { @@ -605,6 +609,22 @@ void HMICapabilitiesImpl::set_phone_call_supported(const bool supported) { is_phone_call_supported_ = supported; } +void HMICapabilitiesImpl::set_navigation_capability( + const smart_objects::SmartObject& navigation_capability) { + if (navigation_capability_) { + delete navigation_capability_; + } + navigation_capability_ = new smart_objects::SmartObject(navigation_capability); +} + +void HMICapabilitiesImpl::set_phone_capability( + const smart_objects::SmartObject& phone_capability) { + if (phone_capability_) { + delete phone_capability_; + } + phone_capability_ = new smart_objects::SmartObject(phone_capability); +} + void HMICapabilitiesImpl::Init(resumption::LastState* last_state) { hmi_language_handler_.Init(last_state); if (false == load_capabilities_from_file()) { @@ -716,6 +736,14 @@ bool HMICapabilitiesImpl::phone_call_supported() const { return is_phone_call_supported_; } +const smart_objects::SmartObject* HMICapabilitiesImpl::navigation_capability() const { + return navigation_capability_; +} + +const smart_objects::SmartObject* HMICapabilitiesImpl::phone_capability() const { + return phone_capability_; +} + bool HMICapabilitiesImpl::load_capabilities_from_file() { std::string json_string; std::string file_name = app_mngr_.get_settings().hmi_capabilities_file_name(); @@ -1065,7 +1093,21 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { vehicle_type_so); set_vehicle_type(vehicle_type_so); } // VehicleType end - + if(check_existing_json_member(root_json, "SystemCapabilities")) { + Json::Value system_capabilities = root_json.get("SystemCapabilities", ""); + if (check_existing_json_member(system_capabilities, "NavigationCapability")) { + Json::Value navigation_capability = system_capabilities.get("NavigationCapability",""); + smart_objects::SmartObject navigation_capability_so; + Formatters::CFormatterJsonBase::jsonValueToObj(navigation_capability, navigation_capability_so); + set_navigation_capability(navigation_capability_so); + } + if (check_existing_json_member(system_capabilities, "PhoneCapability")) { + Json::Value phone_capability = system_capabilities.get("PhoneCapability",""); + smart_objects::SmartObject phone_capability_so; + Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability, phone_capability_so); + set_phone_capability(phone_capability_so); + } + } } catch (...) { return false; } diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc index 688bacf1ac..a5d2b29476 100644 --- a/src/components/application_manager/src/mobile_command_factory.cc +++ b/src/components/application_manager/src/mobile_command_factory.cc @@ -56,6 +56,8 @@ #include "application_manager/commands/mobile/generic_response.h" #include "application_manager/commands/mobile/get_dtcs_request.h" #include "application_manager/commands/mobile/get_dtcs_response.h" +#include "application_manager/commands/mobile/get_system_capability_request.h" +#include "application_manager/commands/mobile/get_system_capability_response.h" #include "application_manager/commands/mobile/get_vehicle_data_request.h" #include "application_manager/commands/mobile/get_vehicle_data_response.h" #include "application_manager/commands/mobile/get_way_points_request.h" @@ -450,6 +452,17 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( } break; } + case mobile_apis::FunctionID::GetSystemCapabilityID: { + if ((*message)[strings::params][strings::message_type] == + static_cast(application_manager::MessageType::kResponse)) { + command = utils::MakeShared( + message, application_manager); + } else { + command = utils::MakeShared( + message, application_manager); + } + break; + } case mobile_apis::FunctionID::ReadDIDID: { if ((*message)[strings::params][strings::message_type] == static_cast(application_manager::MessageType::kResponse)) { diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 99d9e4122a..2a86c6c1c0 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -134,6 +134,8 @@ const char* audio_pass_thru_capabilities = "audioPassThruCapabilities"; const char* pcm_stream_capabilities = "pcmStreamCapabilities"; const char* audio_pass_thru_icon = "audioPassThruIcon"; const char* way_points = "wayPoints"; +const char* system_capability = "systemCapability"; +const char* system_capability_type = "systemCapabilityType"; // PutFile const char* sync_file_name = "syncFileName"; diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h index 556620b644..451c2ca806 100644 --- a/src/components/include/application_manager/hmi_capabilities.h +++ b/src/components/include/application_manager/hmi_capabilities.h @@ -409,6 +409,14 @@ class HMICapabilities { */ virtual bool phone_call_supported() const = 0; + virtual void set_navigation_capability(const smart_objects::SmartObject& navigation_capability) = 0; + + virtual const smart_objects::SmartObject* navigation_capability() const = 0; + + virtual void set_phone_capability(const smart_objects::SmartObject& phone_capability) = 0; + + virtual const smart_objects::SmartObject* phone_capability() const = 0; + virtual void Init(resumption::LastState* last_state) = 0; /** diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 953f270741..347623a6e3 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -132,6 +132,9 @@ The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data. + + The requested data is not available on this vehicle or is not published for the connected app + @@ -2229,6 +2232,7 @@ + @@ -5001,6 +5040,38 @@ + + + The type of system capability to get more information on + + + + + + + + See Result + + + + + + + + + + + The capability does not exist on the module + The capability should exist on the module but there was an error retrieving the data. + + + + + true if successful; false, if failed + + + + -- cgit v1.2.1 From 2c325e18c2ee1db4efb17f330440423a00514f79 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 13 Jul 2017 10:42:20 -0400 Subject: Add system capabilities to HMI RPC UI.getCapabilitiesResponse --- src/appMain/hmi_capabilities.json | 20 +++++++-------- .../application_manager/smart_object_keys.h | 3 +++ .../commands/hmi/ui_get_capabilities_response.cc | 9 +++++++ .../src/hmi_capabilities_impl.cc | 30 +++++++++++----------- .../application_manager/src/smart_object_keys.cc | 3 +++ src/components/interfaces/HMI_API.xml | 29 ++++++++++++++++++++- src/components/interfaces/MOBILE_API.xml | 2 +- 7 files changed, 69 insertions(+), 27 deletions(-) diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index a849dc86d7..f5e88fe370 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -292,7 +292,16 @@ "longPressAvailable": true, "upDownAvailable": true, "imageSupported": true - }] + }], + "systemCapabilities": { + "navigationCapability": { + "sendLocationEnabled": true, + "getWayPointsEnabled": true + }, + "phoneCapability": { + "dialNumberEnabled": true + } + } }, "VR": { "capabilities": ["TEXT"], @@ -415,14 +424,5 @@ "SyncMessageVersion": { "majorVersion": 3, "minorVersion": 0 - }, - "SystemCapabilities": { - "NavigationCapability": { - "sendLocationEnabled": true, - "getWayPointsEnabled": true - }, - "PhoneCapability": { - "dialNumberEnabled": true - } } } \ No newline at end of file diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 9f9cee99cf..9b8acd0675 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -169,6 +169,9 @@ extern const char* audio_pass_thru_icon; extern const char* way_points; extern const char* system_capability; extern const char* system_capability_type; +extern const char* system_capabilities; +extern const char* navigation_capability; +extern const char* phone_capability; // PutFile extern const char* sync_file_name; diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc index de0a2f2157..bf89b3d5a7 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc @@ -79,6 +79,15 @@ void UIGetCapabilitiesResponse::Run() { msg_params[strings::hmi_capabilities][strings::phone_call].asBool()); } } + + if(msg_params.keyExists(strings::system_capabilities)) { + if(msg_params[strings::system_capabilities].keyExists(strings::navigation_capability)) { + hmi_capabilities.set_navigation_capability(msg_params[strings::system_capabilities][strings::navigation_capability]); + } + if(msg_params[strings::system_capabilities].keyExists(strings::phone_capability)) { + hmi_capabilities.set_phone_capability(msg_params[strings::system_capabilities][strings::phone_capability]); + } + } } } // namespace commands diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index 6ffc501439..9b4d62ed2d 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -988,6 +988,21 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { soft_button_capabilities, soft_button_capabilities_so); set_soft_button_capabilities(soft_button_capabilities_so); } + if(check_existing_json_member(ui, "systemCapabilities")) { + Json::Value system_capabilities = ui.get("systemCapabilities", ""); + if (check_existing_json_member(system_capabilities, "navigationCapability")) { + Json::Value navigation_capability = system_capabilities.get("navigationCapability",""); + smart_objects::SmartObject navigation_capability_so; + Formatters::CFormatterJsonBase::jsonValueToObj(navigation_capability, navigation_capability_so); + set_navigation_capability(navigation_capability_so); + } + if (check_existing_json_member(system_capabilities, "phoneCapability")) { + Json::Value phone_capability = system_capabilities.get("phoneCapability",""); + smart_objects::SmartObject phone_capability_so; + Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability, phone_capability_so); + set_phone_capability(phone_capability_so); + } + } } // UI end // VR @@ -1093,21 +1108,6 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { vehicle_type_so); set_vehicle_type(vehicle_type_so); } // VehicleType end - if(check_existing_json_member(root_json, "SystemCapabilities")) { - Json::Value system_capabilities = root_json.get("SystemCapabilities", ""); - if (check_existing_json_member(system_capabilities, "NavigationCapability")) { - Json::Value navigation_capability = system_capabilities.get("NavigationCapability",""); - smart_objects::SmartObject navigation_capability_so; - Formatters::CFormatterJsonBase::jsonValueToObj(navigation_capability, navigation_capability_so); - set_navigation_capability(navigation_capability_so); - } - if (check_existing_json_member(system_capabilities, "PhoneCapability")) { - Json::Value phone_capability = system_capabilities.get("PhoneCapability",""); - smart_objects::SmartObject phone_capability_so; - Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability, phone_capability_so); - set_phone_capability(phone_capability_so); - } - } } catch (...) { return false; } diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 2a86c6c1c0..7f8fd5d00f 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -136,6 +136,9 @@ const char* audio_pass_thru_icon = "audioPassThruIcon"; const char* way_points = "wayPoints"; const char* system_capability = "systemCapability"; const char* system_capability_type = "systemCapabilityType"; +const char* system_capabilities = "systemCapabilities"; +const char* navigation_capability = "navigationCapability"; +const char* phone_capability = "phoneCapability"; // PutFile const char* sync_file_name = "syncFileName"; diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 0d6d5fad3d..10660f982d 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -2086,6 +2086,30 @@ + + Extended capabilities for an onboard navigation system + + If the module has the ability to add locations to the onboard nav + + + If the module has the ability to return way points from onboard nav + + + + + Extended capabilities of the module's phone feature + + If the module has the abiulity to perform dial number + + + + + + + + + + @@ -2953,7 +2977,7 @@ Optional text to label an app menu button (for certain touchscreen platforms). - >Optional icon to draw on an app menu button (for certain touchscreen platforms). + Optional icon to draw on an app menu button (for certain touchscreen platforms). On-screen keybaord configuration (if available). @@ -3000,6 +3024,9 @@ Specifies the HMI’s capabilities. See HMICapabilities. + + Specifies system capabilities. See SystemCapabilities + Request from SmartDeviceLink to HMI to change language for app. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 347623a6e3..cac520d349 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2407,7 +2407,7 @@ - + The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist -- cgit v1.2.1 From f4129a5aea647b0dd4b14f748c169eaf6e081027 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 13 Jul 2017 14:55:20 -0400 Subject: Handle getSystemCapability Request --- .../mobile/get_system_capability_request.cc | 43 ++++++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc index 9867e8b741..b7d9dbb043 100644 --- a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc @@ -27,14 +27,51 @@ void GetSystemCapabilityRequest::Run() { return; } smart_objects::SmartObject response_params(smart_objects::SmartType_Map); + //response_params[strings::system_capability][strings::system_capability_type] = (mobile_apis::SystemCapabilityType::PHONE_CALL); + mobile_apis::SystemCapabilityType::eType response_type = static_cast((*message_)[strings::msg_params][strings::system_capability_type].asInt()); + response_params[strings::system_capability][strings::system_capability_type] = response_type; - response_params[strings::system_capability][strings::system_capability_type] = mobile_apis::SystemCapabilityType::PHONE_CALL; - LOG4CXX_INFO(logger_ ,"Sanity " << response_params[strings::system_capability_type].asInt()); + const HMICapabilities& hmi_capabilities = + application_manager_.hmi_capabilities(); + + switch (response_type) { + case mobile_apis::SystemCapabilityType::NAVIGATION: { + if (hmi_capabilities.navigation_capability()) { + response_params[strings::system_capability][strings::navigation_capability] = + *hmi_capabilities.navigation_capability(); + } else { + SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); + return; + } + break; + } + case mobile_apis::SystemCapabilityType::PHONE_CALL: { + if (hmi_capabilities.phone_capability()) { + response_params[strings::system_capability][strings::phone_capability] = + *hmi_capabilities.phone_capability(); + } else { + SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); + return; + } + break; + } + case mobile_apis::SystemCapabilityType::VIDEO_STREAMING: + SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); + return; + break; + case mobile_apis::SystemCapabilityType::AUDIO_STREAMING: + SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); + return; + break; + default: // Return unsupported resource + SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); + break; + } SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params); } void GetSystemCapabilityRequest::on_event(const event_engine::Event& event){ - LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest onEVENTs"); + LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest on_event"); } } // namespace commands -- cgit v1.2.1 From 13a3199045adfde25842fcf7a76a64bb98aecc0e Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 18 Jul 2017 13:54:37 -0400 Subject: Unit Tests: UIGetCapabilityResponse --- .../hmi/ui_get_capabilities_response_test.cc | 49 ++++++++++++++++++++++ .../application_manager/mock_hmi_capabilities.h | 7 ++++ 2 files changed, 56 insertions(+) diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index 11162f9a03..b556da603c 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -216,6 +216,55 @@ TEST_F(UIGetCapabilitiesResponseTest, SetPhoneCall_SUCCESS) { command->Run(); } +TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) { + MessageSharedPtr command_msg = CreateCommandMsg(); + (*command_msg)[strings::msg_params][strings::system_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::navigation_capability]["sendLocationEnabled"] = true; + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::navigation_capability]["getWayPointsEnabled"] = true; + + ResponseFromHMIPtr command( + CreateCommand(command_msg)); + + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(mock_hmi_capabilities_)); + + smart_objects::SmartObject navigation_capability_so = + (*command_msg)[strings::msg_params][strings::system_capabilities][strings::navigation_capability]; + + EXPECT_CALL(mock_hmi_capabilities_, + set_navigation_capability(navigation_capability_so)); + + command->Run(); +} + +TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) { + MessageSharedPtr command_msg = CreateCommandMsg(); + (*command_msg)[strings::msg_params][strings::system_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::phone_capability]["dialNumberEnabled"] = true; + + ResponseFromHMIPtr command( + CreateCommand(command_msg)); + + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(mock_hmi_capabilities_)); + + smart_objects::SmartObject phone_capability_so = + (*command_msg)[strings::msg_params][strings::system_capabilities][strings::phone_capability]; + + EXPECT_CALL(mock_hmi_capabilities_, + set_phone_capability(phone_capability_so)); + + command->Run(); +} + } // namespace ui_get_capabilities_response } // namespace hmi_commands_test } // namespace commands_test diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h index a8664f5e2c..020e56c292 100644 --- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h +++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h @@ -154,6 +154,13 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities { MOCK_CONST_METHOD0(phone_call_supported, bool()); MOCK_METHOD1(set_phone_call_supported, void(const bool supported)); + MOCK_CONST_METHOD0(navigation_capability, const smart_objects::SmartObject*()); + MOCK_METHOD1(set_navigation_capability, void(const smart_objects::SmartObject& navigation_capability)); + + MOCK_CONST_METHOD0(phone_capability, const smart_objects::SmartObject*()); + MOCK_METHOD1(set_phone_capability, void(const smart_objects::SmartObject& phone_capability)); + + MOCK_METHOD1(Init, void(resumption::LastState* last_state)); MOCK_CONST_METHOD0(ccpu_version, const std::string&()); -- cgit v1.2.1 From 1b7b9eef9897c3126b94163fd820ad691cb59825 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Mon, 19 Jun 2017 22:05:04 +0900 Subject: fix: memory issue in FromMicToFileRecorderThread Strings were not copied properly, instead pointers to buffers were copied. One of the buffer was released immediately, causing memory access through a dangling pointer. --- .../src/audio/from_mic_to_file_recorder_thread.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc index 0239795d75..a514959701 100644 --- a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc +++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc @@ -32,6 +32,7 @@ #include "media_manager/audio/from_mic_to_file_recorder_thread.h" #include +#include #include #include "utils/logger.h" @@ -88,11 +89,11 @@ void FromMicToFileRecorderThread::initArgs() { argv_[3] = new gchar[3]; argv_[4] = new gchar[durationString_.length() + 1]; - argv_[0] = const_cast(std::string("AudioManager").c_str()); - argv_[1] = const_cast(oKey_.c_str()); - argv_[2] = const_cast(outputFileName_.c_str()); - argv_[3] = const_cast(tKey_.c_str()); - argv_[4] = const_cast(durationString_.c_str()); + std::strcpy(argv_[0], "AudioManager"); + std::strcpy(argv_[1], oKey_.c_str()); + std::strcpy(argv_[2], outputFileName_.c_str()); + std::strcpy(argv_[3], tKey_.c_str()); + std::strcpy(argv_[4], durationString_.c_str()); } void FromMicToFileRecorderThread::threadMain() { -- cgit v1.2.1 From 3836f3c70d2b1b87008f24aa5f1907accfdf7436 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Tue, 20 Jun 2017 16:29:51 +0900 Subject: fix: memory leak in FromMicToFileRecorderThread --- .../audio/from_mic_to_file_recorder_thread.h | 1 + .../src/audio/from_mic_to_file_recorder_thread.cc | 36 ++++++++++++++++------ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h index f0c6d3c48f..ded709b1fa 100644 --- a/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h +++ b/src/components/media_manager/include/media_manager/audio/from_mic_to_file_recorder_thread.h @@ -74,6 +74,7 @@ class FromMicToFileRecorderThread : public threads::ThreadDelegate { } GstTimeout; void initArgs(); + void deinitArgs(); void psleep(void* timeout); diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc index 0239795d75..27550ac144 100644 --- a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc +++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc @@ -95,6 +95,18 @@ void FromMicToFileRecorderThread::initArgs() { argv_[4] = const_cast(durationString_.c_str()); } +void FromMicToFileRecorderThread::deinitArgs() { + LOG4CXX_AUTO_TRACE(logger_); + + if (argv_) { + for (int32_t i = 0; i < argc_; i++) { + delete[] argv_[i]; + } + delete[] argv_; + argv_ = NULL; + } +} + void FromMicToFileRecorderThread::threadMain() { LOG4CXX_AUTO_TRACE(logger_); @@ -136,6 +148,13 @@ void FromMicToFileRecorderThread::threadMain() { "length of time in seconds to capture", "int32_t"}, {NULL}}; + // g_option_context_parse() modifies params, so keep argc_ and argv_ + int32_t argc = argc_; + gchar** argv = new gchar*[argc]; + for (int32_t i = 0; i < argc; i++) { + argv[i] = argv_[i]; + } + #ifndef GLIB_VERSION_2_32 // g_thread_init() does nothing since 2.32 if (!g_thread_supported()) { g_thread_init(NULL); @@ -145,7 +164,7 @@ void FromMicToFileRecorderThread::threadMain() { context = g_option_context_new("-- M-AUDIO RAW"); g_option_context_add_main_entries(context, entries, NULL); g_option_context_add_group(context, gst_init_get_option_group()); - if (!g_option_context_parse(context, &argc_, &argv_, &err)) { + if (!g_option_context_parse(context, &argc, &argv, &err)) { g_error("%s\n", err->message); } @@ -159,7 +178,10 @@ void FromMicToFileRecorderThread::threadMain() { LOG4CXX_TRACE(logger_, "Duration set to: " << duration); // Initialize gstreamer and setup the main loop information - gst_init(&argc_, &argv_); + gst_init(&argc, &argv); + + delete[] argv; + argv = NULL; pipeline = gst_pipeline_new("vga2usb-h264"); @@ -207,10 +229,7 @@ void FromMicToFileRecorderThread::threadMain() { gst_object_unref(GST_OBJECT(pipeline)); g_option_context_free(context); - if (argv_) { - delete[] argv_; - argv_ = NULL; - } + deinitArgs(); return; } } @@ -238,10 +257,7 @@ void FromMicToFileRecorderThread::threadMain() { g_main_loop_unref(loop); g_option_context_free(context); - if (argv_) { - delete[] argv_; - argv_ = NULL; - } + deinitArgs(); loop = NULL; } -- cgit v1.2.1 From 5d8de6b299da0347092115584377d2e0134f37db Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 19 Jul 2017 09:57:56 -0400 Subject: Unit Test: Load capabilities from file --- .../application_manager/test/hmi_capabilities.json | 786 ++++++++++----------- .../test/hmi_capabilities_test.cc | 18 +- 2 files changed, 391 insertions(+), 413 deletions(-) diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 61cda5ce43..4e43bcb72c 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -1,466 +1,428 @@ { - "UI": - { - "language":"EN_US", - "languages":[ - "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO" + "UI": { + "language": "EN_US", + "languages": [ + "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "ZH_TW", + "JA_JP", "AR_SA", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO" ], - "displayCapabilities": - { - "displayType":"GEN2_8_DMA", + "displayCapabilities": { + "displayType": "GEN2_8_DMA", "textFields": [{ - "name": "mainField1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField3", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField4", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "statusBar", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mediaClock", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mediaTrack", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText3", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "scrollableMessageBody", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "initialInteractionText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "ETA", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "totalDistance", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "audioPassThruDisplayText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "audioPassThruDisplayText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "sliderHeader", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "sliderFooter", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "notificationText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "menuName", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "secondaryText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "tertiaryText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "timeToDestination", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "turnText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "menuTitle", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - } - ], - "imageFields": - [ - { - "name":"softButtonImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"choiceImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"choiceSecondaryImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"menuIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"cmdIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"appIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"graphic", - "imageTypeSupported": - [ + "name": "mainField1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField3", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField4", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "statusBar", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mediaClock", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mediaTrack", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText3", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "scrollableMessageBody", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "initialInteractionText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "ETA", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "totalDistance", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "audioPassThruDisplayText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "audioPassThruDisplayText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "sliderHeader", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "sliderFooter", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "notificationText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "menuName", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "secondaryText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "tertiaryText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "timeToDestination", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "turnText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "menuTitle", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + } + ], + "imageFields": [{ + "name": "softButtonImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "choiceImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "choiceSecondaryImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "menuIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "cmdIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "appIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "graphic", + "imageTypeSupported": [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"locationImage", - "imageTypeSupported": - [ - "GRAPHIC_PNG" - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - } + ], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "locationImage", + "imageTypeSupported": [ + "GRAPHIC_PNG" + ], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + } - ], - "mediaClockFormats": - [ - "CLOCK1","CLOCK2","CLOCK3","CLOCKTEXT1","CLOCKTEXT2","CLOCKTEXT3","CLOCKTEXT4" ], - "graphicSupported":true, - "templatesAvailable": - [ + "mediaClockFormats": [ + "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4" + ], + "graphicSupported": true, + "templatesAvailable": [ - "DEFAULT","MEDIA","NON-MEDIA","ONSCREEN_PRESETS","NAV_FULLSCREEN_MAP","NAV_KEYBOARD", - "GRAPHIC_WITH_TEXT","TEXT_WITH_GRAPHIC","TILES_ONLY","TEXTBUTTONS_ONLY", - "GRAPHIC_WITH_TILES","TILES_WITH_GRAPHIC","GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", - "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC","GRAPHIC_WITH_TEXTBUTTONS", - "TEXTBUTTONS_WITH_GRAPHIC","LARGE_GRAPHIC_WITH_SOFTBUTTONS", - "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS","LARGE_GRAPHIC_ONLY" - ], - "screenParams": - { - "resolution": - { - "resolutionWidth":800, - "resolutionHeight":350 - }, - "touchEventAvailable": - { - "pressAvailable":true, - "multiTouchAvailable":false, - "doublePressAvailable":false - } - }, - "numCustomPresetsAvailable":8, - "imageCapabilities": - [ + "DEFAULT", "MEDIA", "NON-MEDIA", "ONSCREEN_PRESETS", "NAV_FULLSCREEN_MAP", "NAV_KEYBOARD", + "GRAPHIC_WITH_TEXT", "TEXT_WITH_GRAPHIC", "TILES_ONLY", "TEXTBUTTONS_ONLY", + "GRAPHIC_WITH_TILES", "TILES_WITH_GRAPHIC", "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", + "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC", "GRAPHIC_WITH_TEXTBUTTONS", + "TEXTBUTTONS_WITH_GRAPHIC", "LARGE_GRAPHIC_WITH_SOFTBUTTONS", + "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS", "LARGE_GRAPHIC_ONLY" + ], + "screenParams": { + "resolution": { + "resolutionWidth": 800, + "resolutionHeight": 350 + }, + "touchEventAvailable": { + "pressAvailable": true, + "multiTouchAvailable": false, + "doublePressAvailable": false + } + }, + "numCustomPresetsAvailable": 8, + "imageCapabilities": [ "DYNAMIC", "STATIC" ] }, - "audioPassThruCapabilities": - { - "samplingRate" : "44KHZ", - "bitsPerSample" : "RATE_8_BIT", - "audioType" : "PCM" + "audioPassThruCapabilities": { + "samplingRate": "44KHZ", + "bitsPerSample": "RATE_8_BIT", + "audioType": "PCM" }, - "pcmStreamCapabilities": - { - "samplingRate" : "16KHZ", - "bitsPerSample" : "RATE_16_BIT", - "audioType" : "PCM" + "pcmStreamCapabilities": { + "samplingRate": "16KHZ", + "bitsPerSample": "RATE_16_BIT", + "audioType": "PCM" }, - "hmiZoneCapabilities":"FRONT", - "softButtonCapabilities": - [ - { - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true, - "imageSupported" :true + "hmiZoneCapabilities": "FRONT", + "softButtonCapabilities": [{ + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true, + "imageSupported": true + }], + "systemCapabilities": { + "navigationCapability": { + "sendLocationEnabled": true, + "getWayPointsEnabled": true + }, + "phoneCapability": { + "dialNumberEnabled": true } + } + }, + "VR": { + "capabilities": ["TEXT"], + "language": "ES_MX", + "languages": [ + "AR_SA", "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "ZH_TW", + "JA_JP", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO" ] }, - "VR": - { - "capabilities":["TEXT"], - "language":"ES_MX", - "languages": - [ - "AR_SA", "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO" - ] -}, - "TTS": - { - "capabilities":["TEXT"], - "language":"DE_DE", - "languages": - [ - "DA_DK","CS_CZ","KO_KR","EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","AR_SA","PT_BR","NO_NO" + "TTS": { + "capabilities": ["TEXT"], + "language": "DE_DE", + "languages": [ + "DA_DK", "CS_CZ", "KO_KR", "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "ZH_TW", + "JA_JP", "AR_SA", "PT_BR", "NO_NO" ] }, - "Buttons": - { - "capabilities": - [ - { - "name":"PRESET_0", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "Buttons": { + "capabilities": [{ + "name": "PRESET_0", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_1", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_1", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_2", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_2", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_3", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_3", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_4", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_4", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_5", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_5", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_6", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_6", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_7", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_7", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_8", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_8", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_9", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_9", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"OK", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "OK", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"SEEKLEFT", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "SEEKLEFT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"SEEKRIGHT", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "SEEKRIGHT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"TUNEUP", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "TUNEUP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"TUNEDOWN", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "TUNEDOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true } ], - "presetBankCapabilities": - { - "onScreenPresetsAvailable":true + "presetBankCapabilities": { + "onScreenPresetsAvailable": true } }, - "VehicleInfo": - { - "make" :"Ford", - "model" :"Fiesta", - "modelYear" :"2013", - "trim" :"SE" + "VehicleInfo": { + "make": "Ford", + "model": "Fiesta", + "modelYear": "2013", + "trim": "SE" }, - "SyncMessageVersion": - { + "SyncMessageVersion": { "majorVersion": 3, "minorVersion": 0 } -} +} \ No newline at end of file diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 4eb9f920d9..a9c5e147b2 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -351,12 +351,28 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { // Check vehicle type const smart_objects::SmartObject vehicle_type_so = *(hmi_capabilities_test->vehicle_type()); - EXPECT_TRUE(preset_bank_so["onScreenPresetsAvailable"].asBool()); EXPECT_EQ("Ford", vehicle_type_so["make"].asString()); EXPECT_EQ("Fiesta", vehicle_type_so["model"].asString()); EXPECT_EQ("2013", vehicle_type_so["modelYear"].asString()); EXPECT_EQ("SE", vehicle_type_so["trim"].asString()); + + //Check system capabilities + smart_objects::SmartObject navigation_capability_so = + *(hmi_capabilities_test->navigation_capability()); + + EXPECT_TRUE(navigation_capability_so.keyExists("sendLocationEnabled")); + EXPECT_TRUE(navigation_capability_so.keyExists("getWayPointsEnabled")); + EXPECT_TRUE(navigation_capability_so["sendLocationEnabled"].asBool()); + EXPECT_TRUE(navigation_capability_so["getWayPointsEnabled"].asBool()); + + const smart_objects::SmartObject phone_capability_so = + *(hmi_capabilities_test->phone_capability()); + + EXPECT_TRUE(phone_capability_so.keyExists("dialNumberEnabled")); + EXPECT_TRUE(phone_capability_so["dialNumberEnabled"].asBool()); + + } TEST_F(HMICapabilitiesTest, VerifyImageType) { -- cgit v1.2.1 From fb7c1870bca97b127e793af73e83bbceba9d5fee Mon Sep 17 00:00:00 2001 From: "Scott Adam Betts (TNA)" Date: Mon, 24 Jul 2017 14:54:06 -0500 Subject: Adding additional languages and unit tests: EN-IN, TH-TH, EN-SA, HE-IL, HU-HU, RO-RO, UK-UA, ID-ID, VI-VN, MS-MY and HI-IN --- .../application_manager/test/hmi_capabilities.json | 3 +- .../test/hmi_capabilities_test.cc | 10 ++++- .../test/message_helper/message_helper_test.cc | 4 +- src/components/interfaces/HMI_API.xml | 30 +++++++++++++++ src/components/interfaces/MOBILE_API.xml | 30 +++++++++++++++ src/components/interfaces/QT_HMI_API.xml | 30 +++++++++++++++ tools/intergen/test/test_hmi_interface.xml | 45 ++++++++++++++++++++++ 7 files changed, 148 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 61cda5ce43..91449ff25c 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -4,7 +4,8 @@ "language":"EN_US", "languages":[ "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO" +"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO","NL_BE","EL_GR","HU_HU","FI_FI","SK_SK","EN_IN","TH_TH","EN_SA","HE_IL", +"RO_RO","UK_UA","ID_ID","VI_VN","MS_MY","HI_IN" ], "displayCapabilities": { diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 4eb9f920d9..8778df9efd 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -104,7 +104,8 @@ const char* const cstring_values_[] = { "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "EN_AU", "ZH_CN", "ZH_TW", "JA_JP", "AR_SA", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO", - "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK"}; + "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK", "EN_IN", "TH_TH", "EN_SA", + "HE_IL", "RO_RO", "UK_UA", "ID_ID", "VI_VN", "MS_MY", "HI_IN"}; const hmi_apis::Common_Language::eType enum_values_[] = { hmi_apis::Common_Language::EN_US, hmi_apis::Common_Language::ES_MX, @@ -121,7 +122,12 @@ const hmi_apis::Common_Language::eType enum_values_[] = { hmi_apis::Common_Language::DA_DK, hmi_apis::Common_Language::NO_NO, hmi_apis::Common_Language::NL_BE, hmi_apis::Common_Language::EL_GR, hmi_apis::Common_Language::HU_HU, hmi_apis::Common_Language::FI_FI, - hmi_apis::Common_Language::SK_SK}; + hmi_apis::Common_Language::SK_SK, hmi_apis::Common_Language::EN_IN, + hmi_apis::Common_Language::TH_TH, hmi_apis::Common_Language::EN_SA, + hmi_apis::Common_Language::HE_IL, hmi_apis::Common_Language::RO_RO, + hmi_apis::Common_Language::UK_UA, hmi_apis::Common_Language::ID_ID, + hmi_apis::Common_Language::VI_VN, hmi_apis::Common_Language::MS_MY, + hmi_apis::Common_Language::HI_IN}; struct CStringComparator { bool operator()(const char* a, const char* b) { diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc index 94ab511dc4..e234cef16f 100644 --- a/src/components/application_manager/test/message_helper/message_helper_test.cc +++ b/src/components/application_manager/test/message_helper/message_helper_test.cc @@ -448,7 +448,9 @@ class MessageHelperTest : public ::testing::Test { "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", "EN-AU", "ZH-CN", "ZH-TW", "JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO", - "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK"} + "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK", "EN-IN", + "TH-TH", "EN-SA", "HE-IL", "RO-RO", "UK-UA", "ID-ID", + "VI-VN", "MS-MY", "HI-IN"} , hmi_result_strings{"SUCCESS", "UNSUPPORTED_REQUEST", "UNSUPPORTED_RESOURCE", diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 0d6d5fad3d..b76ffe1ce4 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -200,6 +200,36 @@ Slovak - Slovakia + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 953f270741..5b9655fc68 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -246,6 +246,36 @@ Slovak - Slovakia + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India + diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml index 2d53559ad1..a495fda398 100644 --- a/src/components/interfaces/QT_HMI_API.xml +++ b/src/components/interfaces/QT_HMI_API.xml @@ -190,6 +190,36 @@ Slovak - Slovakia + + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India diff --git a/tools/intergen/test/test_hmi_interface.xml b/tools/intergen/test/test_hmi_interface.xml index e091909833..e3efc1b3da 100644 --- a/tools/intergen/test/test_hmi_interface.xml +++ b/tools/intergen/test/test_hmi_interface.xml @@ -175,6 +175,51 @@ Norwegian - Norway + + Dutch (Flemish) - Belgium + + + Greek - Greece + + + Hungarian - Hungary + + + Finnish - Finland + + + Slovak - Slovakia + + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India + -- cgit v1.2.1 From 52836c2a7125a14543b3c3fedbca8617eba5d2f3 Mon Sep 17 00:00:00 2001 From: "Scott Adam Betts (TNA)" Date: Mon, 24 Jul 2017 14:58:12 -0500 Subject: Adding additional languages and unit tests: EN-IN, TH-TH, EN-SA, HE-IL, HU-HU, RO-RO, UK-UA, ID-ID, VI-VN, MS-MY and HI-IN --- .../application_manager/test/hmi_capabilities.json | 3 +- .../test/hmi_capabilities_test.cc | 10 ++++- .../test/message_helper/message_helper_test.cc | 4 +- src/components/interfaces/HMI_API.xml | 30 +++++++++++++++ src/components/interfaces/MOBILE_API.xml | 30 +++++++++++++++ src/components/interfaces/QT_HMI_API.xml | 30 +++++++++++++++ tools/intergen/test/test_hmi_interface.xml | 45 ++++++++++++++++++++++ 7 files changed, 148 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 61cda5ce43..91449ff25c 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -4,7 +4,8 @@ "language":"EN_US", "languages":[ "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO" +"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO","NL_BE","EL_GR","HU_HU","FI_FI","SK_SK","EN_IN","TH_TH","EN_SA","HE_IL", +"RO_RO","UK_UA","ID_ID","VI_VN","MS_MY","HI_IN" ], "displayCapabilities": { diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 4eb9f920d9..8c6ffeb947 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -104,7 +104,8 @@ const char* const cstring_values_[] = { "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "EN_AU", "ZH_CN", "ZH_TW", "JA_JP", "AR_SA", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO", - "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK"}; + "NL_BE", "EL_GR", "HU_HU", "FI_FI", "SK_SK", "EN_IN", "TH_TH", "EN_SA", + "HE_IL", "RO_RO", "UK_UA", "ID_ID", "VI_VN", "MS_MY", "HI_IN"}; const hmi_apis::Common_Language::eType enum_values_[] = { hmi_apis::Common_Language::EN_US, hmi_apis::Common_Language::ES_MX, @@ -121,7 +122,12 @@ const hmi_apis::Common_Language::eType enum_values_[] = { hmi_apis::Common_Language::DA_DK, hmi_apis::Common_Language::NO_NO, hmi_apis::Common_Language::NL_BE, hmi_apis::Common_Language::EL_GR, hmi_apis::Common_Language::HU_HU, hmi_apis::Common_Language::FI_FI, - hmi_apis::Common_Language::SK_SK}; + hmi_apis::Common_Language::SK_SK, hmi_apis::Common_Language::EN_IN, + hmi_apis::Common_Language::TH_TH, hmi_apis::Common_Language::EN_SA, + hmi_apis::Common_Language::HE_IL, hmi_apis::Common_Language::RO_RO, + hmi_apis::Common_Language::UK_UA, hmi_apis::Common_Language::ID_ID, + hmi_apis::Common_Language::VI_VN, hmi_apis::Common_Language::MS_MY, + hmi_apis::Common_Language::HI_IN}; struct CStringComparator { bool operator()(const char* a, const char* b) { diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc index 94ab511dc4..ec6ba9cfe5 100644 --- a/src/components/application_manager/test/message_helper/message_helper_test.cc +++ b/src/components/application_manager/test/message_helper/message_helper_test.cc @@ -448,7 +448,9 @@ class MessageHelperTest : public ::testing::Test { "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", "EN-AU", "ZH-CN", "ZH-TW", "JA-JP", "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO", - "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK"} + "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK", "EN-IN", + "TH-TH", "EN-SA", "HE-IL", "RO-RO", "UK-UA", "ID-ID", + "VI-VN", "MS-MY", "HI-IN"} , hmi_result_strings{"SUCCESS", "UNSUPPORTED_REQUEST", "UNSUPPORTED_RESOURCE", diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 0d6d5fad3d..63c0da6cde 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -200,6 +200,36 @@ Slovak - Slovakia + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 953f270741..894d630b71 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -246,6 +246,36 @@ Slovak - Slovakia + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India + diff --git a/src/components/interfaces/QT_HMI_API.xml b/src/components/interfaces/QT_HMI_API.xml index 2d53559ad1..72076ca198 100644 --- a/src/components/interfaces/QT_HMI_API.xml +++ b/src/components/interfaces/QT_HMI_API.xml @@ -191,6 +191,36 @@ Slovak - Slovakia + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India + Contains information about the SoftButton capabilities. diff --git a/tools/intergen/test/test_hmi_interface.xml b/tools/intergen/test/test_hmi_interface.xml index e091909833..16f2892327 100644 --- a/tools/intergen/test/test_hmi_interface.xml +++ b/tools/intergen/test/test_hmi_interface.xml @@ -175,6 +175,51 @@ Norwegian - Norway + + Dutch (Flemish) - Belgium + + + Greek - Greece + + + Hungarian - Hungary + + + Finnish - Finland + + + Slovak - Slovakia + + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India + -- cgit v1.2.1 From 67966b50aa3a1ab95ea6d6fd591ddfdff5977ef7 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Tue, 25 Jul 2017 11:06:20 -0400 Subject: Add BSON library to 3rd party libs --- CMakeLists.txt | 2 + src/3rd_party/CMakeLists.txt | 14 + src/3rd_party/CMakeLists.txt~ | 291 + src/3rd_party/bson_c_lib/Makefile.am | 2 + src/3rd_party/bson_c_lib/Makefile.in | 794 + src/3rd_party/bson_c_lib/README.md | 39 + src/3rd_party/bson_c_lib/aclocal.m4 | 9751 ++++++++++++ src/3rd_party/bson_c_lib/compile | 347 + src/3rd_party/bson_c_lib/config.guess | 1558 ++ src/3rd_party/bson_c_lib/config.h.in | 107 + src/3rd_party/bson_c_lib/config.sub | 1791 +++ src/3rd_party/bson_c_lib/configure | 15032 +++++++++++++++++++ src/3rd_party/bson_c_lib/configure.ac | 33 + src/3rd_party/bson_c_lib/depcomp | 791 + src/3rd_party/bson_c_lib/examples/sample.c | 61 + src/3rd_party/bson_c_lib/install-sh | 527 + src/3rd_party/bson_c_lib/ltmain.sh | 9661 ++++++++++++ src/3rd_party/bson_c_lib/missing | 215 + src/3rd_party/bson_c_lib/src/Makefile.am | 11 + src/3rd_party/bson_c_lib/src/Makefile.in | 769 + src/3rd_party/bson_c_lib/src/bson_array.c | 391 + src/3rd_party/bson_c_lib/src/bson_array.h | 230 + src/3rd_party/bson_c_lib/src/bson_object.c | 404 + src/3rd_party/bson_c_lib/src/bson_object.h | 290 + src/3rd_party/bson_c_lib/src/bson_util.c | 136 + src/3rd_party/bson_c_lib/src/bson_util.h | 183 + src/3rd_party/bson_c_lib/src/emhashmap/LICENSE | 22 + src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am | 8 + src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in | 625 + src/3rd_party/bson_c_lib/src/emhashmap/README.mkd | 56 + src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c | 157 + src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h | 144 + src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh | 17 + .../bson_c_lib/src/emhashmap/tests/tests.c | 218 + src/appMain/CMakeLists.txt | 4 + src/components/protocol_handler/CMakeLists.txt | 4 + 36 files changed, 44685 insertions(+) create mode 100644 src/3rd_party/CMakeLists.txt~ create mode 100644 src/3rd_party/bson_c_lib/Makefile.am create mode 100644 src/3rd_party/bson_c_lib/Makefile.in create mode 100644 src/3rd_party/bson_c_lib/README.md create mode 100644 src/3rd_party/bson_c_lib/aclocal.m4 create mode 100755 src/3rd_party/bson_c_lib/compile create mode 100755 src/3rd_party/bson_c_lib/config.guess create mode 100644 src/3rd_party/bson_c_lib/config.h.in create mode 100755 src/3rd_party/bson_c_lib/config.sub create mode 100755 src/3rd_party/bson_c_lib/configure create mode 100644 src/3rd_party/bson_c_lib/configure.ac create mode 100755 src/3rd_party/bson_c_lib/depcomp create mode 100644 src/3rd_party/bson_c_lib/examples/sample.c create mode 100755 src/3rd_party/bson_c_lib/install-sh create mode 100644 src/3rd_party/bson_c_lib/ltmain.sh create mode 100755 src/3rd_party/bson_c_lib/missing create mode 100644 src/3rd_party/bson_c_lib/src/Makefile.am create mode 100644 src/3rd_party/bson_c_lib/src/Makefile.in create mode 100644 src/3rd_party/bson_c_lib/src/bson_array.c create mode 100644 src/3rd_party/bson_c_lib/src/bson_array.h create mode 100644 src/3rd_party/bson_c_lib/src/bson_object.c create mode 100644 src/3rd_party/bson_c_lib/src/bson_object.h create mode 100644 src/3rd_party/bson_c_lib/src/bson_util.c create mode 100644 src/3rd_party/bson_c_lib/src/bson_util.h create mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/LICENSE create mode 100644 src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am create mode 100644 src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in create mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/README.mkd create mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c create mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h create mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh create mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/tests/tests.c diff --git a/CMakeLists.txt b/CMakeLists.txt index a813b98a1c..3e68df883f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,6 +282,8 @@ if(ENABLE_LOG) message(STATUS "Logger enabled") endif() +set(install-bson_c_lib "install-bson_c_lib") + if (TELEMETRY_MONITOR) add_definitions(-DTELEMETRY_MONITOR) message(STATUS "Telemetry monitor enabled") diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index cddc2d16b6..23f0974d27 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -283,9 +283,23 @@ if(HMI_DBUS_API) add_subdirectory(dbus-cmake) endif() +set(install-bson_c_lib_var "install-bson_c_lib") +set(BSON_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) +set(BSON_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) +set(EMHASHMAP_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) +set(EMHASHMAP_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) + +include(ExternalProject) +ExternalProject_Add(libbson + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bson_c_lib + CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bson_c_lib/configure + BUILD_COMMAND make + INSTALL_COMMAND sudo make install) + add_custom_target(install-3rd_party DEPENDS ${install-3rd_party_logger_var} DEPENDS ${install-3rd_party_dbus_var} + DEPENDS ${install-bson_c_lib_var} WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} ) diff --git a/src/3rd_party/CMakeLists.txt~ b/src/3rd_party/CMakeLists.txt~ new file mode 100644 index 0000000000..cddc2d16b6 --- /dev/null +++ b/src/3rd_party/CMakeLists.txt~ @@ -0,0 +1,291 @@ +# Copyright (c) 2014, Ford Motor Company +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 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. +# +# Neither the name of the Ford Motor Company nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + +include("./set_3rd_party_paths.cmake") + +set(3RD_PARTY_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + +set (install-3rd_party_logger_var "") +set (install-3rd_party_dbus_var "") + +if(NO_REBUILD_3RD_PARTY) + set(NO_REBUILD_3RD_PARTY_LOGGER ON) + set(NO_REBUILD_3RD_PARTY_DBUS ON) +endif() + +if(FORCE_3RD_PARTY) + if(NO_REBUILD_3RD_PARTY) + message(FATAL_ERROR "Please don't turn on both FORCE_3RD_PARTY and NO_REBUILD_3RD_PARTY at the same time.") + else() + set(FORCE_3RD_PARTY_LOGGER ON) + set(FORCE_3RD_PARTY_DBUS ON) + endif() +endif() + +if(ENABLE_LOG OR HMI_DBUS_API) + # --- libexpat + add_subdirectory(expat-2.1.0) + set(EXPAT_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) +endif() + +if(ENABLE_LOG) + if(NO_REBUILD_3RD_PARTY_LOGGER) + message(STATUS "Not rebuilding logger.") + else() + if(FORCE_3RD_PARTY_LOGGER) + message(STATUS "Force to rebuild logger.") + + #build logger + add_custom_target(3rd_party_logger + make + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} + ) + + #install logger + #install either to default place with sudo or non-default plase without sudo. + #to install with sudo to non-default place use manual installation + add_custom_target(install-3rd_party_logger + COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; + if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then + sudo -k \; + sudo make install\; + else + make install\; + fi\" + DEPENDS 3rd_party_logger + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} + ) + else() + #build logger + add_custom_target(3rd_party_logger + COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} && + grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\; + if [ \\$$? == 0 ]\; then + VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\; + VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\; + VAR2=-1\; + cd ${CMAKE_CURRENT_SOURCE_DIR}\; + git log . 1>/dev/null 2>&1\; + if [ \\$$? == 0 ]; then + VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\; + fi\; + if [ \\$$VAR1 != \\$$VAR2 ]\; then + echo " Need to rebuild logger. " \; + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + make\; + else + echo " Logger is actual. " \; + fi\; + else + echo " Need to build logger. " \; + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + make\; + fi\" + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} + ) + + #install logger + #install either to default place with sudo or non-default plase without sudo. + #to install with sudo to non-default place use manual installation + add_custom_target(install-3rd_party_logger + COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} && + grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\; + if [ \\$$? == 0 ]\; then + VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\; + VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\; + VAR2=-1\; + cd ${CMAKE_CURRENT_SOURCE_DIR}\; + git log . 1>/dev/null 2>&1\; + if [ \\$$? == 0 ]; then + VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\; + fi\; + if [ \\$$VAR1 != \\$$VAR2 ]\; then + USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; + if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + sudo -k \; + sudo make install\; + else + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + make install\; + fi\; + fi\; + else + USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; + if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + sudo -k \; + sudo make install\; + else + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + make install\; + fi\; + fi\" + DEPENDS 3rd_party_logger + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} + ) + endif() + + set(install-3rd_party_logger_var "install-3rd_party_logger") + endif() + + set(APR_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) + set(APR_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) + set(APR_UTIL_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) + set(LOG4CXX_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) + set(LOG4CXX_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) + + # --- libapr-1 + add_subdirectory(apr-cmake) + + # --- apr-util + add_subdirectory(apr-util-cmake) + + # --- log4cxx + add_subdirectory(apache-log4cxx-cmake) +endif() + +# --- D-Bus +if(HMI_DBUS_API) + if(NO_REBUILD_3RD_PARTY_DBUS) + message(STATUS "Not rebuilding D-Bus.") + else() + if(FORCE_3RD_PARTY_DBUS) + message(STATUS "Force to rebuild D-Bus.") + + #build d-bus + add_custom_target(3rd_party_dbus + make + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} + ) + + #install d-bus + #install either to default place with sudo or non-default plase without sudo. + #to install with sudo to non-default place use manual installation + add_custom_target(install-3rd_party_dbus + COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; + if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then + sudo -k \; + sudo make install\; + else + make install\; + fi\" + DEPENDS 3rd_party_dbus + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} + ) + else() + #build d-bus + add_custom_target(3rd_party_dbus + COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\; + if [ \\$$? == 0 ]\; then + VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\; + VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\; + VAR2=-1\; + cd ${CMAKE_CURRENT_SOURCE_DIR}\; + git log . 1>/dev/null 2>&1\; + if [ \\$$? == 0 ]; then + VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\; + fi\; + if [ \\$$VAR1 != \\$$VAR2 ]\; then + echo " Need to rebuild D-Bus. " \; + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + make\; + else + echo " D-Bus is actual. " \; + fi\; + else + echo " Need to build D-Bus. " \; + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + make\; + fi\" + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} + ) + + #install d-bus + #install either to default place with sudo or non-default plase without sudo. + #to install with sudo to non-default place use manual installation + add_custom_target(install-3rd_party_dbus + COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\; + if [ \\$$? == 0 ]\; then + VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\; + VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\; + VAR2=-1\; + cd ${CMAKE_CURRENT_SOURCE_DIR}\; + git log . 1>/dev/null 2>&1\; + if [ \\$$? == 0 ]; then + VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\; + fi\; + if [ \\$$VAR1 != \\$$VAR2 ]\; then + USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; + if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + sudo -k \; + sudo make install\; + else + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + make install\; + fi\; + fi\; + else + USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; + if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + sudo -k \; + sudo make install\; + else + cd ${3RD_PARTY_BINARY_DIRECTORY}\; + make install\; + fi\; + fi\" + DEPENDS 3rd_party_dbus + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} + ) + + set(install-3rd_party_dbus_var "install-3rd_party_dbus") + endif() + endif() + + # --- D-Bus + set(DBUS_INCLUDE_DIR ${3RD_PARTY_INSTALL_PREFIX}/include) + set(DBUS_INCLUDE_DIR_ARCH ${3RD_PARTY_INSTALL_PREFIX_ARCH}/include) + set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_INCLUDE_DIR_ARCH}) + set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIRS} PARENT_SCOPE) + set(DBUS_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) + + add_subdirectory(dbus-cmake) +endif() + +add_custom_target(install-3rd_party + DEPENDS ${install-3rd_party_logger_var} + DEPENDS ${install-3rd_party_dbus_var} + WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} +) + diff --git a/src/3rd_party/bson_c_lib/Makefile.am b/src/3rd_party/bson_c_lib/Makefile.am new file mode 100644 index 0000000000..dfa49b2ea4 --- /dev/null +++ b/src/3rd_party/bson_c_lib/Makefile.am @@ -0,0 +1,2 @@ +AUTOMAKE_OPTIONS = foreign +SUBDIRS = src diff --git a/src/3rd_party/bson_c_lib/Makefile.in b/src/3rd_party/bson_c_lib/Makefile.in new file mode 100644 index 0000000000..4d6218e40a --- /dev/null +++ b/src/3rd_party/bson_c_lib/Makefile.in @@ -0,0 +1,794 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in compile config.guess config.sub depcomp \ + install-sh missing ltmain.sh +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign +SUBDIRS = src +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/3rd_party/bson_c_lib/README.md b/src/3rd_party/bson_c_lib/README.md new file mode 100644 index 0000000000..81a2887b5d --- /dev/null +++ b/src/3rd_party/bson_c_lib/README.md @@ -0,0 +1,39 @@ +# README # +Library for converting to and from BSON + +## Build library ## +```bash +make +``` + +## Build and run sample program ## +```bash +make sample +LD_LIBRARY_PATH=. ./sample +``` + +### What is this repository for? ### + +* Quick summary +* Version +* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo) + +### How do I get set up? ### + +* Summary of set up +* Configuration +* Dependencies +* Database configuration +* How to run tests +* Deployment instructions + +### Contribution guidelines ### + +* Writing tests +* Code review +* Other guidelines + +### Who do I talk to? ### + +* Repo owner or admin +* Other community or team contact \ No newline at end of file diff --git a/src/3rd_party/bson_c_lib/aclocal.m4 b/src/3rd_party/bson_c_lib/aclocal.m4 new file mode 100644 index 0000000000..05207cfdf0 --- /dev/null +++ b/src/3rd_party/bson_c_lib/aclocal.m4 @@ -0,0 +1,9751 @@ +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS + +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) + +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) + +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) + +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) + +# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.14' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.14.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.14.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/src/3rd_party/bson_c_lib/compile b/src/3rd_party/bson_c_lib/compile new file mode 100755 index 0000000000..531136b068 --- /dev/null +++ b/src/3rd_party/bson_c_lib/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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 2, 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 . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/3rd_party/bson_c_lib/config.guess b/src/3rd_party/bson_c_lib/config.guess new file mode 100755 index 0000000000..b79252d6b1 --- /dev/null +++ b/src/3rd_party/bson_c_lib/config.guess @@ -0,0 +1,1558 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2013 Free Software Foundation, Inc. + +timestamp='2013-06-10' + +# This file 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 . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2013 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/src/3rd_party/bson_c_lib/config.h.in b/src/3rd_party/bson_c_lib/config.h.in new file mode 100644 index 0000000000..26a7a34bd3 --- /dev/null +++ b/src/3rd_party/bson_c_lib/config.h.in @@ -0,0 +1,107 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t diff --git a/src/3rd_party/bson_c_lib/config.sub b/src/3rd_party/bson_c_lib/config.sub new file mode 100755 index 0000000000..9633db7046 --- /dev/null +++ b/src/3rd_party/bson_c_lib/config.sub @@ -0,0 +1,1791 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2013 Free Software Foundation, Inc. + +timestamp='2013-08-10' + +# This file 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 . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2013 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze*) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | c8051 | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 \ + | or1k | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze*) + basic_machine=microblaze-xilinx + ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i686-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or1k-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/src/3rd_party/bson_c_lib/configure b/src/3rd_party/bson_c_lib/configure new file mode 100755 index 0000000000..0fb2eb03d0 --- /dev/null +++ b/src/3rd_party/bson_c_lib/configure @@ -0,0 +1,15032 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for bson_c_lib 0.1. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and jacob@livio.io +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='bson_c_lib' +PACKAGE_TARNAME='bson_c_lib' +PACKAGE_VERSION='0.1' +PACKAGE_STRING='bson_c_lib 0.1' +PACKAGE_BUGREPORT='jacob@livio.io' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_unique_file="examples/sample.c" +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_shared +enable_static +with_pic +enable_fast_install +enable_dependency_tracking +with_gnu_ld +with_sysroot +enable_libtool_lock +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures bson_c_lib 0.1 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/bson_c_lib] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of bson_c_lib 0.1:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +bson_c_lib configure 0.1 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ----------------------------- ## +## Report this to jacob@livio.io ## +## ----------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_uintX_t +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by bson_c_lib $as_me 0.1, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.14' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='bson_c_lib' + VERSION='0.1' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +ac_config_headers="$ac_config_headers config.h" + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Checks for libraries. +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=no +fi + + + + + + + +# Checks for header files. +for ac_header in stddef.h stdint.h stdlib.h string.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + +# Checks for library functions. +for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 +_ACEOF + +fi + +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_malloc_0_nonnull=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes +else + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then : + +$as_echo "#define HAVE_MALLOC 1" >>confdefs.h + +else + $as_echo "#define HAVE_MALLOC 0" >>confdefs.h + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +$as_echo "#define malloc rpl_malloc" >>confdefs.h + +fi + + +for ac_func in memset +do : + ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" +if test "x$ac_cv_func_memset" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MEMSET 1 +_ACEOF + +fi +done + + +ac_config_files="$ac_config_files Makefile src/Makefile src/emhashmap/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by bson_c_lib $as_me 0.1, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +bson_c_lib config.status 0.1 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/emhashmap/Makefile") CONFIG_FILES="$CONFIG_FILES src/emhashmap/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool 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 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/src/3rd_party/bson_c_lib/configure.ac b/src/3rd_party/bson_c_lib/configure.ac new file mode 100644 index 0000000000..c883034ebb --- /dev/null +++ b/src/3rd_party/bson_c_lib/configure.ac @@ -0,0 +1,33 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT(bson_c_lib, 0.1, jacob@livio.io) +AM_INIT_AUTOMAKE +LT_INIT +AC_CONFIG_SRCDIR([examples/sample.c]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. +AC_ENABLE_SHARED +AC_DISABLE_STATIC + +# Checks for header files. +AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_CHECK_HEADER_STDBOOL +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_SIZE_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_FUNC_MALLOC +AC_CHECK_FUNCS([memset]) + +AC_OUTPUT(Makefile src/Makefile src/emhashmap/Makefile) diff --git a/src/3rd_party/bson_c_lib/depcomp b/src/3rd_party/bson_c_lib/depcomp new file mode 100755 index 0000000000..4ebd5b3a2f --- /dev/null +++ b/src/3rd_party/bson_c_lib/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2013-05-30.07; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. + +# 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 2, 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 . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/3rd_party/bson_c_lib/examples/sample.c b/src/3rd_party/bson_c_lib/examples/sample.c new file mode 100644 index 0000000000..628c3328b6 --- /dev/null +++ b/src/3rd_party/bson_c_lib/examples/sample.c @@ -0,0 +1,61 @@ +#include "../src/bson_object.h" +#include +BsonObject obj; + +void construct_object() { + printf("boolean value before: %i\n", BOOLEAN_TRUE); + bson_object_put_bool(&obj, "correct", BOOLEAN_TRUE); + bson_boolean getElement = bson_object_get_bool(&obj, "correct"); + printf("boolean value after: %i\n", getElement); + + bson_object_put_int32(&obj, "one", 64); + bson_object_put_double(&obj, "two", 2.5); + bson_object_put_string(&obj, "chars", "aaaaaaaaaaaa"); + + BsonObject subObj; + bson_object_initialize(&subObj, 1, 0.5f); + bson_object_put_int32(&subObj, "four", 64); + bson_object_put_object(&obj, "three", &subObj); + + BsonArray array; + bson_array_initialize(&array, 2); + bson_array_add_int32(&array, 23); + bson_array_add_double(&array, 5.4); + bson_array_add_string(&array, "A string"); + + BsonObject subObj2; + bson_object_initialize(&subObj2, 1, 0.5f); + bson_object_put_int32(&subObj2, "i", 64); + bson_array_add_object(&array, &subObj2); + + bson_object_put_array(&obj, "anArray", &array); + char objString[1024]; + printf("Constructed object: %s\n", bson_object_to_string(&obj, objString)); +} + +int main(int argc, char** argv) { + bson_object_initialize(&obj, 16, 0.5f); + construct_object(); + uint8_t *bytes = bson_object_to_bytes(&obj); + if (bytes == NULL) { + printf("Conversion to bytes failed\n"); + } + else { + int i = 0; + for (i = 0; i < bson_object_size(&obj); i++) { + if (i % 8 == 0) { + printf("\n"); + } + printf("0x%02hhx ", bytes[i]); + } + printf("\n\n"); + BsonObject parsedObj = bson_object_from_bytes(bytes); + char objString[1024]; + printf("Parsed object: %s\n", bson_object_to_string(&parsedObj, objString)); + bson_object_deinitialize(&parsedObj); + free(bytes); + } + + bson_object_deinitialize(&obj); + return 0; +} diff --git a/src/3rd_party/bson_c_lib/install-sh b/src/3rd_party/bson_c_lib/install-sh new file mode 100755 index 0000000000..377bb8687f --- /dev/null +++ b/src/3rd_party/bson_c_lib/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/3rd_party/bson_c_lib/ltmain.sh b/src/3rd_party/bson_c_lib/ltmain.sh new file mode 100644 index 0000000000..a356acafa4 --- /dev/null +++ b/src/3rd_party/bson_c_lib/ltmain.sh @@ -0,0 +1,9661 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" +TIMESTAMP="" +package_revision=1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/src/3rd_party/bson_c_lib/missing b/src/3rd_party/bson_c_lib/missing new file mode 100755 index 0000000000..db98974ff5 --- /dev/null +++ b/src/3rd_party/bson_c_lib/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2013-10-28.13; # UTC + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# 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 2, 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 . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/3rd_party/bson_c_lib/src/Makefile.am b/src/3rd_party/bson_c_lib/src/Makefile.am new file mode 100644 index 0000000000..81807aa62d --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/Makefile.am @@ -0,0 +1,11 @@ +SUBDIRS = emhashmap + +AM_CFLAGS = -Wall +AM_LDFLAGS = -lemhashmap + +includedir = /usr/local/include +include_HEADERS = bson_object.h bson_array.h bson_util.h + +lib_LTLIBRARIES = libbson.la +libbson_la_SOURCES = bson_object.c bson_array.c bson_util.c +libbson_la_LIBADD = emhashmap/libemhashmap.la diff --git a/src/3rd_party/bson_c_lib/src/Makefile.in b/src/3rd_party/bson_c_lib/src/Makefile.in new file mode 100644 index 0000000000..3a68b235bd --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/Makefile.in @@ -0,0 +1,769 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp $(include_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libbson_la_DEPENDENCIES = emhashmap/libemhashmap.la +am_libbson_la_OBJECTS = bson_object.lo bson_array.lo bson_util.lo +libbson_la_OBJECTS = $(am_libbson_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libbson_la_SOURCES) +DIST_SOURCES = $(libbson_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(include_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = /usr/local/include +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = emhashmap +AM_CFLAGS = -Wall +AM_LDFLAGS = -lemhashmap +include_HEADERS = bson_object.h bson_array.h bson_util.h +lib_LTLIBRARIES = libbson.la +libbson_la_SOURCES = bson_object.c bson_array.c bson_util.c +libbson_la_LIBADD = emhashmap/libemhashmap.la +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libbson.la: $(libbson_la_OBJECTS) $(libbson_la_DEPENDENCIES) $(EXTRA_libbson_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libbson_la_OBJECTS) $(libbson_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_array.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_object.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_util.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-includeHEADERS + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libLTLIBRARIES \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-includeHEADERS install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-includeHEADERS uninstall-libLTLIBRARIES + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/3rd_party/bson_c_lib/src/bson_array.c b/src/3rd_party/bson_c_lib/src/bson_array.c new file mode 100644 index 0000000000..edac6a1f02 --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/bson_array.c @@ -0,0 +1,391 @@ +#include "bson_array.h" + +bool bson_array_initialize(BsonArray *array, size_t initialCapacity) { + array->count = 0; + array->maxCount = initialCapacity; + array->elements = malloc(sizeof(BsonElement *) * initialCapacity); + return true; +} + +void bson_array_deinitialize(BsonArray *array) { + size_t i = 0; + for (i = 0; i < array->count; i++) { + BsonElement *element = array->elements[i]; + if (element->type == TYPE_DOCUMENT) { + bson_object_deinitialize((BsonObject *)element->value); + } + else if (element->type == TYPE_ARRAY) { + bson_array_deinitialize((BsonArray *)element->value); + } + free(element->value); + free(element); + } + + free(array->elements); +} + +size_t bson_array_size(BsonArray *array) { + size_t arraySize = ARRAY_OVERHEAD_BYTES; + size_t i = 0; + for (i = 0; i < array->count; i++) { + BsonElement *element = array->elements[i]; + arraySize += array_key_size(i) + ELEMENT_OVERHEAD_BYTES; + if (element->type == TYPE_DOCUMENT) { + arraySize += bson_object_size((BsonObject *)element->value); + } + else if (element->type == TYPE_ARRAY) { + arraySize += bson_array_size((BsonArray *)element->value); + } + else { + arraySize += element->size; + } + } + return arraySize; +} + +uint8_t *bson_array_to_bytes(BsonArray *array) { + size_t arraySize = bson_array_size(array); + uint8_t *bytes = malloc(arraySize); + size_t position = 0; + write_int32_le(bytes, (int32_t)arraySize, &position); + size_t i = 0; + for (i = 0; i < array->count; i++) { + BsonElement *element = array->elements[i]; + + bytes[position++] = element->type; + + uint8_t *keyBytes = index_to_key(i); + memcpy(&bytes[position], keyBytes, digits(i)); + free(keyBytes); + position += digits(i); + + //Null-terminate + bytes[position++] = 0x00; + + switch (element->type) { + case TYPE_DOCUMENT: { + BsonObject *obj = (BsonObject *)element->value; + uint8_t *objBytes = bson_object_to_bytes(obj); + if (objBytes == NULL) { + printf("An error occured while parsing the object with index \"%i\"\n", (int)i); + free(bytes); + return NULL; + } + size_t objSize = bson_object_size(obj); + memcpy(&bytes[position], objBytes, objSize); + free(objBytes); + position += objSize; + break; + } + case TYPE_ARRAY: { + BsonArray *subArray = (BsonArray *)element->value; + uint8_t *subArrayBytes = bson_array_to_bytes(subArray); + if (subArrayBytes == NULL) { + printf("An error occured while parsing the object with index \"%i\"\n", (int)i); + free(bytes); + return NULL; + } + size_t subArraySize = bson_array_size(subArray); + memset(&bytes[position], 0, subArraySize); + memcpy(&bytes[position], subArrayBytes, subArraySize); + free(subArrayBytes); + position += subArraySize; + break; + } + case TYPE_INT32: { + write_int32_le(bytes, *(int32_t *)element->value, &position); + break; + } + case TYPE_INT64: { + write_int64_le(bytes, *(int64_t *)element->value, &position); + break; + } + case TYPE_STRING: { + char *stringVal = (char *)element->value; + //String length is written first + write_int32_le(bytes, (int32_t)(strlen(stringVal) + 1), &position); + + uint8_t *stringBytes = string_to_byte_array(stringVal); + memcpy(&bytes[position], stringBytes, strlen(stringVal)); + free(stringBytes); + position += strlen(stringVal); + + //Null-terminate + bytes[position++] = 0x00; + break; + } + case TYPE_DOUBLE: { + write_double_le(bytes, *(double *)element->value, &position); + break; + } + case TYPE_BOOLEAN: { + bytes[position++] = (uint8_t)(*(bson_boolean *)element->value); + break; + } + default: { + printf("Unrecognized BSON type: %i\n", element->type); + position += sizeof(*element->value); + } + } + } + + bytes[position++] = DOCUMENT_END; + if (position != arraySize) { + printf("Something went horribly wrong. Unexpected size of array in bytes: %i, expected size: %i\n", (int)position, (int)arraySize); + free(bytes); + return NULL; + } + return bytes; +} + +BsonArray bson_array_from_bytes(uint8_t *data) { + uint8_t *current = data; + int32_t size = read_int32_le(¤t); + BsonArray array; + bson_array_initialize(&array, 10); + uint8_t type = *current; + current++; + while (type != DOCUMENT_END) { + char *key = byte_array_to_string(current); + current += strlen(key) + 1; + + switch ((element_type)type) { + case TYPE_DOCUMENT: { + BsonObject obj = bson_object_from_bytes(current); + bson_array_add_object(&array, &obj); + current += bson_object_size(&obj); + break; + } + case TYPE_ARRAY: { + BsonArray subArray = bson_array_from_bytes(current); + bson_array_add_array(&array, &subArray); + current += bson_array_size(&subArray); + break; + } + case TYPE_INT32: { + int32_t value = read_int32_le(¤t); + bson_array_add_int32(&array, value); + break; + } + case TYPE_INT64: { + int64_t value = read_int64_le(¤t); + bson_array_add_int64(&array, value); + break; + } + case TYPE_STRING: { + //String length is read first + int32_t stringLength = read_int32_le(¤t) - 1; + + char *stringVal = byte_array_to_bson_string(current, stringLength); + bson_array_add_string(&array, stringVal); + free(stringVal); + current += stringLength + 1; + break; + } + case TYPE_DOUBLE: { + double value = read_double_le(¤t); + bson_array_add_double(&array, value); + break; + } + case TYPE_BOOLEAN: { + bson_array_add_bool(&array, *current); + current++; + break; + } + default: { + printf("Unrecognized BSON type: %i\n", type); + } + } + free(key); + type = *current; + current++; + } + + if (data + size != current) { + printf("Unexpected parsed array size. Expected %i, got %i\n", (int) size, (int)(current - data)); + } + return array; +} + +char *bson_array_to_string(BsonArray *array, char *out) { + //TODO just move the pointer rather than keep a position variable + int position = 0; + position += sprintf(out, "[ "); + size_t i = 0; + for (i = 0; i < array->count; i++) { + BsonElement *element = array->elements[i]; + switch (element->type) { + case TYPE_DOCUMENT: { + char docString[512]; + position += sprintf(&out[position], "%s", bson_object_to_string(bson_array_get_object(array, i), docString)); + break; + } + case TYPE_ARRAY: { + char docString[512]; + position += sprintf(&out[position], "%s", bson_array_to_string(bson_array_get_array(array, i), docString)); + break; + } + case TYPE_INT32: { + position += sprintf(&out[position], "%i", (int)bson_array_get_int32(array, i)); + break; + } + case TYPE_INT64: { + position += sprintf(&out[position], "%li", (long)bson_array_get_int64(array, i)); + break; + } + case TYPE_STRING: { + position += sprintf(&out[position], "\"%s\"", bson_array_get_string(array, i)); + break; + } + case TYPE_DOUBLE: { + position += sprintf(&out[position], "%f", bson_array_get_double(array, i)); + break; + } + case TYPE_BOOLEAN: { + position += sprintf(&out[position], "%s", (bson_array_get_bool(array, i) == BOOLEAN_TRUE) ? "true" : "false"); + break; + } + default: { + printf("Unrecognized BSON type: %i\n", element->type); + position += sprintf(&out[position], "UNKNOWN_TYPE"); + } + } + if (i != (array->count - 1)) { + position += sprintf(&out[position], ", "); + } + } + sprintf(&out[position], " ]"); + + return out; +} + +bool bson_array_resize(BsonArray *array, size_t newSize) { + if (array->count > newSize) { + printf("Attempted to resize an array smaller than the number of elements it contains\n"); + return false; + } + int i = 0; + BsonElement **newArray = malloc(sizeof(BsonElement *) * newSize); + BsonElement **oldArray = array->elements; + for (i = 0; i < array->maxCount; i++) { + newArray[i] = oldArray[i]; + } + free(oldArray); + array->elements = newArray; + array->maxCount = newSize; + return true; +} + +bool bson_array_add_element(BsonArray *array, BsonElement *element, size_t allocSize) { + if (array->count == array->maxCount) { + if (!bson_array_resize(array, array->maxCount * 2)) { + return false; + } + } + BsonElement *allocElement = malloc(sizeof(BsonElement)); + allocElement->type = element->type; + allocElement->size = element->size; + allocElement->value = malloc(allocSize); + memcpy(allocElement->value, element->value, allocSize); + array->elements[array->count] = allocElement; + array->count++; + return true; +} + +/* + @brief Add a new element to the end of a given array + + @param array - The array to be modified + @param type - The type of the element to be added + @param value - The value of the element to be added + @param allocSize - The size, in bytes, to be allocated for the element + @param elementSize - The size, in bytes, of the element when converted to BSON format + + @return - true if the addition was successful, false if not +*/ +bool bson_array_add(BsonArray *array, element_type type, void *value, size_t allocSize, size_t elementSize) { + BsonElement element; + element.type = type; + element.value = value; + element.size = elementSize; + return bson_array_add_element(array, &element, allocSize); +} + +bool bson_array_add_object(BsonArray *array, BsonObject *value) { + return bson_array_add(array, TYPE_DOCUMENT, value, sizeof(BsonObject), 0); +} + +bool bson_array_add_array(BsonArray *array, BsonArray *value) { + return bson_array_add(array, TYPE_ARRAY, value, sizeof(BsonArray), 0); +} + +bool bson_array_add_int32(BsonArray *array, int32_t value) { + return bson_array_add(array, TYPE_INT32, &value, sizeof(int32_t), + SIZE_INT32); +} + +bool bson_array_add_int64(BsonArray *array, int64_t value) { + return bson_array_add(array, TYPE_INT64, &value, sizeof(int64_t), + SIZE_INT64); +} + +bool bson_array_add_string(BsonArray *array, char *value) { + return bson_array_add(array, TYPE_STRING, value, (strlen(value) + 1) * sizeof(char), + strlen(value) + STRING_OVERHEAD_BYTES); +} + +bool bson_array_add_bool(BsonArray *array, bson_boolean value) { + return bson_array_add(array, TYPE_BOOLEAN, &value, sizeof(bson_boolean), + SIZE_BOOLEAN); +} + +bool bson_array_add_double(BsonArray *array, double value) { + return bson_array_add(array, TYPE_DOUBLE, &value, sizeof(double), + SIZE_DOUBLE); +} + +BsonElement *bson_array_get(BsonArray *array, size_t index) { + return (index >= array->count) ? NULL : array->elements[index]; +} + +BsonObject *bson_array_get_object(BsonArray *array, size_t index) { + BsonElement *element = bson_array_get(array, index); + return (element == NULL || element->type != TYPE_DOCUMENT) ? + NULL : (BsonObject *)element->value; +} + +BsonArray *bson_array_get_array(BsonArray *array, size_t index) { + BsonElement *element = bson_array_get(array, index); + return (element == NULL || element->type != TYPE_ARRAY) ? + NULL : (BsonArray *)element->value; +} + +int32_t bson_array_get_int32(BsonArray *array, size_t index) { + BsonElement *element = bson_array_get(array, index); + return (element == NULL || element->type != TYPE_INT32) ? + -1 : *(int32_t *)element->value; +} + +int64_t bson_array_get_int64(BsonArray *array, size_t index) { + BsonElement *element = bson_array_get(array, index); + return (element == NULL || element->type != TYPE_INT64) ? + -1 : *(int64_t *)element->value; +} + +char *bson_array_get_string(BsonArray *array, size_t index) { + BsonElement *element = bson_array_get(array, index); + return (element == NULL || element->type != TYPE_STRING) ? + NULL : (char *)element->value; +} + +bson_boolean bson_array_get_bool(BsonArray *array, size_t index) { + BsonElement *element = bson_array_get(array, index); + return (element == NULL || element->type != TYPE_BOOLEAN) ? + BOOLEAN_INVALID : *(bson_boolean *)element->value; +} + +double bson_array_get_double(BsonArray *array, size_t index) { + BsonElement *element = bson_array_get(array, index); + return (element == NULL || element->type != TYPE_DOUBLE) ? + -1 : *(double *)element->value; +} diff --git a/src/3rd_party/bson_c_lib/src/bson_array.h b/src/3rd_party/bson_c_lib/src/bson_array.h new file mode 100644 index 0000000000..a61498f17e --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/bson_array.h @@ -0,0 +1,230 @@ +#ifndef BSON_ARRAY_H +#define BSON_ARRAY_H + +#include "bson_object.h" + +typedef struct BsonElement BsonElement; +typedef struct BsonObject BsonObject; + +typedef enum bson_boolean bson_boolean; +typedef enum element_type element_type; + +//Object representing a BSON array +struct BsonArray { + //Array of BSON elements + BsonElement **elements; + //Number of elements currently in the array + size_t count; + //The current maximum number of elements in the array + size_t maxCount; +}; +typedef struct BsonArray BsonArray; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + @brief Initalize BSON Array + + @param array - The uninitialized BSON Array + @param initialSize - The initial maximum size of the array + + @return - true if the array was initialized successfully, false if not +*/ +bool bson_array_initialize(BsonArray *array, size_t initialCapacity); +/* + @brief Deinitalize BSON Array, free all associated memory, + and recursively clean up all sub-objects + + @param array - The BSON Array to be deinitalized +*/ +void bson_array_deinitialize(BsonArray *array); + +/* + @brief Calculate the size, in bytes, of a given array when converted to a BSON document + + @param obj - The BSON array from which the size is calculated + + @return - The calculated size +*/ +size_t bson_array_size(BsonArray *array); + +/* + @brief Get the BSON represention of an array + + @param array - The array to be converted to BSON + + @return - A byte array containing the BSON representation of the array, + this data must be freed by the caller after use +*/ +uint8_t *bson_array_to_bytes(BsonArray *array); +/* + @brief Parse BSON data into an array + + @param data - The BSON data to be parsed + + @return - The BSON array created from the BSON data +*/ +BsonArray bson_array_from_bytes(uint8_t *data); + +/* + @brief Get a JSON string representation of a BSON array + + @param array - The array to be converted to a JSON string + @param out - The output string of the function + + @return - The value of out +*/ +char *bson_array_to_string(BsonArray *array, char *out); + +/* + @brief Add a BSON object to the end of a given array + + @param array - The array to be modified + @param value - The pointer to the BSON object to be added + + @return - true if the addition was successful, false if not +*/ +bool bson_array_add_object(BsonArray *array, BsonObject *value); +/* + @brief Add a BSON array to the end of a given array + + @param array - The array to be modified + @param value - The pointer to the BSON array to be added + + @return - true if the addition was successful, false if not +*/ +bool bson_array_add_array(BsonArray *array, BsonArray *value); +/* + @brief Add a 32-bit integer value to the end of a given array + + @param array - The array to be modified + @param value - The integer value to be added + + @return - true if the addition was successful, false if not +*/ +bool bson_array_add_int32(BsonArray *array, int32_t value); +/* + @brief Add a 64-bit integer value to the end of a given array + + @param array - The array to be modified + @param value - The integer value to be added + + @return - true if the addition was successful, false if not +*/ +bool bson_array_add_int64(BsonArray *array, int64_t value); +/* + @brief Add a string value to the end of a given array + + @param array - The array to be modified + @param value - The string value to be added + + @return - true if the addition was successful, false if not +*/ +bool bson_array_add_string(BsonArray *array, char *value); +/* + @brief Add a boolean value to the end of a given array + + @param array - The array to be modified + @param value - The boolean value to be added + + @return - true if the addition was successful, false if not +*/ +bool bson_array_add_bool(BsonArray *array, bson_boolean value); +/* + @brief Add a floating-point value to the end of a given array + + @param array - The array to be modified + @param value - The floating-point value to be added + + @return - true if the addition was successful, false if not +*/ +bool bson_array_add_double(BsonArray *array, double value); + +/* + @brief Retrieve the object at a specified index + + @param array - The array to be accessed + @param index - The index of the object within the array + + @return - The BSON element at the given index if it exists, + NULL if the index is out of bounds +*/ +BsonElement *bson_array_get(BsonArray *array, size_t index); +/* + @brief Retrieve the BSON object at a specified index in an array + + @param array - The array to be accessed + @param index - The index of the BSON object within the array + + @return - The pointer to the BSON object at the given index if it exists, + NULL if the index is out of bounds or the value is not a BSON object +*/ +BsonObject *bson_array_get_object(BsonArray *array, size_t index); +/* + @brief Retrieve the BSON array at a specified index in an array + + @param array - The array to be accessed + @param index - The index of the BSON array within the array + + @return - The pointer to the BSON array at the given index if it exists, + NULL if the index is out of bounds or the value is not a BSON array +*/ +BsonArray *bson_array_get_array(BsonArray *array, size_t index); +/* + @brief Retrieve the 32-bit integer value at a specified index in an array + + @param array - The array to be accessed + @param index - The index of the integer value within the array + + @return - The integer value at the given index if it exists, + NULL if the index is out of bounds or the value is not a 32-bit integer +*/ +int32_t bson_array_get_int32(BsonArray *array, size_t index); +/* + @brief Retrieve the 64-bit integer value at a specified index in an array + + @param array - The array to be accessed + @param index - The index of the integer value within the array + + @return - The integer value at the given index if it exists, + NULL if the index is out of bounds or the value is not a 64-bit integer +*/ +int64_t bson_array_get_int64(BsonArray *array, size_t index); +/* + @brief Retrieve the string value at a specified index in an array + + @param array - The array to be accessed + @param index - The index of the string value within the array + + @return - The string value at the given index if it exists, + NULL if the index is out of bounds or the value is not a string +*/ +char *bson_array_get_string(BsonArray *array, size_t index); +/* + @brief Retrieve the boolean value at a specified index in an array + + @param array - The array to be accessed + @param index - The index of the string value within the array + + @return - The boolean value at the given index if it exists, + NULL if the index is out of bounds or the value is not a boolean +*/ +bson_boolean bson_array_get_bool(BsonArray *array, size_t index); +/* + @brief Retrieve the floating-point value at a specified index in an array + + @param array - The array to be accessed + @param index - The index of the floating-point value within the array + + @return - The floating-point value at the given index if it exists, + NULL if the index is out of bounds or the value is not a floating-point number +*/ +double bson_array_get_double(BsonArray *array, size_t index); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/3rd_party/bson_c_lib/src/bson_object.c b/src/3rd_party/bson_c_lib/src/bson_object.c new file mode 100644 index 0000000000..b517789027 --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/bson_object.c @@ -0,0 +1,404 @@ +#include "bson_object.h" +#define DEFAULT_MAP_SIZE 32 + +size_t hash_function(const char* key, size_t maxValue) { + size_t keyLength = strlen(key); + size_t hash = 0; + int i; + for (i = 0; i < keyLength; i++) { + hash += key[i]; + hash %= maxValue; + } + return hash; +} + +bool bson_object_initialize(BsonObject *obj, size_t capacity, float loadFactor) { + return emhashmap_initialize(&obj->data, (int)capacity, loadFactor, &hash_function); +} + +bool bson_object_initialize_default(BsonObject *obj) { + return bson_object_initialize(obj, DEFAULT_MAP_SIZE, 0.5f); +} + +void bson_object_deinitialize(BsonObject *obj) { + MapIterator iterator = emhashmap_iterator(&obj->data); + MapEntry *current = emhashmap_iterator_next(&iterator); + while (current != NULL) { + BsonElement *element = (BsonElement *)current->value; + if (element->type == TYPE_DOCUMENT) { + bson_object_deinitialize((BsonObject *)element->value); + } + else if (element->type == TYPE_ARRAY) { + bson_array_deinitialize((BsonArray *)element->value); + } + free(element->value); + free(element); + current = emhashmap_iterator_next(&iterator); + } + + emhashmap_deinitialize(&obj->data); +} + +size_t bson_object_size(BsonObject *obj) { + size_t objSize = OBJECT_OVERHEAD_BYTES; + MapIterator iterator = emhashmap_iterator(&obj->data); + MapEntry *current = emhashmap_iterator_next(&iterator); + while (current != NULL) { + BsonElement *element = (BsonElement *)current->value; + objSize += object_key_size(current->key) + ELEMENT_OVERHEAD_BYTES; + if (element->type == TYPE_DOCUMENT) { + objSize += bson_object_size((BsonObject *)element->value); + } + else if (element->type == TYPE_ARRAY) { + objSize += bson_array_size((BsonArray *)element->value); + } + else { + objSize += element->size; + } + current = emhashmap_iterator_next(&iterator); + } + return objSize; +} + +uint8_t *bson_object_to_bytes(BsonObject *obj) { + //TODO just move the pointer rather than keep a position variable + MapIterator iterator = emhashmap_iterator(&obj->data); + MapEntry *current = emhashmap_iterator_next(&iterator); + size_t objSize = bson_object_size(obj); + uint8_t *bytes = malloc(objSize); + size_t position = 0; + write_int32_le(bytes, (int32_t)objSize, &position); + + while (current != NULL) { + BsonElement *element = (BsonElement *)current->value; + + bytes[position++] = element->type; + + uint8_t *keyBytes = string_to_byte_array(current->key); + memcpy(&bytes[position], keyBytes, strlen(current->key)); + free(keyBytes); + position += strlen(current->key); + + //Null-terminate + bytes[position++] = 0x00; + + switch (element->type) { + case TYPE_DOCUMENT: { + BsonObject *subObject = (BsonObject *)element->value; + uint8_t *subObjectBytes = bson_object_to_bytes(subObject); + if (subObjectBytes == NULL) { + printf("An error occured while parsing the object with key \"%s\"\n", current->key); + free(bytes); + return NULL; + } + size_t subObjectSize = bson_object_size(subObject); + memcpy(&bytes[position], subObjectBytes, subObjectSize); + free(subObjectBytes); + position += subObjectSize; + break; + } + case TYPE_ARRAY: { + BsonArray *array = (BsonArray *)element->value; + uint8_t *arrayBytes = bson_array_to_bytes(array); + if (arrayBytes == NULL) { + printf("An error occured while parsing the object with key \"%s\"\n", current->key); + free(bytes); + return NULL; + } + size_t arraySize = bson_array_size(array); + memset(&bytes[position], 0, arraySize); + memcpy(&bytes[position], arrayBytes, arraySize); + free(arrayBytes); + position += arraySize; + break; + } + case TYPE_INT32: { + write_int32_le(bytes, *(int32_t *)element->value, &position); + break; + } + case TYPE_INT64: { + write_int64_le(bytes, *(int64_t *)element->value, &position); + break; + } + case TYPE_STRING: { + char *stringVal = (char *)element->value; + //String length is written first + write_int32_le(bytes, (int32_t)(strlen(stringVal) + 1), &position); + + uint8_t *stringBytes = string_to_byte_array(stringVal); + memcpy(&bytes[position], stringBytes, strlen(stringVal)); + free(stringBytes); + position += strlen(stringVal); + + //Null-terminate + bytes[position++] = 0x00; + break; + } + case TYPE_DOUBLE: { + write_double_le(bytes, *(double *)element->value, &position); + break; + } + case TYPE_BOOLEAN: { + bytes[position++] = (uint8_t)(*(bson_boolean *)element->value); + break; + } + default: { + printf("Unrecognized BSON type: %i\n", element->type); + position += sizeof(element->value); + } + } + current = emhashmap_iterator_next(&iterator); + } + + bytes[position++] = DOCUMENT_END; + if (position != objSize) { + printf("Something went horribly wrong. Unexpected size of map in bytes: %i, expected size: %i\n", (int)position, (int)objSize); + free(bytes); + return NULL; + } + return bytes; +} + +BsonObject bson_object_from_bytes(uint8_t *data) { + uint8_t *current = data; + int32_t size = read_int32_le(¤t); + BsonObject obj; + bson_object_initialize_default(&obj); + uint8_t type = *current; + current++; + while (type != DOCUMENT_END) { + char *key = byte_array_to_string(current); + current += strlen(key) + 1; + + switch ((element_type)type) { + case TYPE_DOCUMENT: { + BsonObject subObject = bson_object_from_bytes(current); + bson_object_put_object(&obj, key, &subObject); + current += bson_object_size(&subObject); + break; + } + case TYPE_ARRAY: { + BsonArray array = bson_array_from_bytes(current); + bson_object_put_array(&obj, key, &array); + current += bson_array_size(&array); + break; + } + case TYPE_INT32: { + int32_t value = read_int32_le(¤t); + bson_object_put_int32(&obj, key, value); + break; + } + case TYPE_INT64: { + int64_t value = read_int64_le(¤t); + bson_object_put_int64(&obj, key, value); + break; + } + case TYPE_STRING: { + //String length is read first + int32_t stringLength = read_int32_le(¤t) - 1; + + char *stringVal = byte_array_to_bson_string(current, stringLength); + bson_object_put_string(&obj, key, stringVal); + free(stringVal); + current += stringLength + 1; + break; + } + case TYPE_DOUBLE: { + double value = read_double_le(¤t); + bson_object_put_double(&obj, key, value); + break; + } + case TYPE_BOOLEAN: { + bson_object_put_bool(&obj, key, *current); + current++; + break; + } + default: { + printf("Unrecognized BSON type: %i\n", type); + } + } + free(key); + type = *current; + current++; + } + + if (data + size != current) { + printf("Unexpected parsed object size. Expected %i, got %i\n", (int) size, (int)(current - data)); + } + return obj; +} + +char *bson_object_to_string(BsonObject *obj, char *out) { + //TODO just move the pointer rather than keep a position variable + int position = 0; + MapIterator iterator = emhashmap_iterator(&obj->data); + MapEntry *current = emhashmap_iterator_next(&iterator); + position += sprintf(out, "{ "); + while (current != NULL) { + BsonElement *element = (BsonElement *)current->value; + position += sprintf(&out[position], "\"%s\":", current->key); + switch (element->type) { + case TYPE_DOCUMENT: { + char docString[512]; + position += sprintf(&out[position], "%s", bson_object_to_string(bson_object_get_object(obj, current->key), docString)); + break; + } + case TYPE_ARRAY: { + char docString[512]; + position += sprintf(&out[position], "%s", bson_array_to_string(bson_object_get_array(obj, current->key), docString)); + break; + } + case TYPE_INT32: { + position += sprintf(&out[position], "%i", (int)bson_object_get_int32(obj, current->key)); + break; + } + case TYPE_INT64: { + position += sprintf(&out[position], "%li", (long)bson_object_get_int64(obj, current->key)); + break; + } + case TYPE_STRING: { + position += sprintf(&out[position], "\"%s\"", bson_object_get_string(obj, current->key)); + break; + } + case TYPE_DOUBLE: { + position += sprintf(&out[position], "%f", bson_object_get_double(obj, current->key)); + break; + } + case TYPE_BOOLEAN: { + position += sprintf(&out[position], "%s", (bson_object_get_bool(obj, current->key) == BOOLEAN_TRUE) ? "true" : "false"); + break; + } + default: { + printf("Unrecognized BSON type: %i\n", element->type); + position += sprintf(&out[position], "UNKNOWN_TYPE"); + } + } + current = emhashmap_iterator_next(&iterator); + if (current != NULL) { + position += sprintf(&out[position], ", "); + } + } + sprintf(&out[position], " }"); + + return out; +} + +bool bson_object_put_element(BsonObject *obj, const char *key, BsonElement *element, size_t allocSize) { + BsonElement *allocElement = malloc(sizeof(BsonElement)); + allocElement->type = element->type; + allocElement->size = element->size; + allocElement->value = malloc(allocSize); + memcpy(allocElement->value, element->value, allocSize); + BsonElement *existingElement = emhashmap_remove(&obj->data, key); + if (existingElement != NULL) { + if (existingElement->type == TYPE_DOCUMENT) { + bson_object_deinitialize((BsonObject *)existingElement->value); + } + else if (existingElement->type == TYPE_ARRAY) { + bson_array_deinitialize((BsonArray *)existingElement->value); + } + free(existingElement->value); + free(existingElement); + } + return emhashmap_put(&obj->data, key, (void *)allocElement); +} + +bool bson_object_put(BsonObject *obj, const char *key, element_type type, void *value, size_t allocSize, size_t elementSize) { + BsonElement element; + element.type = type; + element.value = value; + element.size = elementSize; + return bson_object_put_element(obj, key, &element, allocSize); +} + +bool bson_object_put_object(BsonObject *obj, const char *key, BsonObject *value) { + return bson_object_put(obj, key, TYPE_DOCUMENT, value, sizeof(BsonObject), 0); +} + +bool bson_object_put_array(BsonObject *obj, const char *key, BsonArray *value) { + return bson_object_put(obj, key, TYPE_ARRAY, value, sizeof(BsonArray), 0); +} + +bool bson_object_put_int32(BsonObject *obj, const char *key, int32_t value) { + return bson_object_put(obj, key, TYPE_INT32, &value, sizeof(int32_t), + SIZE_INT32); +} + +bool bson_object_put_int64(BsonObject *obj, const char *key, int64_t value) { + return bson_object_put(obj, key, TYPE_INT64, &value, sizeof(int64_t), + SIZE_INT64); +} + +bool bson_object_put_string(BsonObject *obj, const char *key, char *value) { + return bson_object_put(obj, key, TYPE_STRING, value, (strlen(value) + 1) * sizeof(char), + strlen(value) + STRING_OVERHEAD_BYTES); +} + +bool bson_object_put_bool(BsonObject *obj, const char *key, bson_boolean value) { + return bson_object_put(obj, key, TYPE_BOOLEAN, &value, sizeof(bson_boolean), + SIZE_BOOLEAN); +} + +bool bson_object_put_double(BsonObject *obj, const char *key, double value) { + return bson_object_put(obj, key, TYPE_DOUBLE, &value, sizeof(double), + SIZE_DOUBLE); +} + +BsonElement *bson_object_get(BsonObject *obj, const char *key) { + MapEntry *entry = emhashmap_get(&obj->data, key); + return (entry == NULL) ? NULL : entry->value; +} + +BsonObject *bson_object_get_object(BsonObject *obj, const char *key) { + BsonElement *element = bson_object_get(obj, key); + return (element == NULL || element->type != TYPE_DOCUMENT) ? + NULL : (BsonObject *)element->value; +} + +BsonArray *bson_object_get_array(BsonObject *obj, const char *key) { + BsonElement *element = bson_object_get(obj, key); + return (element == NULL || element->type != TYPE_ARRAY) ? + NULL : (BsonArray *)element->value; +} + +int32_t bson_object_get_int32(BsonObject *obj, const char *key) { + BsonElement *element = bson_object_get(obj, key); + return (element == NULL || element->type != TYPE_INT32) ? + -1 : *(int32_t *)element->value; +} + +int64_t bson_object_get_int64(BsonObject *obj, const char *key) { + BsonElement *element = bson_object_get(obj, key); + return (element == NULL || element->type != TYPE_INT64) ? + -1 : *(int64_t *)element->value; +} + +char *bson_object_get_string(BsonObject *obj, const char *key) { + BsonElement *element = bson_object_get(obj, key); + return (element == NULL || element->type != TYPE_STRING) ? + NULL : (char *)element->value; +} + +bson_boolean bson_object_get_bool(BsonObject *obj, const char *key) { + BsonElement *element = bson_object_get(obj, key); + return (element == NULL || element->type != TYPE_BOOLEAN) ? + BOOLEAN_INVALID : *(bson_boolean *)element->value; +} + +double bson_object_get_double(BsonObject *obj, const char *key) { + BsonElement *element = bson_object_get(obj, key); + return (element == NULL || element->type != TYPE_DOUBLE) ? + -1 : *(double *)element->value; +} + +MapIterator bson_object_iterator(BsonObject *obj) { + return emhashmap_iterator(&obj->data); +} + +BsonObjectEntry bson_object_iterator_next(MapIterator *iterator) { + MapEntry *entry = emhashmap_iterator_next(iterator); + BsonObjectEntry bsonEntry; + strncpy(bsonEntry.key, entry->key, 255); + bsonEntry.element = (BsonElement *)entry->value; + return bsonEntry; +} \ No newline at end of file diff --git a/src/3rd_party/bson_c_lib/src/bson_object.h b/src/3rd_party/bson_c_lib/src/bson_object.h new file mode 100644 index 0000000000..77179310e5 --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/bson_object.h @@ -0,0 +1,290 @@ +#ifndef BSON_OBJECT_H +#define BSON_OBJECT_H + +#include +#include + +#include "bson_util.h" +#include "bson_array.h" +#include "emhashmap/emhashmap.h" + +typedef struct BsonArray BsonArray; + +typedef enum element_type element_type; +typedef enum bson_boolean bson_boolean; + +struct BsonObject { + //Internal map implementation + HashMap data; +}; +typedef struct BsonObject BsonObject; + +struct BsonElement { + //The value of this element + void *value; + //The data type of this element + element_type type; + //Size of the element in bytes when converted to BSON + //Unused for TYPE_DOCUMENT and TYPE_ARRAY + size_t size; +}; +typedef struct BsonElement BsonElement; + +struct BsonObjectEntry { + char key[255]; + BsonElement *element; +}; +typedef struct BsonObjectEntry BsonObjectEntry; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + @brief Initalize BSON Object + + @param obj - The uninitialized BSON Object + @param size - The maximum capacity of the map used to store object data + @param loadFactor - The load factor of the map used to store object data + + @return - true if the object was initialized successfully, false if not +*/ +bool bson_object_initialize(BsonObject *obj, size_t capacity, float loadFactor); +/* + @brief Initalize BSON object with default map size (64) and load factor (0.5) + + @param obj - The uninitialized BSON Object + + @return - true if the object was initialized successfully, false if not +*/ +bool bson_object_initialize_default(BsonObject *obj); +/* + @brief Deinitalize BSON object, free all associated memory, + and recursively clean up all sub-objects + + @param obj - The BSON object to be deinitalized +*/ +void bson_object_deinitialize(BsonObject *obj); + +/* + @brief Calculate the size, in bytes, of a given object when converted to a BSON document + + @param obj - The BSON object from which the size is calculated + + @return - The calculated size +*/ +size_t bson_object_size(BsonObject *obj); + +/* + @brief Get the BSON represention of an object + + @param obj - The array to be converted to BSON + + @return - A byte array containing the BSON representation of the object, + this data must be freed by the caller after use +*/ +uint8_t *bson_object_to_bytes(BsonObject *obj); +/* + @brief Parse BSON data into an object + + @param data - The BSON data to be parsed + + @return - The BSON object created from the BSON data +*/ +BsonObject bson_object_from_bytes(uint8_t *data); + +/* + @brief Get a JSON string representation of a BSON object + + @param obj - The object to be converted to a JSON string + @param out - The output string of the function + + @return - The value of out +*/ +char *bson_object_to_string(BsonObject *obj, char *out); + +/* + @brief Put a new BSON object into a given object + + @param obj - The object to be modified + @param key - The key used to reference the new object + (if it matches an existing key, + the associated value will be overwritten) + @param value - The pointer to the BSON object to be added to the object + + @return - true if the value was set successfully, false if not +*/ +bool bson_object_put_object(BsonObject *obj, const char *key, BsonObject *value); +/* + @brief Put a new BSON array into a given object + + @param obj - The object to be modified + @param key - The key used to reference the new array + (if it matches an existing key, + the associated value will be overwritten) + @param value - The pointer to the BSON array to be added to the object + + @return - true if the value was set successfully, false if not +*/ +bool bson_object_put_array(BsonObject *obj, const char *key, BsonArray *value); +/* + @brief Put a new 32-bit integer value into a given object + + @param obj - The object to be modified + @param key - The key used to reference the new integer value + (if it matches an existing key, + the associated value will be overwritten) + @param value - The integer value to be added to the object + + @return - true if the value was set successfully, false if not +*/ +bool bson_object_put_int32(BsonObject *obj, const char *key, int32_t value); +/* + @brief Put a new 64-bit integer value into a given object + + @param obj - The object to be modified + @param key - The key used to reference the new integer value + (if it matches an existing key, + the associated value will be overwritten) + @param value - The integer value to be added to the object + + @return - true if the value was set successfully, false if not +*/ +bool bson_object_put_int64(BsonObject *obj, const char *key, int64_t value); +/* + @brief Put a new string value into a given object + + @param obj - The object to be modified + @param key - The key used to reference the new string value + (if it matches an existing key, + the associated value will be overwritten) + @param value - The string value to be added to the object + + @return - true if the value was set successfully, false if not +*/ +bool bson_object_put_string(BsonObject *obj, const char *key, char *value); +/* + @brief Put a new boolean value into a given object + + @param obj - The object to be modified + @param key - The key used to reference the new boolean value + (if it matches an existing key, + the associated value will be overwritten) + @param value - The boolean value to be added to the object + + @return - true if the value was set successfully, false if not +*/ +bool bson_object_put_bool(BsonObject *obj, const char *key, bson_boolean value); +/* + @brief Put a new floating-point value into a given object + + @param obj - The object to be modified + @param key - The key used to reference the new floating-point value + (if it matches an existing key, + the associated value will be overwritten) + @param value - The floating-point value to be added to the object + + @return - true if the value was set successfully, false if not +*/ +bool bson_object_put_double(BsonObject *obj, const char *key, double value); + +/* + @brief Put a new element into a given object + + @param obj - The object to be modified + @param key - The key used to reference the new element + @param type - The type of the element to be added + @param value - The value of the element to be added + @param allocSize - The size, in bytes, to be allocated for the element + @param elementSize - The size, in bytes, of the element when converted to BSON format + + @return - true if the addition was successful, false if not +*/ +BsonElement *bson_object_get(BsonObject *obj, const char *key); +/* + @brief Retrieve the BSON object to which the specified key is mapped in an object + + @param obj - The object to be accessed + @param key - The key associated with the object to be retrieved + + @return - The pointer to the BSON object mapped to the given key if it exists, NULL otherwise +*/ +BsonObject *bson_object_get_object(BsonObject *obj, const char *key); +/* + @brief Retrieve the BSON array to which the specified key is mapped in an object + + @param obj - The object to be accessed + @param key - The key associated with the array to be retrieved + + @return - The pointer to the BSON array mapped to the given key if it exists, NULL otherwise +*/ +BsonArray *bson_object_get_array(BsonObject *obj, const char *key); +/* + @brief Retrieve the 32-bit integer value to which the specified key is mapped in an object + + @param obj - The object to be accessed + @param key - The key associated with the integer value to be retrieved + + @return - The 32-bit integer value mapped to the given key if it exists, NULL otherwise +*/ +int32_t bson_object_get_int32(BsonObject *obj, const char *key); +/* + @brief Retrieve the 64-bit integer value to which the specified key is mapped in an object + + @param obj - The object to be accessed + @param key - The key associated with the integer value to be retrieved + + @return - The 64-bit integer value mapped to the given key if it exists, NULL otherwise +*/ +int64_t bson_object_get_int64(BsonObject *obj, const char *key); +/* + @brief Retrieve the string value to which the specified key is mapped in an object + + @param obj - The object to be accessed + @param key - The key associated with the string value to be retrieved + + @return - The string value mapped to the given key if it exists, NULL otherwise +*/ +char *bson_object_get_string(BsonObject *obj, const char *key); +/* + @brief Retrieve the boolean value to which the specified key is mapped in an object + + @param obj - The object to be accessed + @param key - The key associated with the boolean value to be retrieved + + @return - The boolean value mapped to the given key if it exists, NULL otherwise +*/ +bson_boolean bson_object_get_bool(BsonObject *obj, const char *key); +/* + @brief Retrieve the floating-point value to which the specified key is mapped in an object + + @param obj - The object to be accessed + @param key - The key associated with the floating-point value to be retrieved + + @return - The floating-point value mapped to the given key if it exists, NULL otherwise +*/ +double bson_object_get_double(BsonObject *obj, const char *key); + +/* + @brief Get an iterator for a given BSON object + + @param obj - The object from which the iterator is created + + @return - The iterator +*/ +MapIterator bson_object_iterator(BsonObject *obj); +/* + @brief Get the next value from an object iterator + + @param iterator - The iterator to be advanced + + @return - The next BSON object entry in the object if it exists, + NULL if the iterator has moved past the end of the entry list +*/ +BsonObjectEntry bson_object_iterator_next(MapIterator *iterator); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/3rd_party/bson_c_lib/src/bson_util.c b/src/3rd_party/bson_c_lib/src/bson_util.c new file mode 100644 index 0000000000..223cb5d96b --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/bson_util.c @@ -0,0 +1,136 @@ +#include "bson_util.h" + +void write_int32_le(uint8_t *bytes, int32_t value, size_t *position) { + int i = 0; + for (i = 0; i < SIZE_INT32; i++) { + bytes[(*position)++] = (uint8_t)value & 0x000000FF; + value >>= 8; + } +} + +void write_int64_le(uint8_t *bytes, int64_t value, size_t *position) { + int i = 0; + for (i = 0; i < SIZE_INT64; i++) { + bytes[(*position)++] = (uint8_t)value & 0x000000FFull; + value >>= 8; + } +} + +void write_double_le(uint8_t *bytes, double value, size_t *position) { + union doubleUnion_t { + double value; + uint64_t intValue; + }; + union doubleUnion_t unionVal; + unionVal.value = value; + int i = 0; + for (i = 0; i < SIZE_DOUBLE; i++) { + bytes[(*position)++] = (uint8_t)unionVal.intValue & 0x000000FFull; + unionVal.intValue >>= 8; + } +} + +int32_t read_int32_le(uint8_t **bytes) { + int32_t value = 0; + int i = 0; + for (i = SIZE_INT32 - 1; i >= 0; i--) { + value <<= 8; + value += (*bytes)[i]; + } + (*bytes) += SIZE_INT32; + return value; +} + +int64_t read_int64_le(uint8_t **bytes) { + int32_t value = 0; + int i = 0; + for (i = SIZE_INT64 - 1; i >= 0; i--) { + value <<= 8; + value += (*bytes)[i]; + } + (*bytes) += SIZE_INT64; + return value; +} + +double read_double_le(uint8_t **bytes) { + union doubleUnion_t { + double value; + uint64_t intValue; + }; + union doubleUnion_t unionVal; + unionVal.intValue = 0; + int i = 0; + for (i = SIZE_DOUBLE - 1; i >= 0; i--) { + unionVal.intValue <<= 8; + unionVal.intValue += (*bytes)[i]; + } + (*bytes) += SIZE_DOUBLE; + return unionVal.value; +} + +uint8_t *string_to_byte_array(char *stringVal) { + size_t length = strlen(stringVal); + uint8_t *bytes = malloc(length + 1); + int i = 0; + for (i = 0; i < length; i++) { + bytes[i] = stringVal[i]; + } + bytes[length] = 0x00; + return bytes; +} + +size_t c_string_length(uint8_t *value) { + size_t length = 0; + while (value[length] != 0x00) { + length++; + } + return length; +} + +char *byte_array_to_string(uint8_t *bytes) { + size_t length = c_string_length(bytes); + return byte_array_to_bson_string(bytes, length); +} + +char *byte_array_to_bson_string(uint8_t *bytes, size_t length) { + char *stringVal = malloc(sizeof(char) * (length + 1)); + + int i = 0; + for (i = 0; i < length; i++) { + stringVal[i] = bytes[i] & 0xFF; + } + stringVal[length] = 0x00; + return stringVal; +} + +uint8_t *index_to_key(size_t index) { + size_t length = digits(index); + uint8_t *bytes = malloc(length); + size_t modValue = index; + int i = 0; + for (i = (int)length - 1; i >= 0; i--) { + //Convert digit to UTF-8 + bytes[i] = 0x30 + (modValue % 10); + modValue /= 10; + } + return bytes; +} + +size_t object_key_size(char *key) { + return strlen(key) + 1; +} + +size_t array_key_size(size_t index) { + //One byte for each decimal digit in index plus null character + return digits(index) + 1; +} + +size_t digits(size_t value) { + size_t modValue = value; + size_t numDigits = 1; + while (modValue >= 10) { + numDigits++; + modValue /= 10; + } + return numDigits; +} diff --git a/src/3rd_party/bson_c_lib/src/bson_util.h b/src/3rd_party/bson_c_lib/src/bson_util.h new file mode 100644 index 0000000000..1f9133d6ed --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/bson_util.h @@ -0,0 +1,183 @@ +#ifndef BSON_UTIL_H +#define BSON_UTIL_H + +#include +#include +#include +#include + +//4 bytes for length, one for ending null character +#define OBJECT_OVERHEAD_BYTES 5 +//Same as object +#define ARRAY_OVERHEAD_BYTES 5 +//1 byte for element type +#define ELEMENT_OVERHEAD_BYTES 1 +//4 bytes for length, one for ending null character +#define STRING_OVERHEAD_BYTES 5 + +//Sizes in bytes of each primitive type, as defined by the BSON spec +#define SIZE_INT32 4 +#define SIZE_INT64 8 +#define SIZE_DOUBLE 8 +#define SIZE_BOOLEAN 1 + +//Last byte in a BSON document +#define DOCUMENT_END 0x00 + +//Byte which defines the type of a value as defined in the BSON spec +enum element_type { + TYPE_DOUBLE = 0x01, + TYPE_STRING = 0x02, + TYPE_DOCUMENT = 0x03, + TYPE_ARRAY = 0x04, + TYPE_BINARY = 0x05, //unused + TYPE_UNDEFINED = 0x06, //deprecated + TYPE_OBJECT_ID = 0x07, //unused + TYPE_BOOLEAN = 0x08, + TYPE_DATE_TIME = 0x09, //unused + TYPE_NULL = 0x0A, + TYPE_REGEX = 0x0B, //unused + TYPE_DB_POINTER = 0x0C, //deprecated + TYPE_JS_CODE = 0x0D, //unused + TYPE_SYMBOL = 0x0E, //deprecated + TYPE_JS_CODE_WITH_SCOPE = 0x0F, //unused + TYPE_INT32 = 0x10, + TYPE_TIMESTAMP = 0x11, //unused + TYPE_INT64 = 0x12, + TYPE_DEC128 = 0x13, //unused + TYPE_MIN_KEY = 0xFF, //unused + TYPE_MAX_KEY = 0x7F //unused +}; +typedef enum element_type element_type; + +//Definition of each boolean value according to the BSON spec +enum bson_boolean { + BOOLEAN_INVALID = -1, + BOOLEAN_FALSE = 0x00, + BOOLEAN_TRUE = 0x01 +}; +typedef enum bson_boolean bson_boolean; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + @brief Write a little endian 32-bit integer value to a given buffer + + @param bytes - The byte buffer to be written to + @param value - The integer value to be written to the buffer + @param position - Pointer to the current position in the buffer, will be advanced past the written value +*/ +void write_int32_le(uint8_t *bytes, int32_t value, size_t *position); +/* + @brief Write a little endian 64-bit integer value to a given buffer + + @param bytes - The byte buffer to be written to + @param value - The integer value to be written to the buffer + @param position - Pointer to the current position in the buffer, will be advanced past the written value +*/ +void write_int64_le(uint8_t *bytes, int64_t value, size_t *position); +/* + @brief Write a little endian 64-bit floating-point value to a given buffer + + @param bytes - The byte buffer to be written to + @param value - The integer value to be written to the buffer + @param position - Pointer to the current position in the buffer, will be advanced past the written value +*/ +void write_double_le(uint8_t *bytes, double value, size_t *position); + +/* + @brief Read a little endian 32-bit integer value from a given buffer + + @param bytes - Pointer to the byte buffer from which to read, + this value will be advanced past the value that was read + + @return - The value that was read from the buffer +*/ +int32_t read_int32_le(uint8_t **bytes); +/* + @brief Read a little endian 64-bit integer value from a given buffer + + @param bytes - Pointer to the byte buffer from which to read, + this value will be advanced past the value that was read + + @return - The value that was read from the buffer +*/ +int64_t read_int64_le(uint8_t **bytes); +/* + @brief Read a little endian 64-bit floating point value from a given buffer + + @param bytes - Pointer to the byte buffer from which to read, + this value will be advanced past the value that was read + + @return - The value that was read from the buffer +*/ +double read_double_le(uint8_t **bytes); + +/* + @brief Convert the give UTF-8 string into a byte array + + @param stringVal - the string value to be converted + + @return - The byte array representation of the string, must be freed by the caller after use +*/ +uint8_t *string_to_byte_array(char *stringVal); +/* + @brief Convert the given byte array to a UTF-8 string + + @param bytes - The byte array to be converted + + @return The converted string +*/ +char *byte_array_to_string(uint8_t *bytes); +/* + @brief Convert the given byte array to a UTF-8 BSON string + + @param bytes - The byte array to be converted + @param length - The length of the array to be converted + + @return The converted string (may include null characters) +*/ +char *byte_array_to_bson_string(uint8_t *bytes, size_t length); + +/* + @brief Convert the given a array index into a BSON key + + @param index - The index to be converted + + @return - A byte array containing the BSON key representation of index, must be freed by the caller after use +*/ +uint8_t *index_to_key(size_t index); + +/* + @brief Calculate the size, in bytes, of a BSON object key + + @param key - The object key used for calculations + + @return - The size of the BSON object key, in bytes +*/ +size_t object_key_size(char *key); +/* + @brief Calculate the size, in bytes, of a BSON array key + + @param index - The array key (index) used for calculations + + @return - The size of the BSON array key, in bytes +*/ +size_t array_key_size(size_t index); + +/* + @brief Calculate the number of decimal digits in a given integer value + + @param value - The value on which calculations are done + + @return The number of decimal digits in value +*/ +size_t digits(size_t value); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/LICENSE b/src/3rd_party/bson_c_lib/src/emhashmap/LICENSE new file mode 100755 index 0000000000..6108defdd8 --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/emhashmap/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2013, Ford Motor Company +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * 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 HOLDERS AND 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 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. diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am b/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am new file mode 100644 index 0000000000..59330dbeaa --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am @@ -0,0 +1,8 @@ +AM_CFLAGS = -Wall +AM_LDFLAGS = + +includedir = /usr/local/include +include_HEADERS = emhashmap.h + +noinst_LTLIBRARIES = libemhashmap.la +libemhashmap_la_SOURCES = emhashmap.c diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in b/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in new file mode 100644 index 0000000000..fdb5dc943d --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in @@ -0,0 +1,625 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/emhashmap +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp $(include_HEADERS) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libemhashmap_la_LIBADD = +am_libemhashmap_la_OBJECTS = emhashmap.lo +libemhashmap_la_OBJECTS = $(am_libemhashmap_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libemhashmap_la_SOURCES) +DIST_SOURCES = $(libemhashmap_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(includedir)" +HEADERS = $(include_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = /usr/local/include +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = -Wall +AM_LDFLAGS = +include_HEADERS = emhashmap.h +noinst_LTLIBRARIES = libemhashmap.la +libemhashmap_la_SOURCES = emhashmap.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/emhashmap/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/emhashmap/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libemhashmap.la: $(libemhashmap_la_OBJECTS) $(libemhashmap_la_DEPENDENCIES) $(EXTRA_libemhashmap_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libemhashmap_la_OBJECTS) $(libemhashmap_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emhashmap.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-includeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-includeHEADERS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/README.mkd b/src/3rd_party/bson_c_lib/src/emhashmap/README.mkd new file mode 100755 index 0000000000..c5bd0a465c --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/emhashmap/README.mkd @@ -0,0 +1,56 @@ +Generic C Hash Map for Embedded Systems +==================================== + +This library is an implementation of a hash map in C that maps integers to void +pointers. The map is initialized with a fixed size and load factor, and memory +is allocated on the heap all at once. There are no dependencies besides the BSD +queue.h, which is included in most systems by default. + +## Compiling + + $ make + +## Test Suite + +**Dependencies** + +* check + +This library has a test suite built with the `check` C library. Run the tests +like so: + + $ make test + +## Examples + + #include "emhashmap.h" + + #define MAX_CAPACITY 64 + + HashMap map = emhashmap_create(64); + + int key = 42; + char* value = "foo"; + emhashmap_put(&map, key, (void*)value); + + bool contains = emhashmap_contains(list, key); + // contains == true + + int size = emhashmap_size(&map); + // size == 1 + + emhashmap_remove(&map, key); + + emhashmap_is_empty(&map); + // == true + + emhashmap_destroy(&map); + +## License + +This library is licensed under the BSD license and is Copyright 2014, +Ford Motor Company + +## Contributors + +* Chris Peplin, cpeplin@ford.com diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c b/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c new file mode 100755 index 0000000000..4b896f1d8d --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c @@ -0,0 +1,157 @@ +#include "emhashmap.h" + +#include +#include +#include +#include +#include + +static MapBucketList* find_bucket(HashMap* map, const char* key) { + MapBucketList* bucket = NULL; + + if(map != NULL && map->buckets != NULL) { + bucket = &map->buckets[(*map->hash)(key, map->bucket_count)]; + } + return bucket; +} + +void emhashmap_deinitialize(HashMap* map) { + if(map->entries != NULL) { + free(map->entries); + map->entries = NULL; + } + + if(map->buckets != NULL) { + free(map->buckets); + map->buckets = NULL; + } +} + +bool emhashmap_initialize(HashMap* map, int capacity, float load_factor, size_t (*hash_function)(const char*, size_t)) { + map->bucket_count = ((int)(capacity / load_factor) + 1); + map->capacity = capacity; + map->entries = (MapEntry*) malloc(sizeof(MapEntry) * map->capacity); + memset(map->entries, 0, sizeof(MapEntry) * map->capacity); + map->buckets = (MapBucketList*) malloc(sizeof(MapBucketList) * + map->bucket_count); + memset(map->buckets, 0, sizeof(MapBucketList) * map->bucket_count); + map->hash = hash_function; + int i; + for(i = 0; i < map->bucket_count; i++) { + LIST_INIT(&map->buckets[i]); + } + + LIST_INIT(&map->free_list); + for(i = 0; i < map->capacity; i++) { + LIST_INSERT_HEAD(&map->free_list, &map->entries[i], entries); + } + return map->buckets != NULL; +} + +MapEntry* emhashmap_get(HashMap* map, const char* key) { + MapBucketList* bucket = find_bucket(map, key); + + MapEntry* entry; + LIST_FOREACH(entry, bucket, entries) { + if(strcmp(entry->key, key) == 0) { + return entry; + } + } + return NULL; +} + +bool emhashmap_contains(HashMap* map, const char* key) { + return emhashmap_get(map, key) != NULL; +} + +bool emhashmap_put(HashMap* map, const char* key, void* value) { + MapBucketList* bucket = find_bucket(map, key); + + MapEntry* entry, *matching_entry = NULL; + LIST_FOREACH(entry, bucket, entries) { + if(strcmp(entry->key, key) == 0) { + matching_entry = entry; + } + } + + bool result = true; + if(matching_entry != NULL) { + matching_entry->value = value; + } else { + MapEntry* new_entry = LIST_FIRST(&map->free_list); + if(new_entry == NULL) { + result = false; + } else { + strncpy(new_entry->key, key, 255); + new_entry->value = value; + LIST_REMOVE(new_entry, entries); + LIST_INSERT_HEAD(bucket, new_entry, entries); + } + } + return result; +} + +void* emhashmap_remove(HashMap* map, const char* key) { + MapBucketList* bucket = find_bucket(map, key); + + MapEntry* entry, *matching_entry = NULL; + LIST_FOREACH(entry, bucket, entries) { + if(strcmp(entry->key, key) == 0) { + matching_entry = entry; + } + } + + void* value = NULL; + if(matching_entry != NULL) { + value = matching_entry->value; + LIST_REMOVE(matching_entry, entries); + } + return value; +} + +int emhashmap_size(HashMap* map) { + int size = 0; + int i; + for(i = 0; i < map->bucket_count; i++) { + MapEntry* entry = NULL; + LIST_FOREACH(entry, &map->buckets[i], entries) { + ++size; + } + } + return size; +} + +bool emhashmap_is_empty(HashMap* map) { + return emhashmap_size(map) == 0; +} + +float emhashmap_load_factor(HashMap* map) { + return emhashmap_size(map) / map->capacity; +} + +MapIterator emhashmap_iterator(HashMap* map) { + MapIterator iterator; + iterator.current_bucket = 0; + iterator.current_entry = NULL; + iterator.map = map; + return iterator; +} + +MapEntry* emhashmap_iterator_next(MapIterator* iterator) { + if(iterator != NULL) { + if(iterator->current_entry != NULL) { + iterator->current_entry = LIST_NEXT(iterator->current_entry, entries); + } + + if(iterator->current_entry == NULL) { + do { + iterator->current_entry = LIST_FIRST(&iterator->map->buckets[iterator->current_bucket++]); + } while(iterator->current_entry == NULL && + iterator->current_bucket < iterator->map->bucket_count - 1); + } + return iterator->current_entry; + } + else { + return NULL; + } +} diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h b/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h new file mode 100755 index 0000000000..7d7f28721f --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h @@ -0,0 +1,144 @@ +#ifndef _EMHASHMAP_H_ +#define _EMHASHMAP_H_ + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Public: An entry in the map. + * + * key - the entry key, currently supports only integers. + * value - a pointer to the value. this must be allocated with malloc or + * be in global scope, and the map entry does not take ownership of its + * memory. + */ +struct MapEntry { + char key[255]; + void* value; + LIST_ENTRY(MapEntry) entries; +}; +typedef struct MapEntry MapEntry; + +LIST_HEAD(MapBucketList, MapEntry); +typedef struct MapBucketList MapBucketList; + +/* Public: A struct encapsulating a map's state. All of the fields are private + * - use the emhashmap_ functions to interact with the map. + * + * bucket_count - The fixed count of buckets for elements in the map. + * capacity - The total, fixed capacity of the map. + * buckets - An array of MapBucketList lists, each a bucket in the map. + * entries - An array of all entry slots, to be used in each bucket. + * free_list - An array of all entries when not actively in a bucket. + */ +struct HashMap { + int bucket_count; + int capacity; + MapBucketList* buckets; + MapEntry* entries; + MapBucketList free_list; + size_t (*hash)(const char*, size_t); +}; +typedef struct HashMap HashMap; + +struct MapIterator { + HashMap* map; + int current_bucket; + MapEntry* current_entry; +}; +typedef struct MapIterator MapIterator; + +/* Public: Initialize a map with the given capacity and load factor (determines + * the number of buckets). + * + * This allocates memory for the buckets and entries, so make sure to call + * emhashmap_destroy(HashMap*) after done with this map. + * + * map - a pointer to the map to initialize. It must already be allocated on the + * stack or heap. + * capacity - the initial capacity for the map. + * load_factor - The desired load factor when the map is at capacity. + * + * Returns true if the map was initialized, successfully, false if space could + * not be allocated for the buckets or entries. + */ +bool emhashmap_initialize(HashMap* map, int capacity, float load_factor, size_t (*hash_function)(const char*, size_t)); + +/* Public: De-initialize a map, freeing memory for the buckets and entries. + * + * This will *not* free the memory associated with any values stored in the map + * - only the buckets and map entry objects. + * + * map - a pointer to the map to deinitialize. It must already be allocated on + * the stack or heap. + */ +void emhashmap_deinitialize(HashMap* map); + +/* Public: Retrive the entry for a given key from the map. + * + * map - the map to retrive the value. + * key - the key for this value. + * + * Returns the MapEntry if found, otherwise NULL. + */ +MapEntry* emhashmap_get(HashMap* map, const char* key); + +/* Public: Check if the given key is in the map. + * + * map - the map to query. + * key - the key to check for membership. + * + * Returns true if the key is in the map. + */ +bool emhashmap_contains(HashMap* map, const char* key); + +/* Public: Put the value in the map with the given key. + * + * If the key already exists in the map, its value will be overridden (so make + * sure you've freed the memory associated with the existing value). + * + * Returns true if there was space in the map and the key-value pair was added + * successfully. Returns false if the map is full. + */ +bool emhashmap_put(HashMap* map, const char* key, void* value); + +/* Public: Remove a value with the given key from the map. + * + * map - the map to query. + * key - the key to remove. + * + * Returns the value pointer if found in the map and removed - the map user is + * responsible for freeing any memory associated with that pointer. + * Returns NULL if the key was not in the map. + */ +void* emhashmap_remove(HashMap* map, const char* key); + +/* Public: Get the number of keys in the map. + * + * map - the map to query. + * + * Returns the total number of keys in the map. + */ +int emhashmap_size(HashMap* map); + +/* Public: Check if a map is empty. + * + * map - the map to query. + * + * Returns true if there are no entries in the map. + */ +bool emhashmap_is_empty(HashMap* map); + +MapIterator emhashmap_iterator(HashMap* map); + +MapEntry* emhashmap_iterator_next(MapIterator* iterator); + +#ifdef __cplusplus +} +#endif + +#endif // _EMHASHMAP_H_ diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh b/src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh new file mode 100755 index 0000000000..4781636b8f --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh @@ -0,0 +1,17 @@ +echo "Running unit tests:" + +for i in $1/*.bin +do + if test -f $i + then + if ./$i + then + echo $i PASS + else + echo "ERROR in test $i:" + exit 1 + fi + fi +done + +echo "${txtbld}$(tput setaf 2)All unit tests passed.$(tput sgr0)" diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/tests/tests.c b/src/3rd_party/bson_c_lib/src/emhashmap/tests/tests.c new file mode 100755 index 0000000000..88f1f21621 --- /dev/null +++ b/src/3rd_party/bson_c_lib/src/emhashmap/tests/tests.c @@ -0,0 +1,218 @@ +#include +#include +#include "emhashmap.h" +#include +#include + +HashMap map; +int capacity = 128; +float load_factor = 10; +int key = 1; +void* value = (void*) 1; + +void setup() { + emhashmap_initialize(&map, capacity, load_factor); +} + +void teardown() { + emhashmap_deinitialize(&map); +} + +START_TEST (test_init) +{ + emhashmap_initialize(&map, capacity, .5); + emhashmap_deinitialize(&map); +} +END_TEST + +START_TEST (test_fill_up) +{ + int i; + for(i = 0; i < capacity; i++) { + ck_assert(emhashmap_put(&map, i, (void*)i)); + ck_assert_int_eq(emhashmap_size(&map), i + 1); + } + ck_assert(!emhashmap_put(&map, i, (void*)i)); +} +END_TEST + +START_TEST (test_put_multiple) +{ + ck_assert(emhashmap_put(&map, key, value)); + ck_assert(emhashmap_put(&map, 2, (void*)2)); + ck_assert_int_eq(emhashmap_size(&map), 2); +} +END_TEST + +START_TEST (test_get) +{ + emhashmap_put(&map, key, value); + MapEntry* entered_value = emhashmap_get(&map, key); + ck_assert(entered_value != NULL); + ck_assert(entered_value->value == value); +} +END_TEST + +START_TEST (test_get_missing) +{ + ck_assert(emhashmap_get(&map, key) == NULL); +} +END_TEST + +START_TEST (test_put) +{ + ck_assert(emhashmap_put(&map, key, value)); + ck_assert_int_eq(emhashmap_size(&map), 1); +} +END_TEST + +START_TEST (test_overwrite) +{ + ck_assert(emhashmap_put(&map, key, value)); + ck_assert_int_eq(emhashmap_size(&map), 1); + void* another_value = (void*)2; + ck_assert(emhashmap_put(&map, key, another_value)); + ck_assert_int_eq(emhashmap_size(&map), 1); + ck_assert(emhashmap_get(&map, key)->value == another_value); +} +END_TEST + +START_TEST (test_contains) +{ + emhashmap_put(&map, key, value); + ck_assert(emhashmap_contains(&map, key)); +} +END_TEST + +START_TEST (test_contains_null_value) +{ + emhashmap_put(&map, key, NULL); + ck_assert(emhashmap_contains(&map, key)); +} +END_TEST + +START_TEST (test_does_not_contain) +{ + emhashmap_put(&map, key, value); + ck_assert(!emhashmap_contains(&map, 2)); +} +END_TEST + +START_TEST (test_remove) +{ + emhashmap_put(&map, key, value); + ck_assert(emhashmap_contains(&map, key)); + ck_assert(emhashmap_remove(&map, key) == value); + ck_assert(!emhashmap_contains(&map, key)); +} +END_TEST + +START_TEST (test_remove_not_in_map) +{ + emhashmap_put(&map, key, value); + ck_assert(emhashmap_contains(&map, key)); + ck_assert(!emhashmap_remove(&map, 2)); + ck_assert(emhashmap_contains(&map, key)); +} +END_TEST + +START_TEST (test_is_empty) +{ + ck_assert(emhashmap_is_empty(&map)); + emhashmap_put(&map, key, value); + ck_assert(!emhashmap_is_empty(&map)); +} +END_TEST + +START_TEST (test_size) +{ + ck_assert_int_eq(emhashmap_size(&map), 0); + emhashmap_put(&map, key, value); + ck_assert_int_eq(emhashmap_size(&map), 1); + emhashmap_put(&map, 2, value); + ck_assert_int_eq(emhashmap_size(&map), 2); +} +END_TEST + +START_TEST (test_create) +{ + ck_assert(&map != NULL); +} +END_TEST + +START_TEST (test_iterate_empty) +{ + MapIterator iterator = emhashmap_iterator(&map); + ck_assert(emhashmap_iterator_next(&iterator) == NULL); +} +END_TEST + +START_TEST (test_iterate_one) +{ + emhashmap_put(&map, key, value); + MapIterator iterator = emhashmap_iterator(&map); + MapEntry* entry = emhashmap_iterator_next(&iterator); + ck_assert(entry != NULL); + ck_assert(entry->key == key); + ck_assert(entry->value == value); +} +END_TEST + +START_TEST (test_iterate_many) +{ + emhashmap_put(&map, key, value); + emhashmap_put(&map, 2, value); + MapIterator iterator = emhashmap_iterator(&map); + + MapEntry* entry = emhashmap_iterator_next(&iterator); + ck_assert(entry != NULL); + ck_assert(entry->key == key); + ck_assert(entry->value == value); + + entry = emhashmap_iterator_next(&iterator); + ck_assert(entry != NULL); + ck_assert(entry->key == 2); + ck_assert(entry->value == value); + + entry = emhashmap_iterator_next(&iterator); + ck_assert(entry == NULL); +} +END_TEST + +Suite* suite(void) { + Suite* s = suite_create("queue"); + TCase *tc_core = tcase_create("core"); + tcase_add_checked_fixture (tc_core, setup, teardown); + tcase_add_test(tc_core, test_init); + tcase_add_test(tc_core, test_get); + tcase_add_test(tc_core, test_get_missing); + tcase_add_test(tc_core, test_put); + tcase_add_test(tc_core, test_put_multiple); + tcase_add_test(tc_core, test_fill_up); + tcase_add_test(tc_core, test_overwrite); + tcase_add_test(tc_core, test_contains); + tcase_add_test(tc_core, test_does_not_contain); + tcase_add_test(tc_core, test_remove); + tcase_add_test(tc_core, test_remove_not_in_map); + tcase_add_test(tc_core, test_is_empty); + tcase_add_test(tc_core, test_size); + tcase_add_test(tc_core, test_create); + tcase_add_test(tc_core, test_iterate_empty); + tcase_add_test(tc_core, test_iterate_one); + tcase_add_test(tc_core, test_iterate_many); + suite_add_tcase(s, tc_core); + + return s; +} + +int main(void) { + int numberFailed; + Suite* s = suite(); + SRunner *sr = srunner_create(s); + // Don't fork so we can actually use gdb + srunner_set_fork_status(sr, CK_NOFORK); + srunner_run_all(sr, CK_NORMAL); + numberFailed = srunner_ntests_failed(sr); + srunner_free(sr); + return (numberFailed == 0) ? 0 : 1; +} diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index e5f85f7a46..a1f7b6e115 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -64,6 +64,7 @@ include_directories( ${CMAKE_BINARY_DIR}/src/components ${JSONCPP_INCLUDE_DIRECTORY} ${LOG4CXX_INCLUDE_DIRECTORY} + ${BSON_INCLUDE_DIRECTORY} ${OPENSSL_INCLUDE_DIRECTORY} ${default_media_inc} ${MESSAGE_BROKER_INCLUDE_DIRECTORY} @@ -139,6 +140,9 @@ if(ENABLE_LOG) list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY}) endif() +list(APPEND LIBRARIES bson -L${BSON_LIBS_DIRECTORY}) +list(APPEND LIBRARIES emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}) + add_executable(${PROJECT} ${SOURCES}) target_link_libraries(${PROJECT} ${LIBRARIES}) diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt index c1dd9b2769..139d52fc53 100644 --- a/src/components/protocol_handler/CMakeLists.txt +++ b/src/components/protocol_handler/CMakeLists.txt @@ -35,6 +35,7 @@ include_directories( ${COMPONENTS_DIR}/protocol_handler/include/ ${COMPONENTS_DIR}/connection_handler/include/ ${LOG4CXX_INCLUDE_DIRECTORY} + ${BSON_INCLUDE_DIRECTORY} ) set(PATHS @@ -46,6 +47,8 @@ collect_sources(SOURCES "${PATHS}") set(LIBRARIES ProtocolLibrary Utils + bson -L${BSON_LIBS_DIRECTORY} + emhashmap -L${EMHASHMAP_LIBS_DIRECTORY} ) get_property(dirs DIRECTORY "" PROPERTY LIBRARIES) @@ -55,6 +58,7 @@ endforeach() add_library(ProtocolHandler ${SOURCES}) +add_dependencies(ProtocolHandler install-bson_c_lib) target_link_libraries(ProtocolHandler ${LIBRARIES}) if(BUILD_TESTS) -- cgit v1.2.1 From 64bfd2c583784a7239b0cb641b5c9d448169675c Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Tue, 25 Jul 2017 11:17:06 -0400 Subject: Add protocol version 5 with service-specific MTU --- src/appMain/smartDeviceLink.ini | 16 ++++ .../include/config_profile/profile.h | 18 +++++ src/components/config_profile/src/profile.cc | 79 +++++++++++++++++++ .../connection_handler/src/connection.cc | 3 +- .../connection_handler/test/connection_test.cc | 26 ++++++ src/components/include/protocol/common.h | 6 ++ .../protocol_handler/protocol_handler_settings.h | 5 ++ .../mock_protocol_handler_settings.h | 5 ++ .../include/protocol_handler/protocol_packet.h | 16 ++++ .../protocol_handler/src/incoming_data_handler.cc | 1 + .../protocol_handler/src/protocol_handler_impl.cc | 15 +++- .../protocol_handler/src/protocol_packet.cc | 92 +++++++++++++++++++++- .../test/incoming_data_handler_test.cc | 2 +- .../test/protocol_header_validator_test.cc | 91 ++++++++++++++++++++- 14 files changed, 364 insertions(+), 11 deletions(-) diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini index c5cd4dab8e..ea75352ec5 100644 --- a/src/appMain/smartDeviceLink.ini +++ b/src/appMain/smartDeviceLink.ini @@ -222,6 +222,22 @@ AppIconsFolderMaxSize = 104857600 ; Amount of oldest icons to remove in case of max folder size was reached AppIconsAmountToRemove = 1 +[SDL5] +; Enables SDL protocol 5.0 support +EnableProtocol5 = true +; Control service packet with payload bigger than this value will be marked as a malformed, +; if not specified, this value will default to MaxPayloadSize +;MaximumControlPayloadSize = 131072 +; RPC service packet with payload bigger than this value will be marked as a malformed, +; if not specified, this value will default to MaxPayloadSize +;MaximumRpcPayloadSize = 131072 +; Audio service packet with payload bigger than this value will be marked as a malformed, +; if not specified, this value will default to MaxPayloadSize +;MaximumAudioPayloadSize = 131072 +; Video service packet with payloadbigger than this value will be marked as a malformed, +; if not specified, this value will default to MaxPayloadSize +;MaximumVideoPayloadSize = 131072 + [Resumption] ; Timeout in milliseconds for resumption Application HMILevel ; and resolving conflicts in case if multiple applications initiate resumption diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index 42b0d10ceb..b9b162bcb1 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -129,6 +129,19 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, */ const uint32_t& app_icons_amount_to_remove() const OVERRIDE; + /** + * @brief Returns true, if SDL protocol v5 is enabled + */ + bool enable_protocol_5() const OVERRIDE; + + size_t maximum_control_payload_size() const OVERRIDE; + + size_t maximum_rpc_payload_size() const OVERRIDE; + + size_t maximum_audio_payload_size() const OVERRIDE; + + size_t maximum_video_payload_size() const OVERRIDE; + /** * @brief Returns the path to the config file */ @@ -763,6 +776,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, std::string app_icons_folder_; uint32_t app_icons_folder_max_size_; uint32_t app_icons_amount_to_remove_; + bool enable_protocol_5_; + size_t maximum_control_payload_size_; + size_t maximum_rpc_payload_size_; + size_t maximum_audio_payload_size_; + size_t maximum_video_payload_size_; std::string config_file_name_; std::string server_address_; uint16_t server_port_; diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index beabc6afa8..09af180f2d 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -85,6 +85,7 @@ const char* kFilesystemRestrictionsSection = "FILESYSTEM RESTRICTIONS"; const char* kIAPSection = "IAP"; const char* kProtocolHandlerSection = "ProtocolHandler"; const char* kSDL4Section = "SDL4"; +const char* kSDL5Section = "SDL5"; const char* kResumptionSection = "Resumption"; const char* kAppLaunchSection = "AppLaunch"; @@ -104,6 +105,11 @@ const char* kEnableProtocol4Key = "EnableProtocol4"; const char* kAppIconsFolderKey = "AppIconsFolder"; const char* kAppIconsFolderMaxSizeKey = "AppIconsFolderMaxSize"; const char* kAppIconsAmountToRemoveKey = "AppIconsAmountToRemove"; +const char* kEnableProtocol5Key = "EnableProtocol5"; +const char* kMaximumControlPayloadSizeKey = "MaximumControlPayloadSize"; +const char* kMaximumRpcPayloadSizeKey = "MaximumRpcPayloadSize"; +const char* kMaximumAudioPayloadSizeKey = "MaximumAudioPayloadSize"; +const char* kMaximumVideoPayloadSizeKey = "MaximumVideoPayloadSize"; const char* kLaunchHMIKey = "LaunchHMI"; const char* kDefaultSDLVersion = ""; #ifdef WEB_HMI @@ -286,6 +292,10 @@ const uint16_t kDefaultOpenAttemptTimeoutMs = 500; const uint32_t kDefaultAppIconsFolderMaxSize = 104857600; const uint32_t kDefaultAppIconsAmountToRemove = 1; const uint16_t kDefaultAttemptsToOpenResumptionDB = 5; +const size_t kDefaultMaximumControlPayloadSize = 0; +const size_t kDefaultMaximumRpcPayloadSize = 0; +const size_t kDefaultMaximumAudioPayloadSize = 0; +const size_t kDefaultMaximumVideoPayloadSize = 0; const uint16_t kDefaultOpenAttemptTimeoutMsResumptionDB = 500; const uint16_t kDefaultAppLaunchWaitTime = 5000; const uint16_t kDefaultAppLaunchMaxRetryAttempt = 3; @@ -317,6 +327,11 @@ Profile::Profile() , app_icons_folder_() , app_icons_folder_max_size_(kDefaultAppIconsFolderMaxSize) , app_icons_amount_to_remove_(kDefaultAppIconsAmountToRemove) + , enable_protocol_5_(false) + , maximum_control_payload_size_(kDefaultMaximumControlPayloadSize) + , maximum_rpc_payload_size_(kDefaultMaximumRpcPayloadSize) + , maximum_audio_payload_size_(kDefaultMaximumAudioPayloadSize) + , maximum_video_payload_size_(kDefaultMaximumVideoPayloadSize) , config_file_name_(kDefaultConfigFileName) , server_address_(kDefaultServerAddress) , server_port_(kDefaultServerPort) @@ -454,6 +469,26 @@ const uint32_t& Profile::app_icons_amount_to_remove() const { return app_icons_amount_to_remove_; } +bool Profile::enable_protocol_5() const { + return enable_protocol_5_; +} + +size_t Profile::maximum_control_payload_size() const { + return maximum_control_payload_size_; +} + +size_t Profile::maximum_rpc_payload_size() const { + return maximum_rpc_payload_size_; +} + +size_t Profile::maximum_audio_payload_size() const { + return maximum_audio_payload_size_; +} + +size_t Profile::maximum_video_payload_size() const { + return maximum_video_payload_size_; +} + const std::string& Profile::hmi_capabilities_file_name() const { return hmi_capabilities_file_name_; } @@ -1053,6 +1088,50 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE( app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey, kSDL4Section); + // Enable protocol ver.4 parameter + std::string enable_protocol_5_value; + if (ReadValue(&enable_protocol_5_value, kSDL5Section, kEnableProtocol5Key) && + 0 == strcmp("true", enable_protocol_5_value.c_str())) { + enable_protocol_5_ = true; + } else { + enable_protocol_5_ = false; + } + + LOG_UPDATED_BOOL_VALUE(enable_protocol_5_, kEnableProtocol5Key, kSDL5Section); + + ReadUIntValue(&maximum_control_payload_size_, + kDefaultMaximumPayloadSize, + kSDL5Section, + kMaximumControlPayloadSizeKey); + + LOG_UPDATED_VALUE(maximum_control_payload_size_, + kMaximumControlPayloadSizeKey, + kSDL5Section); + + ReadUIntValue(&maximum_rpc_payload_size_, + kDefaultMaximumPayloadSize, + kSDL5Section, + kMaximumRpcPayloadSizeKey); + + LOG_UPDATED_VALUE( + maximum_rpc_payload_size_, kMaximumRpcPayloadSizeKey, kSDL5Section); + + ReadUIntValue(&maximum_audio_payload_size_, + kDefaultMaximumPayloadSize, + kSDL5Section, + kMaximumAudioPayloadSizeKey); + + LOG_UPDATED_VALUE( + maximum_audio_payload_size_, kMaximumAudioPayloadSizeKey, kSDL5Section); + + ReadUIntValue(&maximum_video_payload_size_, + kDefaultMaximumPayloadSize, + kSDL5Section, + kMaximumVideoPayloadSizeKey); + + LOG_UPDATED_VALUE( + maximum_video_payload_size_, kMaximumVideoPayloadSizeKey, kSDL5Section); + // Application info file name ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName, diff --git a/src/components/connection_handler/src/connection.cc b/src/components/connection_handler/src/connection.cc index 7bb54d4493..202736e612 100644 --- a/src/components/connection_handler/src/connection.cc +++ b/src/components/connection_handler/src/connection.cc @@ -352,8 +352,7 @@ bool Connection::SupportHeartBeat(uint8_t session_id) { } Session& session = session_it->second; return ( - (::protocol_handler::PROTOCOL_VERSION_3 == session.protocol_version || - ::protocol_handler::PROTOCOL_VERSION_4 == session.protocol_version) && + (session.protocol_version >= ::protocol_handler::PROTOCOL_VERSION_3) && (0 != heartbeat_timeout_)); } diff --git a/src/components/connection_handler/test/connection_test.cc b/src/components/connection_handler/test/connection_test.cc index 85f43f3785..4582cc10ee 100644 --- a/src/components/connection_handler/test/connection_test.cc +++ b/src/components/connection_handler/test/connection_test.cc @@ -201,6 +201,32 @@ TEST_F(ConnectionTest, HeartBeat_Protocol4_ZeroHeartBeat_NotSupported) { EXPECT_FALSE(connection_->SupportHeartBeat(session_id)); } +TEST_F(ConnectionTest, HeartBeat_Protocol5_PositiveHeartBeat_Supported) { + // Arrange + StartSession(); + // Check execution if protocol version is 5 + const uint8_t protocol_version = static_cast(PROTOCOL_VERSION_5); + connection_->UpdateProtocolVersionSession(session_id, protocol_version); + EXPECT_TRUE(connection_->SupportHeartBeat(session_id)); +} + +TEST_F(ConnectionTest, HeartBeat_Protocol5_ZeroHeartBeat_NotSupported) { + // Correctc of connection (need connection with heartbeat=0) + delete connection_; + connection_ = 0; + + const ConnectionHandle connectionHandle = 0; + const DeviceHandle device_handle = 0u; + const uint32_t heart_beat = 0u; + connection_ = new Connection( + connectionHandle, device_handle, connection_handler_, heart_beat); + StartSession(); + // Check execution if protocol version is 5 + const uint8_t protocol_version = static_cast(PROTOCOL_VERSION_5); + connection_->UpdateProtocolVersionSession(session_id, protocol_version); + EXPECT_FALSE(connection_->SupportHeartBeat(session_id)); +} + // Try to add service without session TEST_F(ConnectionTest, Session_AddNewServiceWithoutSession) { EXPECT_EQ(connection_->AddNewService(session_id, kAudio, true), diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h index ce4c4adf6f..2904f383de 100644 --- a/src/components/include/protocol/common.h +++ b/src/components/include/protocol/common.h @@ -84,6 +84,12 @@ enum { * SDL4.0 feature. */ PROTOCOL_VERSION_4 = 0x04, + /** + *@brief Constant: number of protocol version (5). + * Supports constructed payloads for protocol packets + * SDL4.4 feature. + */ + PROTOCOL_VERSION_5 = 0x05, /** *\brief Maximum value of packet version field (size 4-bit) specified AppLink *Protocol v.7 diff --git a/src/components/include/protocol_handler/protocol_handler_settings.h b/src/components/include/protocol_handler/protocol_handler_settings.h index 987b0ac449..fc37d4af58 100644 --- a/src/components/include/protocol_handler/protocol_handler_settings.h +++ b/src/components/include/protocol_handler/protocol_handler_settings.h @@ -15,6 +15,10 @@ class ProtocolHandlerSettings { virtual ~ProtocolHandlerSettings() {} virtual size_t maximum_payload_size() const = 0; + virtual size_t maximum_control_payload_size() const = 0; + virtual size_t maximum_rpc_payload_size() const = 0; + virtual size_t maximum_audio_payload_size() const = 0; + virtual size_t maximum_video_payload_size() const = 0; virtual size_t message_frequency_count() const = 0; virtual size_t message_frequency_time() const = 0; virtual bool malformed_message_filtering() const = 0; @@ -30,6 +34,7 @@ class ProtocolHandlerSettings { * @brief Protocol version, from .ini file. */ virtual bool enable_protocol_4() const = 0; + virtual bool enable_protocol_5() const = 0; virtual uint32_t multiframe_waiting_timeout() const = 0; #ifdef ENABLE_SECURITY diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h index d12e7899e0..43af035f0b 100644 --- a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h +++ b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h @@ -43,6 +43,10 @@ class MockProtocolHandlerSettings : public protocol_handler::ProtocolHandlerSettings { public: MOCK_CONST_METHOD0(maximum_payload_size, size_t()); + MOCK_CONST_METHOD0(maximum_control_payload_size, size_t()); + MOCK_CONST_METHOD0(maximum_rpc_payload_size, size_t()); + MOCK_CONST_METHOD0(maximum_audio_payload_size, size_t()); + MOCK_CONST_METHOD0(maximum_video_payload_size, size_t()); MOCK_CONST_METHOD0(message_frequency_count, size_t()); MOCK_CONST_METHOD0(message_frequency_time, size_t()); MOCK_CONST_METHOD0(malformed_message_filtering, bool()); @@ -51,6 +55,7 @@ class MockProtocolHandlerSettings MOCK_CONST_METHOD0(heart_beat_timeout, uint32_t()); MOCK_CONST_METHOD0(max_supported_protocol_version, uint16_t()); MOCK_CONST_METHOD0(enable_protocol_4, bool()); + MOCK_CONST_METHOD0(enable_protocol_5, bool()); MOCK_CONST_METHOD0(multiframe_waiting_timeout, uint32_t()); #ifdef ENABLE_SECURITY MOCK_CONST_METHOD0(force_protected_service, const std::vector&()); diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h index f8696c46a0..276c416d59 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h @@ -99,7 +99,19 @@ class ProtocolPacket { * \brief Setter/getter maximum payload size of packets */ void set_max_payload_size(const size_t max_payload_size); + void set_max_control_payload_size(const size_t max_payload_size); + void set_max_rpc_payload_size(const size_t max_payload_size); + void set_max_audio_payload_size(const size_t max_payload_size); + void set_max_video_payload_size(const size_t max_payload_size); + size_t max_payload_size() const; + size_t max_control_payload_size() const; + size_t max_rpc_payload_size() const; + size_t max_audio_payload_size() const; + size_t max_video_payload_size() const; + + size_t max_payload_size_by_service_type(const ServiceType type) const; + /** * \brief Check ProtocolHeader according to protocol requiements */ @@ -107,6 +119,10 @@ class ProtocolPacket { private: size_t max_payload_size_; + size_t max_control_payload_size_; + size_t max_rpc_payload_size_; + size_t max_audio_payload_size_; + size_t max_video_payload_size_; }; /** diff --git a/src/components/protocol_handler/src/incoming_data_handler.cc b/src/components/protocol_handler/src/incoming_data_handler.cc index e1d08a6ada..4944ea9cc7 100644 --- a/src/components/protocol_handler/src/incoming_data_handler.cc +++ b/src/components/protocol_handler/src/incoming_data_handler.cc @@ -126,6 +126,7 @@ uint32_t IncomingDataHandler::GetPacketSize( case PROTOCOL_VERSION_2: case PROTOCOL_VERSION_3: case PROTOCOL_VERSION_4: + case PROTOCOL_VERSION_5: return header.dataSize + PROTOCOL_HEADER_V2_SIZE; default: LOG4CXX_WARN(logger_, diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index aa2910722d..1fd49222f0 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -85,6 +85,14 @@ ProtocolHandlerImpl::ProtocolHandlerImpl( LOG4CXX_AUTO_TRACE(logger_); protocol_header_validator_.set_max_payload_size( get_settings().maximum_payload_size()); + protocol_header_validator_.set_max_control_payload_size( + get_settings().maximum_control_payload_size()); + protocol_header_validator_.set_max_rpc_payload_size( + get_settings().maximum_rpc_payload_size()); + protocol_header_validator_.set_max_audio_payload_size( + get_settings().maximum_audio_payload_size()); + protocol_header_validator_.set_max_video_payload_size( + get_settings().maximum_video_payload_size()); incoming_data_handler_.set_validator(&protocol_header_validator_); const size_t& message_frequency_count = @@ -1173,8 +1181,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat( if (session_observer_.ProtocolVersionUsed( connection_id, packet.session_id(), protocol_version)) { // TODO(EZamakhov): investigate message_id for HeartBeatAck - if (PROTOCOL_VERSION_3 == protocol_version || - PROTOCOL_VERSION_4 == protocol_version) { + if (protocol_version >= PROTOCOL_VERSION_3) { return SendHeartBeatAck( connection_id, packet.session_id(), packet.message_id()); } else { @@ -1508,7 +1515,11 @@ uint8_t ProtocolHandlerImpl::SupportedSDLProtocolVersion() const { bool heart_beat_support = (0 != get_settings().heart_beat_timeout()); bool sdl4_support = get_settings().enable_protocol_4(); + bool sdl5_support = get_settings().enable_protocol_5(); + if (sdl5_support) { + return PROTOCOL_VERSION_5; + } if (sdl4_support) { return PROTOCOL_VERSION_4; } diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc index d766cf18c4..d4daffe1d7 100644 --- a/src/components/protocol_handler/src/protocol_packet.cc +++ b/src/components/protocol_handler/src/protocol_packet.cc @@ -114,7 +114,8 @@ void ProtocolPacket::ProtocolHeader::deserialize(const uint8_t* message, switch (version) { case PROTOCOL_VERSION_2: case PROTOCOL_VERSION_3: - case PROTOCOL_VERSION_4: { + case PROTOCOL_VERSION_4: + case PROTOCOL_VERSION_5: { if (messageSize < PROTOCOL_HEADER_V2_SIZE) { LOG4CXX_DEBUG(logger_, "Message size less " << PROTOCOL_HEADER_V2_SIZE @@ -131,7 +132,11 @@ void ProtocolPacket::ProtocolHeader::deserialize(const uint8_t* message, } ProtocolPacket::ProtocolHeaderValidator::ProtocolHeaderValidator() - : max_payload_size_(std::numeric_limits::max()) {} + : max_payload_size_(std::numeric_limits::max()) + , max_control_payload_size_(0) + , max_rpc_payload_size_(0) + , max_audio_payload_size_(0) + , max_video_payload_size_(0) {} void ProtocolPacket::ProtocolHeaderValidator::set_max_payload_size( const size_t max_payload_size) { @@ -139,15 +144,92 @@ void ProtocolPacket::ProtocolHeaderValidator::set_max_payload_size( max_payload_size_ = max_payload_size; } +void ProtocolPacket::ProtocolHeaderValidator::set_max_control_payload_size( + const size_t max_payload_size) { + LOG4CXX_DEBUG(logger_, + "New maximum RPC payload size is " << max_payload_size); + max_control_payload_size_ = max_payload_size; +} + +void ProtocolPacket::ProtocolHeaderValidator::set_max_rpc_payload_size( + const size_t max_payload_size) { + LOG4CXX_DEBUG(logger_, + "New maximum RPC payload size is " << max_payload_size); + max_rpc_payload_size_ = max_payload_size; +} + +void ProtocolPacket::ProtocolHeaderValidator::set_max_audio_payload_size( + const size_t max_payload_size) { + LOG4CXX_DEBUG(logger_, + "New maximum audio payload size is " << max_payload_size); + max_audio_payload_size_ = max_payload_size; +} + +void ProtocolPacket::ProtocolHeaderValidator::set_max_video_payload_size( + const size_t max_payload_size) { + LOG4CXX_DEBUG(logger_, + "New maximum video payload size is " << max_payload_size); + max_video_payload_size_ = max_payload_size; +} + size_t ProtocolPacket::ProtocolHeaderValidator::max_payload_size() const { return max_payload_size_; } +size_t ProtocolPacket::ProtocolHeaderValidator::max_control_payload_size() + const { + return max_control_payload_size_; +} + +size_t ProtocolPacket::ProtocolHeaderValidator::max_rpc_payload_size() const { + return max_rpc_payload_size_; +} + +size_t ProtocolPacket::ProtocolHeaderValidator::max_audio_payload_size() const { + return max_audio_payload_size_; +} + +size_t ProtocolPacket::ProtocolHeaderValidator::max_video_payload_size() const { + return max_video_payload_size_; +} + +size_t +ProtocolPacket::ProtocolHeaderValidator::max_payload_size_by_service_type( + const ServiceType type) const { + size_t payload_size = 0; + switch (type) { + case kControl: + // Default to the generic MTU if specific MTU is not set + payload_size = max_control_payload_size_ == 0 ? max_payload_size_ + : max_control_payload_size_; + break; + case kBulk: + case kRpc: + // Default to the generic MTU if specific MTU is not set + payload_size = max_rpc_payload_size_ == 0 ? max_payload_size_ + : max_rpc_payload_size_; + break; + case kAudio: + // Default to the generic MTU if specific MTU is not set + payload_size = max_audio_payload_size_ == 0 ? max_payload_size_ + : max_audio_payload_size_; + break; + case kMobileNav: + // Default to the generic MTU if specific MTU is not set + payload_size = max_video_payload_size_ == 0 ? max_payload_size_ + : max_video_payload_size_; + break; + case kInvalidServiceType: + LOG4CXX_WARN(logger_, "Invalid service type" << static_cast(type)); + } + return payload_size; +} + RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate( const ProtocolHeader& header) const { LOG4CXX_DEBUG(logger_, "Validating header - " << header); // expected payload size will be calculated depending - // on used protocol version + // on used protocol version and service type size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE; // Protocol version shall be from 1 to 4 switch (header.version) { @@ -160,6 +242,10 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate( ? max_payload_size_ : MAXIMUM_FRAME_DATA_V2_SIZE; break; + case PROTOCOL_VERSION_5: + payload_size = max_payload_size_by_service_type( + ServiceTypeFromByte(header.serviceType)); + break; default: LOG4CXX_WARN(logger_, "Unknown version:" << static_cast(header.version)); diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc index 66f5aea712..d0a311583c 100644 --- a/src/components/protocol_handler/test/incoming_data_handler_test.cc +++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc @@ -262,7 +262,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Version) { FrameList malformed_packets; std::vector malformed_versions; malformed_versions.push_back(0); - for (uint8_t version = PROTOCOL_VERSION_4 + 1; + for (uint8_t version = PROTOCOL_VERSION_5 + 1; version <= PROTOCOL_VERSION_MAX; ++version) { malformed_versions.push_back(version); diff --git a/src/components/protocol_handler/test/protocol_header_validator_test.cc b/src/components/protocol_handler/test/protocol_header_validator_test.cc index 40b0f34846..3f1414aeab 100644 --- a/src/components/protocol_handler/test/protocol_header_validator_test.cc +++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc @@ -57,7 +57,7 @@ class ProtocolHeaderValidatorTest : public ::testing::Test { uint32_t some_session_id; }; -// Protocol version shall be from 1 to 3 +// Protocol version shall be from 1 to 5 TEST_F(ProtocolHeaderValidatorTest, MaxPayloadSizeSetGet) { EXPECT_EQ(std::numeric_limits::max(), header_validator.max_payload_size()); @@ -67,11 +67,96 @@ TEST_F(ProtocolHeaderValidatorTest, MaxPayloadSizeSetGet) { } } -// Protocol version shall be from 1 to 4 +TEST_F(ProtocolHeaderValidatorTest, MaxControlPayloadSizeSetGet) { + EXPECT_EQ(0, header_validator.max_control_payload_size()); + for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { + header_validator.set_max_control_payload_size(value); + EXPECT_EQ(value, header_validator.max_control_payload_size()); + } +} + +TEST_F(ProtocolHeaderValidatorTest, MaxRpcPayloadSizeSetGet) { + EXPECT_EQ(0, header_validator.max_rpc_payload_size()); + for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { + header_validator.set_max_rpc_payload_size(value); + EXPECT_EQ(value, header_validator.max_rpc_payload_size()); + } +} + +TEST_F(ProtocolHeaderValidatorTest, MaxAudioPayloadSizeSetGet) { + EXPECT_EQ(0, header_validator.max_audio_payload_size()); + for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { + header_validator.set_max_audio_payload_size(value); + EXPECT_EQ(value, header_validator.max_audio_payload_size()); + } +} + +TEST_F(ProtocolHeaderValidatorTest, MaxVideoPayloadSizeSetGet) { + EXPECT_EQ(0, header_validator.max_video_payload_size()); + for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { + header_validator.set_max_video_payload_size(value); + EXPECT_EQ(value, header_validator.max_video_payload_size()); + } +} + +TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Control) { + size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE; + header_validator.set_max_payload_size(payload_size); + // Default to max_payload_size if a specific MTU is not set + EXPECT_EQ(payload_size, + header_validator.max_payload_size_by_service_type(kControl)); + for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { + header_validator.set_max_control_payload_size(value); + EXPECT_EQ(value, + header_validator.max_payload_size_by_service_type(kControl)); + } +} + +TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Rpc) { + size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE; + header_validator.set_max_payload_size(payload_size); + // Default to max_payload_size if a specific MTU is not set + EXPECT_EQ(payload_size, + header_validator.max_payload_size_by_service_type(kRpc)); + EXPECT_EQ(payload_size, + header_validator.max_payload_size_by_service_type(kBulk)); + for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { + header_validator.set_max_rpc_payload_size(value); + EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kRpc)); + EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kBulk)); + } +} + +TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Audio) { + size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE; + header_validator.set_max_payload_size(payload_size); + // Default to max_payload_size if a specific MTU is not set + EXPECT_EQ(payload_size, + header_validator.max_payload_size_by_service_type(kAudio)); + for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { + header_validator.set_max_audio_payload_size(value); + EXPECT_EQ(value, header_validator.max_payload_size_by_service_type(kAudio)); + } +} + +TEST_F(ProtocolHeaderValidatorTest, GetMaxPayloadSizeByServiceType_Video) { + size_t payload_size = MAXIMUM_FRAME_DATA_V2_SIZE; + header_validator.set_max_payload_size(payload_size); + // Default to max_payload_size if a specific MTU is not set + EXPECT_EQ(payload_size, + header_validator.max_payload_size_by_service_type(kMobileNav)); + for (size_t value = 1; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { + header_validator.set_max_video_payload_size(value); + EXPECT_EQ(value, + header_validator.max_payload_size_by_service_type(kMobileNav)); + } +} + +// Protocol version shall be from 1 to 5 TEST_F(ProtocolHeaderValidatorTest, Malformed_Version) { std::vector malformed_versions; malformed_versions.push_back(0); - for (uint8_t version = PROTOCOL_VERSION_4 + 1; + for (uint8_t version = PROTOCOL_VERSION_5 + 1; version <= PROTOCOL_VERSION_MAX; ++version) { malformed_versions.push_back(version); -- cgit v1.2.1 From c39bb5becd1e37530c4f8fea54b23d563620f3ef Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Tue, 25 Jul 2017 11:20:38 -0400 Subject: Implement reading and writing constructed payloads for StartService and EndService --- .../connection_handler/connection_handler_impl.h | 10 +- .../src/connection_handler_impl.cc | 18 +- .../test/connection_handler_impl_test.cc | 18 +- .../include/protocol_handler/session_observer.h | 9 +- .../test/protocol_handler/mock_session_observer.h | 6 + .../protocol_handler/protocol_handler_impl.h | 29 ++ .../include/protocol_handler/protocol_packet.h | 44 +++ .../protocol_handler/src/protocol_handler_impl.cc | 298 +++++++++++++++++++-- .../protocol_handler/src/protocol_packet.cc | 42 +++ .../test/protocol_handler_tm_test.cc | 8 +- 10 files changed, 440 insertions(+), 42 deletions(-) diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h index cd8aec0ff3..a6651a6466 100644 --- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h +++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h @@ -189,20 +189,26 @@ class ConnectionHandlerImpl const bool is_protected, uint32_t* hash_id); + // DEPRECATED + uint32_t OnSessionEndedCallback( + const transport_manager::ConnectionUID connection_handle, + const uint8_t session_id, + const uint32_t& hashCode, + const protocol_handler::ServiceType& service_type) OVERRIDE; /** * \brief Callback function used by ProtocolHandler * when Mobile Application initiates session ending. * \param connection_handle Connection identifier within which session exists * \param sessionId Identifier of the session to be ended * \param hashCode Hash used only in second version of SmartDeviceLink - * protocol. + * protocol. (Set to HASH_ID_WRONG if the hash is incorrect) * If not equal to hash assigned to session on start then operation fails. * \return uint32_t 0 if operation fails, session key otherwise */ uint32_t OnSessionEndedCallback( const transport_manager::ConnectionUID connection_handle, const uint8_t session_id, - const uint32_t& hashCode, + uint32_t* hashCode, const protocol_handler::ServiceType& service_type) OVERRIDE; /** diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index 0f6720f6a1..125a6cd769 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -378,11 +378,22 @@ void ConnectionHandlerImpl::OnMalformedMessageCallback( CloseConnection(connection_handle); } +// DEPRECATED uint32_t ConnectionHandlerImpl::OnSessionEndedCallback( const transport_manager::ConnectionUID connection_handle, const uint8_t session_id, const uint32_t& hashCode, const protocol_handler::ServiceType& service_type) { + uint32_t hashValue = hashCode; + return OnSessionEndedCallback( + connection_handle, session_id, &hashValue, service_type); +} + +uint32_t ConnectionHandlerImpl::OnSessionEndedCallback( + const transport_manager::ConnectionUID connection_handle, + const uint8_t session_id, + uint32_t* hashCode, + const protocol_handler::ServiceType& service_type) { LOG4CXX_AUTO_TRACE(logger_); connection_list_lock_.AcquireForReading(); @@ -402,12 +413,13 @@ uint32_t ConnectionHandlerImpl::OnSessionEndedCallback( "Session " << static_cast(session_id) << " to be removed"); // old version of protocol doesn't support hash - if (protocol_handler::HASH_ID_NOT_SUPPORTED != hashCode) { - if (protocol_handler::HASH_ID_WRONG == hashCode || - session_key != hashCode) { + if (protocol_handler::HASH_ID_NOT_SUPPORTED != *hashCode) { + if (protocol_handler::HASH_ID_WRONG == *hashCode || + session_key != *hashCode) { LOG4CXX_WARN(logger_, "Wrong hash_id for session " << static_cast(session_id)); + *hashCode = protocol_handler::HASH_ID_WRONG; return 0; } } diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc index 6b5c2c89ad..7f4429500d 100644 --- a/src/components/connection_handler/test/connection_handler_impl_test.cc +++ b/src/components/connection_handler/test/connection_handler_impl_test.cc @@ -1030,9 +1030,10 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) { TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) { AddTestDeviceConnection(); - + uint32_t dummy_hash = 0u; const uint32_t end_session_result = - connection_handler_->OnSessionEndedCallback(uid_, 0u, 0u, kAudio); + connection_handler_->OnSessionEndedCallback( + uid_, 0u, &dummy_hash, kAudio); EXPECT_EQ(0u, end_session_result); CheckSessionExists(uid_, 0); } @@ -1040,9 +1041,10 @@ TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) { TEST_F(ConnectionHandlerTest, ServiceStop_UnExistService) { AddTestDeviceConnection(); AddTestSession(); + uint32_t dummy_hash = 0u; const uint32_t end_session_result = connection_handler_->OnSessionEndedCallback( - uid_, start_session_id_, 0u, kAudio); + uid_, start_session_id_, &dummy_hash, kAudio); EXPECT_EQ(0u, end_session_result); CheckServiceExists(uid_, start_session_id_, kAudio, false); } @@ -1060,7 +1062,7 @@ TEST_F(ConnectionHandlerTest, ServiceStop) { const uint32_t end_session_result = connection_handler_->OnSessionEndedCallback( - uid_, start_session_id_, some_hash_id, kAudio); + uid_, start_session_id_, &some_hash_id, kAudio); EXPECT_EQ(connection_key_, end_session_result); CheckServiceExists(uid_, start_session_id_, kAudio, false); } @@ -1072,12 +1074,13 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckHash) { AddTestSession(); const uint32_t hash = connection_key_; - const uint32_t wrong_hash = hash + 1; + uint32_t wrong_hash = hash + 1; const uint32_t end_audio_wrong_hash = connection_handler_->OnSessionEndedCallback( - uid_, start_session_id_, wrong_hash, kRpc); + uid_, start_session_id_, &wrong_hash, kRpc); EXPECT_EQ(0u, end_audio_wrong_hash); + EXPECT_EQ(protocol_handler::HASH_ID_WRONG, wrong_hash); CheckSessionExists(uid_, start_session_id_); const uint32_t end_audio = connection_handler_->OnSessionEndedCallback( @@ -1092,13 +1095,14 @@ TEST_F(ConnectionHandlerTest, SessionStop_CheckSpecificHash) { for (uint32_t session = 0; session < 0xFF; ++session) { AddTestSession(); - const uint32_t wrong_hash = protocol_handler::HASH_ID_WRONG; + uint32_t wrong_hash = protocol_handler::HASH_ID_WRONG; const uint32_t hash = protocol_handler::HASH_ID_NOT_SUPPORTED; const uint32_t end_audio_wrong_hash = connection_handler_->OnSessionEndedCallback( uid_, start_session_id_, wrong_hash, kRpc); EXPECT_EQ(0u, end_audio_wrong_hash); + EXPECT_EQ(protocol_handler::HASH_ID_WRONG, wrong_hash); CheckSessionExists(uid_, start_session_id_); const uint32_t end_audio = connection_handler_->OnSessionEndedCallback( diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h index 5e630c6c74..a5901baf0b 100644 --- a/src/components/include/protocol_handler/session_observer.h +++ b/src/components/include/protocol_handler/session_observer.h @@ -80,6 +80,13 @@ class SessionObserver { const bool is_protected, uint32_t* hash_id) = 0; + // DEPRECATED + virtual uint32_t OnSessionEndedCallback( + const transport_manager::ConnectionUID connection_handle, + const uint8_t sessionId, + const uint32_t& hashCode, + const protocol_handler::ServiceType& service_type) = 0; + /** * \brief Callback function used by ProtocolHandler * when Mobile Application initiates session ending. @@ -94,7 +101,7 @@ class SessionObserver { virtual uint32_t OnSessionEndedCallback( const transport_manager::ConnectionUID connection_handle, const uint8_t sessionId, - const uint32_t& hashCode, + uint32_t* hashCode, const protocol_handler::ServiceType& service_type) = 0; /** diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h index c376cb85f5..0a86a29db5 100644 --- a/src/components/include/test/protocol_handler/mock_session_observer.h +++ b/src/components/include/test/protocol_handler/mock_session_observer.h @@ -59,6 +59,12 @@ class MockSessionObserver : public ::protocol_handler::SessionObserver { const uint8_t sessionId, const uint32_t& hashCode, const protocol_handler::ServiceType& service_type)); + MOCK_METHOD4( + OnSessionEndedCallback, + uint32_t(const transport_manager::ConnectionUID connection_handle, + const uint8_t sessionId, + uint32_t* hashCode, + const protocol_handler::ServiceType& service_type)); MOCK_METHOD1(OnApplicationFloodCallBack, void(const uint32_t& connection_key)); MOCK_METHOD1(OnMalformedMessageCallback, diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index b18ee07d4d..562540ff3f 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -250,6 +250,14 @@ class ProtocolHandlerImpl uint8_t service_type, bool protection); + void SendStartSessionAck(ConnectionID connection_id, + uint8_t session_id, + uint8_t protocol_version, + uint32_t hash_code, + uint8_t service_type, + bool protection, + ProtocolPacket::ProtocolVersion& full_version); + const ProtocolHandlerSettings& get_settings() const OVERRIDE { return settings_; } @@ -266,6 +274,12 @@ class ProtocolHandlerImpl uint8_t protocol_version, uint8_t service_type); + void SendStartSessionNAck(ConnectionID connection_id, + uint8_t session_id, + uint8_t protocol_version, + uint8_t service_type, + std::vector& rejectedParams); + /** * \brief Sends acknowledgement of end session/service to mobile application * with session number for second version of protocol. @@ -294,6 +308,21 @@ class ProtocolHandlerImpl uint32_t session_id, uint8_t protocol_version, uint8_t service_type); + /** + * \brief Sends fail of ending session to mobile application (variant for + * Protocol v5) + * \param connection_id Identifier of connection within which + * session exists + * \param session_id ID of session ment to be ended + * \param protocol_version Version of protocol used for communication + * \param service_type Type of session: RPC or BULK Data. RPC by default + * \param rejected_params List of rejected params to send in payload + */ + void SendEndSessionNAck(ConnectionID connection_id, + uint32_t session_id, + uint8_t protocol_version, + uint8_t service_type, + std::vector& rejected_params); SessionObserver& get_session_observer() OVERRIDE; diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h index 276c416d59..eae4a74025 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h @@ -63,6 +63,50 @@ class ProtocolPacket { uint32_t totalDataBytes; }; + class ProtocolVersion { + public: + ProtocolVersion(); + ProtocolVersion(uint8_t majorVersion, + uint8_t minorVersion, + uint8_t patchVersion); + ProtocolVersion(ProtocolVersion& other); + ProtocolVersion(std::string versionString); + uint8_t majorVersion; + uint8_t minorVersion; + uint8_t patchVersion; + static inline uint8_t cmp(const ProtocolVersion& version1, + const ProtocolVersion& version2) { + uint8_t diff = version1.majorVersion - version2.majorVersion; + if (diff == 0) { + diff = version1.minorVersion - version2.minorVersion; + if (diff == 0) { + diff = version1.minorVersion - version2.minorVersion; + } + } + return diff; + } + inline bool operator==(const ProtocolVersion& other) { + return ProtocolVersion::cmp(*this, other) == 0; + } + inline bool operator<(const ProtocolVersion& other) { + return ProtocolVersion::cmp(*this, other) < 0; + } + bool operator>(const ProtocolVersion& other) { + return ProtocolVersion::cmp(*this, other) > 0; + } + inline bool operator<=(const ProtocolVersion& other) { + return ProtocolVersion::cmp(*this, other) <= 0; + } + bool operator>=(const ProtocolVersion& other) { + return ProtocolVersion::cmp(*this, other) >= 0; + } + static inline ProtocolVersion* min(ProtocolVersion& version1, + ProtocolVersion& version2) { + return (version1 < version2) ? &version1 : &version2; + } + std::string to_string(); + }; + /** * \class ProtocolHeader * \brief Used for storing protocol header of a message. diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 1fd49222f0..fce8cbfcea 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -33,6 +33,7 @@ #include "protocol_handler/protocol_handler_impl.h" #include #include // std::find +#include #include "connection_handler/connection_handler_impl.h" #include "protocol_handler/session_observer.h" @@ -57,6 +58,8 @@ std::string ConvertPacketDataToString(const uint8_t* data, const size_t kStackSize = 32768; +ProtocolPacket::ProtocolVersion defaultProtocolVersion(5, 0, 0); + ProtocolHandlerImpl::ProtocolHandlerImpl( const ProtocolHandlerSettings& settings, protocol_handler::SessionObserver& session_observer, @@ -184,17 +187,38 @@ void set_hash_id(uint32_t hash_id, protocol_handler::ProtocolPacket& packet) { void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id, uint8_t session_id, - uint8_t, + uint8_t protocol_version, uint32_t hash_id, uint8_t service_type, bool protection) { LOG4CXX_AUTO_TRACE(logger_); + ProtocolPacket::ProtocolVersion* fullVersion = + new ProtocolPacket::ProtocolVersion(); + SendStartSessionAck(connection_id, + session_id, + protocol_version, + hash_id, + service_type, + protection, + *fullVersion); + delete fullVersion; +} + +void ProtocolHandlerImpl::SendStartSessionAck( + ConnectionID connection_id, + uint8_t session_id, + uint8_t protocol_version, + uint32_t hash_id, + uint8_t service_type, + bool protection, + ProtocolPacket::ProtocolVersion& full_version) { + LOG4CXX_AUTO_TRACE(logger_); - uint8_t protocolVersion = SupportedSDLProtocolVersion(); + uint8_t maxProtocolVersion = SupportedSDLProtocolVersion(); ProtocolFramePtr ptr( new protocol_handler::ProtocolPacket(connection_id, - protocolVersion, + maxProtocolVersion, protection, FRAME_TYPE_CONTROL, service_type, @@ -203,7 +227,38 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id, 0u, message_counters_[session_id]++)); - set_hash_id(hash_id, *ptr); + // Cannot include a constructed payload if either side doesn't support it + if (maxProtocolVersion >= PROTOCOL_VERSION_5) { + ServiceType serviceTypeValue = ServiceTypeFromByte(service_type); + + BsonObject payloadObj; + bson_object_initialize_default(&payloadObj); + bson_object_put_int32(&payloadObj, "hashId", static_cast(hash_id)); + bson_object_put_int64( + &payloadObj, + "mtu", + static_cast( + protocol_header_validator_.max_payload_size_by_service_type( + serviceTypeValue))); + if (serviceTypeValue == kRpc) { + // Minimum protocol version supported by both + ProtocolPacket::ProtocolVersion* minVersion = + (full_version.majorVersion < PROTOCOL_VERSION_5) + ? &defaultProtocolVersion + : ProtocolPacket::ProtocolVersion::min(full_version, + defaultProtocolVersion); + char protocolVersionString[255]; + strncpy(protocolVersionString, (*minVersion).to_string().c_str(), 255); + bson_object_put_string( + &payloadObj, "protocolVersion", protocolVersionString); + } + uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); + ptr->set_data(payloadBytes, bson_object_size(&payloadObj)); + free(payloadBytes); + bson_object_deinitialize(&payloadObj); + } else { + set_hash_id(hash_id, *ptr); + } raw_ford_messages_to_mobile_.PostMessage( impl::RawFordMessageToMobile(ptr, false)); @@ -243,6 +298,52 @@ void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id, << static_cast(session_id)); } +void ProtocolHandlerImpl::SendStartSessionNAck( + ConnectionID connection_id, + uint8_t session_id, + uint8_t protocol_version, + uint8_t service_type, + std::vector& rejectedParams) { + LOG4CXX_AUTO_TRACE(logger_); + + ProtocolFramePtr ptr( + new protocol_handler::ProtocolPacket(connection_id, + protocol_version, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + service_type, + FRAME_DATA_START_SERVICE_NACK, + session_id, + 0u, + message_counters_[session_id]++)); + + if (rejectedParams.size() > 0) { + BsonObject payloadObj; + bson_object_initialize_default(&payloadObj); + BsonArray rejectedParamsArr; + bson_array_initialize(&rejectedParamsArr, rejectedParams.size()); + for (std::string param : rejectedParams) { + char paramPtr[255]; + strncpy(paramPtr, param.c_str(), 255); + bson_array_add_string(&rejectedParamsArr, paramPtr); + } + bson_object_put_array(&payloadObj, "rejectedParams", &rejectedParamsArr); + uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); + ptr->set_data(payloadBytes, bson_object_size(&payloadObj)); + free(payloadBytes); + bson_object_deinitialize(&payloadObj); + } + + raw_ford_messages_to_mobile_.PostMessage( + impl::RawFordMessageToMobile(ptr, false)); + + LOG4CXX_DEBUG(logger_, + "SendStartSessionNAck() for connection " + << connection_id << " for service_type " + << static_cast(service_type) << " session_id " + << static_cast(session_id)); +} + void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id, uint32_t session_id, uint8_t protocol_version, @@ -270,6 +371,51 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id, << static_cast(session_id)); } +void ProtocolHandlerImpl::SendEndSessionNAck( + ConnectionID connection_id, + uint32_t session_id, + uint8_t protocol_version, + uint8_t service_type, + std::vector& rejectedParams) { + LOG4CXX_AUTO_TRACE(logger_); + + ProtocolFramePtr ptr( + new protocol_handler::ProtocolPacket(connection_id, + protocol_version, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + service_type, + FRAME_DATA_END_SERVICE_NACK, + session_id, + 0u, + message_counters_[session_id]++)); + if (rejectedParams.size() > 0) { + BsonObject payloadObj; + bson_object_initialize_default(&payloadObj); + BsonArray rejectedParamsArr; + bson_array_initialize(&rejectedParamsArr, rejectedParams.size()); + for (std::string param : rejectedParams) { + char paramPtr[255]; + strncpy(paramPtr, param.c_str(), 255); + bson_array_add_string(&rejectedParamsArr, paramPtr); + } + bson_object_put_array(&payloadObj, "rejectedParams", &rejectedParamsArr); + uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); + ptr->set_data(payloadBytes, bson_object_size(&payloadObj)); + free(payloadBytes); + bson_object_deinitialize(&payloadObj); + } + + raw_ford_messages_to_mobile_.PostMessage( + impl::RawFordMessageToMobile(ptr, false)); + + LOG4CXX_DEBUG(logger_, + "SendEndSessionNAck() for connection " + << connection_id << " for service_type " + << static_cast(service_type) << " session_id " + << static_cast(session_id)); +} + SessionObserver& ProtocolHandlerImpl::get_session_observer() { return session_observer_; } @@ -421,7 +567,7 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message, metric_observer_->StartMessageProcess(message_id, start_time); } #endif // TELEMETRY_MONITOR - const size_t max_frame_size = get_settings().maximum_payload_size(); + size_t max_frame_size = get_settings().maximum_payload_size(); size_t frame_size = MAXIMUM_FRAME_DATA_V2_SIZE; switch (message->protocol_version()) { case PROTOCOL_VERSION_3: @@ -430,6 +576,13 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message, ? max_frame_size : MAXIMUM_FRAME_DATA_V2_SIZE; break; + case PROTOCOL_VERSION_5: + max_frame_size = + protocol_header_validator_.max_payload_size_by_service_type( + ServiceTypeFromByte(message->service_type())); + frame_size = max_frame_size > MAXIMUM_FRAME_DATA_V2_SIZE + ? max_frame_size + : MAXIMUM_FRAME_DATA_V2_SIZE; default: break; } @@ -932,10 +1085,18 @@ uint32_t get_hash_id(const ProtocolPacket& packet) { LOG4CXX_WARN(logger_, "Packet without hash data (data size less 4)"); return HASH_ID_WRONG; } - const uint32_t hash_be = *(reinterpret_cast(packet.data())); - const uint32_t hash_le = BE_TO_LE32(hash_be); - // null hash is wrong hash value - return hash_le == HASH_ID_NOT_SUPPORTED ? HASH_ID_WRONG : hash_le; + if (packet.protocol_version() >= PROTOCOL_VERSION_5) { + BsonObject obj = bson_object_from_bytes(packet.data()); + const uint32_t hash_id = (uint32_t)bson_object_get_int32(&obj, "hashId"); + bson_object_deinitialize(&obj); + return hash_id; + } else { + const uint32_t hash_be = *(reinterpret_cast(packet.data())); + const uint32_t hash_le = BE_TO_LE32(hash_be); + + // null hash is wrong hash value + return hash_le == HASH_ID_NOT_SUPPORTED ? HASH_ID_WRONG : hash_le; + } } RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession( @@ -943,12 +1104,14 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession( LOG4CXX_AUTO_TRACE(logger_); const uint8_t current_session_id = packet.session_id(); - const uint32_t hash_id = get_hash_id(packet); + uint32_t hash_id; + + hash_id = get_hash_id(packet); const ServiceType service_type = ServiceTypeFromByte(packet.service_type()); const ConnectionID connection_id = packet.connection_id(); const uint32_t session_key = session_observer_.OnSessionEndedCallback( - connection_id, current_session_id, hash_id, service_type); + connection_id, current_session_id, &hash_id, service_type); // TODO(EZamakhov): add clean up output queue (for removed service) if (session_key != 0) { @@ -961,10 +1124,22 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession( LOG4CXX_WARN(logger_, "Refused to end session " << static_cast(service_type) << " type."); - SendEndSessionNAck(connection_id, - current_session_id, - packet.protocol_version(), - service_type); + if (packet.protocol_version() >= PROTOCOL_VERSION_5) { + std::vector rejectedParams(0, std::string("")); + if (hash_id == protocol_handler::HASH_ID_WRONG) { + rejectedParams.push_back(std::string("hashId")); + } + SendEndSessionNAck(connection_id, + current_session_id, + packet.protocol_version(), + service_type, + rejectedParams); + } else { + SendEndSessionNAck(connection_id, + current_session_id, + packet.protocol_version(), + service_type); + } } return RESULT_OK; } @@ -1014,7 +1189,28 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { , protocol_version_(protocol_version) , hash_id_(hash_id) , service_type_(service_type) - , force_protected_service_(force_protected_service) {} + , force_protected_service_(force_protected_service) + , full_version_() {} + StartSessionHandler(uint32_t connection_key, + ProtocolHandlerImpl* protocol_handler, + SessionObserver& session_observer, + ConnectionID connection_id, + int32_t session_id, + uint8_t protocol_version, + uint32_t hash_id, + ServiceType service_type, + const std::vector& force_protected_service, + ProtocolPacket::ProtocolVersion& full_version) + : connection_key_(connection_key) + , protocol_handler_(protocol_handler) + , session_observer_(session_observer) + , connection_id_(connection_id) + , session_id_(session_id) + , protocol_version_(protocol_version) + , hash_id_(hash_id) + , service_type_(service_type) + , force_protected_service_(force_protected_service) + , full_version_(full_version) {} bool OnHandshakeDone( const uint32_t connection_key, @@ -1067,6 +1263,7 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { const uint32_t hash_id_; const ServiceType service_type_; const std::vector force_protected_service_; + const ProtocolPacket::ProtocolVersion full_version_; }; } // namespace #endif // ENABLE_SECURITY @@ -1129,7 +1326,26 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( PROTECTION_OFF); return RESULT_OK; } - if (ssl_context->IsInitCompleted()) { + ProtocolPacket::ProtocolVersion* fullVersion; + std::vector rejectedParams(0, std::string("")); + if (packet.data_size() != 0) { + BsonObject obj = bson_object_from_bytes(packet.data()); + fullVersion = new ProtocolPacket::ProtocolVersion( + std::string(bson_object_get_string(&obj, "protocolVersion"))); + bson_object_deinitialize(&obj); + if (fullVersion->majorVersion < PROTOCOL_VERSION_5) { + rejectedParams.push_back(std::string("protocolVersion")); + } + } else { + fullVersion = new ProtocolPacket::ProtocolVersion(); + } + if (!rejectedParams.empty()) { + SendStartSessionNAck(connection_id, + packet.session_id(), + protocol_version, + packet.service_type(), + rejectedParams); + } else if (ssl_context->IsInitCompleted()) { // mark service as protected session_observer_.SetProtectionFlag(connection_key, service_type); // Start service as protected with current SSLContext @@ -1138,7 +1354,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( packet.protocol_version(), hash_id, packet.service_type(), - PROTECTION_ON); + PROTECTION_ON, + *fullVersion); } else { security_manager_->AddListener( new StartSessionHandler(connection_key, @@ -1149,25 +1366,54 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( packet.protocol_version(), hash_id, service_type, - get_settings().force_protected_service())); + get_settings().force_protected_service(), + *fullVersion)); if (!ssl_context->IsHandshakePending()) { // Start handshake process security_manager_->StartHandshake(connection_key); } } + delete fullVersion; LOG4CXX_DEBUG(logger_, "Protection establishing for connection " << connection_key << " is in progress"); return RESULT_OK; } #endif // ENABLE_SECURITY - // Start service without protection - SendStartSessionAck(connection_id, - session_id, - packet.protocol_version(), - hash_id, - packet.service_type(), - PROTECTION_OFF); + if (packet.data_size() != 0) { + BsonObject obj = bson_object_from_bytes(packet.data()); + ProtocolPacket::ProtocolVersion fullVersion( + bson_object_get_string(&obj, "protocolVersion")); + bson_object_deinitialize(&obj); + + if (fullVersion.majorVersion >= PROTOCOL_VERSION_5) { + // Start service without protection + SendStartSessionAck(connection_id, + session_id, + packet.protocol_version(), + hash_id, + packet.service_type(), + PROTECTION_OFF, + fullVersion); + } else { + std::vector rejectedParams(1, + std::string("protocolVersion")); + SendStartSessionNAck(connection_id, + packet.session_id(), + protocol_version, + packet.service_type(), + rejectedParams); + } + + } else { + // Start service without protection + SendStartSessionAck(connection_id, + session_id, + packet.protocol_version(), + hash_id, + packet.service_type(), + PROTECTION_OFF); + } return RESULT_OK; } diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc index d4daffe1d7..0cf884f736 100644 --- a/src/components/protocol_handler/src/protocol_packet.cc +++ b/src/components/protocol_handler/src/protocol_packet.cc @@ -52,6 +52,48 @@ ProtocolPacket::ProtocolData::~ProtocolData() { delete[] data; } +ProtocolPacket::ProtocolVersion::ProtocolVersion() + : majorVersion(0), minorVersion(0), patchVersion(0) {} + +ProtocolPacket::ProtocolVersion::ProtocolVersion(uint8_t majorVersion, + uint8_t minorVersion, + uint8_t patchVersion) + : majorVersion(majorVersion) + , minorVersion(minorVersion) + , patchVersion(patchVersion) {} + +ProtocolPacket::ProtocolVersion::ProtocolVersion(ProtocolVersion& other) { + this->majorVersion = other.majorVersion; + this->minorVersion = other.minorVersion; + this->patchVersion = other.patchVersion; +} + +ProtocolPacket::ProtocolVersion::ProtocolVersion(std::string versionString) + : majorVersion(0), minorVersion(0), patchVersion(0) { + unsigned int majorInt, minorInt, patchInt; + int readElements = sscanf( + versionString.c_str(), "%u.%u.%u", &majorInt, &minorInt, &patchInt); + if (readElements != 3) { + LOG4CXX_WARN(logger_, + "Error while parsing version string: " << versionString); + } else { + majorVersion = static_cast(majorInt); + minorVersion = static_cast(minorInt); + patchVersion = static_cast(patchInt); + } +} + +std::string ProtocolPacket::ProtocolVersion::to_string() { + char versionString[255]; + snprintf(versionString, + 255, + "%u.%u.%u", + static_cast(majorVersion), + static_cast(minorVersion), + static_cast(patchVersion)); + return std::string(versionString); +} + ProtocolPacket::ProtocolHeader::ProtocolHeader() : version(0x00) , protection_flag(PROTECTION_OFF) diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index 308901e013..66226825ba 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -96,6 +96,7 @@ using connection_handler::DeviceHandle; using ::testing::Return; using ::testing::ReturnRefOfCopy; using ::testing::ReturnNull; +using ::testing::An; using ::testing::AnyOf; using ::testing::DoAll; using ::testing::_; @@ -500,12 +501,12 @@ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) { uint32_t times = 0; AddSession(waiter, times); - const ServiceType service = kRpc; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, - OnSessionEndedCallback(connection_id, session_id, _, service)) + OnSessionEndedCallback( + connection_id, session_id, An(), service)) . // reject session start WillOnce( @@ -539,7 +540,8 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) { // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, - OnSessionEndedCallback(connection_id, session_id, _, service)) + OnSessionEndedCallback( + connection_id, session_id, An(), service)) . // return sessions start success WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(connection_key))); -- cgit v1.2.1 From 60707ab4ce9f50b25b980a8485b55807b3cc6f6e Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Tue, 25 Jul 2017 12:33:17 -0400 Subject: Update BSON lib README --- src/3rd_party/bson_c_lib/README.md | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/src/3rd_party/bson_c_lib/README.md b/src/3rd_party/bson_c_lib/README.md index 81a2887b5d..7fb06298d4 100644 --- a/src/3rd_party/bson_c_lib/README.md +++ b/src/3rd_party/bson_c_lib/README.md @@ -6,34 +6,14 @@ Library for converting to and from BSON make ``` -## Build and run sample program ## +## Install library ## ```bash -make sample -LD_LIBRARY_PATH=. ./sample +sudo make install ``` -### What is this repository for? ### - -* Quick summary -* Version -* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo) - -### How do I get set up? ### - -* Summary of set up -* Configuration -* Dependencies -* Database configuration -* How to run tests -* Deployment instructions - -### Contribution guidelines ### - -* Writing tests -* Code review -* Other guidelines - -### Who do I talk to? ### - -* Repo owner or admin -* Other community or team contact \ No newline at end of file +## Build and run sample program ## +```bash +cd examples +gcc -o sample sample.c -lbson -lemhashmap +./sample +``` -- cgit v1.2.1 From d1e98a00954006fa195e1138278f25db1ab027bc Mon Sep 17 00:00:00 2001 From: Masato Ogawa Date: Thu, 27 Jul 2017 17:39:38 +0900 Subject: Add TouchType CANCEL During operation with a SDL application supporting video streaming, a native dialog such as incoming-call may interrupt. If touch events before and after a screen interruption are evaluated as one gesture, an unexpected gesture may be detected. By notifying CANCEL, HMI can cancel gesture recognitions of a SDL application. This is for discussion on proposal SDL-0049. --- src/components/interfaces/HMI_API.xml | 1 + src/components/interfaces/MOBILE_API.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 0d6d5fad3d..2bcc3a7556 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -824,6 +824,7 @@ + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 953f270741..d6df600d45 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1700,6 +1700,7 @@ + -- cgit v1.2.1 From 1713cb8ee875b08a6547735f453a6c3428d4a91e Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 27 Jul 2017 10:33:29 -0400 Subject: Mobile Projection Implementation and Unit Tests --- .../include/application_manager/application.h | 3 ++ .../include/application_manager/application_impl.h | 5 +++ .../application_manager/application_manager_impl.h | 2 + .../include/application_manager/hmi_state.h | 2 + .../application_manager/src/application_impl.cc | 18 ++++++++- .../src/application_manager_impl.cc | 47 ++++++++++++++++++---- .../commands/mobile/on_touch_event_notification.cc | 21 ++++++++-- .../mobile/register_app_interface_request.cc | 10 ++++- .../application_manager/src/hmi_state.cc | 8 +++- .../src/state_controller_impl.cc | 13 ++++-- .../test/application_impl_test.cc | 27 +++++++++++++ .../mobile/on_touch_event_notification_test.cc | 20 +++++++-- .../include/application_manager/mock_application.h | 2 + .../application_manager/application_manager.h | 3 ++ .../application_manager/mock_application_manager.h | 4 ++ src/components/interfaces/HMI_API.xml | 1 + src/components/interfaces/MOBILE_API.xml | 1 + 17 files changed, 167 insertions(+), 20 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index c523f61329..a0abfb79d4 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -427,6 +427,9 @@ class Application : public virtual InitialApplicationData, virtual bool is_navi() const = 0; virtual void set_is_navi(bool allow) = 0; + virtual void SetMobileProjectionEnabled(bool option) = 0; + virtual bool MobileProjectionEnabled() const = 0; + virtual bool video_streaming_approved() const = 0; virtual void set_video_streaming_approved(bool state) = 0; virtual bool audio_streaming_approved() const = 0; diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index ae63a2f8ae..2d2994fe7d 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -96,6 +96,10 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, } void set_is_navi(bool allow); + void SetMobileProjectionEnabled(bool option); + + bool MobileProjectionEnabled() const; + bool video_streaming_approved() const; void set_video_streaming_approved(bool state); bool audio_streaming_approved() const; @@ -338,6 +342,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, smart_objects::SmartObject* active_message_; bool is_media_; bool is_navi_; + bool mobile_projection_enabled_; bool video_streaming_approved_; bool audio_streaming_approved_; diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 0e6f598a9c..596b9303f3 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -243,10 +243,12 @@ class ApplicationManagerImpl std::vector applications_by_button( uint32_t button) OVERRIDE; std::vector applications_with_navi() OVERRIDE; + std::vector applications_with_mobile_projection() OVERRIDE; ApplicationSharedPtr get_limited_media_application() const OVERRIDE; ApplicationSharedPtr get_limited_navi_application() const OVERRIDE; ApplicationSharedPtr get_limited_voice_application() const OVERRIDE; + ApplicationSharedPtr get_limited_mobile_projection_application() const OVERRIDE; uint32_t application_id(const int32_t correlation_id) OVERRIDE; void set_application_id(const int32_t correlation_id, diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h index 799fdff67d..939b8b86d0 100644 --- a/src/components/application_manager/include/application_manager/hmi_state.h +++ b/src/components/application_manager/include/application_manager/hmi_state.h @@ -196,6 +196,8 @@ class HmiState { */ bool is_voice_communication_app(const uint32_t app_id) const; + bool is_mobile_projection_app(const uint32_t app_id) const; + private: void operator=(const HmiState&); }; diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 5f9c4386f5..7c5f7ed6fa 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -88,6 +88,7 @@ ApplicationImpl::ApplicationImpl( , active_message_(NULL) , is_media_(false) , is_navi_(false) + , mobile_projection_enabled_(false) , video_streaming_approved_(false) , audio_streaming_approved_(false) , video_streaming_allowed_(false) @@ -179,6 +180,7 @@ bool ApplicationImpl::is_audio() const { void ApplicationImpl::ChangeSupportingAppHMIType() { is_navi_ = false; is_voice_communication_application_ = false; + mobile_projection_enabled_ = false; const smart_objects::SmartObject& array_app_types = *app_types_; uint32_t lenght_app_types = array_app_types.length(); @@ -193,6 +195,11 @@ void ApplicationImpl::ChangeSupportingAppHMIType() { array_app_types[i].asUInt())) { is_voice_communication_application_ = true; } + if (mobile_apis::AppHMIType::PROJECTION == + static_cast( + array_app_types[i].asUInt())) { + mobile_projection_enabled_ = true; + } } } @@ -228,6 +235,15 @@ void ApplicationImpl::SetPostponedState(HmiStatePtr state) { state_.AddState(state); } +void ApplicationImpl::SetMobileProjectionEnabled(bool option) { + LOG4CXX_AUTO_TRACE(logger_); + mobile_projection_enabled_ = option; +} + +bool ApplicationImpl::MobileProjectionEnabled() const { + return mobile_projection_enabled_; +} + struct StateIDComparator { HmiState::StateID state_id_; StateIDComparator(HmiState::StateID state_id) : state_id_(state_id) {} @@ -489,7 +505,7 @@ void ApplicationImpl::WakeUpStreaming( protocol_handler::ServiceType service_type) { using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); - + if (ServiceType::kMobileNav == service_type) { sync_primitives::AutoLock lock(video_streaming_suspended_lock_); if (video_streaming_suspended_) { diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 097abc4645..c09ddffbb5 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -291,6 +291,28 @@ ApplicationManagerImpl::applications_with_navi() { DataAccessor accessor = applications(); return FindAllApps(accessor, NaviAppPredicate); } + +bool LimitedMobileProjectionPredicate( const ApplicationSharedPtr app) { + return app ? (app->MobileProjectionEnabled() && + app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) : false; +} + +ApplicationSharedPtr ApplicationManagerImpl::get_limited_mobile_projection_application() + const { + DataAccessor accessor = applications(); + return FindApp(accessor, LimitedMobileProjectionPredicate); +} + +bool MobileProjectionPredicate(const ApplicationSharedPtr app) { + return app ? app->MobileProjectionEnabled() : false; +} + +std::vector +ApplicationManagerImpl::applications_with_mobile_projection() { + DataAccessor accessor = applications(); + return FindAllApps(accessor, MobileProjectionPredicate); +} + std::vector ApplicationManagerImpl::applications_by_button(uint32_t button) { SubscribedToButtonPredicate finder( @@ -353,6 +375,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( bool voice_state = app->is_voice_communication_supported(); bool media_state = app->is_media_application(); bool navi_state = app->is_navi(); + bool mobile_projection_state = app->MobileProjectionEnabled(); ApplicationSharedPtr active_app = active_application(); // Check app in FULL level if (active_app.valid()) { @@ -374,6 +397,10 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( if (navi_state && active_app->is_navi()) { return true; } + + if (mobile_projection_state && active_app->MobileProjectionEnabled()) { + return true; + } } // Check LIMITED apps @@ -398,6 +425,12 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( } } + if (mobile_projection_state) { + if (get_limited_mobile_projection_application().valid() && + (get_limited_mobile_projection_application()->app_id() != app->app_id())) + return true; + } + return false; } @@ -1180,7 +1213,7 @@ bool ApplicationManagerImpl::OnServiceStartedCallback( if (Compare( type, ServiceType::kMobileNav, ServiceType::kAudio)) { - if (app->is_navi()) { + if (app->is_navi() || app->MobileProjectionEnabled()) { return StartNaviService(session_key, type); } else { LOG4CXX_WARN(logger_, "Refuse not navi application"); @@ -2900,7 +2933,7 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || !app->is_navi()) { + if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id); return; } @@ -2934,7 +2967,7 @@ void ApplicationManagerImpl::OnAppStreaming( LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || !app->is_navi()) { + if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { LOG4CXX_DEBUG(logger_, " There is no navi application with id: " << app_id); return; } @@ -2954,7 +2987,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || !app->is_navi()) { + if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id); return; } @@ -3005,7 +3038,7 @@ void ApplicationManagerImpl::OnHMILevelChanged( } ApplicationSharedPtr app = application(app_id); - if (!app || !app->is_navi()) { + if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { LOG4CXX_ERROR(logger_, "Navi application not found"); return; } @@ -3128,7 +3161,7 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || !app->is_navi()) { + if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { LOG4CXX_ERROR(logger_, "Navi application not found"); return; } @@ -3149,7 +3182,7 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || !app->is_navi()) { + if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { LOG4CXX_ERROR(logger_, "Navi application not found"); return; } diff --git a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc index c769194c95..63d513bcaf 100644 --- a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc @@ -53,14 +53,29 @@ void OnTouchEventNotification::Run() { const std::vector& applications = application_manager_.applications_with_navi(); - std::vector::const_iterator it = applications.begin(); - for (; applications.end() != it; ++it) { - ApplicationSharedPtr app = *it; + const std::vector& projection_applications = + application_manager_.applications_with_mobile_projection(); + + std::vector::const_iterator nav_it = applications.begin(); + + for (; applications.end() != nav_it; ++nav_it) { + ApplicationSharedPtr app = *nav_it; if (app->IsFullscreen()) { (*message_)[strings::params][strings::connection_key] = app->app_id(); SendNotification(); } } + + std::vector::const_iterator projection_it = + projection_applications.begin(); + + for (; projection_applications.end() != projection_it; ++projection_it) { + ApplicationSharedPtr projection_app = *projection_it; + if (projection_app->IsFullscreen()) { + (*message_)[strings::params][strings::connection_key] = projection_app->app_id(); + SendNotification(); + } + } } } // namespace mobile diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 413aa1f669..3be16ec78d 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -74,6 +74,8 @@ mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) { return mobile_apis::AppHMIType::TESTING; } else if ("SYSTEM" == str) { return mobile_apis::AppHMIType::SYSTEM; + } else if ("PROJECTION" == str) { + return mobile_apis::AppHMIType::PROJECTION; } else { return mobile_apis::AppHMIType::INVALID_ENUM; } @@ -90,7 +92,8 @@ std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) { {mobile_apis::AppHMIType::SOCIAL, "SOCIAL"}, {mobile_apis::AppHMIType::BACKGROUND_PROCESS, "BACKGROUND_PROCESS"}, {mobile_apis::AppHMIType::TESTING, "TESTING"}, - {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"}}; + {mobile_apis::AppHMIType::SYSTEM, "SYSTEM"}, + {mobile_apis::AppHMIType::PROJECTION, "PROJECTION"}}; std::map::const_iterator iter = app_hmi_type_map.find(type); @@ -319,6 +322,11 @@ void RegisterAppInterfaceRequest::Run() { app_type.getElement(i).asUInt())) { application->set_voice_communication_supported(true); } + if (mobile_apis::AppHMIType::PROJECTION == + static_cast( + app_type.getElement(i).asUInt())) { + application->SetMobileProjectionEnabled(true); + } } } diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc index 1f05232476..aad927cc6a 100644 --- a/src/components/application_manager/src/hmi_state.cc +++ b/src/components/application_manager/src/hmi_state.cc @@ -1,3 +1,4 @@ + /* * Copyright (c) 2015, Ford Motor Company * All rights reserved. @@ -74,6 +75,11 @@ bool HmiState::is_voice_communication_app(const uint32_t app_id) const { return app ? app->is_voice_communication_supported() : false; } +bool HmiState::is_mobile_projection_app(const uint32_t app_id) const { + const ApplicationSharedPtr app = app_mngr_.application(app_id); + return app ? app->MobileProjectionEnabled() : false; +} + mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state() const { using namespace mobile_apis; @@ -133,7 +139,7 @@ mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const { HMILevel::HMI_NONE)) { return parent()->hmi_level(); } - if (is_navi_app(app_id_)) { + if (is_navi_app(app_id_) || is_mobile_projection_app(app_id_)) { return HMILevel::HMI_LIMITED; } if (!is_media_app(app_id_)) { diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index 06a7e508e5..c9a80e8089 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -363,7 +363,7 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app, } if (IsTempStateActive(HmiState::StateID::STATE_ID_EMBEDDED_NAVI) && - app->is_navi()) { + (app->is_navi() || app->MobileProjectionEnabled())) { LOG4CXX_DEBUG(logger_, "Resumption for navi app is not allowed. " << "EMBEDDED_NAVI event is active"); @@ -556,12 +556,19 @@ bool StateControllerImpl::IsSameAppType(ApplicationConstSharedPtr app1, ApplicationConstSharedPtr app2) { const bool both_media = app1->is_media_application() && app2->is_media_application(); + const bool both_navi = app1->is_navi() && app2->is_navi(); + const bool both_vc = app1->is_voice_communication_supported() && - app2->is_voice_communication_supported(); + app2->is_voice_communication_supported(); + const bool both_simple = !app1->IsAudioApplication() && !app2->IsAudioApplication(); - return both_simple || both_media || both_navi || both_vc; + + const bool both_projection = app1->MobileProjectionEnabled() && + app2->MobileProjectionEnabled(); + + return both_simple || both_media || both_navi || both_vc || both_projection; } void StateControllerImpl::on_event(const event_engine::Event& event) { diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index 54414a93de..6e98965e5c 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -569,12 +569,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeNotNaviNotVoice) { EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); app_impl->set_app_types(type_media); app_impl->ChangeSupportingAppHMIType(); EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); } TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) { @@ -583,12 +585,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) { EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); app_impl->set_app_types(type_comm); app_impl->ChangeSupportingAppHMIType(); EXPECT_FALSE(app_impl->is_navi()); EXPECT_TRUE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); } TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) { @@ -597,12 +601,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) { EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); app_impl->set_app_types(type_navi); app_impl->ChangeSupportingAppHMIType(); EXPECT_TRUE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); } TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) { @@ -613,12 +619,33 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) { EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); app_impl->set_app_types(app_types); app_impl->ChangeSupportingAppHMIType(); EXPECT_TRUE(app_impl->is_navi()); EXPECT_TRUE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); +} + +TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoiceAndProjection) { + smart_objects::SmartObject app_types; + app_types[0] = AppHMIType::NAVIGATION; + app_types[1] = AppHMIType::COMMUNICATION; + app_types[2] = AppHMIType::MEDIA; + app_types[3] = AppHMIType::PROJECTION; + + EXPECT_FALSE(app_impl->is_navi()); + EXPECT_FALSE(app_impl->is_voice_communication_supported()); + EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + + app_impl->set_app_types(app_types); + app_impl->ChangeSupportingAppHMIType(); + + EXPECT_TRUE(app_impl->is_navi()); + EXPECT_TRUE(app_impl->is_voice_communication_supported()); + EXPECT_TRUE(app_impl->MobileProjectionEnabled()); } TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) { diff --git a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc index 466facec1f..c90991fdf7 100644 --- a/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc +++ b/src/components/application_manager/test/commands/mobile/on_touch_event_notification_test.cc @@ -76,10 +76,16 @@ TEST_F(OnTouchEventNotificationTest, Run_AppIsNotFullscreen_UNSUCCESS) { std::vector applications_with_navi; applications_with_navi.push_back(mock_app); + std::vector applications_with_mobile_projection; + applications_with_mobile_projection.push_back(mock_app); + EXPECT_CALL(app_mngr_, applications_with_navi()) .WillOnce(Return(applications_with_navi)); - EXPECT_CALL(*mock_app, IsFullscreen()).WillOnce(Return(false)); + EXPECT_CALL(app_mngr_, applications_with_mobile_projection()) + .WillOnce(Return(applications_with_mobile_projection)); + + EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(false)); EXPECT_CALL(*mock_app, app_id()).Times(0); @@ -118,14 +124,20 @@ TEST_F(OnTouchEventNotificationTest, Run_NotEmptyListOfAppsWithNavi_SUCCESS) { std::vector applications_with_navi; applications_with_navi.push_back(mock_app); + std::vector applications_with_mobile_projection; + applications_with_mobile_projection.push_back(mock_app); + EXPECT_CALL(app_mngr_, applications_with_navi()) .WillOnce(Return(applications_with_navi)); - EXPECT_CALL(*mock_app, IsFullscreen()).WillOnce(Return(true)); + EXPECT_CALL(app_mngr_, applications_with_mobile_projection()) + .WillOnce(Return(applications_with_mobile_projection)); + + EXPECT_CALL(*mock_app, IsFullscreen()).WillRepeatedly(Return(true)); - EXPECT_CALL(*mock_app, app_id()).WillOnce(Return(kAppId)); + EXPECT_CALL(*mock_app, app_id()).WillRepeatedly(Return(kAppId)); - EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _)); + EXPECT_CALL(app_mngr_, SendMessageToMobile(CheckMessageData(), _)).Times(2); command_->Run(); } diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index 2617f777bb..b56175d44b 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -59,6 +59,8 @@ class MockApplication : public ::application_manager::Application { MOCK_METHOD0(ChangeSupportingAppHMIType, void()); MOCK_CONST_METHOD0(is_navi, bool()); MOCK_METHOD1(set_is_navi, void(bool allow)); + MOCK_CONST_METHOD0(MobileProjectionEnabled, bool()); + MOCK_METHOD1(SetMobileProjectionEnabled, void(bool allow)); MOCK_CONST_METHOD0(video_streaming_approved, bool()); MOCK_METHOD1(set_video_streaming_approved, void(bool state)); MOCK_CONST_METHOD0(audio_streaming_approved, bool()); diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index 180be220cc..7b4f55b17f 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -157,6 +157,7 @@ class ApplicationManager { uint32_t button) = 0; virtual std::vector applications_with_navi() = 0; + virtual std::vector applications_with_mobile_projection() = 0; /** * @brief Returns media application with LIMITED HMI Level if exists * @@ -182,6 +183,8 @@ class ApplicationManager { */ virtual ApplicationSharedPtr get_limited_voice_application() const = 0; + virtual ApplicationSharedPtr get_limited_mobile_projection_application() const = 0; + /** * @brief Retrieves application id associated with correlation id * diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index fc9b213d04..fb15435ca0 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -85,12 +85,16 @@ class MockApplicationManager : public application_manager::ApplicationManager { std::vector(uint32_t button)); MOCK_METHOD0(applications_with_navi, std::vector()); + MOCK_METHOD0(applications_with_mobile_projection, + std::vector()); MOCK_CONST_METHOD0(get_limited_media_application, application_manager::ApplicationSharedPtr()); MOCK_CONST_METHOD0(get_limited_navi_application, application_manager::ApplicationSharedPtr()); MOCK_CONST_METHOD0(get_limited_voice_application, application_manager::ApplicationSharedPtr()); + MOCK_CONST_METHOD0(get_limited_mobile_projection_application, + application_manager::ApplicationSharedPtr()); MOCK_METHOD1(application_id, uint32_t(const int32_t correlation_id)); MOCK_METHOD2(set_application_id, void(const int32_t correlation_id, const uint32_t app_id)); diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 0d6d5fad3d..80ee97d908 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -234,6 +234,7 @@ + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 953f270741..e482bf741c 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2051,6 +2051,7 @@ + -- cgit v1.2.1 From d790b9e7ee173b95abed7e5c863f3813c6e404f8 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 27 Jul 2017 11:20:48 -0400 Subject: Fix default max payload size values --- src/components/config_profile/src/profile.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index 09af180f2d..a75eef1fc1 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -1100,7 +1100,7 @@ void Profile::UpdateValues() { LOG_UPDATED_BOOL_VALUE(enable_protocol_5_, kEnableProtocol5Key, kSDL5Section); ReadUIntValue(&maximum_control_payload_size_, - kDefaultMaximumPayloadSize, + kDefaultMaximumControlPayloadSize, kSDL5Section, kMaximumControlPayloadSizeKey); @@ -1109,7 +1109,7 @@ void Profile::UpdateValues() { kSDL5Section); ReadUIntValue(&maximum_rpc_payload_size_, - kDefaultMaximumPayloadSize, + kDefaultMaximumRpcPayloadSize, kSDL5Section, kMaximumRpcPayloadSizeKey); @@ -1117,7 +1117,7 @@ void Profile::UpdateValues() { maximum_rpc_payload_size_, kMaximumRpcPayloadSizeKey, kSDL5Section); ReadUIntValue(&maximum_audio_payload_size_, - kDefaultMaximumPayloadSize, + kDefaultMaximumAudioPayloadSize, kSDL5Section, kMaximumAudioPayloadSizeKey); @@ -1125,7 +1125,7 @@ void Profile::UpdateValues() { maximum_audio_payload_size_, kMaximumAudioPayloadSizeKey, kSDL5Section); ReadUIntValue(&maximum_video_payload_size_, - kDefaultMaximumPayloadSize, + kDefaultMaximumVideoPayloadSize, kSDL5Section, kMaximumVideoPayloadSizeKey); -- cgit v1.2.1 From 38cf82c7b69af9f98fa0cc3bad8d1d86dcb6f618 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 27 Jul 2017 11:31:58 -0400 Subject: Add kV5 to ProtocolVersion enum --- .../include/application_manager/application_manager_impl.h | 3 ++- .../include/application_manager/message.h | 3 ++- .../application_manager/src/application_manager_impl.cc | 7 +++++++ .../src/commands/hmi/sdl_activate_app_request.cc | 3 ++- .../mobile/on_hmi_status_notification_from_mobile.cc | 11 +++++++---- .../application_manager/src/mobile_message_handler.cc | 10 +++++++--- .../test/commands/hmi/sdl_activate_app_request_test.cc | 12 ++++++------ .../mobile/on_hmi_status_notification_from_mobile_test.cc | 8 ++++---- .../application_manager/test/mobile_message_handler_test.cc | 4 ++-- 9 files changed, 39 insertions(+), 22 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 0e6f598a9c..e6148a3c1d 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1082,7 +1082,8 @@ class ApplicationManagerImpl bool operator()(const ApplicationSharedPtr app) const { return app ? handle_ == app->device() && - ProtocolVersion::kV4 == app->protocol_version() + ProtocolVersion::kV4 <= app->protocol_version() && + ProtocolVersion::kV5 >= app->protocol_version() : false; } }; diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index fe903393fb..53b2271de8 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -63,7 +63,8 @@ enum ProtocolVersion { kV1 = 1, kV2 = 2, kV3 = 3, - kV4 = 4 + kV4 = 4, + kV5 = 5 }; class Message { diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 097abc4645..8c792750a8 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1802,6 +1802,7 @@ bool ApplicationManagerImpl::ConvertMessageToSO( << message.json_message()); switch (message.protocol_version()) { + case ProtocolVersion::kV5: case ProtocolVersion::kV4: case ProtocolVersion::kV3: case ProtocolVersion::kV2: { @@ -3458,7 +3459,13 @@ ProtocolVersion ApplicationManagerImpl::SupportedSDLVersion() const { LOG4CXX_AUTO_TRACE(logger_); bool heart_beat_support = get_settings().heart_beat_timeout(); bool sdl4_support = protocol_handler_->get_settings().enable_protocol_4(); + bool sdl5_support = protocol_handler_->get_settings().enable_protocol_5(); + if (sdl5_support) { + LOG4CXX_DEBUG(logger_, + "SDL Supported protocol version " << ProtocolVersion::kV5); + return ProtocolVersion::kV5; + } if (sdl4_support) { LOG4CXX_DEBUG(logger_, "SDL Supported protocol version " << ProtocolVersion::kV4); diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc index 3a5a8d25f9..1abe38c5fe 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc @@ -46,7 +46,8 @@ struct ProtoV4AppsOnDevice : std::unary_function { bool operator()(const ApplicationSharedPtr app) const { return app ? handle_ == app->device() && - ProtocolVersion::kV4 == app->protocol_version() + ProtocolVersion::kV4 <= app->protocol_version() && + ProtocolVersion::kV5 >= app->protocol_version() : false; } }; diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc index 9b16bd3572..58fd571d08 100644 --- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc +++ b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc @@ -75,10 +75,11 @@ void OnHMIStatusNotificationFromMobile::Run() { << connection_key() << " and handle: " << handle); if (!is_apps_requested_before && - ProtocolVersion::kV4 == app->protocol_version() && app->is_foreground()) { + ProtocolVersion::kV4 <= app->protocol_version() && + ProtocolVersion::kV5 >= app->protocol_version() && app->is_foreground()) { // In case this notification will be received from mobile side with // foreground level for app on mobile, this should trigger remote - // apps list query for SDL 4.0 app + // apps list query for SDL 4.0+ app MessageHelper::SendQueryApps(connection_key(), application_manager_); return; } @@ -89,7 +90,8 @@ void OnHMIStatusNotificationFromMobile::Run() { " for handle: " << handle); - if (ProtocolVersion::kV4 == app->protocol_version()) { + if (ProtocolVersion::kV4 <= app->protocol_version() && + ProtocolVersion::kV5 >= app->protocol_version()) { const ApplicationSet& accessor = application_manager_.applications().GetData(); @@ -97,7 +99,8 @@ void OnHMIStatusNotificationFromMobile::Run() { ApplicationSetConstIt it = accessor.begin(); for (; accessor.end() != it; ++it) { if (connection_key() != (*it)->app_id() && - ProtocolVersion::kV4 == (*it)->protocol_version() && + ProtocolVersion::kV4 <= (*it)->protocol_version() && + ProtocolVersion::kV5 >= (*it)->protocol_version() && (*it)->is_foreground()) { is_another_foreground_sdl4_app = true; break; diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc index b635cb1f84..5dddf42825 100644 --- a/src/components/application_manager/src/mobile_message_handler.cc +++ b/src/components/application_manager/src/mobile_message_handler.cc @@ -87,6 +87,11 @@ MobileMessageHandler::HandleIncomingMessageProtocol( out_message = MobileMessageHandler::HandleIncomingMessageProtocolV2(message); break; + case ProtocolVersion::kV5: + LOG4CXX_DEBUG(logger_, "Protocol version - V5"); + out_message = + MobileMessageHandler::HandleIncomingMessageProtocolV2(message); + break; default: LOG4CXX_WARN(logger_, "Can't recognise protocol version"); out_message = NULL; @@ -119,9 +124,8 @@ MobileMessageHandler::HandleOutgoingMessageProtocol( if (message->protocol_version() == application_manager::kV1) { return MobileMessageHandler::HandleOutgoingMessageProtocolV1(message); } - if ((message->protocol_version() == application_manager::kV2) || - (message->protocol_version() == application_manager::kV3) || - (message->protocol_version() == application_manager::kV4)) { + if ((message->protocol_version() >= application_manager::kV2) && + (message->protocol_version() <= application_manager::kV5)) { return MobileMessageHandler::HandleOutgoingMessageProtocolV2(message); } return NULL; diff --git a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc index eeae0422d1..a2fc214b95 100644 --- a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc @@ -209,9 +209,9 @@ TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) { ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle)); EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false)); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV4)); + .WillByDefault(Return(am::ProtocolVersion::kV5)); ON_CALL(*mock_app, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV4)); + .WillByDefault(Return(am::ProtocolVersion::kV5)); const std::string url = "url"; ON_CALL(*mock_app_first, SchemaUrl()).WillByDefault(Return(url)); @@ -291,7 +291,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) { app_list_.insert(mock_app_first); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV4)); + .WillByDefault(Return(am::ProtocolVersion::kV5)); ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle)); EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true)); @@ -355,7 +355,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) { DataAccessor accessor(app_list_, lock_); EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor)); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV4)); + .WillByDefault(Return(am::ProtocolVersion::kV5)); ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle)); EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(true)); @@ -389,7 +389,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) { DataAccessor accessor(app_list_, lock_); EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor)); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV4)); + .WillByDefault(Return(am::ProtocolVersion::kV5)); EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false)); EXPECT_CALL(*message_helper_mock_, SendLaunchApp(_, _, _, _)); @@ -423,7 +423,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) { app_list_.insert(mock_app_first); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV4)); + .WillByDefault(Return(am::ProtocolVersion::kV5)); EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true)); EXPECT_CALL(*message_helper_mock_, SendLaunchApp(_, _, _, _)); diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc index 2cfed4a26a..37ed397b75 100644 --- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc +++ b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc @@ -91,7 +91,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); EXPECT_CALL(*mock_app, protocol_version()) - .WillRepeatedly(Return(ProtocolVersion::kV4)); + .WillRepeatedly(Return(ProtocolVersion::kV5)); EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true)); command->Run(); @@ -144,7 +144,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); EXPECT_CALL(*mock_app, protocol_version()) - .WillRepeatedly(Return(ProtocolVersion::kV4)); + .WillRepeatedly(Return(ProtocolVersion::kV5)); EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true)); command->Run(); @@ -224,7 +224,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false)); EXPECT_CALL(*mock_app, protocol_version()) - .WillOnce(Return(ProtocolVersion::kV4)); + .WillOnce(Return(ProtocolVersion::kV5)); EXPECT_CALL(app_mngr_, applications()).Times(0); @@ -261,7 +261,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); EXPECT_CALL(*mock_app, protocol_version()) - .WillRepeatedly(Return(ProtocolVersion::kV4)); + .WillRepeatedly(Return(ProtocolVersion::kV5)); EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(false)); EXPECT_CALL(app_mngr_, MarkAppsGreyOut(kHandle, false)); diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc index 07b523c56e..0fe6018aa7 100644 --- a/src/components/application_manager/test/mobile_message_handler_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_test.cc @@ -270,7 +270,7 @@ TEST_F( size_t payload_size = data.size(); std::srand(time(0)); // Generate unknown random protocol version except 1-3 - uint32_t protocol_version = 4 + rand() % UINT32_MAX; + uint32_t protocol_version = 5 + rand() % UINT32_MAX; Message* message = HandleIncomingMessage(protocol_version, data, payload_size); @@ -288,7 +288,7 @@ TEST_F( const uint32_t correlation_id = 92u; const uint32_t connection_key = 1u; // Generate unknown random protocol version except 1-3 - uint32_t protocol_version = 4 + rand() % UINT32_MAX; + uint32_t protocol_version = 5 + rand() % UINT32_MAX; MobileMessage message_to_send = CreateMessageForSending( protocol_version, function_id, correlation_id, connection_key, data); -- cgit v1.2.1 From 0189c74b82b5b89a05c768b00fe076a1f75d435c Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 27 Jul 2017 11:32:37 -0400 Subject: Fix print statements --- src/components/protocol_handler/src/protocol_packet.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc index 0cf884f736..39871d5bae 100644 --- a/src/components/protocol_handler/src/protocol_packet.cc +++ b/src/components/protocol_handler/src/protocol_packet.cc @@ -189,7 +189,7 @@ void ProtocolPacket::ProtocolHeaderValidator::set_max_payload_size( void ProtocolPacket::ProtocolHeaderValidator::set_max_control_payload_size( const size_t max_payload_size) { LOG4CXX_DEBUG(logger_, - "New maximum RPC payload size is " << max_payload_size); + "New maximum Control payload size is " << max_payload_size); max_control_payload_size_ = max_payload_size; } @@ -262,7 +262,7 @@ ProtocolPacket::ProtocolHeaderValidator::max_payload_size_by_service_type( : max_video_payload_size_; break; case kInvalidServiceType: - LOG4CXX_WARN(logger_, "Invalid service type" << static_cast(type)); + LOG4CXX_WARN(logger_, "Invalid service type: " << static_cast(type)); } return payload_size; } -- cgit v1.2.1 From 3a07ac91ccb504ed8a50fbf57452c7c4d94c54e8 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 27 Jul 2017 11:46:30 -0400 Subject: Remove BSON lib and replace with git repo section of ExternalProject command --- src/3rd_party/CMakeLists.txt | 2 + src/3rd_party/bson_c_lib/Makefile.am | 2 - src/3rd_party/bson_c_lib/Makefile.in | 794 - src/3rd_party/bson_c_lib/README.md | 19 - src/3rd_party/bson_c_lib/aclocal.m4 | 9751 ------------ src/3rd_party/bson_c_lib/compile | 347 - src/3rd_party/bson_c_lib/config.guess | 1558 -- src/3rd_party/bson_c_lib/config.h.in | 107 - src/3rd_party/bson_c_lib/config.sub | 1791 --- src/3rd_party/bson_c_lib/configure | 15032 ------------------- src/3rd_party/bson_c_lib/configure.ac | 33 - src/3rd_party/bson_c_lib/depcomp | 791 - src/3rd_party/bson_c_lib/examples/sample.c | 61 - src/3rd_party/bson_c_lib/install-sh | 527 - src/3rd_party/bson_c_lib/ltmain.sh | 9661 ------------ src/3rd_party/bson_c_lib/missing | 215 - src/3rd_party/bson_c_lib/src/Makefile.am | 11 - src/3rd_party/bson_c_lib/src/Makefile.in | 769 - src/3rd_party/bson_c_lib/src/bson_array.c | 391 - src/3rd_party/bson_c_lib/src/bson_array.h | 230 - src/3rd_party/bson_c_lib/src/bson_object.c | 404 - src/3rd_party/bson_c_lib/src/bson_object.h | 290 - src/3rd_party/bson_c_lib/src/bson_util.c | 136 - src/3rd_party/bson_c_lib/src/bson_util.h | 183 - src/3rd_party/bson_c_lib/src/emhashmap/LICENSE | 22 - src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am | 8 - src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in | 625 - src/3rd_party/bson_c_lib/src/emhashmap/README.mkd | 56 - src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c | 157 - src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h | 144 - src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh | 17 - .../bson_c_lib/src/emhashmap/tests/tests.c | 218 - 32 files changed, 2 insertions(+), 44350 deletions(-) delete mode 100644 src/3rd_party/bson_c_lib/Makefile.am delete mode 100644 src/3rd_party/bson_c_lib/Makefile.in delete mode 100644 src/3rd_party/bson_c_lib/README.md delete mode 100644 src/3rd_party/bson_c_lib/aclocal.m4 delete mode 100755 src/3rd_party/bson_c_lib/compile delete mode 100755 src/3rd_party/bson_c_lib/config.guess delete mode 100644 src/3rd_party/bson_c_lib/config.h.in delete mode 100755 src/3rd_party/bson_c_lib/config.sub delete mode 100755 src/3rd_party/bson_c_lib/configure delete mode 100644 src/3rd_party/bson_c_lib/configure.ac delete mode 100755 src/3rd_party/bson_c_lib/depcomp delete mode 100644 src/3rd_party/bson_c_lib/examples/sample.c delete mode 100755 src/3rd_party/bson_c_lib/install-sh delete mode 100644 src/3rd_party/bson_c_lib/ltmain.sh delete mode 100755 src/3rd_party/bson_c_lib/missing delete mode 100644 src/3rd_party/bson_c_lib/src/Makefile.am delete mode 100644 src/3rd_party/bson_c_lib/src/Makefile.in delete mode 100644 src/3rd_party/bson_c_lib/src/bson_array.c delete mode 100644 src/3rd_party/bson_c_lib/src/bson_array.h delete mode 100644 src/3rd_party/bson_c_lib/src/bson_object.c delete mode 100644 src/3rd_party/bson_c_lib/src/bson_object.h delete mode 100644 src/3rd_party/bson_c_lib/src/bson_util.c delete mode 100644 src/3rd_party/bson_c_lib/src/bson_util.h delete mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/LICENSE delete mode 100644 src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am delete mode 100644 src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in delete mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/README.mkd delete mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c delete mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h delete mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh delete mode 100755 src/3rd_party/bson_c_lib/src/emhashmap/tests/tests.c diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index 23f0974d27..b47aba4270 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -292,6 +292,8 @@ set(EMHASHMAP_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) include(ExternalProject) ExternalProject_Add(libbson SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bson_c_lib + GIT_REPOSITORY https://github.com/smartdevicelink/bson_c_lib.git + GIT TAG master CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bson_c_lib/configure BUILD_COMMAND make INSTALL_COMMAND sudo make install) diff --git a/src/3rd_party/bson_c_lib/Makefile.am b/src/3rd_party/bson_c_lib/Makefile.am deleted file mode 100644 index dfa49b2ea4..0000000000 --- a/src/3rd_party/bson_c_lib/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -AUTOMAKE_OPTIONS = foreign -SUBDIRS = src diff --git a/src/3rd_party/bson_c_lib/Makefile.in b/src/3rd_party/bson_c_lib/Makefile.in deleted file mode 100644 index 4d6218e40a..0000000000 --- a/src/3rd_party/bson_c_lib/Makefile.in +++ /dev/null @@ -1,794 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in compile config.guess config.sub depcomp \ - install-sh missing ltmain.sh -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AUTOMAKE_OPTIONS = foreign -SUBDIRS = src -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: check-recursive -all-am: Makefile config.h -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) all install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-cscope clean-generic \ - clean-libtool cscope cscopelist-am ctags ctags-am dist \ - dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/3rd_party/bson_c_lib/README.md b/src/3rd_party/bson_c_lib/README.md deleted file mode 100644 index 7fb06298d4..0000000000 --- a/src/3rd_party/bson_c_lib/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# README # -Library for converting to and from BSON - -## Build library ## -```bash -make -``` - -## Install library ## -```bash -sudo make install -``` - -## Build and run sample program ## -```bash -cd examples -gcc -o sample sample.c -lbson -lemhashmap -./sample -``` diff --git a/src/3rd_party/bson_c_lib/aclocal.m4 b/src/3rd_party/bson_c_lib/aclocal.m4 deleted file mode 100644 index 05207cfdf0..0000000000 --- a/src/3rd_party/bson_c_lib/aclocal.m4 +++ /dev/null @@ -1,9751 +0,0 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool 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 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -]) - -# serial 57 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl -dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -_LT_OUTPUT_LIBTOOL_INIT -]) - -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2011 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - _LT_PROG_REPLACE_SHELLFNS - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Go], [_LT_LANG(GO)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -m4_ifndef([AC_PROG_GO], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_GO. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -m4_defun([AC_PROG_GO], -[AC_LANG_PUSH(Go)dnl -AC_ARG_VAR([GOC], [Go compiler command])dnl -AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl -_AC_ARG_VAR_LDFLAGS()dnl -AC_CHECK_TOOL(GOC, gccgo) -if test -z "$GOC"; then - if test -n "$ac_tool_prefix"; then - AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) - fi -fi -if test -z "$GOC"; then - AC_CHECK_PROG(GOC, gccgo, gccgo, false) -fi -])#m4_defun -])#m4_ifndef - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([AC_PROG_GO], - [LT_LANG(GO)], - [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES([TAG]) -# --------------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], - [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -case "$ECHO" in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([${with_sysroot}]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac - - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" -])# _LT_ENABLE_LOCK - - -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[[4-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[23]].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi]) -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ F* | *Sun*Fortran*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Intel*\ [[CF]]*Compiler*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - *Portland\ Group*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - _LT_TAGVAR(link_all_deplibs, $1)=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting ${shlibpath_var} if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report which library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC="$lt_save_CC" -])# _LT_LANG_C_CONFIG - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test "$GXX" = yes; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test "$_lt_caught_CXX_error" != yes - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF -package foo -func foo() { -} -_LT_EOF -]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" || - test $p = "-R"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)="${prev}${p}" - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test "$pre_test_object_deps_done" = no; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)="$p" - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)="$p" - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; - -linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; - -solaris*) - case $cc_basename in - CC* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$G77" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" -fi # test "$_lt_disable_F77" != yes - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test "$_lt_disable_FC" != yes - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_GO_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Go compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_GO_CONFIG], -[AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE - -# Source file extension for Go test sources. -ac_ext=go - -# Object file extension for compiled Go test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="package main; func main() { }" - -# Code to be used in simple link tests -lt_simple_link_test_code='package main; func main() { }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GOC-"gccgo"} -CFLAGS=$GOFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)="$LD" -_LT_CC_BASENAME([$compiler]) - -# Go did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GO_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_GO -# ---------- -AC_DEFUN([LT_PROG_GO], -[AC_CHECK_TOOL(GOC, gccgo,) -]) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -AC_MSG_RESULT([$xsi_shell]) -_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) - -AC_MSG_CHECKING([whether the shell understands "+="]) -lt_shell_append=no -( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -AC_MSG_RESULT([$lt_shell_append]) -_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) - - -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) - - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) - - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) - - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) - - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi - -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) - - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) - -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine which file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS - -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 7 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [pic_mode=default]) - -test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) - -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) - -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# @configure_input@ - -# serial 3337 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4.2]) -m4_define([LT_PACKAGE_REVISION], [1.3337]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.2' -macro_revision='1.3337' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) - -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) - -# Copyright (C) 2002-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - diff --git a/src/3rd_party/bson_c_lib/compile b/src/3rd_party/bson_c_lib/compile deleted file mode 100755 index 531136b068..0000000000 --- a/src/3rd_party/bson_c_lib/compile +++ /dev/null @@ -1,347 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2012-10-14.11; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# 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 2, 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 . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/3rd_party/bson_c_lib/config.guess b/src/3rd_party/bson_c_lib/config.guess deleted file mode 100755 index b79252d6b1..0000000000 --- a/src/3rd_party/bson_c_lib/config.guess +++ /dev/null @@ -1,1558 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-06-10' - -# This file 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 . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches with a ChangeLog entry to config-patches@gnu.org. - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; -esac - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/src/3rd_party/bson_c_lib/config.h.in b/src/3rd_party/bson_c_lib/config.h.in deleted file mode 100644 index 26a7a34bd3..0000000000 --- a/src/3rd_party/bson_c_lib/config.h.in +++ /dev/null @@ -1,107 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT64_T - -/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT8_T - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef int32_t - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef int64_t - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef uint64_t - -/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -#undef uint8_t diff --git a/src/3rd_party/bson_c_lib/config.sub b/src/3rd_party/bson_c_lib/config.sub deleted file mode 100755 index 9633db7046..0000000000 --- a/src/3rd_party/bson_c_lib/config.sub +++ /dev/null @@ -1,1791 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-08-10' - -# This file 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 . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches with a ChangeLog entry to config-patches@gnu.org. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2013 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or1k-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/src/3rd_party/bson_c_lib/configure b/src/3rd_party/bson_c_lib/configure deleted file mode 100755 index 0fb2eb03d0..0000000000 --- a/src/3rd_party/bson_c_lib/configure +++ /dev/null @@ -1,15032 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for bson_c_lib 0.1. -# -# Report bugs to . -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and jacob@livio.io -$0: about your system, including any error possibly output -$0: before this message. Then install a modern shell, or -$0: manually run the script under such a shell if you do -$0: have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='bson_c_lib' -PACKAGE_TARNAME='bson_c_lib' -PACKAGE_VERSION='0.1' -PACKAGE_STRING='bson_c_lib 0.1' -PACKAGE_BUGREPORT='jacob@livio.io' -PACKAGE_URL='' - -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_unique_file="examples/sample.c" -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -CPP -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -ac_ct_AR -AR -DLLTOOL -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_shared -enable_static -with_pic -enable_fast_install -enable_dependency_tracking -with_gnu_ld -with_sysroot -enable_libtool_lock -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures bson_c_lib 0.1 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/bson_c_lib] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of bson_c_lib 0.1:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - --disable-libtool-lock avoid locking (might break parallel builds) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -bson_c_lib configure 0.1 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------- ## -## Report this to jacob@livio.io ## -## ----------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - -# ac_fn_c_find_intX_t LINENO BITS VAR -# ----------------------------------- -# Finds a signed integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in #( - int$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_intX_t - -# ac_fn_c_find_uintX_t LINENO BITS VAR -# ------------------------------------ -# Finds an unsigned integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in #( - uint$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_uintX_t -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by bson_c_lib $as_me 0.1, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am__api_version='1.14' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='bson_c_lib' - VERSION='0.1' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - link_all_deplibs=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - -ac_config_headers="$ac_config_headers config.h" - - -# Checks for programs. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# Checks for libraries. -# Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - -# Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=no -fi - - - - - - - -# Checks for header files. -for ac_header in stddef.h stdint.h stdlib.h string.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if ${ac_cv_header_stdbool_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; - -int -main () -{ - - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdbool_h=yes -else - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } - ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF - - -fi - - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - - -# Checks for library functions. -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if ${ac_cv_func_malloc_0_nonnull+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_malloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_malloc_0_nonnull=yes -else - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_MALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -$as_echo "#define malloc rpl_malloc" >>confdefs.h - -fi - - -for ac_func in memset -do : - ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" -if test "x$ac_cv_func_memset" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MEMSET 1 -_ACEOF - -fi -done - - -ac_config_files="$ac_config_files Makefile src/Makefile src/emhashmap/Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by bson_c_lib $as_me 0.1, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -bson_c_lib config.status 0.1 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/emhashmap/Makefile") CONFIG_FILES="$CONFIG_FILES src/emhashmap/Makefile" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool 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 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="" - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/src/3rd_party/bson_c_lib/configure.ac b/src/3rd_party/bson_c_lib/configure.ac deleted file mode 100644 index c883034ebb..0000000000 --- a/src/3rd_party/bson_c_lib/configure.ac +++ /dev/null @@ -1,33 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.69]) -AC_INIT(bson_c_lib, 0.1, jacob@livio.io) -AM_INIT_AUTOMAKE -LT_INIT -AC_CONFIG_SRCDIR([examples/sample.c]) -AC_CONFIG_HEADERS([config.h]) - -# Checks for programs. -AC_PROG_CC - -# Checks for libraries. -AC_ENABLE_SHARED -AC_DISABLE_STATIC - -# Checks for header files. -AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_CHECK_HEADER_STDBOOL -AC_TYPE_INT32_T -AC_TYPE_INT64_T -AC_TYPE_SIZE_T -AC_TYPE_UINT64_T -AC_TYPE_UINT8_T - -# Checks for library functions. -AC_FUNC_MALLOC -AC_CHECK_FUNCS([memset]) - -AC_OUTPUT(Makefile src/Makefile src/emhashmap/Makefile) diff --git a/src/3rd_party/bson_c_lib/depcomp b/src/3rd_party/bson_c_lib/depcomp deleted file mode 100755 index 4ebd5b3a2f..0000000000 --- a/src/3rd_party/bson_c_lib/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2013-05-30.07; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. - -# 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 2, 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 . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/3rd_party/bson_c_lib/examples/sample.c b/src/3rd_party/bson_c_lib/examples/sample.c deleted file mode 100644 index 628c3328b6..0000000000 --- a/src/3rd_party/bson_c_lib/examples/sample.c +++ /dev/null @@ -1,61 +0,0 @@ -#include "../src/bson_object.h" -#include -BsonObject obj; - -void construct_object() { - printf("boolean value before: %i\n", BOOLEAN_TRUE); - bson_object_put_bool(&obj, "correct", BOOLEAN_TRUE); - bson_boolean getElement = bson_object_get_bool(&obj, "correct"); - printf("boolean value after: %i\n", getElement); - - bson_object_put_int32(&obj, "one", 64); - bson_object_put_double(&obj, "two", 2.5); - bson_object_put_string(&obj, "chars", "aaaaaaaaaaaa"); - - BsonObject subObj; - bson_object_initialize(&subObj, 1, 0.5f); - bson_object_put_int32(&subObj, "four", 64); - bson_object_put_object(&obj, "three", &subObj); - - BsonArray array; - bson_array_initialize(&array, 2); - bson_array_add_int32(&array, 23); - bson_array_add_double(&array, 5.4); - bson_array_add_string(&array, "A string"); - - BsonObject subObj2; - bson_object_initialize(&subObj2, 1, 0.5f); - bson_object_put_int32(&subObj2, "i", 64); - bson_array_add_object(&array, &subObj2); - - bson_object_put_array(&obj, "anArray", &array); - char objString[1024]; - printf("Constructed object: %s\n", bson_object_to_string(&obj, objString)); -} - -int main(int argc, char** argv) { - bson_object_initialize(&obj, 16, 0.5f); - construct_object(); - uint8_t *bytes = bson_object_to_bytes(&obj); - if (bytes == NULL) { - printf("Conversion to bytes failed\n"); - } - else { - int i = 0; - for (i = 0; i < bson_object_size(&obj); i++) { - if (i % 8 == 0) { - printf("\n"); - } - printf("0x%02hhx ", bytes[i]); - } - printf("\n\n"); - BsonObject parsedObj = bson_object_from_bytes(bytes); - char objString[1024]; - printf("Parsed object: %s\n", bson_object_to_string(&parsedObj, objString)); - bson_object_deinitialize(&parsedObj); - free(bytes); - } - - bson_object_deinitialize(&obj); - return 0; -} diff --git a/src/3rd_party/bson_c_lib/install-sh b/src/3rd_party/bson_c_lib/install-sh deleted file mode 100755 index 377bb8687f..0000000000 --- a/src/3rd_party/bson_c_lib/install-sh +++ /dev/null @@ -1,527 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2011-11-20.07; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/3rd_party/bson_c_lib/ltmain.sh b/src/3rd_party/bson_c_lib/ltmain.sh deleted file mode 100644 index a356acafa4..0000000000 --- a/src/3rd_party/bson_c_lib/ltmain.sh +++ /dev/null @@ -1,9661 +0,0 @@ - -# libtool (GNU libtool) 2.4.2 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool 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 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . - -PROGRAM=libtool -PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" -TIMESTAMP="" -package_revision=1.3337 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation - - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation - - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $opt_debug - - func_error "missing argument for $1." - exit_cmd=exit -} - - -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation - - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () -{ - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation - -exit_cmd=: - - - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation - -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation - - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation - - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation - - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation - - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation - - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} - - -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - -# func_features -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_warning=: -opt_verbose=: -opt_silent=false -opt_verbose=false - - -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-warning|--no-warn) - opt_warning=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } - - - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} - - - - -## ----------- ## -## Main. ## -## ----------- ## - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via `$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via `$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_append_quoted lastarg "$arg" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with \`-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj="$func_basename_result" - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from \`$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$opt_mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" - func_basename "$dlprefile" - name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$opt_mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$opt_mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) # correct to gnu/linux during the next big refactor - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - func_append verstring ":${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$opt_mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Remove ${wl} instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do - IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" - else - odir="$dir/$objdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" - - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case "$opt_mode" in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$opt_mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$opt_mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - diff --git a/src/3rd_party/bson_c_lib/missing b/src/3rd_party/bson_c_lib/missing deleted file mode 100755 index db98974ff5..0000000000 --- a/src/3rd_party/bson_c_lib/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2013-10-28.13; # UTC - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# 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 2, 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 . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/3rd_party/bson_c_lib/src/Makefile.am b/src/3rd_party/bson_c_lib/src/Makefile.am deleted file mode 100644 index 81807aa62d..0000000000 --- a/src/3rd_party/bson_c_lib/src/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -SUBDIRS = emhashmap - -AM_CFLAGS = -Wall -AM_LDFLAGS = -lemhashmap - -includedir = /usr/local/include -include_HEADERS = bson_object.h bson_array.h bson_util.h - -lib_LTLIBRARIES = libbson.la -libbson_la_SOURCES = bson_object.c bson_array.c bson_util.c -libbson_la_LIBADD = emhashmap/libemhashmap.la diff --git a/src/3rd_party/bson_c_lib/src/Makefile.in b/src/3rd_party/bson_c_lib/src/Makefile.in deleted file mode 100644 index 3a68b235bd..0000000000 --- a/src/3rd_party/bson_c_lib/src/Makefile.in +++ /dev/null @@ -1,769 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp $(include_HEADERS) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -libbson_la_DEPENDENCIES = emhashmap/libemhashmap.la -am_libbson_la_OBJECTS = bson_object.lo bson_array.lo bson_util.lo -libbson_la_OBJECTS = $(am_libbson_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libbson_la_SOURCES) -DIST_SOURCES = $(libbson_la_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -HEADERS = $(include_HEADERS) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = /usr/local/include -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = emhashmap -AM_CFLAGS = -Wall -AM_LDFLAGS = -lemhashmap -include_HEADERS = bson_object.h bson_array.h bson_util.h -lib_LTLIBRARIES = libbson.la -libbson_la_SOURCES = bson_object.c bson_array.c bson_util.c -libbson_la_LIBADD = emhashmap/libemhashmap.la -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libbson.la: $(libbson_la_OBJECTS) $(libbson_la_DEPENDENCIES) $(EXTRA_libbson_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libbson_la_OBJECTS) $(libbson_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_array.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_object.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_util.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ - done - -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: install-includeHEADERS - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libLTLIBRARIES \ - clean-libtool cscopelist-am ctags ctags-am distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-includeHEADERS install-info \ - install-info-am install-libLTLIBRARIES install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-includeHEADERS uninstall-libLTLIBRARIES - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/3rd_party/bson_c_lib/src/bson_array.c b/src/3rd_party/bson_c_lib/src/bson_array.c deleted file mode 100644 index edac6a1f02..0000000000 --- a/src/3rd_party/bson_c_lib/src/bson_array.c +++ /dev/null @@ -1,391 +0,0 @@ -#include "bson_array.h" - -bool bson_array_initialize(BsonArray *array, size_t initialCapacity) { - array->count = 0; - array->maxCount = initialCapacity; - array->elements = malloc(sizeof(BsonElement *) * initialCapacity); - return true; -} - -void bson_array_deinitialize(BsonArray *array) { - size_t i = 0; - for (i = 0; i < array->count; i++) { - BsonElement *element = array->elements[i]; - if (element->type == TYPE_DOCUMENT) { - bson_object_deinitialize((BsonObject *)element->value); - } - else if (element->type == TYPE_ARRAY) { - bson_array_deinitialize((BsonArray *)element->value); - } - free(element->value); - free(element); - } - - free(array->elements); -} - -size_t bson_array_size(BsonArray *array) { - size_t arraySize = ARRAY_OVERHEAD_BYTES; - size_t i = 0; - for (i = 0; i < array->count; i++) { - BsonElement *element = array->elements[i]; - arraySize += array_key_size(i) + ELEMENT_OVERHEAD_BYTES; - if (element->type == TYPE_DOCUMENT) { - arraySize += bson_object_size((BsonObject *)element->value); - } - else if (element->type == TYPE_ARRAY) { - arraySize += bson_array_size((BsonArray *)element->value); - } - else { - arraySize += element->size; - } - } - return arraySize; -} - -uint8_t *bson_array_to_bytes(BsonArray *array) { - size_t arraySize = bson_array_size(array); - uint8_t *bytes = malloc(arraySize); - size_t position = 0; - write_int32_le(bytes, (int32_t)arraySize, &position); - size_t i = 0; - for (i = 0; i < array->count; i++) { - BsonElement *element = array->elements[i]; - - bytes[position++] = element->type; - - uint8_t *keyBytes = index_to_key(i); - memcpy(&bytes[position], keyBytes, digits(i)); - free(keyBytes); - position += digits(i); - - //Null-terminate - bytes[position++] = 0x00; - - switch (element->type) { - case TYPE_DOCUMENT: { - BsonObject *obj = (BsonObject *)element->value; - uint8_t *objBytes = bson_object_to_bytes(obj); - if (objBytes == NULL) { - printf("An error occured while parsing the object with index \"%i\"\n", (int)i); - free(bytes); - return NULL; - } - size_t objSize = bson_object_size(obj); - memcpy(&bytes[position], objBytes, objSize); - free(objBytes); - position += objSize; - break; - } - case TYPE_ARRAY: { - BsonArray *subArray = (BsonArray *)element->value; - uint8_t *subArrayBytes = bson_array_to_bytes(subArray); - if (subArrayBytes == NULL) { - printf("An error occured while parsing the object with index \"%i\"\n", (int)i); - free(bytes); - return NULL; - } - size_t subArraySize = bson_array_size(subArray); - memset(&bytes[position], 0, subArraySize); - memcpy(&bytes[position], subArrayBytes, subArraySize); - free(subArrayBytes); - position += subArraySize; - break; - } - case TYPE_INT32: { - write_int32_le(bytes, *(int32_t *)element->value, &position); - break; - } - case TYPE_INT64: { - write_int64_le(bytes, *(int64_t *)element->value, &position); - break; - } - case TYPE_STRING: { - char *stringVal = (char *)element->value; - //String length is written first - write_int32_le(bytes, (int32_t)(strlen(stringVal) + 1), &position); - - uint8_t *stringBytes = string_to_byte_array(stringVal); - memcpy(&bytes[position], stringBytes, strlen(stringVal)); - free(stringBytes); - position += strlen(stringVal); - - //Null-terminate - bytes[position++] = 0x00; - break; - } - case TYPE_DOUBLE: { - write_double_le(bytes, *(double *)element->value, &position); - break; - } - case TYPE_BOOLEAN: { - bytes[position++] = (uint8_t)(*(bson_boolean *)element->value); - break; - } - default: { - printf("Unrecognized BSON type: %i\n", element->type); - position += sizeof(*element->value); - } - } - } - - bytes[position++] = DOCUMENT_END; - if (position != arraySize) { - printf("Something went horribly wrong. Unexpected size of array in bytes: %i, expected size: %i\n", (int)position, (int)arraySize); - free(bytes); - return NULL; - } - return bytes; -} - -BsonArray bson_array_from_bytes(uint8_t *data) { - uint8_t *current = data; - int32_t size = read_int32_le(¤t); - BsonArray array; - bson_array_initialize(&array, 10); - uint8_t type = *current; - current++; - while (type != DOCUMENT_END) { - char *key = byte_array_to_string(current); - current += strlen(key) + 1; - - switch ((element_type)type) { - case TYPE_DOCUMENT: { - BsonObject obj = bson_object_from_bytes(current); - bson_array_add_object(&array, &obj); - current += bson_object_size(&obj); - break; - } - case TYPE_ARRAY: { - BsonArray subArray = bson_array_from_bytes(current); - bson_array_add_array(&array, &subArray); - current += bson_array_size(&subArray); - break; - } - case TYPE_INT32: { - int32_t value = read_int32_le(¤t); - bson_array_add_int32(&array, value); - break; - } - case TYPE_INT64: { - int64_t value = read_int64_le(¤t); - bson_array_add_int64(&array, value); - break; - } - case TYPE_STRING: { - //String length is read first - int32_t stringLength = read_int32_le(¤t) - 1; - - char *stringVal = byte_array_to_bson_string(current, stringLength); - bson_array_add_string(&array, stringVal); - free(stringVal); - current += stringLength + 1; - break; - } - case TYPE_DOUBLE: { - double value = read_double_le(¤t); - bson_array_add_double(&array, value); - break; - } - case TYPE_BOOLEAN: { - bson_array_add_bool(&array, *current); - current++; - break; - } - default: { - printf("Unrecognized BSON type: %i\n", type); - } - } - free(key); - type = *current; - current++; - } - - if (data + size != current) { - printf("Unexpected parsed array size. Expected %i, got %i\n", (int) size, (int)(current - data)); - } - return array; -} - -char *bson_array_to_string(BsonArray *array, char *out) { - //TODO just move the pointer rather than keep a position variable - int position = 0; - position += sprintf(out, "[ "); - size_t i = 0; - for (i = 0; i < array->count; i++) { - BsonElement *element = array->elements[i]; - switch (element->type) { - case TYPE_DOCUMENT: { - char docString[512]; - position += sprintf(&out[position], "%s", bson_object_to_string(bson_array_get_object(array, i), docString)); - break; - } - case TYPE_ARRAY: { - char docString[512]; - position += sprintf(&out[position], "%s", bson_array_to_string(bson_array_get_array(array, i), docString)); - break; - } - case TYPE_INT32: { - position += sprintf(&out[position], "%i", (int)bson_array_get_int32(array, i)); - break; - } - case TYPE_INT64: { - position += sprintf(&out[position], "%li", (long)bson_array_get_int64(array, i)); - break; - } - case TYPE_STRING: { - position += sprintf(&out[position], "\"%s\"", bson_array_get_string(array, i)); - break; - } - case TYPE_DOUBLE: { - position += sprintf(&out[position], "%f", bson_array_get_double(array, i)); - break; - } - case TYPE_BOOLEAN: { - position += sprintf(&out[position], "%s", (bson_array_get_bool(array, i) == BOOLEAN_TRUE) ? "true" : "false"); - break; - } - default: { - printf("Unrecognized BSON type: %i\n", element->type); - position += sprintf(&out[position], "UNKNOWN_TYPE"); - } - } - if (i != (array->count - 1)) { - position += sprintf(&out[position], ", "); - } - } - sprintf(&out[position], " ]"); - - return out; -} - -bool bson_array_resize(BsonArray *array, size_t newSize) { - if (array->count > newSize) { - printf("Attempted to resize an array smaller than the number of elements it contains\n"); - return false; - } - int i = 0; - BsonElement **newArray = malloc(sizeof(BsonElement *) * newSize); - BsonElement **oldArray = array->elements; - for (i = 0; i < array->maxCount; i++) { - newArray[i] = oldArray[i]; - } - free(oldArray); - array->elements = newArray; - array->maxCount = newSize; - return true; -} - -bool bson_array_add_element(BsonArray *array, BsonElement *element, size_t allocSize) { - if (array->count == array->maxCount) { - if (!bson_array_resize(array, array->maxCount * 2)) { - return false; - } - } - BsonElement *allocElement = malloc(sizeof(BsonElement)); - allocElement->type = element->type; - allocElement->size = element->size; - allocElement->value = malloc(allocSize); - memcpy(allocElement->value, element->value, allocSize); - array->elements[array->count] = allocElement; - array->count++; - return true; -} - -/* - @brief Add a new element to the end of a given array - - @param array - The array to be modified - @param type - The type of the element to be added - @param value - The value of the element to be added - @param allocSize - The size, in bytes, to be allocated for the element - @param elementSize - The size, in bytes, of the element when converted to BSON format - - @return - true if the addition was successful, false if not -*/ -bool bson_array_add(BsonArray *array, element_type type, void *value, size_t allocSize, size_t elementSize) { - BsonElement element; - element.type = type; - element.value = value; - element.size = elementSize; - return bson_array_add_element(array, &element, allocSize); -} - -bool bson_array_add_object(BsonArray *array, BsonObject *value) { - return bson_array_add(array, TYPE_DOCUMENT, value, sizeof(BsonObject), 0); -} - -bool bson_array_add_array(BsonArray *array, BsonArray *value) { - return bson_array_add(array, TYPE_ARRAY, value, sizeof(BsonArray), 0); -} - -bool bson_array_add_int32(BsonArray *array, int32_t value) { - return bson_array_add(array, TYPE_INT32, &value, sizeof(int32_t), - SIZE_INT32); -} - -bool bson_array_add_int64(BsonArray *array, int64_t value) { - return bson_array_add(array, TYPE_INT64, &value, sizeof(int64_t), - SIZE_INT64); -} - -bool bson_array_add_string(BsonArray *array, char *value) { - return bson_array_add(array, TYPE_STRING, value, (strlen(value) + 1) * sizeof(char), - strlen(value) + STRING_OVERHEAD_BYTES); -} - -bool bson_array_add_bool(BsonArray *array, bson_boolean value) { - return bson_array_add(array, TYPE_BOOLEAN, &value, sizeof(bson_boolean), - SIZE_BOOLEAN); -} - -bool bson_array_add_double(BsonArray *array, double value) { - return bson_array_add(array, TYPE_DOUBLE, &value, sizeof(double), - SIZE_DOUBLE); -} - -BsonElement *bson_array_get(BsonArray *array, size_t index) { - return (index >= array->count) ? NULL : array->elements[index]; -} - -BsonObject *bson_array_get_object(BsonArray *array, size_t index) { - BsonElement *element = bson_array_get(array, index); - return (element == NULL || element->type != TYPE_DOCUMENT) ? - NULL : (BsonObject *)element->value; -} - -BsonArray *bson_array_get_array(BsonArray *array, size_t index) { - BsonElement *element = bson_array_get(array, index); - return (element == NULL || element->type != TYPE_ARRAY) ? - NULL : (BsonArray *)element->value; -} - -int32_t bson_array_get_int32(BsonArray *array, size_t index) { - BsonElement *element = bson_array_get(array, index); - return (element == NULL || element->type != TYPE_INT32) ? - -1 : *(int32_t *)element->value; -} - -int64_t bson_array_get_int64(BsonArray *array, size_t index) { - BsonElement *element = bson_array_get(array, index); - return (element == NULL || element->type != TYPE_INT64) ? - -1 : *(int64_t *)element->value; -} - -char *bson_array_get_string(BsonArray *array, size_t index) { - BsonElement *element = bson_array_get(array, index); - return (element == NULL || element->type != TYPE_STRING) ? - NULL : (char *)element->value; -} - -bson_boolean bson_array_get_bool(BsonArray *array, size_t index) { - BsonElement *element = bson_array_get(array, index); - return (element == NULL || element->type != TYPE_BOOLEAN) ? - BOOLEAN_INVALID : *(bson_boolean *)element->value; -} - -double bson_array_get_double(BsonArray *array, size_t index) { - BsonElement *element = bson_array_get(array, index); - return (element == NULL || element->type != TYPE_DOUBLE) ? - -1 : *(double *)element->value; -} diff --git a/src/3rd_party/bson_c_lib/src/bson_array.h b/src/3rd_party/bson_c_lib/src/bson_array.h deleted file mode 100644 index a61498f17e..0000000000 --- a/src/3rd_party/bson_c_lib/src/bson_array.h +++ /dev/null @@ -1,230 +0,0 @@ -#ifndef BSON_ARRAY_H -#define BSON_ARRAY_H - -#include "bson_object.h" - -typedef struct BsonElement BsonElement; -typedef struct BsonObject BsonObject; - -typedef enum bson_boolean bson_boolean; -typedef enum element_type element_type; - -//Object representing a BSON array -struct BsonArray { - //Array of BSON elements - BsonElement **elements; - //Number of elements currently in the array - size_t count; - //The current maximum number of elements in the array - size_t maxCount; -}; -typedef struct BsonArray BsonArray; - -#ifdef __cplusplus -extern "C" { -#endif - -/* - @brief Initalize BSON Array - - @param array - The uninitialized BSON Array - @param initialSize - The initial maximum size of the array - - @return - true if the array was initialized successfully, false if not -*/ -bool bson_array_initialize(BsonArray *array, size_t initialCapacity); -/* - @brief Deinitalize BSON Array, free all associated memory, - and recursively clean up all sub-objects - - @param array - The BSON Array to be deinitalized -*/ -void bson_array_deinitialize(BsonArray *array); - -/* - @brief Calculate the size, in bytes, of a given array when converted to a BSON document - - @param obj - The BSON array from which the size is calculated - - @return - The calculated size -*/ -size_t bson_array_size(BsonArray *array); - -/* - @brief Get the BSON represention of an array - - @param array - The array to be converted to BSON - - @return - A byte array containing the BSON representation of the array, - this data must be freed by the caller after use -*/ -uint8_t *bson_array_to_bytes(BsonArray *array); -/* - @brief Parse BSON data into an array - - @param data - The BSON data to be parsed - - @return - The BSON array created from the BSON data -*/ -BsonArray bson_array_from_bytes(uint8_t *data); - -/* - @brief Get a JSON string representation of a BSON array - - @param array - The array to be converted to a JSON string - @param out - The output string of the function - - @return - The value of out -*/ -char *bson_array_to_string(BsonArray *array, char *out); - -/* - @brief Add a BSON object to the end of a given array - - @param array - The array to be modified - @param value - The pointer to the BSON object to be added - - @return - true if the addition was successful, false if not -*/ -bool bson_array_add_object(BsonArray *array, BsonObject *value); -/* - @brief Add a BSON array to the end of a given array - - @param array - The array to be modified - @param value - The pointer to the BSON array to be added - - @return - true if the addition was successful, false if not -*/ -bool bson_array_add_array(BsonArray *array, BsonArray *value); -/* - @brief Add a 32-bit integer value to the end of a given array - - @param array - The array to be modified - @param value - The integer value to be added - - @return - true if the addition was successful, false if not -*/ -bool bson_array_add_int32(BsonArray *array, int32_t value); -/* - @brief Add a 64-bit integer value to the end of a given array - - @param array - The array to be modified - @param value - The integer value to be added - - @return - true if the addition was successful, false if not -*/ -bool bson_array_add_int64(BsonArray *array, int64_t value); -/* - @brief Add a string value to the end of a given array - - @param array - The array to be modified - @param value - The string value to be added - - @return - true if the addition was successful, false if not -*/ -bool bson_array_add_string(BsonArray *array, char *value); -/* - @brief Add a boolean value to the end of a given array - - @param array - The array to be modified - @param value - The boolean value to be added - - @return - true if the addition was successful, false if not -*/ -bool bson_array_add_bool(BsonArray *array, bson_boolean value); -/* - @brief Add a floating-point value to the end of a given array - - @param array - The array to be modified - @param value - The floating-point value to be added - - @return - true if the addition was successful, false if not -*/ -bool bson_array_add_double(BsonArray *array, double value); - -/* - @brief Retrieve the object at a specified index - - @param array - The array to be accessed - @param index - The index of the object within the array - - @return - The BSON element at the given index if it exists, - NULL if the index is out of bounds -*/ -BsonElement *bson_array_get(BsonArray *array, size_t index); -/* - @brief Retrieve the BSON object at a specified index in an array - - @param array - The array to be accessed - @param index - The index of the BSON object within the array - - @return - The pointer to the BSON object at the given index if it exists, - NULL if the index is out of bounds or the value is not a BSON object -*/ -BsonObject *bson_array_get_object(BsonArray *array, size_t index); -/* - @brief Retrieve the BSON array at a specified index in an array - - @param array - The array to be accessed - @param index - The index of the BSON array within the array - - @return - The pointer to the BSON array at the given index if it exists, - NULL if the index is out of bounds or the value is not a BSON array -*/ -BsonArray *bson_array_get_array(BsonArray *array, size_t index); -/* - @brief Retrieve the 32-bit integer value at a specified index in an array - - @param array - The array to be accessed - @param index - The index of the integer value within the array - - @return - The integer value at the given index if it exists, - NULL if the index is out of bounds or the value is not a 32-bit integer -*/ -int32_t bson_array_get_int32(BsonArray *array, size_t index); -/* - @brief Retrieve the 64-bit integer value at a specified index in an array - - @param array - The array to be accessed - @param index - The index of the integer value within the array - - @return - The integer value at the given index if it exists, - NULL if the index is out of bounds or the value is not a 64-bit integer -*/ -int64_t bson_array_get_int64(BsonArray *array, size_t index); -/* - @brief Retrieve the string value at a specified index in an array - - @param array - The array to be accessed - @param index - The index of the string value within the array - - @return - The string value at the given index if it exists, - NULL if the index is out of bounds or the value is not a string -*/ -char *bson_array_get_string(BsonArray *array, size_t index); -/* - @brief Retrieve the boolean value at a specified index in an array - - @param array - The array to be accessed - @param index - The index of the string value within the array - - @return - The boolean value at the given index if it exists, - NULL if the index is out of bounds or the value is not a boolean -*/ -bson_boolean bson_array_get_bool(BsonArray *array, size_t index); -/* - @brief Retrieve the floating-point value at a specified index in an array - - @param array - The array to be accessed - @param index - The index of the floating-point value within the array - - @return - The floating-point value at the given index if it exists, - NULL if the index is out of bounds or the value is not a floating-point number -*/ -double bson_array_get_double(BsonArray *array, size_t index); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/3rd_party/bson_c_lib/src/bson_object.c b/src/3rd_party/bson_c_lib/src/bson_object.c deleted file mode 100644 index b517789027..0000000000 --- a/src/3rd_party/bson_c_lib/src/bson_object.c +++ /dev/null @@ -1,404 +0,0 @@ -#include "bson_object.h" -#define DEFAULT_MAP_SIZE 32 - -size_t hash_function(const char* key, size_t maxValue) { - size_t keyLength = strlen(key); - size_t hash = 0; - int i; - for (i = 0; i < keyLength; i++) { - hash += key[i]; - hash %= maxValue; - } - return hash; -} - -bool bson_object_initialize(BsonObject *obj, size_t capacity, float loadFactor) { - return emhashmap_initialize(&obj->data, (int)capacity, loadFactor, &hash_function); -} - -bool bson_object_initialize_default(BsonObject *obj) { - return bson_object_initialize(obj, DEFAULT_MAP_SIZE, 0.5f); -} - -void bson_object_deinitialize(BsonObject *obj) { - MapIterator iterator = emhashmap_iterator(&obj->data); - MapEntry *current = emhashmap_iterator_next(&iterator); - while (current != NULL) { - BsonElement *element = (BsonElement *)current->value; - if (element->type == TYPE_DOCUMENT) { - bson_object_deinitialize((BsonObject *)element->value); - } - else if (element->type == TYPE_ARRAY) { - bson_array_deinitialize((BsonArray *)element->value); - } - free(element->value); - free(element); - current = emhashmap_iterator_next(&iterator); - } - - emhashmap_deinitialize(&obj->data); -} - -size_t bson_object_size(BsonObject *obj) { - size_t objSize = OBJECT_OVERHEAD_BYTES; - MapIterator iterator = emhashmap_iterator(&obj->data); - MapEntry *current = emhashmap_iterator_next(&iterator); - while (current != NULL) { - BsonElement *element = (BsonElement *)current->value; - objSize += object_key_size(current->key) + ELEMENT_OVERHEAD_BYTES; - if (element->type == TYPE_DOCUMENT) { - objSize += bson_object_size((BsonObject *)element->value); - } - else if (element->type == TYPE_ARRAY) { - objSize += bson_array_size((BsonArray *)element->value); - } - else { - objSize += element->size; - } - current = emhashmap_iterator_next(&iterator); - } - return objSize; -} - -uint8_t *bson_object_to_bytes(BsonObject *obj) { - //TODO just move the pointer rather than keep a position variable - MapIterator iterator = emhashmap_iterator(&obj->data); - MapEntry *current = emhashmap_iterator_next(&iterator); - size_t objSize = bson_object_size(obj); - uint8_t *bytes = malloc(objSize); - size_t position = 0; - write_int32_le(bytes, (int32_t)objSize, &position); - - while (current != NULL) { - BsonElement *element = (BsonElement *)current->value; - - bytes[position++] = element->type; - - uint8_t *keyBytes = string_to_byte_array(current->key); - memcpy(&bytes[position], keyBytes, strlen(current->key)); - free(keyBytes); - position += strlen(current->key); - - //Null-terminate - bytes[position++] = 0x00; - - switch (element->type) { - case TYPE_DOCUMENT: { - BsonObject *subObject = (BsonObject *)element->value; - uint8_t *subObjectBytes = bson_object_to_bytes(subObject); - if (subObjectBytes == NULL) { - printf("An error occured while parsing the object with key \"%s\"\n", current->key); - free(bytes); - return NULL; - } - size_t subObjectSize = bson_object_size(subObject); - memcpy(&bytes[position], subObjectBytes, subObjectSize); - free(subObjectBytes); - position += subObjectSize; - break; - } - case TYPE_ARRAY: { - BsonArray *array = (BsonArray *)element->value; - uint8_t *arrayBytes = bson_array_to_bytes(array); - if (arrayBytes == NULL) { - printf("An error occured while parsing the object with key \"%s\"\n", current->key); - free(bytes); - return NULL; - } - size_t arraySize = bson_array_size(array); - memset(&bytes[position], 0, arraySize); - memcpy(&bytes[position], arrayBytes, arraySize); - free(arrayBytes); - position += arraySize; - break; - } - case TYPE_INT32: { - write_int32_le(bytes, *(int32_t *)element->value, &position); - break; - } - case TYPE_INT64: { - write_int64_le(bytes, *(int64_t *)element->value, &position); - break; - } - case TYPE_STRING: { - char *stringVal = (char *)element->value; - //String length is written first - write_int32_le(bytes, (int32_t)(strlen(stringVal) + 1), &position); - - uint8_t *stringBytes = string_to_byte_array(stringVal); - memcpy(&bytes[position], stringBytes, strlen(stringVal)); - free(stringBytes); - position += strlen(stringVal); - - //Null-terminate - bytes[position++] = 0x00; - break; - } - case TYPE_DOUBLE: { - write_double_le(bytes, *(double *)element->value, &position); - break; - } - case TYPE_BOOLEAN: { - bytes[position++] = (uint8_t)(*(bson_boolean *)element->value); - break; - } - default: { - printf("Unrecognized BSON type: %i\n", element->type); - position += sizeof(element->value); - } - } - current = emhashmap_iterator_next(&iterator); - } - - bytes[position++] = DOCUMENT_END; - if (position != objSize) { - printf("Something went horribly wrong. Unexpected size of map in bytes: %i, expected size: %i\n", (int)position, (int)objSize); - free(bytes); - return NULL; - } - return bytes; -} - -BsonObject bson_object_from_bytes(uint8_t *data) { - uint8_t *current = data; - int32_t size = read_int32_le(¤t); - BsonObject obj; - bson_object_initialize_default(&obj); - uint8_t type = *current; - current++; - while (type != DOCUMENT_END) { - char *key = byte_array_to_string(current); - current += strlen(key) + 1; - - switch ((element_type)type) { - case TYPE_DOCUMENT: { - BsonObject subObject = bson_object_from_bytes(current); - bson_object_put_object(&obj, key, &subObject); - current += bson_object_size(&subObject); - break; - } - case TYPE_ARRAY: { - BsonArray array = bson_array_from_bytes(current); - bson_object_put_array(&obj, key, &array); - current += bson_array_size(&array); - break; - } - case TYPE_INT32: { - int32_t value = read_int32_le(¤t); - bson_object_put_int32(&obj, key, value); - break; - } - case TYPE_INT64: { - int64_t value = read_int64_le(¤t); - bson_object_put_int64(&obj, key, value); - break; - } - case TYPE_STRING: { - //String length is read first - int32_t stringLength = read_int32_le(¤t) - 1; - - char *stringVal = byte_array_to_bson_string(current, stringLength); - bson_object_put_string(&obj, key, stringVal); - free(stringVal); - current += stringLength + 1; - break; - } - case TYPE_DOUBLE: { - double value = read_double_le(¤t); - bson_object_put_double(&obj, key, value); - break; - } - case TYPE_BOOLEAN: { - bson_object_put_bool(&obj, key, *current); - current++; - break; - } - default: { - printf("Unrecognized BSON type: %i\n", type); - } - } - free(key); - type = *current; - current++; - } - - if (data + size != current) { - printf("Unexpected parsed object size. Expected %i, got %i\n", (int) size, (int)(current - data)); - } - return obj; -} - -char *bson_object_to_string(BsonObject *obj, char *out) { - //TODO just move the pointer rather than keep a position variable - int position = 0; - MapIterator iterator = emhashmap_iterator(&obj->data); - MapEntry *current = emhashmap_iterator_next(&iterator); - position += sprintf(out, "{ "); - while (current != NULL) { - BsonElement *element = (BsonElement *)current->value; - position += sprintf(&out[position], "\"%s\":", current->key); - switch (element->type) { - case TYPE_DOCUMENT: { - char docString[512]; - position += sprintf(&out[position], "%s", bson_object_to_string(bson_object_get_object(obj, current->key), docString)); - break; - } - case TYPE_ARRAY: { - char docString[512]; - position += sprintf(&out[position], "%s", bson_array_to_string(bson_object_get_array(obj, current->key), docString)); - break; - } - case TYPE_INT32: { - position += sprintf(&out[position], "%i", (int)bson_object_get_int32(obj, current->key)); - break; - } - case TYPE_INT64: { - position += sprintf(&out[position], "%li", (long)bson_object_get_int64(obj, current->key)); - break; - } - case TYPE_STRING: { - position += sprintf(&out[position], "\"%s\"", bson_object_get_string(obj, current->key)); - break; - } - case TYPE_DOUBLE: { - position += sprintf(&out[position], "%f", bson_object_get_double(obj, current->key)); - break; - } - case TYPE_BOOLEAN: { - position += sprintf(&out[position], "%s", (bson_object_get_bool(obj, current->key) == BOOLEAN_TRUE) ? "true" : "false"); - break; - } - default: { - printf("Unrecognized BSON type: %i\n", element->type); - position += sprintf(&out[position], "UNKNOWN_TYPE"); - } - } - current = emhashmap_iterator_next(&iterator); - if (current != NULL) { - position += sprintf(&out[position], ", "); - } - } - sprintf(&out[position], " }"); - - return out; -} - -bool bson_object_put_element(BsonObject *obj, const char *key, BsonElement *element, size_t allocSize) { - BsonElement *allocElement = malloc(sizeof(BsonElement)); - allocElement->type = element->type; - allocElement->size = element->size; - allocElement->value = malloc(allocSize); - memcpy(allocElement->value, element->value, allocSize); - BsonElement *existingElement = emhashmap_remove(&obj->data, key); - if (existingElement != NULL) { - if (existingElement->type == TYPE_DOCUMENT) { - bson_object_deinitialize((BsonObject *)existingElement->value); - } - else if (existingElement->type == TYPE_ARRAY) { - bson_array_deinitialize((BsonArray *)existingElement->value); - } - free(existingElement->value); - free(existingElement); - } - return emhashmap_put(&obj->data, key, (void *)allocElement); -} - -bool bson_object_put(BsonObject *obj, const char *key, element_type type, void *value, size_t allocSize, size_t elementSize) { - BsonElement element; - element.type = type; - element.value = value; - element.size = elementSize; - return bson_object_put_element(obj, key, &element, allocSize); -} - -bool bson_object_put_object(BsonObject *obj, const char *key, BsonObject *value) { - return bson_object_put(obj, key, TYPE_DOCUMENT, value, sizeof(BsonObject), 0); -} - -bool bson_object_put_array(BsonObject *obj, const char *key, BsonArray *value) { - return bson_object_put(obj, key, TYPE_ARRAY, value, sizeof(BsonArray), 0); -} - -bool bson_object_put_int32(BsonObject *obj, const char *key, int32_t value) { - return bson_object_put(obj, key, TYPE_INT32, &value, sizeof(int32_t), - SIZE_INT32); -} - -bool bson_object_put_int64(BsonObject *obj, const char *key, int64_t value) { - return bson_object_put(obj, key, TYPE_INT64, &value, sizeof(int64_t), - SIZE_INT64); -} - -bool bson_object_put_string(BsonObject *obj, const char *key, char *value) { - return bson_object_put(obj, key, TYPE_STRING, value, (strlen(value) + 1) * sizeof(char), - strlen(value) + STRING_OVERHEAD_BYTES); -} - -bool bson_object_put_bool(BsonObject *obj, const char *key, bson_boolean value) { - return bson_object_put(obj, key, TYPE_BOOLEAN, &value, sizeof(bson_boolean), - SIZE_BOOLEAN); -} - -bool bson_object_put_double(BsonObject *obj, const char *key, double value) { - return bson_object_put(obj, key, TYPE_DOUBLE, &value, sizeof(double), - SIZE_DOUBLE); -} - -BsonElement *bson_object_get(BsonObject *obj, const char *key) { - MapEntry *entry = emhashmap_get(&obj->data, key); - return (entry == NULL) ? NULL : entry->value; -} - -BsonObject *bson_object_get_object(BsonObject *obj, const char *key) { - BsonElement *element = bson_object_get(obj, key); - return (element == NULL || element->type != TYPE_DOCUMENT) ? - NULL : (BsonObject *)element->value; -} - -BsonArray *bson_object_get_array(BsonObject *obj, const char *key) { - BsonElement *element = bson_object_get(obj, key); - return (element == NULL || element->type != TYPE_ARRAY) ? - NULL : (BsonArray *)element->value; -} - -int32_t bson_object_get_int32(BsonObject *obj, const char *key) { - BsonElement *element = bson_object_get(obj, key); - return (element == NULL || element->type != TYPE_INT32) ? - -1 : *(int32_t *)element->value; -} - -int64_t bson_object_get_int64(BsonObject *obj, const char *key) { - BsonElement *element = bson_object_get(obj, key); - return (element == NULL || element->type != TYPE_INT64) ? - -1 : *(int64_t *)element->value; -} - -char *bson_object_get_string(BsonObject *obj, const char *key) { - BsonElement *element = bson_object_get(obj, key); - return (element == NULL || element->type != TYPE_STRING) ? - NULL : (char *)element->value; -} - -bson_boolean bson_object_get_bool(BsonObject *obj, const char *key) { - BsonElement *element = bson_object_get(obj, key); - return (element == NULL || element->type != TYPE_BOOLEAN) ? - BOOLEAN_INVALID : *(bson_boolean *)element->value; -} - -double bson_object_get_double(BsonObject *obj, const char *key) { - BsonElement *element = bson_object_get(obj, key); - return (element == NULL || element->type != TYPE_DOUBLE) ? - -1 : *(double *)element->value; -} - -MapIterator bson_object_iterator(BsonObject *obj) { - return emhashmap_iterator(&obj->data); -} - -BsonObjectEntry bson_object_iterator_next(MapIterator *iterator) { - MapEntry *entry = emhashmap_iterator_next(iterator); - BsonObjectEntry bsonEntry; - strncpy(bsonEntry.key, entry->key, 255); - bsonEntry.element = (BsonElement *)entry->value; - return bsonEntry; -} \ No newline at end of file diff --git a/src/3rd_party/bson_c_lib/src/bson_object.h b/src/3rd_party/bson_c_lib/src/bson_object.h deleted file mode 100644 index 77179310e5..0000000000 --- a/src/3rd_party/bson_c_lib/src/bson_object.h +++ /dev/null @@ -1,290 +0,0 @@ -#ifndef BSON_OBJECT_H -#define BSON_OBJECT_H - -#include -#include - -#include "bson_util.h" -#include "bson_array.h" -#include "emhashmap/emhashmap.h" - -typedef struct BsonArray BsonArray; - -typedef enum element_type element_type; -typedef enum bson_boolean bson_boolean; - -struct BsonObject { - //Internal map implementation - HashMap data; -}; -typedef struct BsonObject BsonObject; - -struct BsonElement { - //The value of this element - void *value; - //The data type of this element - element_type type; - //Size of the element in bytes when converted to BSON - //Unused for TYPE_DOCUMENT and TYPE_ARRAY - size_t size; -}; -typedef struct BsonElement BsonElement; - -struct BsonObjectEntry { - char key[255]; - BsonElement *element; -}; -typedef struct BsonObjectEntry BsonObjectEntry; - -#ifdef __cplusplus -extern "C" { -#endif - -/* - @brief Initalize BSON Object - - @param obj - The uninitialized BSON Object - @param size - The maximum capacity of the map used to store object data - @param loadFactor - The load factor of the map used to store object data - - @return - true if the object was initialized successfully, false if not -*/ -bool bson_object_initialize(BsonObject *obj, size_t capacity, float loadFactor); -/* - @brief Initalize BSON object with default map size (64) and load factor (0.5) - - @param obj - The uninitialized BSON Object - - @return - true if the object was initialized successfully, false if not -*/ -bool bson_object_initialize_default(BsonObject *obj); -/* - @brief Deinitalize BSON object, free all associated memory, - and recursively clean up all sub-objects - - @param obj - The BSON object to be deinitalized -*/ -void bson_object_deinitialize(BsonObject *obj); - -/* - @brief Calculate the size, in bytes, of a given object when converted to a BSON document - - @param obj - The BSON object from which the size is calculated - - @return - The calculated size -*/ -size_t bson_object_size(BsonObject *obj); - -/* - @brief Get the BSON represention of an object - - @param obj - The array to be converted to BSON - - @return - A byte array containing the BSON representation of the object, - this data must be freed by the caller after use -*/ -uint8_t *bson_object_to_bytes(BsonObject *obj); -/* - @brief Parse BSON data into an object - - @param data - The BSON data to be parsed - - @return - The BSON object created from the BSON data -*/ -BsonObject bson_object_from_bytes(uint8_t *data); - -/* - @brief Get a JSON string representation of a BSON object - - @param obj - The object to be converted to a JSON string - @param out - The output string of the function - - @return - The value of out -*/ -char *bson_object_to_string(BsonObject *obj, char *out); - -/* - @brief Put a new BSON object into a given object - - @param obj - The object to be modified - @param key - The key used to reference the new object - (if it matches an existing key, - the associated value will be overwritten) - @param value - The pointer to the BSON object to be added to the object - - @return - true if the value was set successfully, false if not -*/ -bool bson_object_put_object(BsonObject *obj, const char *key, BsonObject *value); -/* - @brief Put a new BSON array into a given object - - @param obj - The object to be modified - @param key - The key used to reference the new array - (if it matches an existing key, - the associated value will be overwritten) - @param value - The pointer to the BSON array to be added to the object - - @return - true if the value was set successfully, false if not -*/ -bool bson_object_put_array(BsonObject *obj, const char *key, BsonArray *value); -/* - @brief Put a new 32-bit integer value into a given object - - @param obj - The object to be modified - @param key - The key used to reference the new integer value - (if it matches an existing key, - the associated value will be overwritten) - @param value - The integer value to be added to the object - - @return - true if the value was set successfully, false if not -*/ -bool bson_object_put_int32(BsonObject *obj, const char *key, int32_t value); -/* - @brief Put a new 64-bit integer value into a given object - - @param obj - The object to be modified - @param key - The key used to reference the new integer value - (if it matches an existing key, - the associated value will be overwritten) - @param value - The integer value to be added to the object - - @return - true if the value was set successfully, false if not -*/ -bool bson_object_put_int64(BsonObject *obj, const char *key, int64_t value); -/* - @brief Put a new string value into a given object - - @param obj - The object to be modified - @param key - The key used to reference the new string value - (if it matches an existing key, - the associated value will be overwritten) - @param value - The string value to be added to the object - - @return - true if the value was set successfully, false if not -*/ -bool bson_object_put_string(BsonObject *obj, const char *key, char *value); -/* - @brief Put a new boolean value into a given object - - @param obj - The object to be modified - @param key - The key used to reference the new boolean value - (if it matches an existing key, - the associated value will be overwritten) - @param value - The boolean value to be added to the object - - @return - true if the value was set successfully, false if not -*/ -bool bson_object_put_bool(BsonObject *obj, const char *key, bson_boolean value); -/* - @brief Put a new floating-point value into a given object - - @param obj - The object to be modified - @param key - The key used to reference the new floating-point value - (if it matches an existing key, - the associated value will be overwritten) - @param value - The floating-point value to be added to the object - - @return - true if the value was set successfully, false if not -*/ -bool bson_object_put_double(BsonObject *obj, const char *key, double value); - -/* - @brief Put a new element into a given object - - @param obj - The object to be modified - @param key - The key used to reference the new element - @param type - The type of the element to be added - @param value - The value of the element to be added - @param allocSize - The size, in bytes, to be allocated for the element - @param elementSize - The size, in bytes, of the element when converted to BSON format - - @return - true if the addition was successful, false if not -*/ -BsonElement *bson_object_get(BsonObject *obj, const char *key); -/* - @brief Retrieve the BSON object to which the specified key is mapped in an object - - @param obj - The object to be accessed - @param key - The key associated with the object to be retrieved - - @return - The pointer to the BSON object mapped to the given key if it exists, NULL otherwise -*/ -BsonObject *bson_object_get_object(BsonObject *obj, const char *key); -/* - @brief Retrieve the BSON array to which the specified key is mapped in an object - - @param obj - The object to be accessed - @param key - The key associated with the array to be retrieved - - @return - The pointer to the BSON array mapped to the given key if it exists, NULL otherwise -*/ -BsonArray *bson_object_get_array(BsonObject *obj, const char *key); -/* - @brief Retrieve the 32-bit integer value to which the specified key is mapped in an object - - @param obj - The object to be accessed - @param key - The key associated with the integer value to be retrieved - - @return - The 32-bit integer value mapped to the given key if it exists, NULL otherwise -*/ -int32_t bson_object_get_int32(BsonObject *obj, const char *key); -/* - @brief Retrieve the 64-bit integer value to which the specified key is mapped in an object - - @param obj - The object to be accessed - @param key - The key associated with the integer value to be retrieved - - @return - The 64-bit integer value mapped to the given key if it exists, NULL otherwise -*/ -int64_t bson_object_get_int64(BsonObject *obj, const char *key); -/* - @brief Retrieve the string value to which the specified key is mapped in an object - - @param obj - The object to be accessed - @param key - The key associated with the string value to be retrieved - - @return - The string value mapped to the given key if it exists, NULL otherwise -*/ -char *bson_object_get_string(BsonObject *obj, const char *key); -/* - @brief Retrieve the boolean value to which the specified key is mapped in an object - - @param obj - The object to be accessed - @param key - The key associated with the boolean value to be retrieved - - @return - The boolean value mapped to the given key if it exists, NULL otherwise -*/ -bson_boolean bson_object_get_bool(BsonObject *obj, const char *key); -/* - @brief Retrieve the floating-point value to which the specified key is mapped in an object - - @param obj - The object to be accessed - @param key - The key associated with the floating-point value to be retrieved - - @return - The floating-point value mapped to the given key if it exists, NULL otherwise -*/ -double bson_object_get_double(BsonObject *obj, const char *key); - -/* - @brief Get an iterator for a given BSON object - - @param obj - The object from which the iterator is created - - @return - The iterator -*/ -MapIterator bson_object_iterator(BsonObject *obj); -/* - @brief Get the next value from an object iterator - - @param iterator - The iterator to be advanced - - @return - The next BSON object entry in the object if it exists, - NULL if the iterator has moved past the end of the entry list -*/ -BsonObjectEntry bson_object_iterator_next(MapIterator *iterator); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/3rd_party/bson_c_lib/src/bson_util.c b/src/3rd_party/bson_c_lib/src/bson_util.c deleted file mode 100644 index 223cb5d96b..0000000000 --- a/src/3rd_party/bson_c_lib/src/bson_util.c +++ /dev/null @@ -1,136 +0,0 @@ -#include "bson_util.h" - -void write_int32_le(uint8_t *bytes, int32_t value, size_t *position) { - int i = 0; - for (i = 0; i < SIZE_INT32; i++) { - bytes[(*position)++] = (uint8_t)value & 0x000000FF; - value >>= 8; - } -} - -void write_int64_le(uint8_t *bytes, int64_t value, size_t *position) { - int i = 0; - for (i = 0; i < SIZE_INT64; i++) { - bytes[(*position)++] = (uint8_t)value & 0x000000FFull; - value >>= 8; - } -} - -void write_double_le(uint8_t *bytes, double value, size_t *position) { - union doubleUnion_t { - double value; - uint64_t intValue; - }; - union doubleUnion_t unionVal; - unionVal.value = value; - int i = 0; - for (i = 0; i < SIZE_DOUBLE; i++) { - bytes[(*position)++] = (uint8_t)unionVal.intValue & 0x000000FFull; - unionVal.intValue >>= 8; - } -} - -int32_t read_int32_le(uint8_t **bytes) { - int32_t value = 0; - int i = 0; - for (i = SIZE_INT32 - 1; i >= 0; i--) { - value <<= 8; - value += (*bytes)[i]; - } - (*bytes) += SIZE_INT32; - return value; -} - -int64_t read_int64_le(uint8_t **bytes) { - int32_t value = 0; - int i = 0; - for (i = SIZE_INT64 - 1; i >= 0; i--) { - value <<= 8; - value += (*bytes)[i]; - } - (*bytes) += SIZE_INT64; - return value; -} - -double read_double_le(uint8_t **bytes) { - union doubleUnion_t { - double value; - uint64_t intValue; - }; - union doubleUnion_t unionVal; - unionVal.intValue = 0; - int i = 0; - for (i = SIZE_DOUBLE - 1; i >= 0; i--) { - unionVal.intValue <<= 8; - unionVal.intValue += (*bytes)[i]; - } - (*bytes) += SIZE_DOUBLE; - return unionVal.value; -} - -uint8_t *string_to_byte_array(char *stringVal) { - size_t length = strlen(stringVal); - uint8_t *bytes = malloc(length + 1); - int i = 0; - for (i = 0; i < length; i++) { - bytes[i] = stringVal[i]; - } - bytes[length] = 0x00; - return bytes; -} - -size_t c_string_length(uint8_t *value) { - size_t length = 0; - while (value[length] != 0x00) { - length++; - } - return length; -} - -char *byte_array_to_string(uint8_t *bytes) { - size_t length = c_string_length(bytes); - return byte_array_to_bson_string(bytes, length); -} - -char *byte_array_to_bson_string(uint8_t *bytes, size_t length) { - char *stringVal = malloc(sizeof(char) * (length + 1)); - - int i = 0; - for (i = 0; i < length; i++) { - stringVal[i] = bytes[i] & 0xFF; - } - stringVal[length] = 0x00; - return stringVal; -} - -uint8_t *index_to_key(size_t index) { - size_t length = digits(index); - uint8_t *bytes = malloc(length); - size_t modValue = index; - int i = 0; - for (i = (int)length - 1; i >= 0; i--) { - //Convert digit to UTF-8 - bytes[i] = 0x30 + (modValue % 10); - modValue /= 10; - } - return bytes; -} - -size_t object_key_size(char *key) { - return strlen(key) + 1; -} - -size_t array_key_size(size_t index) { - //One byte for each decimal digit in index plus null character - return digits(index) + 1; -} - -size_t digits(size_t value) { - size_t modValue = value; - size_t numDigits = 1; - while (modValue >= 10) { - numDigits++; - modValue /= 10; - } - return numDigits; -} diff --git a/src/3rd_party/bson_c_lib/src/bson_util.h b/src/3rd_party/bson_c_lib/src/bson_util.h deleted file mode 100644 index 1f9133d6ed..0000000000 --- a/src/3rd_party/bson_c_lib/src/bson_util.h +++ /dev/null @@ -1,183 +0,0 @@ -#ifndef BSON_UTIL_H -#define BSON_UTIL_H - -#include -#include -#include -#include - -//4 bytes for length, one for ending null character -#define OBJECT_OVERHEAD_BYTES 5 -//Same as object -#define ARRAY_OVERHEAD_BYTES 5 -//1 byte for element type -#define ELEMENT_OVERHEAD_BYTES 1 -//4 bytes for length, one for ending null character -#define STRING_OVERHEAD_BYTES 5 - -//Sizes in bytes of each primitive type, as defined by the BSON spec -#define SIZE_INT32 4 -#define SIZE_INT64 8 -#define SIZE_DOUBLE 8 -#define SIZE_BOOLEAN 1 - -//Last byte in a BSON document -#define DOCUMENT_END 0x00 - -//Byte which defines the type of a value as defined in the BSON spec -enum element_type { - TYPE_DOUBLE = 0x01, - TYPE_STRING = 0x02, - TYPE_DOCUMENT = 0x03, - TYPE_ARRAY = 0x04, - TYPE_BINARY = 0x05, //unused - TYPE_UNDEFINED = 0x06, //deprecated - TYPE_OBJECT_ID = 0x07, //unused - TYPE_BOOLEAN = 0x08, - TYPE_DATE_TIME = 0x09, //unused - TYPE_NULL = 0x0A, - TYPE_REGEX = 0x0B, //unused - TYPE_DB_POINTER = 0x0C, //deprecated - TYPE_JS_CODE = 0x0D, //unused - TYPE_SYMBOL = 0x0E, //deprecated - TYPE_JS_CODE_WITH_SCOPE = 0x0F, //unused - TYPE_INT32 = 0x10, - TYPE_TIMESTAMP = 0x11, //unused - TYPE_INT64 = 0x12, - TYPE_DEC128 = 0x13, //unused - TYPE_MIN_KEY = 0xFF, //unused - TYPE_MAX_KEY = 0x7F //unused -}; -typedef enum element_type element_type; - -//Definition of each boolean value according to the BSON spec -enum bson_boolean { - BOOLEAN_INVALID = -1, - BOOLEAN_FALSE = 0x00, - BOOLEAN_TRUE = 0x01 -}; -typedef enum bson_boolean bson_boolean; - -#ifdef __cplusplus -extern "C" { -#endif - -/* - @brief Write a little endian 32-bit integer value to a given buffer - - @param bytes - The byte buffer to be written to - @param value - The integer value to be written to the buffer - @param position - Pointer to the current position in the buffer, will be advanced past the written value -*/ -void write_int32_le(uint8_t *bytes, int32_t value, size_t *position); -/* - @brief Write a little endian 64-bit integer value to a given buffer - - @param bytes - The byte buffer to be written to - @param value - The integer value to be written to the buffer - @param position - Pointer to the current position in the buffer, will be advanced past the written value -*/ -void write_int64_le(uint8_t *bytes, int64_t value, size_t *position); -/* - @brief Write a little endian 64-bit floating-point value to a given buffer - - @param bytes - The byte buffer to be written to - @param value - The integer value to be written to the buffer - @param position - Pointer to the current position in the buffer, will be advanced past the written value -*/ -void write_double_le(uint8_t *bytes, double value, size_t *position); - -/* - @brief Read a little endian 32-bit integer value from a given buffer - - @param bytes - Pointer to the byte buffer from which to read, - this value will be advanced past the value that was read - - @return - The value that was read from the buffer -*/ -int32_t read_int32_le(uint8_t **bytes); -/* - @brief Read a little endian 64-bit integer value from a given buffer - - @param bytes - Pointer to the byte buffer from which to read, - this value will be advanced past the value that was read - - @return - The value that was read from the buffer -*/ -int64_t read_int64_le(uint8_t **bytes); -/* - @brief Read a little endian 64-bit floating point value from a given buffer - - @param bytes - Pointer to the byte buffer from which to read, - this value will be advanced past the value that was read - - @return - The value that was read from the buffer -*/ -double read_double_le(uint8_t **bytes); - -/* - @brief Convert the give UTF-8 string into a byte array - - @param stringVal - the string value to be converted - - @return - The byte array representation of the string, must be freed by the caller after use -*/ -uint8_t *string_to_byte_array(char *stringVal); -/* - @brief Convert the given byte array to a UTF-8 string - - @param bytes - The byte array to be converted - - @return The converted string -*/ -char *byte_array_to_string(uint8_t *bytes); -/* - @brief Convert the given byte array to a UTF-8 BSON string - - @param bytes - The byte array to be converted - @param length - The length of the array to be converted - - @return The converted string (may include null characters) -*/ -char *byte_array_to_bson_string(uint8_t *bytes, size_t length); - -/* - @brief Convert the given a array index into a BSON key - - @param index - The index to be converted - - @return - A byte array containing the BSON key representation of index, must be freed by the caller after use -*/ -uint8_t *index_to_key(size_t index); - -/* - @brief Calculate the size, in bytes, of a BSON object key - - @param key - The object key used for calculations - - @return - The size of the BSON object key, in bytes -*/ -size_t object_key_size(char *key); -/* - @brief Calculate the size, in bytes, of a BSON array key - - @param index - The array key (index) used for calculations - - @return - The size of the BSON array key, in bytes -*/ -size_t array_key_size(size_t index); - -/* - @brief Calculate the number of decimal digits in a given integer value - - @param value - The value on which calculations are done - - @return The number of decimal digits in value -*/ -size_t digits(size_t value); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/LICENSE b/src/3rd_party/bson_c_lib/src/emhashmap/LICENSE deleted file mode 100755 index 6108defdd8..0000000000 --- a/src/3rd_party/bson_c_lib/src/emhashmap/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013, Ford Motor Company -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * 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 HOLDERS AND 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 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. diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am b/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am deleted file mode 100644 index 59330dbeaa..0000000000 --- a/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -AM_CFLAGS = -Wall -AM_LDFLAGS = - -includedir = /usr/local/include -include_HEADERS = emhashmap.h - -noinst_LTLIBRARIES = libemhashmap.la -libemhashmap_la_SOURCES = emhashmap.c diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in b/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in deleted file mode 100644 index fdb5dc943d..0000000000 --- a/src/3rd_party/bson_c_lib/src/emhashmap/Makefile.in +++ /dev/null @@ -1,625 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/emhashmap -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp $(include_HEADERS) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -libemhashmap_la_LIBADD = -am_libemhashmap_la_OBJECTS = emhashmap.lo -libemhashmap_la_OBJECTS = $(am_libemhashmap_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libemhashmap_la_SOURCES) -DIST_SOURCES = $(libemhashmap_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(includedir)" -HEADERS = $(include_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = /usr/local/include -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CFLAGS = -Wall -AM_LDFLAGS = -include_HEADERS = emhashmap.h -noinst_LTLIBRARIES = libemhashmap.la -libemhashmap_la_SOURCES = emhashmap.c -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/emhashmap/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/emhashmap/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libemhashmap.la: $(libemhashmap_la_OBJECTS) $(libemhashmap_la_DEPENDENCIES) $(EXTRA_libemhashmap_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libemhashmap_la_OBJECTS) $(libemhashmap_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emhashmap.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ - done - -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(includedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-includeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-includeHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ - ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am \ - install-includeHEADERS install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-includeHEADERS - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/README.mkd b/src/3rd_party/bson_c_lib/src/emhashmap/README.mkd deleted file mode 100755 index c5bd0a465c..0000000000 --- a/src/3rd_party/bson_c_lib/src/emhashmap/README.mkd +++ /dev/null @@ -1,56 +0,0 @@ -Generic C Hash Map for Embedded Systems -==================================== - -This library is an implementation of a hash map in C that maps integers to void -pointers. The map is initialized with a fixed size and load factor, and memory -is allocated on the heap all at once. There are no dependencies besides the BSD -queue.h, which is included in most systems by default. - -## Compiling - - $ make - -## Test Suite - -**Dependencies** - -* check - -This library has a test suite built with the `check` C library. Run the tests -like so: - - $ make test - -## Examples - - #include "emhashmap.h" - - #define MAX_CAPACITY 64 - - HashMap map = emhashmap_create(64); - - int key = 42; - char* value = "foo"; - emhashmap_put(&map, key, (void*)value); - - bool contains = emhashmap_contains(list, key); - // contains == true - - int size = emhashmap_size(&map); - // size == 1 - - emhashmap_remove(&map, key); - - emhashmap_is_empty(&map); - // == true - - emhashmap_destroy(&map); - -## License - -This library is licensed under the BSD license and is Copyright 2014, -Ford Motor Company - -## Contributors - -* Chris Peplin, cpeplin@ford.com diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c b/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c deleted file mode 100755 index 4b896f1d8d..0000000000 --- a/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.c +++ /dev/null @@ -1,157 +0,0 @@ -#include "emhashmap.h" - -#include -#include -#include -#include -#include - -static MapBucketList* find_bucket(HashMap* map, const char* key) { - MapBucketList* bucket = NULL; - - if(map != NULL && map->buckets != NULL) { - bucket = &map->buckets[(*map->hash)(key, map->bucket_count)]; - } - return bucket; -} - -void emhashmap_deinitialize(HashMap* map) { - if(map->entries != NULL) { - free(map->entries); - map->entries = NULL; - } - - if(map->buckets != NULL) { - free(map->buckets); - map->buckets = NULL; - } -} - -bool emhashmap_initialize(HashMap* map, int capacity, float load_factor, size_t (*hash_function)(const char*, size_t)) { - map->bucket_count = ((int)(capacity / load_factor) + 1); - map->capacity = capacity; - map->entries = (MapEntry*) malloc(sizeof(MapEntry) * map->capacity); - memset(map->entries, 0, sizeof(MapEntry) * map->capacity); - map->buckets = (MapBucketList*) malloc(sizeof(MapBucketList) * - map->bucket_count); - memset(map->buckets, 0, sizeof(MapBucketList) * map->bucket_count); - map->hash = hash_function; - int i; - for(i = 0; i < map->bucket_count; i++) { - LIST_INIT(&map->buckets[i]); - } - - LIST_INIT(&map->free_list); - for(i = 0; i < map->capacity; i++) { - LIST_INSERT_HEAD(&map->free_list, &map->entries[i], entries); - } - return map->buckets != NULL; -} - -MapEntry* emhashmap_get(HashMap* map, const char* key) { - MapBucketList* bucket = find_bucket(map, key); - - MapEntry* entry; - LIST_FOREACH(entry, bucket, entries) { - if(strcmp(entry->key, key) == 0) { - return entry; - } - } - return NULL; -} - -bool emhashmap_contains(HashMap* map, const char* key) { - return emhashmap_get(map, key) != NULL; -} - -bool emhashmap_put(HashMap* map, const char* key, void* value) { - MapBucketList* bucket = find_bucket(map, key); - - MapEntry* entry, *matching_entry = NULL; - LIST_FOREACH(entry, bucket, entries) { - if(strcmp(entry->key, key) == 0) { - matching_entry = entry; - } - } - - bool result = true; - if(matching_entry != NULL) { - matching_entry->value = value; - } else { - MapEntry* new_entry = LIST_FIRST(&map->free_list); - if(new_entry == NULL) { - result = false; - } else { - strncpy(new_entry->key, key, 255); - new_entry->value = value; - LIST_REMOVE(new_entry, entries); - LIST_INSERT_HEAD(bucket, new_entry, entries); - } - } - return result; -} - -void* emhashmap_remove(HashMap* map, const char* key) { - MapBucketList* bucket = find_bucket(map, key); - - MapEntry* entry, *matching_entry = NULL; - LIST_FOREACH(entry, bucket, entries) { - if(strcmp(entry->key, key) == 0) { - matching_entry = entry; - } - } - - void* value = NULL; - if(matching_entry != NULL) { - value = matching_entry->value; - LIST_REMOVE(matching_entry, entries); - } - return value; -} - -int emhashmap_size(HashMap* map) { - int size = 0; - int i; - for(i = 0; i < map->bucket_count; i++) { - MapEntry* entry = NULL; - LIST_FOREACH(entry, &map->buckets[i], entries) { - ++size; - } - } - return size; -} - -bool emhashmap_is_empty(HashMap* map) { - return emhashmap_size(map) == 0; -} - -float emhashmap_load_factor(HashMap* map) { - return emhashmap_size(map) / map->capacity; -} - -MapIterator emhashmap_iterator(HashMap* map) { - MapIterator iterator; - iterator.current_bucket = 0; - iterator.current_entry = NULL; - iterator.map = map; - return iterator; -} - -MapEntry* emhashmap_iterator_next(MapIterator* iterator) { - if(iterator != NULL) { - if(iterator->current_entry != NULL) { - iterator->current_entry = LIST_NEXT(iterator->current_entry, entries); - } - - if(iterator->current_entry == NULL) { - do { - iterator->current_entry = LIST_FIRST(&iterator->map->buckets[iterator->current_bucket++]); - } while(iterator->current_entry == NULL && - iterator->current_bucket < iterator->map->bucket_count - 1); - } - return iterator->current_entry; - } - else { - return NULL; - } -} diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h b/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h deleted file mode 100755 index 7d7f28721f..0000000000 --- a/src/3rd_party/bson_c_lib/src/emhashmap/emhashmap.h +++ /dev/null @@ -1,144 +0,0 @@ -#ifndef _EMHASHMAP_H_ -#define _EMHASHMAP_H_ - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Public: An entry in the map. - * - * key - the entry key, currently supports only integers. - * value - a pointer to the value. this must be allocated with malloc or - * be in global scope, and the map entry does not take ownership of its - * memory. - */ -struct MapEntry { - char key[255]; - void* value; - LIST_ENTRY(MapEntry) entries; -}; -typedef struct MapEntry MapEntry; - -LIST_HEAD(MapBucketList, MapEntry); -typedef struct MapBucketList MapBucketList; - -/* Public: A struct encapsulating a map's state. All of the fields are private - * - use the emhashmap_ functions to interact with the map. - * - * bucket_count - The fixed count of buckets for elements in the map. - * capacity - The total, fixed capacity of the map. - * buckets - An array of MapBucketList lists, each a bucket in the map. - * entries - An array of all entry slots, to be used in each bucket. - * free_list - An array of all entries when not actively in a bucket. - */ -struct HashMap { - int bucket_count; - int capacity; - MapBucketList* buckets; - MapEntry* entries; - MapBucketList free_list; - size_t (*hash)(const char*, size_t); -}; -typedef struct HashMap HashMap; - -struct MapIterator { - HashMap* map; - int current_bucket; - MapEntry* current_entry; -}; -typedef struct MapIterator MapIterator; - -/* Public: Initialize a map with the given capacity and load factor (determines - * the number of buckets). - * - * This allocates memory for the buckets and entries, so make sure to call - * emhashmap_destroy(HashMap*) after done with this map. - * - * map - a pointer to the map to initialize. It must already be allocated on the - * stack or heap. - * capacity - the initial capacity for the map. - * load_factor - The desired load factor when the map is at capacity. - * - * Returns true if the map was initialized, successfully, false if space could - * not be allocated for the buckets or entries. - */ -bool emhashmap_initialize(HashMap* map, int capacity, float load_factor, size_t (*hash_function)(const char*, size_t)); - -/* Public: De-initialize a map, freeing memory for the buckets and entries. - * - * This will *not* free the memory associated with any values stored in the map - * - only the buckets and map entry objects. - * - * map - a pointer to the map to deinitialize. It must already be allocated on - * the stack or heap. - */ -void emhashmap_deinitialize(HashMap* map); - -/* Public: Retrive the entry for a given key from the map. - * - * map - the map to retrive the value. - * key - the key for this value. - * - * Returns the MapEntry if found, otherwise NULL. - */ -MapEntry* emhashmap_get(HashMap* map, const char* key); - -/* Public: Check if the given key is in the map. - * - * map - the map to query. - * key - the key to check for membership. - * - * Returns true if the key is in the map. - */ -bool emhashmap_contains(HashMap* map, const char* key); - -/* Public: Put the value in the map with the given key. - * - * If the key already exists in the map, its value will be overridden (so make - * sure you've freed the memory associated with the existing value). - * - * Returns true if there was space in the map and the key-value pair was added - * successfully. Returns false if the map is full. - */ -bool emhashmap_put(HashMap* map, const char* key, void* value); - -/* Public: Remove a value with the given key from the map. - * - * map - the map to query. - * key - the key to remove. - * - * Returns the value pointer if found in the map and removed - the map user is - * responsible for freeing any memory associated with that pointer. - * Returns NULL if the key was not in the map. - */ -void* emhashmap_remove(HashMap* map, const char* key); - -/* Public: Get the number of keys in the map. - * - * map - the map to query. - * - * Returns the total number of keys in the map. - */ -int emhashmap_size(HashMap* map); - -/* Public: Check if a map is empty. - * - * map - the map to query. - * - * Returns true if there are no entries in the map. - */ -bool emhashmap_is_empty(HashMap* map); - -MapIterator emhashmap_iterator(HashMap* map); - -MapEntry* emhashmap_iterator_next(MapIterator* iterator); - -#ifdef __cplusplus -} -#endif - -#endif // _EMHASHMAP_H_ diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh b/src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh deleted file mode 100755 index 4781636b8f..0000000000 --- a/src/3rd_party/bson_c_lib/src/emhashmap/runtests.sh +++ /dev/null @@ -1,17 +0,0 @@ -echo "Running unit tests:" - -for i in $1/*.bin -do - if test -f $i - then - if ./$i - then - echo $i PASS - else - echo "ERROR in test $i:" - exit 1 - fi - fi -done - -echo "${txtbld}$(tput setaf 2)All unit tests passed.$(tput sgr0)" diff --git a/src/3rd_party/bson_c_lib/src/emhashmap/tests/tests.c b/src/3rd_party/bson_c_lib/src/emhashmap/tests/tests.c deleted file mode 100755 index 88f1f21621..0000000000 --- a/src/3rd_party/bson_c_lib/src/emhashmap/tests/tests.c +++ /dev/null @@ -1,218 +0,0 @@ -#include -#include -#include "emhashmap.h" -#include -#include - -HashMap map; -int capacity = 128; -float load_factor = 10; -int key = 1; -void* value = (void*) 1; - -void setup() { - emhashmap_initialize(&map, capacity, load_factor); -} - -void teardown() { - emhashmap_deinitialize(&map); -} - -START_TEST (test_init) -{ - emhashmap_initialize(&map, capacity, .5); - emhashmap_deinitialize(&map); -} -END_TEST - -START_TEST (test_fill_up) -{ - int i; - for(i = 0; i < capacity; i++) { - ck_assert(emhashmap_put(&map, i, (void*)i)); - ck_assert_int_eq(emhashmap_size(&map), i + 1); - } - ck_assert(!emhashmap_put(&map, i, (void*)i)); -} -END_TEST - -START_TEST (test_put_multiple) -{ - ck_assert(emhashmap_put(&map, key, value)); - ck_assert(emhashmap_put(&map, 2, (void*)2)); - ck_assert_int_eq(emhashmap_size(&map), 2); -} -END_TEST - -START_TEST (test_get) -{ - emhashmap_put(&map, key, value); - MapEntry* entered_value = emhashmap_get(&map, key); - ck_assert(entered_value != NULL); - ck_assert(entered_value->value == value); -} -END_TEST - -START_TEST (test_get_missing) -{ - ck_assert(emhashmap_get(&map, key) == NULL); -} -END_TEST - -START_TEST (test_put) -{ - ck_assert(emhashmap_put(&map, key, value)); - ck_assert_int_eq(emhashmap_size(&map), 1); -} -END_TEST - -START_TEST (test_overwrite) -{ - ck_assert(emhashmap_put(&map, key, value)); - ck_assert_int_eq(emhashmap_size(&map), 1); - void* another_value = (void*)2; - ck_assert(emhashmap_put(&map, key, another_value)); - ck_assert_int_eq(emhashmap_size(&map), 1); - ck_assert(emhashmap_get(&map, key)->value == another_value); -} -END_TEST - -START_TEST (test_contains) -{ - emhashmap_put(&map, key, value); - ck_assert(emhashmap_contains(&map, key)); -} -END_TEST - -START_TEST (test_contains_null_value) -{ - emhashmap_put(&map, key, NULL); - ck_assert(emhashmap_contains(&map, key)); -} -END_TEST - -START_TEST (test_does_not_contain) -{ - emhashmap_put(&map, key, value); - ck_assert(!emhashmap_contains(&map, 2)); -} -END_TEST - -START_TEST (test_remove) -{ - emhashmap_put(&map, key, value); - ck_assert(emhashmap_contains(&map, key)); - ck_assert(emhashmap_remove(&map, key) == value); - ck_assert(!emhashmap_contains(&map, key)); -} -END_TEST - -START_TEST (test_remove_not_in_map) -{ - emhashmap_put(&map, key, value); - ck_assert(emhashmap_contains(&map, key)); - ck_assert(!emhashmap_remove(&map, 2)); - ck_assert(emhashmap_contains(&map, key)); -} -END_TEST - -START_TEST (test_is_empty) -{ - ck_assert(emhashmap_is_empty(&map)); - emhashmap_put(&map, key, value); - ck_assert(!emhashmap_is_empty(&map)); -} -END_TEST - -START_TEST (test_size) -{ - ck_assert_int_eq(emhashmap_size(&map), 0); - emhashmap_put(&map, key, value); - ck_assert_int_eq(emhashmap_size(&map), 1); - emhashmap_put(&map, 2, value); - ck_assert_int_eq(emhashmap_size(&map), 2); -} -END_TEST - -START_TEST (test_create) -{ - ck_assert(&map != NULL); -} -END_TEST - -START_TEST (test_iterate_empty) -{ - MapIterator iterator = emhashmap_iterator(&map); - ck_assert(emhashmap_iterator_next(&iterator) == NULL); -} -END_TEST - -START_TEST (test_iterate_one) -{ - emhashmap_put(&map, key, value); - MapIterator iterator = emhashmap_iterator(&map); - MapEntry* entry = emhashmap_iterator_next(&iterator); - ck_assert(entry != NULL); - ck_assert(entry->key == key); - ck_assert(entry->value == value); -} -END_TEST - -START_TEST (test_iterate_many) -{ - emhashmap_put(&map, key, value); - emhashmap_put(&map, 2, value); - MapIterator iterator = emhashmap_iterator(&map); - - MapEntry* entry = emhashmap_iterator_next(&iterator); - ck_assert(entry != NULL); - ck_assert(entry->key == key); - ck_assert(entry->value == value); - - entry = emhashmap_iterator_next(&iterator); - ck_assert(entry != NULL); - ck_assert(entry->key == 2); - ck_assert(entry->value == value); - - entry = emhashmap_iterator_next(&iterator); - ck_assert(entry == NULL); -} -END_TEST - -Suite* suite(void) { - Suite* s = suite_create("queue"); - TCase *tc_core = tcase_create("core"); - tcase_add_checked_fixture (tc_core, setup, teardown); - tcase_add_test(tc_core, test_init); - tcase_add_test(tc_core, test_get); - tcase_add_test(tc_core, test_get_missing); - tcase_add_test(tc_core, test_put); - tcase_add_test(tc_core, test_put_multiple); - tcase_add_test(tc_core, test_fill_up); - tcase_add_test(tc_core, test_overwrite); - tcase_add_test(tc_core, test_contains); - tcase_add_test(tc_core, test_does_not_contain); - tcase_add_test(tc_core, test_remove); - tcase_add_test(tc_core, test_remove_not_in_map); - tcase_add_test(tc_core, test_is_empty); - tcase_add_test(tc_core, test_size); - tcase_add_test(tc_core, test_create); - tcase_add_test(tc_core, test_iterate_empty); - tcase_add_test(tc_core, test_iterate_one); - tcase_add_test(tc_core, test_iterate_many); - suite_add_tcase(s, tc_core); - - return s; -} - -int main(void) { - int numberFailed; - Suite* s = suite(); - SRunner *sr = srunner_create(s); - // Don't fork so we can actually use gdb - srunner_set_fork_status(sr, CK_NOFORK); - srunner_run_all(sr, CK_NORMAL); - numberFailed = srunner_ntests_failed(sr); - srunner_free(sr); - return (numberFailed == 0) ? 0 : 1; -} -- cgit v1.2.1 From 4221644fe32671ec071e9f4e9ad161cb4e97c654 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 27 Jul 2017 15:33:16 -0400 Subject: Fix BSON library download step --- src/3rd_party/CMakeLists.txt | 14 +- src/3rd_party/CMakeLists.txt~ | 291 ------------------------- src/components/protocol_handler/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 298 deletions(-) delete mode 100644 src/3rd_party/CMakeLists.txt~ diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index b47aba4270..ad52c0c2aa 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -283,25 +283,27 @@ if(HMI_DBUS_API) add_subdirectory(dbus-cmake) endif() -set(install-bson_c_lib_var "install-bson_c_lib") set(BSON_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) set(BSON_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) set(EMHASHMAP_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) set(EMHASHMAP_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) +set(BSON_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bson_c_lib) include(ExternalProject) ExternalProject_Add(libbson - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bson_c_lib - GIT_REPOSITORY https://github.com/smartdevicelink/bson_c_lib.git - GIT TAG master - CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bson_c_lib/configure + GIT_REPOSITORY "http://github.com/smartdevicelink/bson_c_lib.git" + GIT_TAG "master" + BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY} + DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY} + SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY} + CONFIGURE_COMMAND touch * && ./configure BUILD_COMMAND make INSTALL_COMMAND sudo make install) add_custom_target(install-3rd_party DEPENDS ${install-3rd_party_logger_var} DEPENDS ${install-3rd_party_dbus_var} - DEPENDS ${install-bson_c_lib_var} + DEPENDS libbson WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} ) diff --git a/src/3rd_party/CMakeLists.txt~ b/src/3rd_party/CMakeLists.txt~ deleted file mode 100644 index cddc2d16b6..0000000000 --- a/src/3rd_party/CMakeLists.txt~ +++ /dev/null @@ -1,291 +0,0 @@ -# Copyright (c) 2014, Ford Motor Company -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# -# 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. -# -# Neither the name of the Ford Motor Company nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - -include("./set_3rd_party_paths.cmake") - -set(3RD_PARTY_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -set(3RD_PARTY_BINARY_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - -set (install-3rd_party_logger_var "") -set (install-3rd_party_dbus_var "") - -if(NO_REBUILD_3RD_PARTY) - set(NO_REBUILD_3RD_PARTY_LOGGER ON) - set(NO_REBUILD_3RD_PARTY_DBUS ON) -endif() - -if(FORCE_3RD_PARTY) - if(NO_REBUILD_3RD_PARTY) - message(FATAL_ERROR "Please don't turn on both FORCE_3RD_PARTY and NO_REBUILD_3RD_PARTY at the same time.") - else() - set(FORCE_3RD_PARTY_LOGGER ON) - set(FORCE_3RD_PARTY_DBUS ON) - endif() -endif() - -if(ENABLE_LOG OR HMI_DBUS_API) - # --- libexpat - add_subdirectory(expat-2.1.0) - set(EXPAT_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) -endif() - -if(ENABLE_LOG) - if(NO_REBUILD_3RD_PARTY_LOGGER) - message(STATUS "Not rebuilding logger.") - else() - if(FORCE_3RD_PARTY_LOGGER) - message(STATUS "Force to rebuild logger.") - - #build logger - add_custom_target(3rd_party_logger - make - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} - ) - - #install logger - #install either to default place with sudo or non-default plase without sudo. - #to install with sudo to non-default place use manual installation - add_custom_target(install-3rd_party_logger - COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; - if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then - sudo -k \; - sudo make install\; - else - make install\; - fi\" - DEPENDS 3rd_party_logger - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} - ) - else() - #build logger - add_custom_target(3rd_party_logger - COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} && - grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\; - if [ \\$$? == 0 ]\; then - VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\; - VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\; - VAR2=-1\; - cd ${CMAKE_CURRENT_SOURCE_DIR}\; - git log . 1>/dev/null 2>&1\; - if [ \\$$? == 0 ]; then - VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\; - fi\; - if [ \\$$VAR1 != \\$$VAR2 ]\; then - echo " Need to rebuild logger. " \; - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - make\; - else - echo " Logger is actual. " \; - fi\; - else - echo " Need to build logger. " \; - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - make\; - fi\" - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} - ) - - #install logger - #install either to default place with sudo or non-default plase without sudo. - #to install with sudo to non-default place use manual installation - add_custom_target(install-3rd_party_logger - COMMAND /bin/bash -c \"cd ${CMAKE_CURRENT_SOURCE_DIR} && - grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 1>/dev/null 2>&1\; - if [ \\$$? == 0 ]\; then - VAR1=\\$$\( readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/liblog4cxx.so 2>/dev/null\)\; - VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\; - VAR2=-1\; - cd ${CMAKE_CURRENT_SOURCE_DIR}\; - git log . 1>/dev/null 2>&1\; - if [ \\$$? == 0 ]; then - VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/apache-log4cxx-0.10.0\)\; - fi\; - if [ \\$$VAR1 != \\$$VAR2 ]\; then - USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; - if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - sudo -k \; - sudo make install\; - else - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - make install\; - fi\; - fi\; - else - USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; - if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - sudo -k \; - sudo make install\; - else - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - make install\; - fi\; - fi\" - DEPENDS 3rd_party_logger - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} - ) - endif() - - set(install-3rd_party_logger_var "install-3rd_party_logger") - endif() - - set(APR_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) - set(APR_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) - set(APR_UTIL_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) - set(LOG4CXX_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) - set(LOG4CXX_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) - - # --- libapr-1 - add_subdirectory(apr-cmake) - - # --- apr-util - add_subdirectory(apr-util-cmake) - - # --- log4cxx - add_subdirectory(apache-log4cxx-cmake) -endif() - -# --- D-Bus -if(HMI_DBUS_API) - if(NO_REBUILD_3RD_PARTY_DBUS) - message(STATUS "Not rebuilding D-Bus.") - else() - if(FORCE_3RD_PARTY_DBUS) - message(STATUS "Force to rebuild D-Bus.") - - #build d-bus - add_custom_target(3rd_party_dbus - make - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} - ) - - #install d-bus - #install either to default place with sudo or non-default plase without sudo. - #to install with sudo to non-default place use manual installation - add_custom_target(install-3rd_party_dbus - COMMAND /bin/bash -c \"USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; - if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then - sudo -k \; - sudo make install\; - else - make install\; - fi\" - DEPENDS 3rd_party_dbus - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} - ) - else() - #build d-bus - add_custom_target(3rd_party_dbus - COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\; - if [ \\$$? == 0 ]\; then - VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\; - VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\; - VAR2=-1\; - cd ${CMAKE_CURRENT_SOURCE_DIR}\; - git log . 1>/dev/null 2>&1\; - if [ \\$$? == 0 ]; then - VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\; - fi\; - if [ \\$$VAR1 != \\$$VAR2 ]\; then - echo " Need to rebuild D-Bus. " \; - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - make\; - else - echo " D-Bus is actual. " \; - fi\; - else - echo " Need to build D-Bus. " \; - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - make\; - fi\" - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} - ) - - #install d-bus - #install either to default place with sudo or non-default plase without sudo. - #to install with sudo to non-default place use manual installation - add_custom_target(install-3rd_party_dbus - COMMAND /bin/bash -c \"grep .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 1>/dev/null 2>&1\; - if [ \\$$? == 0 ]\; then - VAR1=\\$$\(readelf -p .commit_hash ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib/libdbus-1.so 2>/dev/null\)\; - VAR1=\\$$\(echo \\$$VAR1 | awk '{print \\$$NF}'\)\; - VAR2=-1\; - cd ${CMAKE_CURRENT_SOURCE_DIR}\; - git log . 1>/dev/null 2>&1\; - if [ \\$$? == 0 ]; then - VAR2=\\$$\(git log --pretty=\"format:%H\" -1 ${3RD_PARTY_SOURCE_DIRECTORY}/dbus-1.7.8\)\; - fi\; - if [ \\$$VAR1 != \\$$VAR2 ]\; then - USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; - if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - sudo -k \; - sudo make install\; - else - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - make install\; - fi\; - fi\; - else - USE_DEFAULT_3RD_PARTY_PATH=${USE_DEFAULT_3RD_PARTY_PATH}\; - if [ \\$$USE_DEFAULT_3RD_PARTY_PATH == "true" ]\; then - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - sudo -k \; - sudo make install\; - else - cd ${3RD_PARTY_BINARY_DIRECTORY}\; - make install\; - fi\; - fi\" - DEPENDS 3rd_party_dbus - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} - ) - - set(install-3rd_party_dbus_var "install-3rd_party_dbus") - endif() - endif() - - # --- D-Bus - set(DBUS_INCLUDE_DIR ${3RD_PARTY_INSTALL_PREFIX}/include) - set(DBUS_INCLUDE_DIR_ARCH ${3RD_PARTY_INSTALL_PREFIX_ARCH}/include) - set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIR} ${DBUS_INCLUDE_DIR_ARCH}) - set(DBUS_INCLUDE_DIRS ${DBUS_INCLUDE_DIRS} PARENT_SCOPE) - set(DBUS_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) - - add_subdirectory(dbus-cmake) -endif() - -add_custom_target(install-3rd_party - DEPENDS ${install-3rd_party_logger_var} - DEPENDS ${install-3rd_party_dbus_var} - WORKING_DIRECTORY ${3RD_PARTY_BINARY_DIRECTORY} -) - diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt index 139d52fc53..ebecff2402 100644 --- a/src/components/protocol_handler/CMakeLists.txt +++ b/src/components/protocol_handler/CMakeLists.txt @@ -58,7 +58,7 @@ endforeach() add_library(ProtocolHandler ${SOURCES}) -add_dependencies(ProtocolHandler install-bson_c_lib) +add_dependencies(ProtocolHandler libbson) target_link_libraries(ProtocolHandler ${LIBRARIES}) if(BUILD_TESTS) -- cgit v1.2.1 From 9c4fdd4626ee4ba262191b1756fdaa468182a713 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Fri, 28 Jul 2017 13:36:44 -0400 Subject: Fix BSON library config step --- src/3rd_party/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index ad52c0c2aa..2abbe4f284 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -296,7 +296,7 @@ ExternalProject_Add(libbson BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY} DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY} SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY} - CONFIGURE_COMMAND touch * && ./configure + CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in && ./configure BUILD_COMMAND make INSTALL_COMMAND sudo make install) -- cgit v1.2.1 From 5241e0f9f37477ab51dbece22b042f0b5a679452 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Fri, 28 Jul 2017 14:11:17 -0400 Subject: =?UTF-8?q?SystemCapabilities=20Hmi=20Level=20=E2=80=9CNONE?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/appMain/sdl_preloaded_pt.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index e2c3ab805c..29deab5278 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -102,7 +102,8 @@ "GetSystemCapability": { "hmi_levels": ["BACKGROUND", "FULL", - "LIMITED"] + "LIMITED", + "NONE"] }, "ListFiles": { "hmi_levels": ["BACKGROUND", -- cgit v1.2.1 From e3b0b31a8c2537f21f9a8c0c39f855ed4ebced5c Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 31 Jul 2017 11:35:14 -0400 Subject: Formatting and review changes --- .../mobile/get_system_capability_request.h | 16 +++++------ .../mobile/get_system_capability_response.h | 18 ++++++------- .../application_manager/hmi_capabilities_impl.h | 31 ++++++++++++++++++++-- .../commands/hmi/ui_get_capabilities_response.cc | 15 +++++++---- .../mobile/get_system_capability_request.cc | 30 +++++++++++---------- .../src/hmi_capabilities_impl.cc | 29 +++++++++++++------- .../hmi/ui_get_capabilities_response_test.cc | 16 ++++++----- .../test/hmi_capabilities_test.cc | 6 ++--- .../application_manager/mock_hmi_capabilities.h | 10 ++++--- .../include/application_manager/hmi_capabilities.h | 30 +++++++++++++++++++-- src/components/interfaces/MOBILE_API.xml | 4 +-- 11 files changed, 136 insertions(+), 69 deletions(-) diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h index e74af559b6..ba55a6b4cd 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_request.h @@ -41,9 +41,9 @@ namespace application_manager { namespace commands { class GetSystemCapabilityRequest : public CommandRequestImpl { -public: + public: GetSystemCapabilityRequest(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~GetSystemCapabilityRequest(); @@ -51,13 +51,11 @@ public: virtual void on_event(const event_engine::Event& event); -private: + private: DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityRequest); +}; // GetSystemCapabilityRequest +} // commands +} // application_manager - -};//GetSystemCapabilityRequest -}//commands -}//application_manager - -#endif //SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_ \ No newline at end of file +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_REQUEST_H_ \ No newline at end of file diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h index 14fe5be8b9..9fa6f9b5bb 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_system_capability_response.h @@ -36,27 +36,25 @@ #include "application_manager/commands/command_response_impl.h" #include "utils/macro.h" - + namespace application_manager { namespace commands { class GetSystemCapabilityResponse : public CommandResponseImpl { -public: + public: GetSystemCapabilityResponse(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~GetSystemCapabilityResponse(); virtual void Run() OVERRIDE; -private: + private: DISALLOW_COPY_AND_ASSIGN(GetSystemCapabilityResponse); +}; // GetSystemCapabilityResponse +} // commands +} // application_manager - -};//GetSystemCapabilityResponse -}//commands -}//application_manager - -#endif //SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_ \ No newline at end of file +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_SYSTEM_CAPABILITY_RESPONSE_H_ \ No newline at end of file diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h index 080503e314..777c45d0ac 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h @@ -407,11 +407,38 @@ class HMICapabilitiesImpl : public HMICapabilities { */ bool phone_call_supported() const OVERRIDE; - void set_navigation_capability(const smart_objects::SmartObject& navigation_capability) OVERRIDE; + /* + * @brief Interface used to store information regarding + * the navigation "System Capability" + * + * @param navigation_capability contains information related + * to the navigation system capability. + */ + void set_navigation_capability( + const smart_objects::SmartObject& navigation_capability) OVERRIDE; + /* + * @brief Retrieves information regarding the navigation system capability + * + * @return NAVIGATION system capability + */ const smart_objects::SmartObject* navigation_capability() const OVERRIDE; - void set_phone_capability(const smart_objects::SmartObject& phone_capability) OVERRIDE; + /* + * @brief Interface used to store information regarding + * the phone "System Capability" + * + * @param phone_capability contains information related + * to the phone system capability. + */ + void set_phone_capability( + const smart_objects::SmartObject& phone_capability) OVERRIDE; + + /* + * @brief Retrieves information regarding the phone call system capability + * + * @return PHONE_CALL system capability + */ const smart_objects::SmartObject* phone_capability() const OVERRIDE; diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc index bf89b3d5a7..4b31debbdd 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc @@ -80,12 +80,17 @@ void UIGetCapabilitiesResponse::Run() { } } - if(msg_params.keyExists(strings::system_capabilities)) { - if(msg_params[strings::system_capabilities].keyExists(strings::navigation_capability)) { - hmi_capabilities.set_navigation_capability(msg_params[strings::system_capabilities][strings::navigation_capability]); + if (msg_params.keyExists(strings::system_capabilities)) { + if (msg_params[strings::system_capabilities].keyExists( + strings::navigation_capability)) { + hmi_capabilities.set_navigation_capability( + msg_params[strings::system_capabilities] + [strings::navigation_capability]); } - if(msg_params[strings::system_capabilities].keyExists(strings::phone_capability)) { - hmi_capabilities.set_phone_capability(msg_params[strings::system_capabilities][strings::phone_capability]); + if (msg_params[strings::system_capabilities].keyExists( + strings::phone_capability)) { + hmi_capabilities.set_phone_capability( + msg_params[strings::system_capabilities][strings::phone_capability]); } } } diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc index b7d9dbb043..91fad1b664 100644 --- a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc @@ -27,9 +27,12 @@ void GetSystemCapabilityRequest::Run() { return; } smart_objects::SmartObject response_params(smart_objects::SmartType_Map); - //response_params[strings::system_capability][strings::system_capability_type] = (mobile_apis::SystemCapabilityType::PHONE_CALL); - mobile_apis::SystemCapabilityType::eType response_type = static_cast((*message_)[strings::msg_params][strings::system_capability_type].asInt()); - response_params[strings::system_capability][strings::system_capability_type] = response_type; + mobile_apis::SystemCapabilityType::eType response_type = + static_cast( + (*message_)[strings::msg_params][strings::system_capability_type] + .asInt()); + response_params[strings::system_capability][strings::system_capability_type] = + response_type; const HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); @@ -37,8 +40,9 @@ void GetSystemCapabilityRequest::Run() { switch (response_type) { case mobile_apis::SystemCapabilityType::NAVIGATION: { if (hmi_capabilities.navigation_capability()) { - response_params[strings::system_capability][strings::navigation_capability] = - *hmi_capabilities.navigation_capability(); + response_params[strings::system_capability] + [strings::navigation_capability] = + *hmi_capabilities.navigation_capability(); } else { SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); return; @@ -47,8 +51,8 @@ void GetSystemCapabilityRequest::Run() { } case mobile_apis::SystemCapabilityType::PHONE_CALL: { if (hmi_capabilities.phone_capability()) { - response_params[strings::system_capability][strings::phone_capability] = - *hmi_capabilities.phone_capability(); + response_params[strings::system_capability][strings::phone_capability] = + *hmi_capabilities.phone_capability(); } else { SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); return; @@ -58,22 +62,20 @@ void GetSystemCapabilityRequest::Run() { case mobile_apis::SystemCapabilityType::VIDEO_STREAMING: SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; - break; case mobile_apis::SystemCapabilityType::AUDIO_STREAMING: SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; - break; - default: // Return unsupported resource + default: // Return unsupported resource SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); - break; + return; } SendResponse(true, mobile_apis::Result::SUCCESS, NULL, &response_params); } -void GetSystemCapabilityRequest::on_event(const event_engine::Event& event){ +void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) { LOG4CXX_INFO(logger_, "GetSystemCapabilityRequest on_event"); } -} // namespace commands +} // namespace commands -} // namespace application_manager \ No newline at end of file +} // namespace application_manager \ No newline at end of file diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index 9b4d62ed2d..12a64165e8 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -614,7 +614,8 @@ void HMICapabilitiesImpl::set_navigation_capability( if (navigation_capability_) { delete navigation_capability_; } - navigation_capability_ = new smart_objects::SmartObject(navigation_capability); + navigation_capability_ = + new smart_objects::SmartObject(navigation_capability); } void HMICapabilitiesImpl::set_phone_capability( @@ -736,11 +737,13 @@ bool HMICapabilitiesImpl::phone_call_supported() const { return is_phone_call_supported_; } -const smart_objects::SmartObject* HMICapabilitiesImpl::navigation_capability() const { +const smart_objects::SmartObject* HMICapabilitiesImpl::navigation_capability() + const { return navigation_capability_; } -const smart_objects::SmartObject* HMICapabilitiesImpl::phone_capability() const { +const smart_objects::SmartObject* HMICapabilitiesImpl::phone_capability() + const { return phone_capability_; } @@ -988,18 +991,24 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { soft_button_capabilities, soft_button_capabilities_so); set_soft_button_capabilities(soft_button_capabilities_so); } - if(check_existing_json_member(ui, "systemCapabilities")) { + if (check_existing_json_member(ui, "systemCapabilities")) { Json::Value system_capabilities = ui.get("systemCapabilities", ""); - if (check_existing_json_member(system_capabilities, "navigationCapability")) { - Json::Value navigation_capability = system_capabilities.get("navigationCapability",""); + if (check_existing_json_member(system_capabilities, + "navigationCapability")) { + Json::Value navigation_capability = + system_capabilities.get("navigationCapability", ""); smart_objects::SmartObject navigation_capability_so; - Formatters::CFormatterJsonBase::jsonValueToObj(navigation_capability, navigation_capability_so); + Formatters::CFormatterJsonBase::jsonValueToObj( + navigation_capability, navigation_capability_so); set_navigation_capability(navigation_capability_so); } - if (check_existing_json_member(system_capabilities, "phoneCapability")) { - Json::Value phone_capability = system_capabilities.get("phoneCapability",""); + if (check_existing_json_member(system_capabilities, + "phoneCapability")) { + Json::Value phone_capability = + system_capabilities.get("phoneCapability", ""); smart_objects::SmartObject phone_capability_so; - Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability, phone_capability_so); + Formatters::CFormatterJsonBase::jsonValueToObj(phone_capability, + phone_capability_so); set_phone_capability(phone_capability_so); } } diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index b556da603c..0f98d102a0 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -222,10 +222,10 @@ TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) { smart_objects::SmartObject(smart_objects::SmartType_Map); (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::navigation_capability]["sendLocationEnabled"] = true; + [strings::navigation_capability]["sendLocationEnabled"] = true; (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::navigation_capability]["getWayPointsEnabled"] = true; + [strings::navigation_capability]["getWayPointsEnabled"] = true; ResponseFromHMIPtr command( CreateCommand(command_msg)); @@ -234,13 +234,14 @@ TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) { .WillOnce(ReturnRef(mock_hmi_capabilities_)); smart_objects::SmartObject navigation_capability_so = - (*command_msg)[strings::msg_params][strings::system_capabilities][strings::navigation_capability]; + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::navigation_capability]; EXPECT_CALL(mock_hmi_capabilities_, set_navigation_capability(navigation_capability_so)); command->Run(); -} +} TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) { MessageSharedPtr command_msg = CreateCommandMsg(); @@ -248,7 +249,7 @@ TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) { smart_objects::SmartObject(smart_objects::SmartType_Map); (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::phone_capability]["dialNumberEnabled"] = true; + [strings::phone_capability]["dialNumberEnabled"] = true; ResponseFromHMIPtr command( CreateCommand(command_msg)); @@ -257,13 +258,14 @@ TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) { .WillOnce(ReturnRef(mock_hmi_capabilities_)); smart_objects::SmartObject phone_capability_so = - (*command_msg)[strings::msg_params][strings::system_capabilities][strings::phone_capability]; + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::phone_capability]; EXPECT_CALL(mock_hmi_capabilities_, set_phone_capability(phone_capability_so)); command->Run(); -} +} } // namespace ui_get_capabilities_response } // namespace hmi_commands_test diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index a9c5e147b2..07b5bda4b4 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -357,7 +357,7 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { EXPECT_EQ("2013", vehicle_type_so["modelYear"].asString()); EXPECT_EQ("SE", vehicle_type_so["trim"].asString()); - //Check system capabilities + // Check system capabilities smart_objects::SmartObject navigation_capability_so = *(hmi_capabilities_test->navigation_capability()); @@ -368,11 +368,9 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { const smart_objects::SmartObject phone_capability_so = *(hmi_capabilities_test->phone_capability()); - + EXPECT_TRUE(phone_capability_so.keyExists("dialNumberEnabled")); EXPECT_TRUE(phone_capability_so["dialNumberEnabled"].asBool()); - - } TEST_F(HMICapabilitiesTest, VerifyImageType) { diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h index 020e56c292..a59235e4fc 100644 --- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h +++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h @@ -154,12 +154,14 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities { MOCK_CONST_METHOD0(phone_call_supported, bool()); MOCK_METHOD1(set_phone_call_supported, void(const bool supported)); - MOCK_CONST_METHOD0(navigation_capability, const smart_objects::SmartObject*()); - MOCK_METHOD1(set_navigation_capability, void(const smart_objects::SmartObject& navigation_capability)); + MOCK_CONST_METHOD0(navigation_capability, + const smart_objects::SmartObject*()); + MOCK_METHOD1(set_navigation_capability, + void(const smart_objects::SmartObject& navigation_capability)); MOCK_CONST_METHOD0(phone_capability, const smart_objects::SmartObject*()); - MOCK_METHOD1(set_phone_capability, void(const smart_objects::SmartObject& phone_capability)); - + MOCK_METHOD1(set_phone_capability, + void(const smart_objects::SmartObject& phone_capability)); MOCK_METHOD1(Init, void(resumption::LastState* last_state)); diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h index 451c2ca806..f7107ebeed 100644 --- a/src/components/include/application_manager/hmi_capabilities.h +++ b/src/components/include/application_manager/hmi_capabilities.h @@ -409,12 +409,38 @@ class HMICapabilities { */ virtual bool phone_call_supported() const = 0; - virtual void set_navigation_capability(const smart_objects::SmartObject& navigation_capability) = 0; + /* + * @brief Interface used to store information regarding + * the navigation "System Capability" + * + * @param navigation_capability contains information related + * to the navigation system capability. + */ + virtual void set_navigation_capability( + const smart_objects::SmartObject& navigation_capability) = 0; + /* + * @brief Retrieves information regarding the navigation system capability + * + * @return NAVIGATION system capability + */ virtual const smart_objects::SmartObject* navigation_capability() const = 0; - virtual void set_phone_capability(const smart_objects::SmartObject& phone_capability) = 0; + /* + * @brief Interface used to store information regarding + * the phone "System Capability" + * + * @param phone_capability contains information related + * to the phone system capability. + */ + virtual void set_phone_capability( + const smart_objects::SmartObject& phone_capability) = 0; + /* + * @brief Retrieves information regarding the phone call system capability + * + * @return PHONE_CALL system capability + */ virtual const smart_objects::SmartObject* phone_capability() const = 0; virtual void Init(resumption::LastState* last_state) = 0; diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index cac520d349..e94cbf3183 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -5061,8 +5061,8 @@ - The capability does not exist on the module - The capability should exist on the module but there was an error retrieving the data. + The capability does not exist on the module + The capability should exist on the module but there was an error retrieving the data. -- cgit v1.2.1 From 4cf0d1f96fabc5e6bcd41f5989e14d846eb1c8f1 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 31 Jul 2017 13:04:00 -0400 Subject: Put description after element --- src/components/interfaces/MOBILE_API.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index e94cbf3183..cac520d349 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -5061,8 +5061,8 @@ - The capability does not exist on the module - The capability should exist on the module but there was an error retrieving the data. + The capability does not exist on the module + The capability should exist on the module but there was an error retrieving the data. -- cgit v1.2.1 From a7667168d89742331aa4f72df43dda40d926d5c9 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 31 Jul 2017 14:39:00 -0400 Subject: Changes based on comments, added any missing method descriptions --- .../application_manager/application_manager_impl.h | 4 ++-- .../include/application_manager/message.h | 3 +++ .../src/commands/hmi/sdl_activate_app_request.cc | 4 ++-- .../on_hmi_status_notification_from_mobile.cc | 13 ++++++------ src/components/application_manager/src/message.cc | 5 +++++ .../src/mobile_message_handler.cc | 4 ++-- .../include/config_profile/profile.h | 14 ++++++++++++- src/components/config_profile/src/profile.cc | 2 +- .../protocol_handler/protocol_handler_impl.h | 23 ++++++++++++++++++++++ .../include/protocol_handler/protocol_packet.h | 5 +++++ .../protocol_handler/src/protocol_handler_impl.cc | 20 +++++++++++++------ 11 files changed, 77 insertions(+), 20 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index e6148a3c1d..0c8a30b47a 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1082,8 +1082,8 @@ class ApplicationManagerImpl bool operator()(const ApplicationSharedPtr app) const { return app ? handle_ == app->device() && - ProtocolVersion::kV4 <= app->protocol_version() && - ProtocolVersion::kV5 >= app->protocol_version() + Message::is_sufficient_version(ProtocolVersion::kV4, + app->protocol_version()) : false; } }; diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index 53b2271de8..4678e88106 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -102,6 +102,9 @@ class Message { void set_data_size(size_t data_size); void set_payload_size(size_t payload_size); + static bool is_sufficient_version(ProtocolVersion minVersion, + ProtocolVersion version); + protocol_handler::MessagePriority Priority() const { return priority_; } diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc index 1abe38c5fe..a75eba3ed8 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc @@ -46,8 +46,8 @@ struct ProtoV4AppsOnDevice : std::unary_function { bool operator()(const ApplicationSharedPtr app) const { return app ? handle_ == app->device() && - ProtocolVersion::kV4 <= app->protocol_version() && - ProtocolVersion::kV5 >= app->protocol_version() + Message::is_sufficient_version(ProtocolVersion::kV4, + app->protocol_version()) : false; } }; diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc index 58fd571d08..4952f01bb2 100644 --- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc +++ b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc @@ -75,8 +75,9 @@ void OnHMIStatusNotificationFromMobile::Run() { << connection_key() << " and handle: " << handle); if (!is_apps_requested_before && - ProtocolVersion::kV4 <= app->protocol_version() && - ProtocolVersion::kV5 >= app->protocol_version() && app->is_foreground()) { + Message::is_sufficient_version(ProtocolVersion::kV4, + app->protocol_version()) && + app->is_foreground()) { // In case this notification will be received from mobile side with // foreground level for app on mobile, this should trigger remote // apps list query for SDL 4.0+ app @@ -90,8 +91,8 @@ void OnHMIStatusNotificationFromMobile::Run() { " for handle: " << handle); - if (ProtocolVersion::kV4 <= app->protocol_version() && - ProtocolVersion::kV5 >= app->protocol_version()) { + if (Message::is_sufficient_version(ProtocolVersion::kV4, + app->protocol_version())) { const ApplicationSet& accessor = application_manager_.applications().GetData(); @@ -99,8 +100,8 @@ void OnHMIStatusNotificationFromMobile::Run() { ApplicationSetConstIt it = accessor.begin(); for (; accessor.end() != it; ++it) { if (connection_key() != (*it)->app_id() && - ProtocolVersion::kV4 <= (*it)->protocol_version() && - ProtocolVersion::kV5 >= (*it)->protocol_version() && + Message::is_sufficient_version(ProtocolVersion::kV4, + (*it)->protocol_version()) && (*it)->is_foreground()) { is_another_foreground_sdl4_app = true; break; diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc index 2206cf479f..48333d4e6f 100644 --- a/src/components/application_manager/src/message.cc +++ b/src/components/application_manager/src/message.cc @@ -205,4 +205,9 @@ void Message::set_data_size(size_t data_size) { void Message::set_payload_size(size_t payload_size) { payload_size_ = payload_size; } + +bool Message::is_sufficient_version(ProtocolVersion minVersion, + ProtocolVersion version) { + return version >= minVersion && version <= ProtocolVersion::kV5; +} } // namespace application_manager diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc index 5dddf42825..e82873ce83 100644 --- a/src/components/application_manager/src/mobile_message_handler.cc +++ b/src/components/application_manager/src/mobile_message_handler.cc @@ -124,8 +124,8 @@ MobileMessageHandler::HandleOutgoingMessageProtocol( if (message->protocol_version() == application_manager::kV1) { return MobileMessageHandler::HandleOutgoingMessageProtocolV1(message); } - if ((message->protocol_version() >= application_manager::kV2) && - (message->protocol_version() <= application_manager::kV5)) { + if (Message::is_sufficient_version(ProtocolVersion::kV4, + message->protocol_version())) { return MobileMessageHandler::HandleOutgoingMessageProtocolV2(message); } return NULL; diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index b9b162bcb1..5c4618903f 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -130,16 +130,28 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, const uint32_t& app_icons_amount_to_remove() const OVERRIDE; /** - * @brief Returns true, if SDL protocol v5 is enabled + * @brief Returns true if SDL protocol v5 is enabled */ bool enable_protocol_5() const OVERRIDE; + /** + * @brief Returns the maximum payload size for control services + */ size_t maximum_control_payload_size() const OVERRIDE; + /** + * @brief Returns the maximum payload size for RPC services + */ size_t maximum_rpc_payload_size() const OVERRIDE; + /** + * @brief Returns the maximum payload size for audio services + */ size_t maximum_audio_payload_size() const OVERRIDE; + /** + * @brief Returns the maximum payload size for video services + */ size_t maximum_video_payload_size() const OVERRIDE; /** diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index a75eef1fc1..9ea2672448 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -1088,7 +1088,7 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE( app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey, kSDL4Section); - // Enable protocol ver.4 parameter + // Enable protocol ver.5 parameter std::string enable_protocol_5_value; if (ReadValue(&enable_protocol_5_value, kSDL5Section, kEnableProtocol5Key) && 0 == strcmp("true", enable_protocol_5_value.c_str())) { diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index 562540ff3f..bb6483dd82 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -250,6 +250,21 @@ class ProtocolHandlerImpl uint8_t service_type, bool protection); + /** + * \brief Sends acknowledgement of starting session to mobile application + * with session number and hash code for second version of protocol + * was started + * \param connection_id Identifier of connection within which session + * \param session_id ID of session to be sent to mobile application + * \param protocol_version Version of protocol used for communication + * \param hash_code For second version of protocol: identifier of session + * to be sent to + * mobile app for using when ending session + * \param service_type Type of session: RPC or BULK Data. RPC by default + * \param protection Protection flag + * \param full_version full protocol version (major.minor.patch) used by the + * mobile proxy + */ void SendStartSessionAck(ConnectionID connection_id, uint8_t session_id, uint8_t protocol_version, @@ -274,6 +289,14 @@ class ProtocolHandlerImpl uint8_t protocol_version, uint8_t service_type); + /** + * \brief Sends fail of starting session to mobile application + * \param connection_id Identifier of connection within which session + * \param session_id ID of session to be sent to mobile application + * \param protocol_version Version of protocol used for communication + * \param service_type Type of session: RPC or BULK Data. RPC by default + * \param rejected_params List of rejected params to send in payload + */ void SendStartSessionNAck(ConnectionID connection_id, uint8_t session_id, uint8_t protocol_version, diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h index eae4a74025..31b4c12ea6 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h @@ -63,6 +63,11 @@ class ProtocolPacket { uint32_t totalDataBytes; }; + /** + * \class ProtocolVersion + * \brief Used for storing the full protocol version of a service + * (major.minor.patch). + */ class ProtocolVersion { public: ProtocolVersion(); diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index fce8cbfcea..8bdd6f1fb1 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -317,7 +317,9 @@ void ProtocolHandlerImpl::SendStartSessionNAck( 0u, message_counters_[session_id]++)); - if (rejectedParams.size() > 0) { + uint8_t maxProtocolVersion = SupportedSDLProtocolVersion(); + + if (maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) { BsonObject payloadObj; bson_object_initialize_default(&payloadObj); BsonArray rejectedParamsArr; @@ -389,7 +391,10 @@ void ProtocolHandlerImpl::SendEndSessionNAck( session_id, 0u, message_counters_[session_id]++)); - if (rejectedParams.size() > 0) { + + uint8_t maxProtocolVersion = SupportedSDLProtocolVersion(); + + if (maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) { BsonObject payloadObj; bson_object_initialize_default(&payloadObj); BsonArray rejectedParamsArr; @@ -1104,9 +1109,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession( LOG4CXX_AUTO_TRACE(logger_); const uint8_t current_session_id = packet.session_id(); - uint32_t hash_id; - - hash_id = get_hash_id(packet); + uint32_t hash_id = get_hash_id(packet); const ServiceType service_type = ServiceTypeFromByte(packet.service_type()); const ConnectionID connection_id = packet.connection_id(); @@ -1328,11 +1331,15 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( } ProtocolPacket::ProtocolVersion* fullVersion; std::vector rejectedParams(0, std::string("")); + // Can't check protocol_version because the first packet is v1, but there + // could still + // be a payload, in which case we can get the real protocol version if (packet.data_size() != 0) { BsonObject obj = bson_object_from_bytes(packet.data()); fullVersion = new ProtocolPacket::ProtocolVersion( std::string(bson_object_get_string(&obj, "protocolVersion"))); bson_object_deinitialize(&obj); + // Constructed payloads added in Protocol v5 if (fullVersion->majorVersion < PROTOCOL_VERSION_5) { rejectedParams.push_back(std::string("protocolVersion")); } @@ -1427,7 +1434,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat( if (session_observer_.ProtocolVersionUsed( connection_id, packet.session_id(), protocol_version)) { // TODO(EZamakhov): investigate message_id for HeartBeatAck - if (protocol_version >= PROTOCOL_VERSION_3) { + if (protocol_version >= PROTOCOL_VERSION_3 && + protocol_version <= PROTOCOL_VERSION_5) { return SendHeartBeatAck( connection_id, packet.session_id(), packet.message_id()); } else { -- cgit v1.2.1 From ecf6fb53ff4f9283ef07c57718bd97767d3517e2 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 31 Jul 2017 15:46:37 -0400 Subject: Hash ID is only set for RPC service StartSessionACK, extra checks for when to include constructed payloads --- .../protocol_handler/src/protocol_handler_impl.cc | 72 +++++++--------------- 1 file changed, 23 insertions(+), 49 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 8bdd6f1fb1..582e6139bc 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -233,7 +233,6 @@ void ProtocolHandlerImpl::SendStartSessionAck( BsonObject payloadObj; bson_object_initialize_default(&payloadObj); - bson_object_put_int32(&payloadObj, "hashId", static_cast(hash_id)); bson_object_put_int64( &payloadObj, "mtu", @@ -241,6 +240,9 @@ void ProtocolHandlerImpl::SendStartSessionAck( protocol_header_validator_.max_payload_size_by_service_type( serviceTypeValue))); if (serviceTypeValue == kRpc) { + // Hash ID is only used in RPC case + bson_object_put_int32( + &payloadObj, "hashId", static_cast(hash_id)); // Minimum protocol version supported by both ProtocolPacket::ProtocolVersion* minVersion = (full_version.majorVersion < PROTOCOL_VERSION_5) @@ -275,27 +277,12 @@ void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id, uint8_t session_id, uint8_t protocol_version, uint8_t service_type) { - LOG4CXX_AUTO_TRACE(logger_); - - ProtocolFramePtr ptr( - new protocol_handler::ProtocolPacket(connection_id, - protocol_version, - PROTECTION_OFF, - FRAME_TYPE_CONTROL, - service_type, - FRAME_DATA_START_SERVICE_NACK, - session_id, - 0u, - message_counters_[session_id]++)); - - raw_ford_messages_to_mobile_.PostMessage( - impl::RawFordMessageToMobile(ptr, false)); - - LOG4CXX_DEBUG(logger_, - "SendStartSessionNAck() for connection " - << connection_id << " for service_type " - << static_cast(service_type) << " session_id " - << static_cast(session_id)); + std::vector rejectedParams(0, std::string("")); + SendStartSessionNAck(connection_id, + session_id, + protocol_version, + service_type, + rejectedParams); } void ProtocolHandlerImpl::SendStartSessionNAck( @@ -319,7 +306,8 @@ void ProtocolHandlerImpl::SendStartSessionNAck( uint8_t maxProtocolVersion = SupportedSDLProtocolVersion(); - if (maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) { + if (protocol_version >= PROTOCOL_VERSION_5 && + maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) { BsonObject payloadObj; bson_object_initialize_default(&payloadObj); BsonArray rejectedParamsArr; @@ -350,27 +338,12 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id, uint32_t session_id, uint8_t protocol_version, uint8_t service_type) { - LOG4CXX_AUTO_TRACE(logger_); - - ProtocolFramePtr ptr( - new protocol_handler::ProtocolPacket(connection_id, - protocol_version, - PROTECTION_OFF, - FRAME_TYPE_CONTROL, - service_type, - FRAME_DATA_END_SERVICE_NACK, - session_id, - 0u, - message_counters_[session_id]++)); - - raw_ford_messages_to_mobile_.PostMessage( - impl::RawFordMessageToMobile(ptr, false)); - - LOG4CXX_DEBUG(logger_, - "SendEndSessionNAck() for connection " - << connection_id << " for service_type " - << static_cast(service_type) << " session_id " - << static_cast(session_id)); + std::vector rejectedParams(0, std::string("")); + SendStartSessionNAck(connection_id, + session_id, + protocol_version, + service_type, + rejectedParams); } void ProtocolHandlerImpl::SendEndSessionNAck( @@ -394,7 +367,8 @@ void ProtocolHandlerImpl::SendEndSessionNAck( uint8_t maxProtocolVersion = SupportedSDLProtocolVersion(); - if (maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) { + if (protocol_version >= PROTOCOL_VERSION_5 && + maxProtocolVersion >= PROTOCOL_VERSION_5 && rejectedParams.size() > 0) { BsonObject payloadObj; bson_object_initialize_default(&payloadObj); BsonArray rejectedParamsArr; @@ -1332,9 +1306,9 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( ProtocolPacket::ProtocolVersion* fullVersion; std::vector rejectedParams(0, std::string("")); // Can't check protocol_version because the first packet is v1, but there - // could still - // be a payload, in which case we can get the real protocol version - if (packet.data_size() != 0) { + // could still be a payload, in which case we can get the real protocol + // version + if (packet.service_type() == kRpc && packet.data_size() != 0) { BsonObject obj = bson_object_from_bytes(packet.data()); fullVersion = new ProtocolPacket::ProtocolVersion( std::string(bson_object_get_string(&obj, "protocolVersion"))); @@ -1387,7 +1361,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( return RESULT_OK; } #endif // ENABLE_SECURITY - if (packet.data_size() != 0) { + if (packet.service_type() == kRpc && packet.data_size() != 0) { BsonObject obj = bson_object_from_bytes(packet.data()); ProtocolPacket::ProtocolVersion fullVersion( bson_object_get_string(&obj, "protocolVersion")); -- cgit v1.2.1 From 99392eb1b1e865310a11aadd297d1ffb95c4d91a Mon Sep 17 00:00:00 2001 From: JackLivio Date: Mon, 31 Jul 2017 16:09:30 -0400 Subject: Command.reset fix --- src/components/application_manager/src/mobile_command_factory.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc index a5d2b29476..d5db849d96 100644 --- a/src/components/application_manager/src/mobile_command_factory.cc +++ b/src/components/application_manager/src/mobile_command_factory.cc @@ -455,11 +455,11 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( case mobile_apis::FunctionID::GetSystemCapabilityID: { if ((*message)[strings::params][strings::message_type] == static_cast(application_manager::MessageType::kResponse)) { - command = utils::MakeShared( - message, application_manager); + command.reset(new commands::GetSystemCapabilityResponse( + message, application_manager)); } else { - command = utils::MakeShared( - message, application_manager); + command.reset(new commands::GetSystemCapabilityRequest( + message, application_manager)); } break; } -- cgit v1.2.1 From 109c7aa452739b3d1d7bbc02eb78dca38b489a7d Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 31 Jul 2017 17:09:44 -0400 Subject: Add missing link in command tests --- src/components/application_manager/test/commands/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt index e22d1434a7..82d357a02b 100644 --- a/src/components/application_manager/test/commands/CMakeLists.txt +++ b/src/components/application_manager/test/commands/CMakeLists.txt @@ -46,6 +46,7 @@ set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands) file(GLOB SOURCES ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc ${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc + ${COMPONENTS_DIR}/application_manager/src/message.cc ${COMMANDS_TEST_DIR}/hmi/* ${COMMANDS_TEST_DIR}/hmi/hmi_notifications/* ${COMMANDS_TEST_DIR}/mobile/* -- cgit v1.2.1 From 9dfc97c96d0f896689b8ea0419f159226db80d3f Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 31 Jul 2017 19:14:22 -0400 Subject: Fix incorrect check in mobile message handler --- src/components/application_manager/src/mobile_message_handler.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc index e82873ce83..88f78ec596 100644 --- a/src/components/application_manager/src/mobile_message_handler.cc +++ b/src/components/application_manager/src/mobile_message_handler.cc @@ -124,7 +124,7 @@ MobileMessageHandler::HandleOutgoingMessageProtocol( if (message->protocol_version() == application_manager::kV1) { return MobileMessageHandler::HandleOutgoingMessageProtocolV1(message); } - if (Message::is_sufficient_version(ProtocolVersion::kV4, + if (Message::is_sufficient_version(ProtocolVersion::kV2, message->protocol_version())) { return MobileMessageHandler::HandleOutgoingMessageProtocolV2(message); } -- cgit v1.2.1 From d34cd01153d579e5b4eb1bd6e2f35a8298a975b9 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 31 Jul 2017 20:19:35 -0400 Subject: Fix copy-paste error --- src/components/protocol_handler/src/protocol_handler_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 582e6139bc..9ef715d1c5 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -339,7 +339,7 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id, uint8_t protocol_version, uint8_t service_type) { std::vector rejectedParams(0, std::string("")); - SendStartSessionNAck(connection_id, + SendEndSessionNAck(connection_id, session_id, protocol_version, service_type, -- cgit v1.2.1 From e5a2ee5567f899797e165009630f3449197e4d57 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 1 Aug 2017 15:15:23 -0400 Subject: Reivew changes --- .../include/application_manager/application.h | 4 +-- .../include/application_manager/application_impl.h | 4 +-- .../application_manager/application_manager_impl.h | 6 ++-- .../application_manager/src/application_impl.cc | 6 ++-- .../src/application_manager_impl.cc | 35 ++++++++++++---------- .../commands/mobile/on_touch_event_notification.cc | 18 ++++++----- .../mobile/register_app_interface_request.cc | 2 +- .../application_manager/src/hmi_state.cc | 2 +- .../src/state_controller_impl.cc | 8 ++--- .../test/application_impl_test.cc | 23 +++++++------- .../include/application_manager/mock_application.h | 4 +-- .../application_manager/application_manager.h | 6 ++-- .../include/policy/policy_table/enums.h | 3 +- .../policy_external/src/policy_table/enums.cc | 7 +++++ .../include/policy/policy_table/enums.h | 1 + .../policy_regular/src/policy_table/enums.cc | 7 +++++ 16 files changed, 81 insertions(+), 55 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index a0abfb79d4..63d9580758 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -427,8 +427,8 @@ class Application : public virtual InitialApplicationData, virtual bool is_navi() const = 0; virtual void set_is_navi(bool allow) = 0; - virtual void SetMobileProjectionEnabled(bool option) = 0; - virtual bool MobileProjectionEnabled() const = 0; + virtual void set_mobile_projection_enabled(bool option) = 0; + virtual bool mobile_projection_enabled() const = 0; virtual bool video_streaming_approved() const = 0; virtual void set_video_streaming_approved(bool state) = 0; diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 2d2994fe7d..695d7ef9d5 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -96,9 +96,9 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, } void set_is_navi(bool allow); - void SetMobileProjectionEnabled(bool option); + void set_mobile_projection_enabled(bool option); - bool MobileProjectionEnabled() const; + bool mobile_projection_enabled() const; bool video_streaming_approved() const; void set_video_streaming_approved(bool state); diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 596b9303f3..fcd9928280 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -243,12 +243,14 @@ class ApplicationManagerImpl std::vector applications_by_button( uint32_t button) OVERRIDE; std::vector applications_with_navi() OVERRIDE; - std::vector applications_with_mobile_projection() OVERRIDE; + std::vector applications_with_mobile_projection() + OVERRIDE; ApplicationSharedPtr get_limited_media_application() const OVERRIDE; ApplicationSharedPtr get_limited_navi_application() const OVERRIDE; ApplicationSharedPtr get_limited_voice_application() const OVERRIDE; - ApplicationSharedPtr get_limited_mobile_projection_application() const OVERRIDE; + ApplicationSharedPtr get_limited_mobile_projection_application() + const OVERRIDE; uint32_t application_id(const int32_t correlation_id) OVERRIDE; void set_application_id(const int32_t correlation_id, diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 7c5f7ed6fa..21039e1865 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -235,12 +235,12 @@ void ApplicationImpl::SetPostponedState(HmiStatePtr state) { state_.AddState(state); } -void ApplicationImpl::SetMobileProjectionEnabled(bool option) { +void ApplicationImpl::set_mobile_projection_enabled(bool option) { LOG4CXX_AUTO_TRACE(logger_); mobile_projection_enabled_ = option; } -bool ApplicationImpl::MobileProjectionEnabled() const { +bool ApplicationImpl::mobile_projection_enabled() const { return mobile_projection_enabled_; } @@ -505,7 +505,7 @@ void ApplicationImpl::WakeUpStreaming( protocol_handler::ServiceType service_type) { using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); - + if (ServiceType::kMobileNav == service_type) { sync_primitives::AutoLock lock(video_streaming_suspended_lock_); if (video_streaming_suspended_) { diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index c09ddffbb5..d8cf70da91 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -292,19 +292,20 @@ ApplicationManagerImpl::applications_with_navi() { return FindAllApps(accessor, NaviAppPredicate); } -bool LimitedMobileProjectionPredicate( const ApplicationSharedPtr app) { - return app ? (app->MobileProjectionEnabled() && - app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) : false; +bool LimitedMobileProjectionPredicate(const ApplicationSharedPtr app) { + return app ? (app->mobile_projection_enabled() && + app->hmi_level() == mobile_api::HMILevel::HMI_LIMITED) + : false; } -ApplicationSharedPtr ApplicationManagerImpl::get_limited_mobile_projection_application() - const { +ApplicationSharedPtr +ApplicationManagerImpl::get_limited_mobile_projection_application() const { DataAccessor accessor = applications(); return FindApp(accessor, LimitedMobileProjectionPredicate); } bool MobileProjectionPredicate(const ApplicationSharedPtr app) { - return app ? app->MobileProjectionEnabled() : false; + return app ? app->mobile_projection_enabled() : false; } std::vector @@ -375,7 +376,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( bool voice_state = app->is_voice_communication_supported(); bool media_state = app->is_media_application(); bool navi_state = app->is_navi(); - bool mobile_projection_state = app->MobileProjectionEnabled(); + bool mobile_projection_state = app->mobile_projection_enabled(); ApplicationSharedPtr active_app = active_application(); // Check app in FULL level if (active_app.valid()) { @@ -398,7 +399,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( return true; } - if (mobile_projection_state && active_app->MobileProjectionEnabled()) { + if (mobile_projection_state && active_app->mobile_projection_enabled()) { return true; } } @@ -427,8 +428,10 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( if (mobile_projection_state) { if (get_limited_mobile_projection_application().valid() && - (get_limited_mobile_projection_application()->app_id() != app->app_id())) + (get_limited_mobile_projection_application()->app_id() != + app->app_id())) { return true; + } } return false; @@ -1213,7 +1216,7 @@ bool ApplicationManagerImpl::OnServiceStartedCallback( if (Compare( type, ServiceType::kMobileNav, ServiceType::kAudio)) { - if (app->is_navi() || app->MobileProjectionEnabled()) { + if (app->is_navi() || app->mobile_projection_enabled()) { return StartNaviService(session_key, type); } else { LOG4CXX_WARN(logger_, "Refuse not navi application"); @@ -2933,7 +2936,7 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { + if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id); return; } @@ -2967,7 +2970,7 @@ void ApplicationManagerImpl::OnAppStreaming( LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { + if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { LOG4CXX_DEBUG(logger_, " There is no navi application with id: " << app_id); return; } @@ -2987,7 +2990,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { + if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id); return; } @@ -3038,7 +3041,7 @@ void ApplicationManagerImpl::OnHMILevelChanged( } ApplicationSharedPtr app = application(app_id); - if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { + if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { LOG4CXX_ERROR(logger_, "Navi application not found"); return; } @@ -3161,7 +3164,7 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { + if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { LOG4CXX_ERROR(logger_, "Navi application not found"); return; } @@ -3182,7 +3185,7 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application(app_id); - if (!app || (!app->is_navi() && !app->MobileProjectionEnabled())) { + if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { LOG4CXX_ERROR(logger_, "Navi application not found"); return; } diff --git a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc index 63d513bcaf..2a9969eac4 100644 --- a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc @@ -50,15 +50,16 @@ OnTouchEventNotification::~OnTouchEventNotification() {} void OnTouchEventNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - const std::vector& applications = + const std::vector& applications_with_navi = application_manager_.applications_with_navi(); const std::vector& projection_applications = - application_manager_.applications_with_mobile_projection(); + application_manager_.applications_with_mobile_projection(); - std::vector::const_iterator nav_it = applications.begin(); - - for (; applications.end() != nav_it; ++nav_it) { + std::vector::const_iterator nav_it = + applications_with_navi.begin(); + + for (; applications_with_navi.end() != nav_it; ++nav_it) { ApplicationSharedPtr app = *nav_it; if (app->IsFullscreen()) { (*message_)[strings::params][strings::connection_key] = app->app_id(); @@ -66,13 +67,14 @@ void OnTouchEventNotification::Run() { } } - std::vector::const_iterator projection_it = - projection_applications.begin(); + std::vector::const_iterator projection_it = + projection_applications.begin(); for (; projection_applications.end() != projection_it; ++projection_it) { ApplicationSharedPtr projection_app = *projection_it; if (projection_app->IsFullscreen()) { - (*message_)[strings::params][strings::connection_key] = projection_app->app_id(); + (*message_)[strings::params][strings::connection_key] = + projection_app->app_id(); SendNotification(); } } diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 3be16ec78d..52153647a7 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -325,7 +325,7 @@ void RegisterAppInterfaceRequest::Run() { if (mobile_apis::AppHMIType::PROJECTION == static_cast( app_type.getElement(i).asUInt())) { - application->SetMobileProjectionEnabled(true); + application->set_mobile_projection_enabled(true); } } } diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc index aad927cc6a..393a9d7784 100644 --- a/src/components/application_manager/src/hmi_state.cc +++ b/src/components/application_manager/src/hmi_state.cc @@ -77,7 +77,7 @@ bool HmiState::is_voice_communication_app(const uint32_t app_id) const { bool HmiState::is_mobile_projection_app(const uint32_t app_id) const { const ApplicationSharedPtr app = app_mngr_.application(app_id); - return app ? app->MobileProjectionEnabled() : false; + return app ? app->mobile_projection_enabled() : false; } mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state() diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index c9a80e8089..9d0abc339d 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -363,7 +363,7 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app, } if (IsTempStateActive(HmiState::StateID::STATE_ID_EMBEDDED_NAVI) && - (app->is_navi() || app->MobileProjectionEnabled())) { + (app->is_navi() || app->mobile_projection_enabled())) { LOG4CXX_DEBUG(logger_, "Resumption for navi app is not allowed. " << "EMBEDDED_NAVI event is active"); @@ -560,13 +560,13 @@ bool StateControllerImpl::IsSameAppType(ApplicationConstSharedPtr app1, const bool both_navi = app1->is_navi() && app2->is_navi(); const bool both_vc = app1->is_voice_communication_supported() && - app2->is_voice_communication_supported(); + app2->is_voice_communication_supported(); const bool both_simple = !app1->IsAudioApplication() && !app2->IsAudioApplication(); - const bool both_projection = app1->MobileProjectionEnabled() && - app2->MobileProjectionEnabled(); + const bool both_projection = + app1->mobile_projection_enabled() && app2->mobile_projection_enabled(); return both_simple || both_media || both_navi || both_vc || both_projection; } diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index 6e98965e5c..8f00284772 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -569,14 +569,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeNotNaviNotVoice) { EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); app_impl->set_app_types(type_media); app_impl->ChangeSupportingAppHMIType(); EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); } TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) { @@ -585,14 +585,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsVoice) { EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); app_impl->set_app_types(type_comm); app_impl->ChangeSupportingAppHMIType(); EXPECT_FALSE(app_impl->is_navi()); EXPECT_TRUE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); } TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) { @@ -601,14 +601,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNavi) { EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); app_impl->set_app_types(type_navi); app_impl->ChangeSupportingAppHMIType(); EXPECT_TRUE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); } TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) { @@ -619,17 +619,18 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoice) { EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); app_impl->set_app_types(app_types); app_impl->ChangeSupportingAppHMIType(); EXPECT_TRUE(app_impl->is_navi()); EXPECT_TRUE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); } -TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoiceAndProjection) { +TEST_F(ApplicationImplTest, + ChangeSupportingAppHMIType_TypeIsNaviAndVoiceAndProjection) { smart_objects::SmartObject app_types; app_types[0] = AppHMIType::NAVIGATION; app_types[1] = AppHMIType::COMMUNICATION; @@ -638,14 +639,14 @@ TEST_F(ApplicationImplTest, ChangeSupportingAppHMIType_TypeIsNaviAndVoiceAndProj EXPECT_FALSE(app_impl->is_navi()); EXPECT_FALSE(app_impl->is_voice_communication_supported()); - EXPECT_FALSE(app_impl->MobileProjectionEnabled()); + EXPECT_FALSE(app_impl->mobile_projection_enabled()); app_impl->set_app_types(app_types); app_impl->ChangeSupportingAppHMIType(); EXPECT_TRUE(app_impl->is_navi()); EXPECT_TRUE(app_impl->is_voice_communication_supported()); - EXPECT_TRUE(app_impl->MobileProjectionEnabled()); + EXPECT_TRUE(app_impl->mobile_projection_enabled()); } TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) { diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index b56175d44b..3276e1f8f5 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -59,8 +59,8 @@ class MockApplication : public ::application_manager::Application { MOCK_METHOD0(ChangeSupportingAppHMIType, void()); MOCK_CONST_METHOD0(is_navi, bool()); MOCK_METHOD1(set_is_navi, void(bool allow)); - MOCK_CONST_METHOD0(MobileProjectionEnabled, bool()); - MOCK_METHOD1(SetMobileProjectionEnabled, void(bool allow)); + MOCK_CONST_METHOD0(mobile_projection_enabled, bool()); + MOCK_METHOD1(set_mobile_projection_enabled, void(bool allow)); MOCK_CONST_METHOD0(video_streaming_approved, bool()); MOCK_METHOD1(set_video_streaming_approved, void(bool state)); MOCK_CONST_METHOD0(audio_streaming_approved, bool()); diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index 7b4f55b17f..98bb341657 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -157,7 +157,8 @@ class ApplicationManager { uint32_t button) = 0; virtual std::vector applications_with_navi() = 0; - virtual std::vector applications_with_mobile_projection() = 0; + virtual std::vector + applications_with_mobile_projection() = 0; /** * @brief Returns media application with LIMITED HMI Level if exists * @@ -183,7 +184,8 @@ class ApplicationManager { */ virtual ApplicationSharedPtr get_limited_voice_application() const = 0; - virtual ApplicationSharedPtr get_limited_mobile_projection_application() const = 0; + virtual ApplicationSharedPtr get_limited_mobile_projection_application() + const = 0; /** * @brief Retrieves application id associated with correlation id diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h index 45fad03dae..4b0a7d74bc 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h @@ -119,7 +119,8 @@ enum AppHMIType { AHT_SOCIAL, AHT_BACKGROUND_PROCESS, AHT_TESTING, - AHT_SYSTEM + AHT_SYSTEM, + AHT_PROJECTION }; bool IsValidEnum(AppHMIType val); const char* EnumToJsonString(AppHMIType val); diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc index e70167c94b..45db2cb469 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -438,6 +438,8 @@ bool IsValidEnum(AppHMIType val) { return true; case AHT_SYSTEM: return true; + case AHT_PROJECTION: + return true; default: return false; } @@ -464,6 +466,8 @@ const char* EnumToJsonString(AppHMIType val) { return "TESTING"; case AHT_SYSTEM: return "SYSTEM"; + case AHT_PROJECTION: + return "PROJECTION"; default: return ""; } @@ -499,6 +503,9 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) { } else if ("SYSTEM" == literal) { *result = AHT_SYSTEM; return true; + } else if ("PROJECTION" == literal) { + *result = AHT_PROJECTION; + return true; } else { return false; } diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h index 0554e94722..876ca03a27 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h @@ -105,6 +105,7 @@ enum AppHMIType { AHT_TESTING, AHT_SYSTEM, AHT_REMOTE_CONTROL, + AHT_PROJECTION }; bool IsValidEnum(AppHMIType val); const char* EnumToJsonString(AppHMIType val); diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc index 26c7b96b32..6de065148a 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -324,6 +324,8 @@ bool IsValidEnum(AppHMIType val) { return true; case AHT_SYSTEM: return true; + case AHT_PROJECTION: + return true; default: return false; } @@ -350,6 +352,8 @@ const char* EnumToJsonString(AppHMIType val) { return "TESTING"; case AHT_SYSTEM: return "SYSTEM"; + case AHT_PROJECTION: + return "PROJECTION"; default: return ""; } @@ -385,6 +389,9 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) { } else if ("SYSTEM" == literal) { *result = AHT_SYSTEM; return true; + } else if ("PROJECTION" == literal) { + *result = AHT_PROJECTION; + return true; } else { return false; } -- cgit v1.2.1 From 9a603de488006113c3474f401d3f3467d3f42e77 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Tue, 1 Aug 2017 15:55:37 -0400 Subject: Add projection description to logging --- .../src/application_manager_impl.cc | 20 +++++++++++++------- .../application_manager/src/state_controller_impl.cc | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index d8cf70da91..05cb331cf7 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1219,7 +1219,7 @@ bool ApplicationManagerImpl::OnServiceStartedCallback( if (app->is_navi() || app->mobile_projection_enabled()) { return StartNaviService(session_key, type); } else { - LOG4CXX_WARN(logger_, "Refuse not navi application"); + LOG4CXX_WARN(logger_, "Refuse not navi/projection application"); } } else { LOG4CXX_WARN(logger_, "Refuse unknown service"); @@ -2937,7 +2937,9 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) { ApplicationSharedPtr app = application(app_id); if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { - LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id); + LOG4CXX_DEBUG( + logger_, + "There is no navi or projection application with id: " << app_id); return; } @@ -2971,7 +2973,9 @@ void ApplicationManagerImpl::OnAppStreaming( ApplicationSharedPtr app = application(app_id); if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { - LOG4CXX_DEBUG(logger_, " There is no navi application with id: " << app_id); + LOG4CXX_DEBUG( + logger_, + " There is no navi or projection application with id: " << app_id); return; } DCHECK_OR_RETURN_VOID(media_manager_); @@ -2991,7 +2995,9 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) { ApplicationSharedPtr app = application(app_id); if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { - LOG4CXX_DEBUG(logger_, "There is no navi application with id: " << app_id); + LOG4CXX_DEBUG( + logger_, + "There is no navi or projection application with id: " << app_id); return; } @@ -3042,7 +3048,7 @@ void ApplicationManagerImpl::OnHMILevelChanged( ApplicationSharedPtr app = application(app_id); if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { - LOG4CXX_ERROR(logger_, "Navi application not found"); + LOG4CXX_ERROR(logger_, "Navi/Projection application not found"); return; } @@ -3165,7 +3171,7 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) { ApplicationSharedPtr app = application(app_id); if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { - LOG4CXX_ERROR(logger_, "Navi application not found"); + LOG4CXX_ERROR(logger_, "Navi/Projection application not found"); return; } @@ -3186,7 +3192,7 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) { ApplicationSharedPtr app = application(app_id); if (!app || (!app->is_navi() && !app->mobile_projection_enabled())) { - LOG4CXX_ERROR(logger_, "Navi application not found"); + LOG4CXX_ERROR(logger_, "Navi/Projection application not found"); return; } diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index 9d0abc339d..b456ff6abb 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -365,7 +365,7 @@ bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app, if (IsTempStateActive(HmiState::StateID::STATE_ID_EMBEDDED_NAVI) && (app->is_navi() || app->mobile_projection_enabled())) { LOG4CXX_DEBUG(logger_, - "Resumption for navi app is not allowed. " + "Resumption for navi or projection app is not allowed. " << "EMBEDDED_NAVI event is active"); return false; } -- cgit v1.2.1 From dffbeda7e4755677e168c0acf7a83f2dde7fdb26 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 3 Aug 2017 17:37:06 +0900 Subject: fix coding style using check_style.sh --- .../media_manager/src/audio/from_mic_to_file_recorder_thread.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc index 27550ac144..cfb1784788 100644 --- a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc +++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc @@ -150,7 +150,7 @@ void FromMicToFileRecorderThread::threadMain() { {NULL}}; // g_option_context_parse() modifies params, so keep argc_ and argv_ int32_t argc = argc_; - gchar** argv = new gchar*[argc]; + gchar** argv = new gchar* [argc]; for (int32_t i = 0; i < argc; i++) { argv[i] = argv_[i]; } -- cgit v1.2.1 From 77f3cbb68f793e9340b9a3a016c7012d3539009f Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 3 Aug 2017 13:58:15 -0400 Subject: Complete logic for version negotiation Also includes a few minor improvements to the Constructed Payloads changes --- .../protocol_handler/src/protocol_handler_impl.cc | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 9ef715d1c5..e7dd772c42 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -192,16 +192,14 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id, uint8_t service_type, bool protection) { LOG4CXX_AUTO_TRACE(logger_); - ProtocolPacket::ProtocolVersion* fullVersion = - new ProtocolPacket::ProtocolVersion(); + ProtocolPacket::ProtocolVersion fullVersion; SendStartSessionAck(connection_id, session_id, protocol_version, hash_id, service_type, protection, - *fullVersion); - delete fullVersion; + fullVersion); } void ProtocolHandlerImpl::SendStartSessionAck( @@ -227,8 +225,13 @@ void ProtocolHandlerImpl::SendStartSessionAck( 0u, message_counters_[session_id]++)); + const bool proxy_supports_v5_protocol = + protocol_version >= PROTOCOL_VERSION_5 || + (ServiceTypeFromByte(service_type) == kRpc && + full_version.majorVersion >= PROTOCOL_VERSION_5); + // Cannot include a constructed payload if either side doesn't support it - if (maxProtocolVersion >= PROTOCOL_VERSION_5) { + if (proxy_supports_v5_protocol && maxProtocolVersion >= PROTOCOL_VERSION_5) { ServiceType serviceTypeValue = ServiceTypeFromByte(service_type); BsonObject payloadObj; @@ -277,7 +280,7 @@ void ProtocolHandlerImpl::SendStartSessionNAck(ConnectionID connection_id, uint8_t session_id, uint8_t protocol_version, uint8_t service_type) { - std::vector rejectedParams(0, std::string("")); + std::vector rejectedParams; SendStartSessionNAck(connection_id, session_id, protocol_version, @@ -338,12 +341,12 @@ void ProtocolHandlerImpl::SendEndSessionNAck(ConnectionID connection_id, uint32_t session_id, uint8_t protocol_version, uint8_t service_type) { - std::vector rejectedParams(0, std::string("")); + std::vector rejectedParams; SendEndSessionNAck(connection_id, - session_id, - protocol_version, - service_type, - rejectedParams); + session_id, + protocol_version, + service_type, + rejectedParams); } void ProtocolHandlerImpl::SendEndSessionNAck( @@ -1102,7 +1105,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession( "Refused to end session " << static_cast(service_type) << " type."); if (packet.protocol_version() >= PROTOCOL_VERSION_5) { - std::vector rejectedParams(0, std::string("")); + std::vector rejectedParams; if (hash_id == protocol_handler::HASH_ID_WRONG) { rejectedParams.push_back(std::string("hashId")); } @@ -1304,7 +1307,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( return RESULT_OK; } ProtocolPacket::ProtocolVersion* fullVersion; - std::vector rejectedParams(0, std::string("")); + std::vector rejectedParams; // Can't check protocol_version because the first packet is v1, but there // could still be a payload, in which case we can get the real protocol // version -- cgit v1.2.1 From d0cc7c448626b03b333a6634a5ee31ea16433b09 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Fri, 4 Aug 2017 14:13:56 -0400 Subject: Use `MaxSupportedProtocolVersion` instead of `EnableProtocolX` to determine protocol version An ini configuration was already implemented for `MaxSupportedProtocolVersion` This commit removes the `EnableProtocolX` options and instead uses the `MaxSupportedProtcolVersion` parameter to determine what features are supported --- src/appMain/smartDeviceLink.ini | 8 ++-- .../src/application_manager_impl.cc | 24 +----------- .../src/commands/mobile/set_app_icon_request.cc | 2 +- .../include/config_profile/profile.h | 8 +--- src/components/config_profile/src/profile.cc | 43 ++++------------------ .../protocol_handler/protocol_handler_settings.h | 5 ++- .../mock_protocol_handler_settings.h | 1 - .../protocol_handler/src/protocol_handler_impl.cc | 17 +-------- 8 files changed, 19 insertions(+), 89 deletions(-) diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini index ea75352ec5..c64e409e29 100644 --- a/src/appMain/smartDeviceLink.ini +++ b/src/appMain/smartDeviceLink.ini @@ -30,6 +30,8 @@ AudioStreamingPort = 5080 ; SDL source version ; represents as a git commit hash value SDLVersion = {GIT_COMMIT} +; SDL supported protocol version +MaxSupportedProtocolVersion = 5 ; All logging event could be dropped by setting $LogsEnabled to false LogsEnabled = true ; Contains .json/.ini files @@ -213,8 +215,7 @@ ThreadPoolSize = 1 HashStringSize = 32 [SDL4] -; Enables SDL 4.0 support -EnableProtocol4 = true +; Section for features added in protocol version 4 ; Path where apps icons must be stored AppIconsFolder = storage ; Max size of the folder in bytes @@ -223,8 +224,7 @@ AppIconsFolderMaxSize = 104857600 AppIconsAmountToRemove = 1 [SDL5] -; Enables SDL protocol 5.0 support -EnableProtocol5 = true +; Section for features added in protocol version 5 ; Control service packet with payload bigger than this value will be marked as a malformed, ; if not specified, this value will default to MaxPayloadSize ;MaximumControlPayloadSize = 131072 diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index e7e7868102..e02f35e9e7 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -3499,28 +3499,8 @@ void ApplicationManagerImpl::OnUpdateHMIAppType( ProtocolVersion ApplicationManagerImpl::SupportedSDLVersion() const { LOG4CXX_AUTO_TRACE(logger_); - bool heart_beat_support = get_settings().heart_beat_timeout(); - bool sdl4_support = protocol_handler_->get_settings().enable_protocol_4(); - bool sdl5_support = protocol_handler_->get_settings().enable_protocol_5(); - - if (sdl5_support) { - LOG4CXX_DEBUG(logger_, - "SDL Supported protocol version " << ProtocolVersion::kV5); - return ProtocolVersion::kV5; - } - if (sdl4_support) { - LOG4CXX_DEBUG(logger_, - "SDL Supported protocol version " << ProtocolVersion::kV4); - return ProtocolVersion::kV4; - } - if (heart_beat_support) { - LOG4CXX_DEBUG(logger_, - "SDL Supported protocol version " << ProtocolVersion::kV3); - return ProtocolVersion::kV3; - } - LOG4CXX_DEBUG(logger_, - "SDL Supported protocol version " << ProtocolVersion::kV2); - return ProtocolVersion::kV2; + return static_cast get_settings() + .max_supported_protocol_version(); } event_engine::EventDispatcher& ApplicationManagerImpl::event_dispatcher() { diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc index 5d70a2fb5b..3da638a861 100644 --- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc @@ -115,7 +115,7 @@ void SetAppIconRequest::CopyToIconStorage( const std::string& path_to_file) const { if (!application_manager_.protocol_handler() .get_settings() - .enable_protocol_4()) { + .max_supported_protocol_version() >= ProtocolVersion::kV4) { LOG4CXX_WARN(logger_, "Icon copying skipped, since protocol ver. 4 is not enabled."); return; diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index 5c4618903f..8a25bcf648 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -111,6 +111,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, /** * @brief Returns true, if SDL 4.0 is enabled */ + // DEPRECATED, use max_supported_protocol_version instead bool enable_protocol_4() const OVERRIDE; /** @@ -129,11 +130,6 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, */ const uint32_t& app_icons_amount_to_remove() const OVERRIDE; - /** - * @brief Returns true if SDL protocol v5 is enabled - */ - bool enable_protocol_5() const OVERRIDE; - /** * @brief Returns the maximum payload size for control services */ @@ -784,11 +780,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, std::string app_config_folder_; std::string app_storage_folder_; std::string app_resource_folder_; - bool enable_protocol_4_; std::string app_icons_folder_; uint32_t app_icons_folder_max_size_; uint32_t app_icons_amount_to_remove_; - bool enable_protocol_5_; size_t maximum_control_payload_size_; size_t maximum_rpc_payload_size_; size_t maximum_audio_payload_size_; diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index 9ea2672448..58709b876c 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -101,11 +101,9 @@ const char* kAppStorageFolderKey = "AppStorageFolder"; const char* kAppResourseFolderKey = "AppResourceFolder"; const char* kLogsEnabledKey = "LogsEnabled"; const char* kAppConfigFolderKey = "AppConfigFolder"; -const char* kEnableProtocol4Key = "EnableProtocol4"; const char* kAppIconsFolderKey = "AppIconsFolder"; const char* kAppIconsFolderMaxSizeKey = "AppIconsFolderMaxSize"; const char* kAppIconsAmountToRemoveKey = "AppIconsAmountToRemove"; -const char* kEnableProtocol5Key = "EnableProtocol5"; const char* kMaximumControlPayloadSizeKey = "MaximumControlPayloadSize"; const char* kMaximumRpcPayloadSizeKey = "MaximumRpcPayloadSize"; const char* kMaximumAudioPayloadSizeKey = "MaximumAudioPayloadSize"; @@ -244,7 +242,7 @@ const uint32_t kDefaultBeforeUpdateHours = 24; const uint32_t kDefaultHubProtocolIndex = 0; const uint32_t kDefaultHeartBeatTimeout = 0; -const uint16_t kDefaultMaxSupportedProtocolVersion = 3; +const uint16_t kDefaultMaxSupportedProtocolVersion = 5; const uint16_t kDefautTransportManagerTCPPort = 12345; const uint16_t kDefaultServerPort = 8087; const uint16_t kDefaultVideoStreamingPort = 5050; @@ -323,11 +321,9 @@ Profile::Profile() app_config_folder_() , app_storage_folder_() , app_resource_folder_() - , enable_protocol_4_(false) , app_icons_folder_() , app_icons_folder_max_size_(kDefaultAppIconsFolderMaxSize) , app_icons_amount_to_remove_(kDefaultAppIconsAmountToRemove) - , enable_protocol_5_(false) , maximum_control_payload_size_(kDefaultMaximumControlPayloadSize) , maximum_rpc_payload_size_(kDefaultMaximumRpcPayloadSize) , maximum_audio_payload_size_(kDefaultMaximumAudioPayloadSize) @@ -454,7 +450,7 @@ const std::string& Profile::app_resource_folder() const { } bool Profile::enable_protocol_4() const { - return enable_protocol_4_; + return max_supported_protocol_version_ >= 4; } const std::string& Profile::app_icons_folder() const { @@ -469,10 +465,6 @@ const uint32_t& Profile::app_icons_amount_to_remove() const { return app_icons_amount_to_remove_; } -bool Profile::enable_protocol_5() const { - return enable_protocol_5_; -} - size_t Profile::maximum_control_payload_size() const { return maximum_control_payload_size_; } @@ -1043,17 +1035,6 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE(app_resource_folder_, kAppResourseFolderKey, kMainSection); - // Enable protocol ver.4 parameter - std::string enable_protocol_4_value; - if (ReadValue(&enable_protocol_4_value, kSDL4Section, kEnableProtocol4Key) && - 0 == strcmp("true", enable_protocol_4_value.c_str())) { - enable_protocol_4_ = true; - } else { - enable_protocol_4_ = false; - } - - LOG_UPDATED_BOOL_VALUE(enable_protocol_4_, kEnableProtocol4Key, kSDL4Section); - // Application icon folder ReadStringValue(&app_icons_folder_, file_system::CurrentWorkingDirectory().c_str(), @@ -1088,17 +1069,6 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE( app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey, kSDL4Section); - // Enable protocol ver.5 parameter - std::string enable_protocol_5_value; - if (ReadValue(&enable_protocol_5_value, kSDL5Section, kEnableProtocol5Key) && - 0 == strcmp("true", enable_protocol_5_value.c_str())) { - enable_protocol_5_ = true; - } else { - enable_protocol_5_ = false; - } - - LOG_UPDATED_BOOL_VALUE(enable_protocol_5_, kEnableProtocol5Key, kSDL5Section); - ReadUIntValue(&maximum_control_payload_size_, kDefaultMaximumControlPayloadSize, kSDL5Section, @@ -1712,10 +1682,11 @@ void Profile::UpdateValues() { kProtocolHandlerSection, kMaxSupportedProtocolVersionKey); - // if .ini file contains protocol version less than 2 or more than 3 - // max_supported_protocol_version_ = 3 - if (max_supported_protocol_version_ < 2) { - max_supported_protocol_version_ = 3; + if (max_supported_protocol_version_ < 1) { + max_supported_protocol_version_ = 1; + } else if (max_supported_protocol_version_ > + kDefaultMaxSupportedProtocolVersion) { + max_supported_protocol_version_ = kDefaultMaxSupportedProtocolVersion; } LOG_UPDATED_BOOL_VALUE(enable_policy_, kEnablePolicy, kPolicySection); diff --git a/src/components/include/protocol_handler/protocol_handler_settings.h b/src/components/include/protocol_handler/protocol_handler_settings.h index fc37d4af58..362f49e140 100644 --- a/src/components/include/protocol_handler/protocol_handler_settings.h +++ b/src/components/include/protocol_handler/protocol_handler_settings.h @@ -29,12 +29,13 @@ class ProtocolHandlerSettings { */ virtual uint32_t heart_beat_timeout() const = 0; - virtual uint16_t max_supported_protocol_version() const = 0; /* * @brief Protocol version, from .ini file. */ + virtual uint16_t max_supported_protocol_version() const = 0; + + // DEPRECATED virtual bool enable_protocol_4() const = 0; - virtual bool enable_protocol_5() const = 0; virtual uint32_t multiframe_waiting_timeout() const = 0; #ifdef ENABLE_SECURITY diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h index 43af035f0b..8ddeded889 100644 --- a/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h +++ b/src/components/include/test/protocol_handler/mock_protocol_handler_settings.h @@ -55,7 +55,6 @@ class MockProtocolHandlerSettings MOCK_CONST_METHOD0(heart_beat_timeout, uint32_t()); MOCK_CONST_METHOD0(max_supported_protocol_version, uint16_t()); MOCK_CONST_METHOD0(enable_protocol_4, bool()); - MOCK_CONST_METHOD0(enable_protocol_5, bool()); MOCK_CONST_METHOD0(multiframe_waiting_timeout, uint32_t()); #ifdef ENABLE_SECURITY MOCK_CONST_METHOD0(force_protected_service, const std::vector&()); diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index e7dd772c42..867f4e0a47 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1742,21 +1742,6 @@ std::string ConvertPacketDataToString(const uint8_t* data, uint8_t ProtocolHandlerImpl::SupportedSDLProtocolVersion() const { LOG4CXX_AUTO_TRACE(logger_); - - bool heart_beat_support = (0 != get_settings().heart_beat_timeout()); - - bool sdl4_support = get_settings().enable_protocol_4(); - bool sdl5_support = get_settings().enable_protocol_5(); - - if (sdl5_support) { - return PROTOCOL_VERSION_5; - } - if (sdl4_support) { - return PROTOCOL_VERSION_4; - } - if (heart_beat_support) { - return PROTOCOL_VERSION_3; - } - return PROTOCOL_VERSION_2; + return get_settings().max_supported_protocol_version(); } } // namespace protocol_handler -- cgit v1.2.1 From 166a09cc489c9e9155dac55183e18544e505e94d Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Fri, 4 Aug 2017 15:28:38 -0400 Subject: - modified MOBILE_API.xml to support the changes needed for metadata tagging --- src/components/interfaces/MOBILE_API.xml | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 81f673af1a..861ebc7a5d 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -701,6 +701,45 @@ + + + The data in this field contains the title of the currently playing audio track. + + + The data in this field contains the artist or creator of the currently playing audio track. + + + The data in this field contains the album title of the currently playing audio track. + + + The data in this field contains the creation year of the currently playing audio track. + + + The data in this field contains the genre of the currently playing audio track. + + + The data in this field contains the name of the current source for the media. + + + The data in this field is a rating. + + + The data in this field is the current temperature. + + + The data in this field is the maximum temperature for the day. + + + The data in this field is the minimum temperature for the day. + + + The data in this field describes the current weather (ex. cloudy, clear, etc.). + + + The data in this field describes the current humidity value. + + + The image field for SoftButton @@ -841,6 +880,21 @@ + + + The type of data contained in the "mainField1" text field. + + + The type of data contained in the "mainField2" text field. + + + The type of data contained in the "mainField3" text field. + + + The type of data contained in the "mainField4" text field. + + + A choice is an option given to the user, which can be selected either by menu, or through voice recognition system. @@ -3288,6 +3342,14 @@ + + + App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4. + If omitted on supported displays, the currently set metadata tags will not change. + If any text field contains no tags, the metadata tag for that textfield should be removed. + + + -- cgit v1.2.1 From a2d33105ac96a1fea9fa755188fef40e311fc411 Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Fri, 4 Aug 2017 15:36:09 -0400 Subject: - modified HMI_API.xml to support the changes needed for metadata tagging --- src/components/interfaces/HMI_API.xml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 092553ea05..d813f27ed1 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -503,6 +503,45 @@ + + + The data in this field contains the title of the currently playing audio track. + + + The data in this field contains the artist or creator of the currently playing audio track. + + + The data in this field contains the album title of the currently playing audio track. + + + The data in this field contains the creation year of the currently playing audio track. + + + The data in this field contains the genre of the currently playing audio track. + + + The data in this field contains the name of the current source for the media. + + + The data in this field is a rating. + + + The data in this field is the current temperature. + + + The data in this field is the maximum temperature for the day. + + + The data in this field is the minimum temperature for the day. + + + The data in this field describes the current weather (ex. cloudy, clear, etc.). + + + The data in this field describes the current humidity value. + + + The image field for SoftButton @@ -1647,6 +1686,9 @@ The text itself. + + The type of data contained in the field. + -- cgit v1.2.1 From 0000726af268818012618c84a925c01a7b0cc0bc Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Tue, 8 Aug 2017 13:54:03 -0400 Subject: Use one enum for shorthand Protocol Version rather than two --- .../include/application_manager/application.h | 4 +- .../include/application_manager/application_impl.h | 7 ++- .../application_manager/application_manager_impl.h | 8 ++- .../include/application_manager/message.h | 22 +++---- .../application_manager/src/application_impl.cc | 8 ++- .../src/application_manager_impl.cc | 69 +++++++++++++--------- .../src/commands/hmi/sdl_activate_app_request.cc | 6 +- .../on_hmi_status_notification_from_mobile.cc | 15 +++-- src/components/application_manager/src/message.cc | 16 +++-- .../src/message_helper/message_helper.cc | 4 +- .../src/mobile_message_handler.cc | 22 +++---- .../commands/hmi/sdl_activate_app_request_test.cc | 18 ++++-- .../on_hmi_status_notification_from_mobile_test.cc | 20 ++++--- .../mobile/on_hmi_status_notification_test.cc | 2 +- .../include/application_manager/mock_application.h | 4 +- .../test/message_helper/message_helper_test.cc | 3 +- .../test/mobile_message_handler_test.cc | 4 +- .../test/mobile_message_handler_v1_test.cc | 6 +- .../src/dbus_message_adapter.cc | 3 +- .../src/messagebroker_adapter.cc | 3 +- src/components/include/protocol/common.h | 5 +- 21 files changed, 145 insertions(+), 104 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 63d9580758..9543193ff9 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -542,8 +542,8 @@ class Application : public virtual InitialApplicationData, virtual void set_grammar_id(uint32_t value) = 0; virtual void set_protocol_version( - const ProtocolVersion& protocol_version) = 0; - virtual ProtocolVersion protocol_version() const = 0; + const protocol_handler::MajorProtocolVersion& protocol_version) = 0; + virtual protocol_handler::MajorProtocolVersion protocol_version() const = 0; virtual void set_is_resuming(bool is_resuming) = 0; virtual bool is_resuming() const = 0; diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 695d7ef9d5..9ef2fb936c 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -162,8 +162,9 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, virtual void set_grammar_id(uint32_t value); bool is_audio() const OVERRIDE; - virtual void set_protocol_version(const ProtocolVersion& protocol_version); - virtual ProtocolVersion protocol_version() const; + virtual void set_protocol_version( + const protocol_handler::MajorProtocolVersion& protocol_version); + virtual protocol_handler::MajorProtocolVersion protocol_version() const; virtual void set_is_resuming(bool is_resuming); virtual bool is_resuming() const; @@ -370,7 +371,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, std::set subscribed_buttons_; VehicleInfoSubscriptions subscribed_vehicle_info_; UsageStatistics usage_report_; - ProtocolVersion protocol_version_; + protocol_handler::MajorProtocolVersion protocol_version_; bool is_voice_communication_application_; sync_primitives::atomic_bool is_resuming_; diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 93c139963a..313219116d 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1086,8 +1086,10 @@ class ApplicationManagerImpl bool operator()(const ApplicationSharedPtr app) const { return app ? handle_ == app->device() && - Message::is_sufficient_version(ProtocolVersion::kV4, - app->protocol_version()) + Message::is_sufficient_version( + protocol_handler::MajorProtocolVersion:: + PROTOCOL_VERSION_4, + app->protocol_version()) : false; } }; @@ -1354,7 +1356,7 @@ class ApplicationManagerImpl * @brief Function returns supported SDL Protocol Version * @return protocol version depends on parameters from smartDeviceLink.ini. */ - ProtocolVersion SupportedSDLVersion() const; + protocol_handler::MajorProtocolVersion SupportedSDLVersion() const; /** * @brief Types of directories used by Application Manager diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index 4678e88106..70d80f44ef 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -39,6 +39,7 @@ #include "utils/shared_ptr.h" #include "protocol/message_priority.h" #include "protocol/rpc_type.h" +#include "protocol/common.h" #include "smart_objects/smart_object.h" namespace application_manager { @@ -57,16 +58,6 @@ enum MessageType { // Map PrcType to corresponding MessageType MessageType MessageTypeFromRpcType(protocol_handler::RpcType rpc_type); -enum ProtocolVersion { - kUnknownProtocol = -1, - kHMI = 0, - kV1 = 1, - kV2 = 2, - kV3 = 3, - kV4 = 4, - kV5 = 5 -}; - class Message { public: Message(protocol_handler::MessagePriority priority); @@ -81,7 +72,7 @@ class Message { int32_t connection_key() const; MessageType type() const; - ProtocolVersion protocol_version() const; + protocol_handler::MajorProtocolVersion protocol_version() const; const std::string& json_message() const; const BinaryData* binary_data() const; @@ -97,13 +88,14 @@ class Message { void set_message_type(MessageType type); void set_binary_data(BinaryData* data); void set_json_message(const std::string& json_message); - void set_protocol_version(ProtocolVersion version); + void set_protocol_version(protocol_handler::MajorProtocolVersion version); void set_smart_object(const smart_objects::SmartObject& object); void set_data_size(size_t data_size); void set_payload_size(size_t payload_size); - static bool is_sufficient_version(ProtocolVersion minVersion, - ProtocolVersion version); + static bool is_sufficient_version( + protocol_handler::MajorProtocolVersion minVersion, + protocol_handler::MajorProtocolVersion version); protocol_handler::MessagePriority Priority() const { return priority_; @@ -126,7 +118,7 @@ class Message { BinaryData* binary_data_; size_t data_size_; size_t payload_size_; - ProtocolVersion version_; + protocol_handler::MajorProtocolVersion version_; }; } // namespace application_manager diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 21039e1865..7e9215b0be 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -107,7 +107,8 @@ ApplicationImpl::ApplicationImpl( , device_(0) , mac_address_(mac_address) , usage_report_(mobile_app_id, statistics_manager) - , protocol_version_(ProtocolVersion::kV3) + , protocol_version_( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3) , is_voice_communication_application_(false) , is_resuming_(false) , video_stream_retry_number_(0) @@ -617,11 +618,12 @@ bool ApplicationImpl::set_activated(bool is_active) { } void ApplicationImpl::set_protocol_version( - const ProtocolVersion& protocol_version) { + const protocol_handler::MajorProtocolVersion& protocol_version) { protocol_version_ = protocol_version; } -ProtocolVersion ApplicationImpl::protocol_version() const { +protocol_handler::MajorProtocolVersion ApplicationImpl::protocol_version() + const { return protocol_version_; } diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index e7e7868102..0994c7bb80 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -546,15 +546,18 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( version.max_supported_api_version = static_cast(max_version); application->set_version(version); - ProtocolVersion protocol_version = static_cast( - message[strings::params][strings::protocol_version].asInt()); + protocol_handler::MajorProtocolVersion protocol_version = + static_cast( + message[strings::params][strings::protocol_version].asInt()); application->set_protocol_version(protocol_version); - if (ProtocolVersion::kUnknownProtocol != protocol_version) { + if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN != + protocol_version) { connection_handler().BindProtocolVersionWithSession( connection_key, static_cast(protocol_version)); } - if ((protocol_version == ProtocolVersion::kV3) && + if ((protocol_version == + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3) && (get_settings().heart_beat_timeout() != 0)) { connection_handler().StartSessionHeartBeat(connection_key); } @@ -1392,7 +1395,7 @@ void ApplicationManagerImpl::SendMessageToMobile( ((*message)[strings::msg_params][strings::result_code] == NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION)) { (*message)[strings::params][strings::protocol_version] = - ProtocolVersion::kV1; + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1; } else { (*message)[strings::params][strings::protocol_version] = SupportedSDLVersion(); @@ -1838,10 +1841,10 @@ bool ApplicationManagerImpl::ConvertMessageToSO( << message.json_message()); switch (message.protocol_version()) { - case ProtocolVersion::kV5: - case ProtocolVersion::kV4: - case ProtocolVersion::kV3: - case ProtocolVersion::kV2: { + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5: + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4: + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3: + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2: { const bool conversion_result = formatters::CFormatterJsonSDLRPCv2::fromString( message.json_message(), @@ -1893,7 +1896,7 @@ bool ApplicationManagerImpl::ConvertMessageToSO( } break; } - case ProtocolVersion::kHMI: { + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI: { #ifdef ENABLE_LOG int32_t result = #endif @@ -1931,7 +1934,7 @@ bool ApplicationManagerImpl::ConvertMessageToSO( } break; } - case ProtocolVersion::kV1: { + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1: { static NsSmartDeviceLinkRPC::V1::v4_protocol_v1_2_no_extra v1_shema; if (message.function_id() == 0 || message.type() == kUnknownType) { @@ -2012,7 +2015,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage( LOG4CXX_WARN(logger_, "Failed to serialize smart object"); return false; } - output.set_protocol_version(application_manager::kV1); + output.set_protocol_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1); } else { if (!formatters::CFormatterJsonSDLRPCv2::toString(message, output_string)) { @@ -2020,7 +2024,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage( return false; } output.set_protocol_version( - static_cast(protocol_version)); + static_cast( + protocol_version)); } break; @@ -2030,7 +2035,8 @@ bool ApplicationManagerImpl::ConvertSOtoMessage( LOG4CXX_WARN(logger_, "Failed to serialize smart object"); return false; } - output.set_protocol_version(application_manager::kHMI); + output.set_protocol_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI); break; } default: @@ -3497,30 +3503,39 @@ void ApplicationManagerImpl::OnUpdateHMIAppType( } } -ProtocolVersion ApplicationManagerImpl::SupportedSDLVersion() const { +protocol_handler::MajorProtocolVersion +ApplicationManagerImpl::SupportedSDLVersion() const { LOG4CXX_AUTO_TRACE(logger_); bool heart_beat_support = get_settings().heart_beat_timeout(); bool sdl4_support = protocol_handler_->get_settings().enable_protocol_4(); bool sdl5_support = protocol_handler_->get_settings().enable_protocol_5(); if (sdl5_support) { - LOG4CXX_DEBUG(logger_, - "SDL Supported protocol version " << ProtocolVersion::kV5); - return ProtocolVersion::kV5; + LOG4CXX_DEBUG( + logger_, + "SDL Supported protocol version " + << protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5); + return protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5; } if (sdl4_support) { - LOG4CXX_DEBUG(logger_, - "SDL Supported protocol version " << ProtocolVersion::kV4); - return ProtocolVersion::kV4; + LOG4CXX_DEBUG( + logger_, + "SDL Supported protocol version " + << protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4); + return protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4; } if (heart_beat_support) { - LOG4CXX_DEBUG(logger_, - "SDL Supported protocol version " << ProtocolVersion::kV3); - return ProtocolVersion::kV3; + LOG4CXX_DEBUG( + logger_, + "SDL Supported protocol version " + << protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3); + return protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3; } - LOG4CXX_DEBUG(logger_, - "SDL Supported protocol version " << ProtocolVersion::kV2); - return ProtocolVersion::kV2; + LOG4CXX_DEBUG( + logger_, + "SDL Supported protocol version " + << protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2); + return protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2; } event_engine::EventDispatcher& ApplicationManagerImpl::event_dispatcher() { diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc index a75eba3ed8..6961c15f76 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc @@ -46,8 +46,10 @@ struct ProtoV4AppsOnDevice : std::unary_function { bool operator()(const ApplicationSharedPtr app) const { return app ? handle_ == app->device() && - Message::is_sufficient_version(ProtocolVersion::kV4, - app->protocol_version()) + Message::is_sufficient_version( + protocol_handler::MajorProtocolVersion:: + PROTOCOL_VERSION_4, + app->protocol_version()) : false; } }; diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc index 4952f01bb2..4bb6cfe9d5 100644 --- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc +++ b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc @@ -75,8 +75,9 @@ void OnHMIStatusNotificationFromMobile::Run() { << connection_key() << " and handle: " << handle); if (!is_apps_requested_before && - Message::is_sufficient_version(ProtocolVersion::kV4, - app->protocol_version()) && + Message::is_sufficient_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4, + app->protocol_version()) && app->is_foreground()) { // In case this notification will be received from mobile side with // foreground level for app on mobile, this should trigger remote @@ -91,8 +92,9 @@ void OnHMIStatusNotificationFromMobile::Run() { " for handle: " << handle); - if (Message::is_sufficient_version(ProtocolVersion::kV4, - app->protocol_version())) { + if (Message::is_sufficient_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4, + app->protocol_version())) { const ApplicationSet& accessor = application_manager_.applications().GetData(); @@ -100,8 +102,9 @@ void OnHMIStatusNotificationFromMobile::Run() { ApplicationSetConstIt it = accessor.begin(); for (; accessor.end() != it; ++it) { if (connection_key() != (*it)->app_id() && - Message::is_sufficient_version(ProtocolVersion::kV4, - (*it)->protocol_version()) && + Message::is_sufficient_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4, + (*it)->protocol_version()) && (*it)->is_foreground()) { is_another_foreground_sdl4_app = true; break; diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc index 48333d4e6f..41a7eea0b6 100644 --- a/src/components/application_manager/src/message.cc +++ b/src/components/application_manager/src/message.cc @@ -64,7 +64,8 @@ Message::Message(protocol_handler::MessagePriority priority) , binary_data_(NULL) , data_size_(0) , payload_size_(0) - , version_(kUnknownProtocol) {} + , version_( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN) {} Message::Message(const Message& message) : priority_(message.priority_), binary_data_(NULL) { @@ -129,7 +130,7 @@ MessageType Message::type() const { return type_; } -ProtocolVersion Message::protocol_version() const { +protocol_handler::MajorProtocolVersion Message::protocol_version() const { return version_; } @@ -186,7 +187,8 @@ void Message::set_json_message(const std::string& json_message) { json_message_ = json_message; } -void Message::set_protocol_version(ProtocolVersion version) { +void Message::set_protocol_version( + protocol_handler::MajorProtocolVersion version) { version_ = version; } @@ -206,8 +208,10 @@ void Message::set_payload_size(size_t payload_size) { payload_size_ = payload_size; } -bool Message::is_sufficient_version(ProtocolVersion minVersion, - ProtocolVersion version) { - return version >= minVersion && version <= ProtocolVersion::kV5; +bool Message::is_sufficient_version( + protocol_handler::MajorProtocolVersion minVersion, + protocol_handler::MajorProtocolVersion version) { + return version >= minVersion && + version <= protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5; } } // namespace application_manager diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 19bb658bca..8e1b4aa125 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -619,8 +619,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse( (*response)[strings::params][strings::connection_key] = connection_key; (*response)[strings::params][strings::protocol_type] = commands::CommandImpl::mobile_protocol_type_; - (*response)[strings::params][strings::protocol_version] = - static_cast(kV2); + (*response)[strings::params][strings::protocol_version] = static_cast( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2); return response; } diff --git a/src/components/application_manager/src/mobile_message_handler.cc b/src/components/application_manager/src/mobile_message_handler.cc index 88f78ec596..f7beea670e 100644 --- a/src/components/application_manager/src/mobile_message_handler.cc +++ b/src/components/application_manager/src/mobile_message_handler.cc @@ -67,27 +67,27 @@ MobileMessageHandler::HandleIncomingMessageProtocol( DCHECK_OR_RETURN(message, NULL); application_manager::Message* out_message = NULL; switch (message->protocol_version()) { - case ProtocolVersion::kV1: + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1: LOG4CXX_DEBUG(logger_, "Protocol version - V1"); out_message = MobileMessageHandler::HandleIncomingMessageProtocolV1(message); break; - case ProtocolVersion::kV2: + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2: LOG4CXX_DEBUG(logger_, "Protocol version - V2"); out_message = MobileMessageHandler::HandleIncomingMessageProtocolV2(message); break; - case ProtocolVersion::kV3: + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3: LOG4CXX_DEBUG(logger_, "Protocol version - V3"); out_message = MobileMessageHandler::HandleIncomingMessageProtocolV2(message); break; - case ProtocolVersion::kV4: + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4: LOG4CXX_DEBUG(logger_, "Protocol version - V4"); out_message = MobileMessageHandler::HandleIncomingMessageProtocolV2(message); break; - case ProtocolVersion::kV5: + case protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5: LOG4CXX_DEBUG(logger_, "Protocol version - V5"); out_message = MobileMessageHandler::HandleIncomingMessageProtocolV2(message); @@ -121,11 +121,13 @@ MobileMessageHandler::HandleOutgoingMessageProtocol( << message->correlation_id() << ", " << message->json_message()); - if (message->protocol_version() == application_manager::kV1) { + if (message->protocol_version() == + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1) { return MobileMessageHandler::HandleOutgoingMessageProtocolV1(message); } - if (Message::is_sufficient_version(ProtocolVersion::kV2, - message->protocol_version())) { + if (Message::is_sufficient_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2, + message->protocol_version())) { return MobileMessageHandler::HandleOutgoingMessageProtocolV2(message); } return NULL; @@ -146,7 +148,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV1( outgoing_message->set_connection_key(message->connection_key()); outgoing_message->set_protocol_version( - static_cast( + static_cast( message->protocol_version())); outgoing_message->set_json_message(std::string( reinterpret_cast(message->data()), message->data_size())); @@ -188,7 +190,7 @@ MobileMessageHandler::HandleIncomingMessageProtocolV2( outgoing_message->set_correlation_id(int32_t(payload.header.correlation_id)); outgoing_message->set_connection_key(message->connection_key()); outgoing_message->set_protocol_version( - static_cast( + static_cast( message->protocol_version())); outgoing_message->set_data_size(message->data_size()); outgoing_message->set_payload_size(message->payload_size()); diff --git a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc index a2fc214b95..3805df5834 100644 --- a/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/sdl_activate_app_request_test.cc @@ -209,9 +209,11 @@ TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) { ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle)); EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false)); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV5)); + .WillByDefault( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); ON_CALL(*mock_app, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV5)); + .WillByDefault( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); const std::string url = "url"; ON_CALL(*mock_app_first, SchemaUrl()).WillByDefault(Return(url)); @@ -291,7 +293,8 @@ TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) { app_list_.insert(mock_app_first); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV5)); + .WillByDefault( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle)); EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true)); @@ -355,7 +358,8 @@ TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) { DataAccessor accessor(app_list_, lock_); EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor)); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV5)); + .WillByDefault( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); ON_CALL(*mock_app_first, device()).WillByDefault(Return(kHandle)); EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(true)); @@ -389,7 +393,8 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) { DataAccessor accessor(app_list_, lock_); EXPECT_CALL(app_mngr_, applications()).WillRepeatedly(Return(accessor)); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV5)); + .WillByDefault( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); EXPECT_CALL(*mock_app_first, is_foreground()).WillOnce(Return(false)); EXPECT_CALL(*message_helper_mock_, SendLaunchApp(_, _, _, _)); @@ -423,7 +428,8 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) { app_list_.insert(mock_app_first); ON_CALL(*mock_app_first, protocol_version()) - .WillByDefault(Return(am::ProtocolVersion::kV5)); + .WillByDefault( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); EXPECT_CALL(*mock_app_first, is_foreground()).WillRepeatedly(Return(true)); EXPECT_CALL(*message_helper_mock_, SendLaunchApp(_, _, _, _)); diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc index 37ed397b75..34f8a010d8 100644 --- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc +++ b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc @@ -52,7 +52,7 @@ const connection_handler::DeviceHandle kHandle = 2u; namespace strings = application_manager::strings; using application_manager::commands::OnHMIStatusNotificationFromMobile; -using application_manager::ProtocolVersion; +using protocol_handler::MajorProtocolVersion; using application_manager::ApplicationSet; using testing::Mock; using testing::Return; @@ -91,7 +91,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); EXPECT_CALL(*mock_app, protocol_version()) - .WillRepeatedly(Return(ProtocolVersion::kV5)); + .WillRepeatedly( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true)); command->Run(); @@ -144,7 +145,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); EXPECT_CALL(*mock_app, protocol_version()) - .WillRepeatedly(Return(ProtocolVersion::kV5)); + .WillRepeatedly( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(true)); command->Run(); @@ -172,7 +174,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, applications()).Times(0); EXPECT_CALL(*mock_app, protocol_version()) - .WillOnce(Return(ProtocolVersion::kV3)); + .WillOnce( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3)); EXPECT_CALL(*mock_app, is_foreground()).Times(0); command->Run(); @@ -199,7 +202,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, applications()).Times(0); EXPECT_CALL(*mock_app, protocol_version()) - .WillOnce(Return(ProtocolVersion::kV3)); + .WillOnce( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3)); EXPECT_CALL(*mock_app, is_foreground()).Times(0); command->Run(); @@ -224,7 +228,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, IsAppsQueriedFrom(kHandle)).WillOnce(Return(false)); EXPECT_CALL(*mock_app, protocol_version()) - .WillOnce(Return(ProtocolVersion::kV5)); + .WillOnce( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); EXPECT_CALL(app_mngr_, applications()).Times(0); @@ -261,7 +266,8 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); EXPECT_CALL(*mock_app, protocol_version()) - .WillRepeatedly(Return(ProtocolVersion::kV5)); + .WillRepeatedly( + Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_5)); EXPECT_CALL(*mock_app, is_foreground()).WillRepeatedly(Return(false)); EXPECT_CALL(app_mngr_, MarkAppsGreyOut(kHandle, false)); diff --git a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc index 8f2ce3d3dc..2da0e60df1 100644 --- a/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc +++ b/src/components/application_manager/test/commands/mobile/on_hmi_status_notification_test.cc @@ -49,7 +49,7 @@ const uint32_t kConnectionKey = 1u; namespace strings = application_manager::strings; using application_manager::commands::OnHMIStatusNotification; -using application_manager::ProtocolVersion; +using protocol_handler::MajorProtocolVersion; using application_manager::MockMessageHelper; using application_manager::commands::CommandImpl; using testing::Mock; diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index 3276e1f8f5..ae9b05bb92 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -123,9 +123,9 @@ class MockApplication : public ::application_manager::Application { MOCK_METHOD1(set_grammar_id, void(uint32_t value)); MOCK_METHOD1( set_protocol_version, - void(const ::application_manager::ProtocolVersion& protocol_version)); + void(const ::protocol_handler::MajorProtocolVersion& protocol_version)); MOCK_CONST_METHOD0(protocol_version, - ::application_manager::ProtocolVersion()); + ::protocol_handler::MajorProtocolVersion()); MOCK_METHOD1(set_is_resuming, void(bool)); MOCK_CONST_METHOD0(is_resuming, bool()); MOCK_METHOD1(AddFile, bool(const ::application_manager::AppFile& file)); diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc index 94ab511dc4..3471c02901 100644 --- a/src/components/application_manager/test/message_helper/message_helper_test.cc +++ b/src/components/application_manager/test/message_helper/message_helper_test.cc @@ -96,7 +96,8 @@ TEST(MessageHelperTestCreate, obj[strings::params][strings::correlation_id].asUInt()); EXPECT_EQ(connection_key, obj[strings::params][strings::connection_key].asUInt()); - EXPECT_EQ(kV2, obj[strings::params][strings::protocol_version].asInt()); + EXPECT_EQ(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2, + obj[strings::params][strings::protocol_version].asInt()); } TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) { diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc index 0fe6018aa7..3f2ba0a3c5 100644 --- a/src/components/application_manager/test/mobile_message_handler_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_test.cc @@ -53,7 +53,7 @@ using protocol_handler::ServiceType; using protocol_handler::MessagePriority; using protocol_handler::PROTOCOL_HEADER_V2_SIZE; using application_manager::MobileMessageHandler; -using application_manager::ProtocolVersion; +using protocol_handler::MajorProtocolVersion; using ::testing::_; using ::application_manager::Message; using ::application_manager::MobileMessage; @@ -176,7 +176,7 @@ class MobileMessageHandlerTest : public testing::Test { message->set_correlation_id(correlation_id); message->set_connection_key(connection_key); message->set_protocol_version( - static_cast(protocol_version)); + static_cast(protocol_version)); message->set_message_type(application_manager::MessageType::kNotification); if (data) { message->set_binary_data(data); diff --git a/src/components/application_manager/test/mobile_message_handler_v1_test.cc b/src/components/application_manager/test/mobile_message_handler_v1_test.cc index f5a6e7833d..a19ea991b9 100644 --- a/src/components/application_manager/test/mobile_message_handler_v1_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc @@ -111,7 +111,8 @@ TEST(MobileMessageHandlerTestV1Test, utils::MakeShared( protocol_handler::MessagePriority::kDefault); - message->set_protocol_version(application_manager::ProtocolVersion::kV1); + message->set_protocol_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1); message->set_json_message(data_json); message->set_connection_key(connection_key_p1); @@ -121,7 +122,8 @@ TEST(MobileMessageHandlerTestV1Test, ASSERT_TRUE(ptr); EXPECT_EQ(connection_key, ptr->connection_key()); - EXPECT_EQ(static_cast(application_manager::ProtocolVersion::kV1), + EXPECT_EQ(static_cast( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_1), ptr->protocol_version()); } diff --git a/src/components/hmi_message_handler/src/dbus_message_adapter.cc b/src/components/hmi_message_handler/src/dbus_message_adapter.cc index 00f5ad6be8..5b0b11e557 100644 --- a/src/components/hmi_message_handler/src/dbus_message_adapter.cc +++ b/src/components/hmi_message_handler/src/dbus_message_adapter.cc @@ -179,7 +179,8 @@ void DBusMessageAdapter::SendMessageToCore( // merge // MessagePriority::FromServiceType(message.servicetype) // shall be used instead - message->set_protocol_version(application_manager::ProtocolVersion::kHMI); + message->set_protocol_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI); message->set_smart_object(obj); handler()->OnMessageReceived(message); LOG4CXX_INFO(logger_, "Successfully sent to observer"); diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc index 27cf9df8cd..39cae7ea76 100644 --- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc +++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc @@ -171,7 +171,8 @@ void MessageBrokerAdapter::ProcessRecievedFromMB(Json::Value& root) { protocol_handler::MessagePriority::kDefault)); // message->set_message_type() message->set_json_message(message_string); - message->set_protocol_version(application_manager::ProtocolVersion::kHMI); + message->set_protocol_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI); if (!handler()) { LOG4CXX_WARN(logger_, "handler is NULL"); diff --git a/src/components/include/protocol/common.h b/src/components/include/protocol/common.h index 2904f383de..00d57a9bf5 100644 --- a/src/components/include/protocol/common.h +++ b/src/components/include/protocol/common.h @@ -56,8 +56,9 @@ const uint8_t PROTOCOL_HEADER_V2_SIZE = 12; *\brief Protocol versions constants * First 4-bit field of AppLink protocol packet */ -enum { - +enum MajorProtocolVersion { + PROTOCOL_VERSION_UNKNOWN = -1, + PROTOCOL_VERSION_HMI = 0x00, /** *\brief Constant: number of protocol version (1). */ -- cgit v1.2.1 From 5e7cc8fba2faabc9d4e00a4f6d5d965f5f4c063d Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Tue, 8 Aug 2017 13:57:37 -0400 Subject: Fix double configure step Currently when the BSON library is built, the configuration step is performed during both the `configure` and `make` commands. This commit fixes this. --- src/3rd_party/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index 2abbe4f284..f9abfb55ce 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -296,7 +296,7 @@ ExternalProject_Add(libbson BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY} DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY} SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY} - CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in && ./configure + CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure && ./configure BUILD_COMMAND make INSTALL_COMMAND sudo make install) -- cgit v1.2.1 From 54e2ef2aef655e842d99b4d0026392e29f5e6f72 Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Tue, 8 Aug 2017 15:51:37 -0400 Subject: - added new ShowRequest::HandleMetadata function for the Show RPC to handle mapping metadata values from incoming mobile protocol to outgoing HMI protocol - hooked HandleMetadata() into ShowRequest::run() for the four mainFields - added new metadata json string entries to smart_object_keys.h/.cc --- .../commands/mobile/show_request.h | 8 ++++ .../application_manager/smart_object_keys.h | 2 + .../src/commands/mobile/show_request.cc | 53 ++++++++++++++++++++++ .../application_manager/src/smart_object_keys.cc | 2 + 4 files changed, 65 insertions(+) diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h index cbe2ca396a..7e07be1c9a 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h @@ -78,6 +78,14 @@ class ShowRequest : public CommandRequestImpl { */ bool CheckStringsOfShowRequest(); + /** + * @brief Handle the conversion of metadata information from the incoming + * mobile json message format to the outgoing hmi json message format + */ + void HandleMetadata(const char* field_id, + int32_t field_index, + smart_objects::SmartObject& msg_params); + DISALLOW_COPY_AND_ASSIGN(ShowRequest); }; diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 9b8acd0675..88a904764b 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -90,6 +90,7 @@ extern const char* main_field_1; extern const char* main_field_2; extern const char* main_field_3; extern const char* main_field_4; +extern const char* text_field_metadata; extern const char* eta; extern const char* time_to_destination; extern const char* total_distance; @@ -388,6 +389,7 @@ namespace hmi_request { extern const char* parent_id; extern const char* field_name; extern const char* field_text; +extern const char* field_types; extern const char* alert_strings; extern const char* duration; extern const char* soft_buttons; diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc index cf2509cdb9..53c6ece67c 100644 --- a/src/components/application_manager/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_request.cc @@ -49,6 +49,41 @@ ShowRequest::ShowRequest(const MessageSharedPtr& message, ShowRequest::~ShowRequest() {} +void ShowRequest::HandleMetadata(const char* field_id, + int32_t field_index, + smart_objects::SmartObject& msg_params) { + smart_objects::SmartObject& metadata_struct = + (*message_)[strings::msg_params][strings::text_field_metadata]; + + if (metadata_struct.keyExists(field_id)) { + LOG4CXX_INFO(logger_, "field " << field_id << " exists."); + + if (field_index != -1) { + LOG4CXX_INFO(logger_, "have a field index of " << field_index); + msg_params[hmi_request::show_strings][field_index] + [hmi_request::field_types] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + const size_t num_tags = metadata_struct[field_id].length(); + LOG4CXX_INFO(logger_, "num_tags = " << num_tags); + + for (size_t i = 0; i < num_tags; ++i) { + const int32_t current_tag = metadata_struct[field_id][i].asInt(); + msg_params[hmi_request::show_strings][field_index] + [hmi_request::field_types][i] = current_tag; + LOG4CXX_INFO(logger_, "tag " << i << ": " << current_tag); + } + } else { + LOG4CXX_INFO(logger_, + "tag provided with no item for " << field_id + << ", ignore with warning"); + // tag provided with no item, ignore with warning + } + } else { + LOG4CXX_INFO(logger_, "field " << field_id << " does not exist."); + } +} + void ShowRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -125,38 +160,56 @@ void ShowRequest::Run() { smart_objects::SmartObject(smart_objects::SmartType_Array); int32_t index = 0; + int32_t main_field_1_index = -1; if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) { msg_params[hmi_request::show_strings][index][hmi_request::field_name] = static_cast(hmi_apis::Common_TextFieldName::mainField1); msg_params[hmi_request::show_strings][index][hmi_request::field_text] = (*message_)[strings::msg_params][strings::main_field_1]; + main_field_1_index = index; ++index; } + int32_t main_field_2_index = -1; if ((*message_)[strings::msg_params].keyExists(strings::main_field_2)) { msg_params[hmi_request::show_strings][index][hmi_request::field_name] = static_cast(hmi_apis::Common_TextFieldName::mainField2); msg_params[hmi_request::show_strings][index][hmi_request::field_text] = (*message_)[strings::msg_params][strings::main_field_2]; + main_field_2_index = index; ++index; } + int32_t main_field_3_index = -1; if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) { msg_params[hmi_request::show_strings][index][hmi_request::field_name] = static_cast(hmi_apis::Common_TextFieldName::mainField3); msg_params[hmi_request::show_strings][index][hmi_request::field_text] = (*message_)[strings::msg_params][strings::main_field_3]; + main_field_3_index = index; ++index; } + int32_t main_field_4_index = -1; if ((*message_)[strings::msg_params].keyExists(strings::main_field_4)) { msg_params[hmi_request::show_strings][index][hmi_request::field_name] = static_cast(hmi_apis::Common_TextFieldName::mainField4); msg_params[hmi_request::show_strings][index][hmi_request::field_text] = (*message_)[strings::msg_params][strings::main_field_4]; + main_field_4_index = index; ++index; } + if ((*message_)[strings::msg_params].keyExists( + strings::text_field_metadata)) { + LOG4CXX_INFO(logger_, "TextFieldMetadata exists."); + + HandleMetadata(strings::main_field_1, main_field_1_index, msg_params); + HandleMetadata(strings::main_field_2, main_field_2_index, msg_params); + HandleMetadata(strings::main_field_3, main_field_3_index, msg_params); + HandleMetadata(strings::main_field_4, main_field_4_index, msg_params); + } + if ((*message_)[strings::msg_params].keyExists(strings::media_clock)) { msg_params[hmi_request::show_strings][index][hmi_request::field_name] = static_cast(hmi_apis::Common_TextFieldName::mediaClock); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 7f8fd5d00f..cafb7f7388 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -57,6 +57,7 @@ const char* main_field_1 = "mainField1"; const char* main_field_2 = "mainField2"; const char* main_field_3 = "mainField3"; const char* main_field_4 = "mainField4"; +const char* text_field_metadata = "textFieldMetadata"; const char* eta = "eta"; const char* time_to_destination = "timeToDestination"; const char* total_distance = "totalDistance"; @@ -349,6 +350,7 @@ namespace hmi_request { const char* parent_id = "parentID"; const char* field_name = "fieldName"; const char* field_text = "fieldText"; +const char* field_types = "fieldTypes"; const char* alert_strings = "alertStrings"; const char* duration = "duration"; const char* soft_buttons = "softButtons"; -- cgit v1.2.1 From a38d055aabed13690216b34246cc18243ca0fdf5 Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Wed, 9 Aug 2017 17:04:37 -0400 Subject: - added some additional unit tests to show_test.cc to test translation of metadata tags from input format to the HMI output format --- .../test/commands/mobile/show_test.cc | 130 +++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc index 2d2e19cbf2..b1e6d93b39 100644 --- a/src/components/application_manager/test/commands/mobile/show_test.cc +++ b/src/components/application_manager/test/commands/mobile/show_test.cc @@ -151,6 +151,52 @@ class ShowRequestTest : public CommandRequestTest { EXPECT_CALL(*mock_app_, set_show_command(_)).Times(0); } + void TestSetupHelperWithMetadata( + MessageSharedPtr msg, + hmi_apis::Common_TextFieldName::eType field_name, + const char* field, + size_t num_tags, + int32_t* field_tags) { + SmartObject msg_params(smart_objects::SmartType_Map); + (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; + (*msg)[am::strings::params][am::strings::function_id] = kFunctionID; + msg_params[field] = text_field_; + msg_params[am::strings::text_field_metadata][field] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + for (size_t i = 0; i < num_tags; ++i) { + const int32_t current_tag = field_tags[i]; + msg_params[am::strings::text_field_metadata][field][i] = current_tag; + } + (*msg)[am::strings::msg_params] = msg_params; + + EXPECT_EQ((*msg)[am::strings::msg_params], msg_params); + + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); + + msg_params.erase(field); + msg_params.erase(am::strings::text_field_metadata); + + msg_params[am::strings::app_id] = kAppId; + msg_params[am::hmi_request::show_strings] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_name] = + static_cast(field_name); + msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_text] = + text_field_; + msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_types] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + for (size_t i = 0; i < num_tags; ++i) { + const int32_t current_tag = field_tags[i]; + msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_types] + [i] = current_tag; + } + + EXPECT_CALL(app_mngr_, ManageHMICommand(_)); + EXPECT_CALL(*mock_app_, set_show_command(msg_params)); + } + void SetUp() OVERRIDE { Mock::VerifyAndClearExpectations(&mock_message_helper_); } @@ -590,6 +636,90 @@ TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) { command->Run(); } +TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) { + MessageSharedPtr msg = CreateMsgParams(); + + SharedPtr command(CreateCommand(msg)); + + text_field_ = "Main_Field_1"; + const size_t num_tags = 1; + int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaArtist}; + TestSetupHelperWithMetadata(msg, + hmi_apis::Common_TextFieldName::mainField1, + am::strings::main_field_1, + num_tags, + tags); + command->Run(); +} + +TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) { + MessageSharedPtr msg = CreateMsgParams(); + + SharedPtr command(CreateCommand(msg)); + + text_field_ = "Main_Field_1"; + const size_t num_tags = 5; + int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaTitle, + hmi_apis::Common_TextFieldType::mediaArtist, + hmi_apis::Common_TextFieldType::rating, + hmi_apis::Common_TextFieldType::humidity, + hmi_apis::Common_TextFieldType::currentTemperature}; + TestSetupHelperWithMetadata(msg, + hmi_apis::Common_TextFieldName::mainField1, + am::strings::main_field_1, + num_tags, + tags); + command->Run(); +} + +TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) { + MessageSharedPtr msg = CreateMsgParams(); + + SharedPtr command(CreateCommand(msg)); + + text_field_ = "Main_Field_2"; + const size_t num_tags = 1; + int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaArtist}; + TestSetupHelperWithMetadata(msg, + hmi_apis::Common_TextFieldName::mainField2, + am::strings::main_field_2, + num_tags, + tags); + command->Run(); +} + +TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) { + MessageSharedPtr msg = CreateMsgParams(); + + SharedPtr command(CreateCommand(msg)); + + text_field_ = "Main_Field_3"; + const size_t num_tags = 1; + int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaArtist}; + TestSetupHelperWithMetadata(msg, + hmi_apis::Common_TextFieldName::mainField3, + am::strings::main_field_3, + num_tags, + tags); + command->Run(); +} + +TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) { + MessageSharedPtr msg = CreateMsgParams(); + + SharedPtr command(CreateCommand(msg)); + + text_field_ = "Main_Field_4"; + const size_t num_tags = 1; + int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaArtist}; + TestSetupHelperWithMetadata(msg, + hmi_apis::Common_TextFieldName::mainField4, + am::strings::main_field_4, + num_tags, + tags); + command->Run(); +} + TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); -- cgit v1.2.1 From 8762264dc82437687a00fca7140187dfc919904a Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Wed, 9 Aug 2017 16:30:42 -0400 Subject: Add constants for BSON object keys --- src/components/include/protocol/bson_object_keys.h | 44 ++++++++++++++++++++++ src/components/protocol/src/bson_object_keys.cc | 14 +++++++ .../protocol_handler/src/protocol_handler_impl.cc | 28 ++++++++------ 3 files changed, 74 insertions(+), 12 deletions(-) create mode 100644 src/components/include/protocol/bson_object_keys.h create mode 100644 src/components/protocol/src/bson_object_keys.cc diff --git a/src/components/include/protocol/bson_object_keys.h b/src/components/include/protocol/bson_object_keys.h new file mode 100644 index 0000000000..08e47ebdab --- /dev/null +++ b/src/components/include/protocol/bson_object_keys.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +namespace protocol_handler { + +namespace strings { + +extern const char* hash_id; +extern const char* protocol_version; +extern const char* mtu; +extern const char* rejected_params; + +} // namespace strings + +} // namespace protocol_handler diff --git a/src/components/protocol/src/bson_object_keys.cc b/src/components/protocol/src/bson_object_keys.cc new file mode 100644 index 0000000000..fba2b4a166 --- /dev/null +++ b/src/components/protocol/src/bson_object_keys.cc @@ -0,0 +1,14 @@ +#include + +namespace protocol_handler { + +namespace strings { + +const char* hash_id = "hashId"; +const char* protocol_version = "protocolVersion"; +const char* mtu = "mtu"; +const char* rejected_params = "rejectedParams"; + +} // namespace strings + +} // namespace protocol_handler diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 867f4e0a47..938583125d 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -34,6 +34,7 @@ #include #include // std::find #include +#include #include "connection_handler/connection_handler_impl.h" #include "protocol_handler/session_observer.h" @@ -238,14 +239,14 @@ void ProtocolHandlerImpl::SendStartSessionAck( bson_object_initialize_default(&payloadObj); bson_object_put_int64( &payloadObj, - "mtu", + strings::mtu, static_cast( protocol_header_validator_.max_payload_size_by_service_type( serviceTypeValue))); if (serviceTypeValue == kRpc) { // Hash ID is only used in RPC case bson_object_put_int32( - &payloadObj, "hashId", static_cast(hash_id)); + &payloadObj, strings::hash_id, static_cast(hash_id)); // Minimum protocol version supported by both ProtocolPacket::ProtocolVersion* minVersion = (full_version.majorVersion < PROTOCOL_VERSION_5) @@ -255,7 +256,7 @@ void ProtocolHandlerImpl::SendStartSessionAck( char protocolVersionString[255]; strncpy(protocolVersionString, (*minVersion).to_string().c_str(), 255); bson_object_put_string( - &payloadObj, "protocolVersion", protocolVersionString); + &payloadObj, strings::protocol_version, protocolVersionString); } uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); ptr->set_data(payloadBytes, bson_object_size(&payloadObj)); @@ -320,7 +321,8 @@ void ProtocolHandlerImpl::SendStartSessionNAck( strncpy(paramPtr, param.c_str(), 255); bson_array_add_string(&rejectedParamsArr, paramPtr); } - bson_object_put_array(&payloadObj, "rejectedParams", &rejectedParamsArr); + bson_object_put_array( + &payloadObj, strings::rejected_params, &rejectedParamsArr); uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); ptr->set_data(payloadBytes, bson_object_size(&payloadObj)); free(payloadBytes); @@ -381,7 +383,8 @@ void ProtocolHandlerImpl::SendEndSessionNAck( strncpy(paramPtr, param.c_str(), 255); bson_array_add_string(&rejectedParamsArr, paramPtr); } - bson_object_put_array(&payloadObj, "rejectedParams", &rejectedParamsArr); + bson_object_put_array( + &payloadObj, strings::rejected_params, &rejectedParamsArr); uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); ptr->set_data(payloadBytes, bson_object_size(&payloadObj)); free(payloadBytes); @@ -1069,7 +1072,8 @@ uint32_t get_hash_id(const ProtocolPacket& packet) { } if (packet.protocol_version() >= PROTOCOL_VERSION_5) { BsonObject obj = bson_object_from_bytes(packet.data()); - const uint32_t hash_id = (uint32_t)bson_object_get_int32(&obj, "hashId"); + const uint32_t hash_id = + (uint32_t)bson_object_get_int32(&obj, strings::hash_id); bson_object_deinitialize(&obj); return hash_id; } else { @@ -1107,7 +1111,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageEndSession( if (packet.protocol_version() >= PROTOCOL_VERSION_5) { std::vector rejectedParams; if (hash_id == protocol_handler::HASH_ID_WRONG) { - rejectedParams.push_back(std::string("hashId")); + rejectedParams.push_back(std::string(strings::hash_id)); } SendEndSessionNAck(connection_id, current_session_id, @@ -1314,11 +1318,11 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( if (packet.service_type() == kRpc && packet.data_size() != 0) { BsonObject obj = bson_object_from_bytes(packet.data()); fullVersion = new ProtocolPacket::ProtocolVersion( - std::string(bson_object_get_string(&obj, "protocolVersion"))); + std::string(bson_object_get_string(&obj, strings::protocol_version))); bson_object_deinitialize(&obj); // Constructed payloads added in Protocol v5 if (fullVersion->majorVersion < PROTOCOL_VERSION_5) { - rejectedParams.push_back(std::string("protocolVersion")); + rejectedParams.push_back(std::string(strings::protocol_version)); } } else { fullVersion = new ProtocolPacket::ProtocolVersion(); @@ -1367,7 +1371,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( if (packet.service_type() == kRpc && packet.data_size() != 0) { BsonObject obj = bson_object_from_bytes(packet.data()); ProtocolPacket::ProtocolVersion fullVersion( - bson_object_get_string(&obj, "protocolVersion")); + bson_object_get_string(&obj, strings::protocol_version)); bson_object_deinitialize(&obj); if (fullVersion.majorVersion >= PROTOCOL_VERSION_5) { @@ -1380,8 +1384,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( PROTECTION_OFF, fullVersion); } else { - std::vector rejectedParams(1, - std::string("protocolVersion")); + std::vector rejectedParams( + 1, std::string(strings::protocol_version)); SendStartSessionNAck(connection_id, packet.session_id(), protocol_version, -- cgit v1.2.1 From 4f793bd5385289f4058264cf62778faa3d3c7248 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 27 Jul 2017 18:59:13 +0900 Subject: Add video streaming capability in system capability --- src/appMain/hmi_capabilities.json | 6 ++ .../application_manager/hmi_capabilities_impl.h | 31 ++++++ .../application_manager/smart_object_keys.h | 2 + .../commands/hmi/ui_get_capabilities_response.cc | 12 +++ .../mobile/get_system_capability_request.cc | 11 ++- .../mobile/register_app_interface_request.cc | 2 + .../src/hmi_capabilities_impl.cc | 98 ++++++++++++++++++ .../application_manager/src/smart_object_keys.cc | 2 + .../include/application_manager/hmi_capabilities.h | 30 ++++++ src/components/interfaces/HMI_API.xml | 109 ++++++++++++++++++++ src/components/interfaces/MOBILE_API.xml | 110 +++++++++++++++++++++ 11 files changed, 411 insertions(+), 2 deletions(-) diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index f5e88fe370..d3b7090e77 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -300,6 +300,12 @@ }, "phoneCapability": { "dialNumberEnabled": true + }, + "videoStreamingCapability": { + "supportedFormats": [{ + "protocol": "RAW", + "codec": "H264" + }] } } }, diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h index 777c45d0ac..bdc1b0c633 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h @@ -407,6 +407,20 @@ class HMICapabilitiesImpl : public HMICapabilities { */ bool phone_call_supported() const OVERRIDE; + /* + * @brief Interface to store whether HMI supports video streaming + * + * @param supported Indicates whether video streaming is supported by HMI + */ + void set_video_streaming_supported(const bool supported) OVERRIDE; + + /* + * @brief Retrieves whether HMI supports video streaming + * + * @return TRUE if it supported, otherwise FALSE + */ + bool video_streaming_supported() const OVERRIDE; + /* * @brief Interface used to store information regarding * the navigation "System Capability" @@ -442,6 +456,21 @@ class HMICapabilitiesImpl : public HMICapabilities { const smart_objects::SmartObject* phone_capability() const OVERRIDE; + /* + * @brief Sets HMI's video streaming related capability information + * + * @param video_streaming_capability the video streaming related capabilities + */ + void set_video_streaming_capability( + const smart_objects::SmartObject& video_streaming_capability) OVERRIDE; + + /* + * @brief Retrieves HMI's video streaming related capabilities + * + * @return HMI's video streaming related capability information + */ + const smart_objects::SmartObject* video_streaming_capability() const OVERRIDE; + void Init(resumption::LastState* last_state) OVERRIDE; /* @@ -518,9 +547,11 @@ class HMICapabilitiesImpl : public HMICapabilities { smart_objects::SmartObject* prerecorded_speech_; bool is_navigation_supported_; bool is_phone_call_supported_; + bool is_video_streaming_supported_; std::string ccpu_version_; smart_objects::SmartObject* navigation_capability_; smart_objects::SmartObject* phone_capability_; + smart_objects::SmartObject* video_streaming_capability_; ApplicationManager& app_mngr_; HMILanguageHandler hmi_language_handler_; diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 9b8acd0675..b8a6d3235f 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -172,6 +172,7 @@ extern const char* system_capability_type; extern const char* system_capabilities; extern const char* navigation_capability; extern const char* phone_capability; +extern const char* video_streaming_capability; // PutFile extern const char* sync_file_name; @@ -263,6 +264,7 @@ extern const char* supported_diag_modes; extern const char* hmi_capabilities; extern const char* navigation; extern const char* phone_call; +extern const char* video_streaming; extern const char* sdl_version; extern const char* system_software_version; extern const char* priority; diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc index 4b31debbdd..3b5aeac639 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc @@ -78,6 +78,12 @@ void UIGetCapabilitiesResponse::Run() { hmi_capabilities.set_phone_call_supported( msg_params[strings::hmi_capabilities][strings::phone_call].asBool()); } + if (msg_params[strings::hmi_capabilities].keyExists( + strings::video_streaming)) { + hmi_capabilities.set_video_streaming_supported( + msg_params[strings::hmi_capabilities][strings::video_streaming] + .asBool()); + } } if (msg_params.keyExists(strings::system_capabilities)) { @@ -92,6 +98,12 @@ void UIGetCapabilitiesResponse::Run() { hmi_capabilities.set_phone_capability( msg_params[strings::system_capabilities][strings::phone_capability]); } + if (msg_params[strings::system_capabilities].keyExists( + strings::video_streaming_capability)) { + hmi_capabilities.set_video_streaming_capability( + msg_params[strings::system_capabilities] + [strings::video_streaming_capability]); + } } } diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc index 91fad1b664..ca0fb1b355 100644 --- a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc @@ -60,8 +60,15 @@ void GetSystemCapabilityRequest::Run() { break; } case mobile_apis::SystemCapabilityType::VIDEO_STREAMING: - SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); - return; + if (hmi_capabilities.video_streaming_capability()) { + response_params[strings::system_capability] + [strings::video_streaming_capability] = + *hmi_capabilities.video_streaming_capability(); + } else { + SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); + return; + } + break; case mobile_apis::SystemCapabilityType::AUDIO_STREAMING: SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 52153647a7..63231438f4 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -485,6 +485,8 @@ void FillUIRelatedFields(smart_objects::SmartObject& response_params, hmi_capabilities.navigation_supported(); response_params[strings::hmi_capabilities][strings::phone_call] = hmi_capabilities.phone_call_supported(); + response_params[strings::hmi_capabilities][strings::video_streaming] = + hmi_capabilities.video_streaming_supported(); } void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index 12a64165e8..99a77d5ba7 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -68,6 +68,10 @@ std::map std::map file_type_enum; std::map display_type_enum; std::map character_set_enum; +std::map + video_streaming_protocol_enum; +std::map + video_streaming_codec_enum; void InitCapabilities() { vr_enum_capabilities.insert(std::make_pair( @@ -333,6 +337,28 @@ void InitCapabilities() { std::string("CID1SET"), hmi_apis::Common_CharacterSet::CID1SET)); character_set_enum.insert(std::make_pair( std::string("CID2SET"), hmi_apis::Common_CharacterSet::CID2SET)); + + video_streaming_protocol_enum.insert(std::make_pair( + std::string("RAW"), hmi_apis::Common_VideoStreamingProtocol::RAW)); + video_streaming_protocol_enum.insert(std::make_pair( + std::string("RTP"), hmi_apis::Common_VideoStreamingProtocol::RTP)); + video_streaming_protocol_enum.insert(std::make_pair( + std::string("RTSP"), hmi_apis::Common_VideoStreamingProtocol::RTSP)); + video_streaming_protocol_enum.insert(std::make_pair( + std::string("RTMP"), hmi_apis::Common_VideoStreamingProtocol::RTMP)); + video_streaming_protocol_enum.insert(std::make_pair( + std::string("WEBM"), hmi_apis::Common_VideoStreamingProtocol::WEBM)); + + video_streaming_codec_enum.insert(std::make_pair( + std::string("H264"), hmi_apis::Common_VideoStreamingCodec::H264)); + video_streaming_codec_enum.insert(std::make_pair( + std::string("H265"), hmi_apis::Common_VideoStreamingCodec::H265)); + video_streaming_codec_enum.insert(std::make_pair( + std::string("Theora"), hmi_apis::Common_VideoStreamingCodec::Theora)); + video_streaming_codec_enum.insert(std::make_pair( + std::string("VP8"), hmi_apis::Common_VideoStreamingCodec::VP8)); + video_streaming_codec_enum.insert(std::make_pair( + std::string("VP9"), hmi_apis::Common_VideoStreamingCodec::VP9)); } } // namespace @@ -363,8 +389,10 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr) , prerecorded_speech_(NULL) , is_navigation_supported_(false) , is_phone_call_supported_(false) + , is_video_streaming_supported_(false) , navigation_capability_(NULL) , phone_capability_(NULL) + , video_streaming_capability_(NULL) , app_mngr_(app_mngr) , hmi_language_handler_(app_mngr) { InitCapabilities(); @@ -394,6 +422,7 @@ HMICapabilitiesImpl::~HMICapabilitiesImpl() { delete prerecorded_speech_; delete navigation_capability_; delete phone_capability_; + delete video_streaming_capability_; } bool HMICapabilitiesImpl::VerifyImageType(const int32_t image_type) const { @@ -609,6 +638,10 @@ void HMICapabilitiesImpl::set_phone_call_supported(const bool supported) { is_phone_call_supported_ = supported; } +void HMICapabilitiesImpl::set_video_streaming_supported(const bool supported) { + is_video_streaming_supported_ = supported; +} + void HMICapabilitiesImpl::set_navigation_capability( const smart_objects::SmartObject& navigation_capability) { if (navigation_capability_) { @@ -626,6 +659,15 @@ void HMICapabilitiesImpl::set_phone_capability( phone_capability_ = new smart_objects::SmartObject(phone_capability); } +void HMICapabilitiesImpl::set_video_streaming_capability( + const smart_objects::SmartObject& video_streaming_capability) { + if (video_streaming_capability_) { + delete video_streaming_capability_; + } + video_streaming_capability_ = + new smart_objects::SmartObject(video_streaming_capability); +} + void HMICapabilitiesImpl::Init(resumption::LastState* last_state) { hmi_language_handler_.Init(last_state); if (false == load_capabilities_from_file()) { @@ -737,6 +779,10 @@ bool HMICapabilitiesImpl::phone_call_supported() const { return is_phone_call_supported_; } +bool HMICapabilitiesImpl::video_streaming_supported() const { + return is_video_streaming_supported_; +} + const smart_objects::SmartObject* HMICapabilitiesImpl::navigation_capability() const { return navigation_capability_; @@ -747,6 +793,11 @@ const smart_objects::SmartObject* HMICapabilitiesImpl::phone_capability() return phone_capability_; } +const smart_objects::SmartObject* +HMICapabilitiesImpl::video_streaming_capability() const { + return video_streaming_capability_; +} + bool HMICapabilitiesImpl::load_capabilities_from_file() { std::string json_string; std::string file_name = app_mngr_.get_settings().hmi_capabilities_file_name(); @@ -1011,6 +1062,53 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { phone_capability_so); set_phone_capability(phone_capability_so); } + if (check_existing_json_member(system_capabilities, + "videoStreamingCapability")) { + Json::Value vs_capability = + system_capabilities.get("videoStreamingCapability", ""); + smart_objects::SmartObject vs_capability_so; + Formatters::CFormatterJsonBase::jsonValueToObj(vs_capability, + vs_capability_so); + + if (vs_capability_so.keyExists("supportedFormats")) { + smart_objects::SmartObject& supported_format_array = + vs_capability_so["supportedFormats"]; + smart_objects::SmartObject converted_array( + smart_objects::SmartType_Array); + for (uint32_t i = 0, j = 0; i < supported_format_array.length(); + i++) { + if (!supported_format_array[i].keyExists("protocol") || + !supported_format_array[i].keyExists("codec")) { + continue; + } + + std::map:: + const_iterator it_protocol = + video_streaming_protocol_enum.find( + supported_format_array[i]["protocol"].asString()); + + std::map:: + const_iterator it_codec = video_streaming_codec_enum.find( + supported_format_array[i]["codec"].asString()); + + // format is valid only if both protocol and codec are converted + // to enum values successfully + if (it_protocol != video_streaming_protocol_enum.end() && + it_codec != video_streaming_codec_enum.end()) { + smart_objects::SmartObject format_so = + smart_objects::SmartObject(smart_objects::SmartType_Map); + format_so["protocol"] = it_protocol->second; + format_so["codec"] = it_codec->second; + converted_array[j++] = format_so; + } + } + vs_capability_so.erase("supportedFormats"); + vs_capability_so["supportedFormats"] = converted_array; + } + set_video_streaming_capability(vs_capability_so); + } } } // UI end diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 7f8fd5d00f..d5324273a7 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -139,6 +139,7 @@ const char* system_capability_type = "systemCapabilityType"; const char* system_capabilities = "systemCapabilities"; const char* navigation_capability = "navigationCapability"; const char* phone_capability = "phoneCapability"; +const char* video_streaming_capability = "videoStreamingCapability"; // PutFile const char* sync_file_name = "syncFileName"; @@ -230,6 +231,7 @@ const char* supported_diag_modes = "supportedDiagModes"; const char* hmi_capabilities = "hmiCapabilities"; const char* navigation = "navigation"; const char* phone_call = "phoneCall"; +const char* video_streaming = "videoStreaming"; const char* sdl_version = "sdlVersion"; const char* system_software_version = "systemSoftwareVersion"; const char* priority = "priority"; diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h index f7107ebeed..03c0fdedb8 100644 --- a/src/components/include/application_manager/hmi_capabilities.h +++ b/src/components/include/application_manager/hmi_capabilities.h @@ -409,6 +409,20 @@ class HMICapabilities { */ virtual bool phone_call_supported() const = 0; + /* + * @brief Interface to store whether HMI supports video streaming + * + * @param supported Indicates whether video streaming is supported by HMI + */ + virtual void set_video_streaming_supported(const bool supported) = 0; + + /* + * @brief Retrieves whether HMI supports video streaming + * + * @return TRUE if it supported, otherwise FALSE + */ + virtual bool video_streaming_supported() const = 0; + /* * @brief Interface used to store information regarding * the navigation "System Capability" @@ -443,6 +457,22 @@ class HMICapabilities { */ virtual const smart_objects::SmartObject* phone_capability() const = 0; + /* + * @brief Sets HMI's video streaming related capability information + * + * @param video_streaming_capability the video streaming related capabilities + */ + virtual void set_video_streaming_capability( + const smart_objects::SmartObject& video_streaming_capability) = 0; + + /* + * @brief Retrieves HMI's video streaming related capabilities + * + * @return HMI's video streaming related capability information + */ + virtual const smart_objects::SmartObject* video_streaming_capability() + const = 0; + virtual void Init(resumption::LastState* last_state) = 0; /** diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 57348e2715..bbc3ea6322 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1208,6 +1208,86 @@ + + Enum for each type of video streaming protocol type. + + + Raw stream bytes that contains no timestamp data and is the lowest supported video streaming + + + + + RTP facilitates the transfer of real-time data. Information provided by this protocol include + timestamps (for synchronization), sequence numbers (for packet loss and reordering detection) + and the payload format which indicates the encoded format of the data. + + + + + The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the + Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) + for media stream delivery. However, some vendors implement proprietary transport protocols. + + + + + Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by + Macromedia for streaming audio, video and data over the Internet, between a Flash player + and a server. Macromedia is now owned by Adobe, which has released an incomplete version + of the specification of the protocol for public use. + + + + + The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and + Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio. + + + + + + Enum for each type of video streaming codec. + + + A block-oriented motion-compensation-based video compression standard. + As of 2014 it is one of the most commonly used formats for the recording, compression, and + distribution of video content. + + + + + High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video + compression standard, one of several potential successors to the widely used AVC (H.264 or + MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio + at the same level of video quality, or substantially improved video quality at the same + bit rate. It supports resolutions up to 8192x4320, including 8K UHD. + + + + + Theora is derived from the formerly proprietary VP3 codec, released into the public domain + by On2 Technologies. It is broadly comparable in design and bitrate efficiency to + MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of + the features present in some of these other codecs. It is comparable in open standards + philosophy to the BBC's Dirac codec. + + + + + VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and + Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct + successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for + Open Media (AOMedia) are based on VP8. + + + + + Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) + and also enables lossless compression. + + + + @@ -1571,6 +1651,16 @@ + + Video streaming formats and their specifications. + + Protocol type, see VideoStreamingProtocol + + + Codec type, see VideoStreamingCodec + + + Contains information about the display capabilities. @@ -2105,11 +2195,30 @@ + + Contains information about this system's video streaming capabilities. + + The preferred resolution of a video stream for decoding and rendering on HMI. + + + The maximum bitrate of video stream that is supported, in kbps. + + + + Detailed information on each format supported by this system, in its preferred order + (i.e. the first element in the array is most preferable to the system). + Each object will contain a VideoStreamingFormat that describes what can be expected. + + + + + + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index a2f8b79658..64427b3781 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -808,6 +808,86 @@ + + Enum for each type of video streaming protocol type. + + + Raw stream bytes that contains no timestamp data and is the lowest supported video streaming + + + + + RTP facilitates the transfer of real-time data. Information provided by this protocol include + timestamps (for synchronization), sequence numbers (for packet loss and reordering detection) + and the payload format which indicates the encoded format of the data. + + + + + The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the + Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) + for media stream delivery. However, some vendors implement proprietary transport protocols. + + + + + Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by + Macromedia for streaming audio, video and data over the Internet, between a Flash player + and a server. Macromedia is now owned by Adobe, which has released an incomplete version + of the specification of the protocol for public use. + + + + + The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and + Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio. + + + + + + Enum for each type of video streaming codec. + + + A block-oriented motion-compensation-based video compression standard. + As of 2014 it is one of the most commonly used formats for the recording, compression, and + distribution of video content. + + + + + High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video + compression standard, one of several potential successors to the widely used AVC (H.264 or + MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio + at the same level of video quality, or substantially improved video quality at the same + bit rate. It supports resolutions up to 8192x4320, including 8K UHD. + + + + + Theora is derived from the formerly proprietary VP3 codec, released into the public domain + by On2 Technologies. It is broadly comparable in design and bitrate efficiency to + MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of + the features present in some of these other codecs. It is comparable in open standards + philosophy to the BBC's Dirac codec. + + + + + VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and + Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct + successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for + Open Media (AOMedia) are based on VP8. + + + + + Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) + and also enables lossless compression. + + + + Either the static hex icon value or the binary image file name identifier (sent by PutFile). @@ -1778,6 +1858,16 @@ + + Video streaming formats and their specifications. + + Protocol type, see VideoStreamingProtocol + + + Codec type, see VideoStreamingCodec + + + Contains information about the display capabilities. @@ -1874,6 +1964,9 @@ Availability of build in phone. True: Available, False: Not Available + + Availability of video streaming. True: Available, False: Not Available + @@ -2409,6 +2502,23 @@ + + Contains information about this system's video streaming capabilities. + + The preferred resolution of a video stream for decoding and rendering on HMI. + + + The maximum bitrate of video stream that is supported, in kbps. + + + + Detailed information on each format supported by this system, in its preferred order + (i.e. the first element in the array is most preferable to the system). + Each object will contain a VideoStreamingFormat that describes what can be expected. + + + + The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist -- cgit v1.2.1 From ad2ad65a3878328031594d2c09fea0a83608cfbf Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 27 Jul 2017 19:00:02 +0900 Subject: Add unit tests for video streaming capability --- .../hmi/ui_get_capabilities_response_test.cc | 78 ++++++++++++++++++++++ .../application_manager/test/hmi_capabilities.json | 15 +++++ .../test/hmi_capabilities_test.cc | 27 ++++++++ .../application_manager/mock_hmi_capabilities.h | 9 +++ 4 files changed, 129 insertions(+) diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index 0f98d102a0..1b91ccc5ac 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -216,6 +216,28 @@ TEST_F(UIGetCapabilitiesResponseTest, SetPhoneCall_SUCCESS) { command->Run(); } +TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreaming_SUCCESS) { + MessageSharedPtr command_msg = CreateCommandMsg(); + (*command_msg)[strings::msg_params][strings::hmi_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + (*command_msg)[strings::msg_params][strings::hmi_capabilities] + [strings::video_streaming] = true; + + ResponseFromHMIPtr command( + CreateCommand(command_msg)); + + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(mock_hmi_capabilities_)); + + smart_objects::SmartObject hmi_capabilities_so = + (*command_msg)[strings::msg_params][strings::hmi_capabilities]; + EXPECT_CALL(mock_hmi_capabilities_, + set_video_streaming_supported( + hmi_capabilities_so[strings::video_streaming].asBool())); + + command->Run(); +} + TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) { MessageSharedPtr command_msg = CreateCommandMsg(); (*command_msg)[strings::msg_params][strings::system_capabilities] = @@ -267,6 +289,62 @@ TEST_F(UIGetCapabilitiesResponseTest, SetPhonenCapability_SUCCESS) { command->Run(); } +TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { + MessageSharedPtr command_msg = CreateCommandMsg(); + (*command_msg)[strings::msg_params][strings::system_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]["preferredResolution"] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]["preferredResolution"] + ["resolutionWidth"] = 800; + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]["preferredResolution"] + ["resolutionWidth"] = 350; + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]["maxBitrate"] = 10000; + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]["supportedFormats"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]["supportedFormats"][0] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]["supportedFormats"][0] + ["protocol"] = hmi_apis::Common_VideoStreamingProtocol::RAW; + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]["supportedFormats"][0] + ["codec"] = hmi_apis::Common_VideoStreamingCodec::H264; + + ResponseFromHMIPtr command( + CreateCommand(command_msg)); + + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(mock_hmi_capabilities_)); + + smart_objects::SmartObject vs_capability_so = + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]; + + EXPECT_CALL(mock_hmi_capabilities_, + set_video_streaming_capability(vs_capability_so)); + + command->Run(); +} + } // namespace ui_get_capabilities_response } // namespace hmi_commands_test } // namespace commands_test diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 4e43bcb72c..c7a2310977 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -300,6 +300,21 @@ }, "phoneCapability": { "dialNumberEnabled": true + }, + "videoStreamingCapability": { + "preferredResolution": { + "resolutionWidth": 800, + "resolutionHeight": 350 + }, + "maxBitrate": 10000, + "supportedFormats": [{ + "protocol": "RAW", + "codec": "H264" + }, + { + "protocol": "RTP", + "codec": "Theora" + }] } } }, diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 07b5bda4b4..cda885f4ae 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -371,6 +371,33 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { EXPECT_TRUE(phone_capability_so.keyExists("dialNumberEnabled")); EXPECT_TRUE(phone_capability_so["dialNumberEnabled"].asBool()); + + const smart_objects::SmartObject vs_capability_so = + *(hmi_capabilities_test->video_streaming_capability()); + + EXPECT_TRUE(vs_capability_so.keyExists("preferredResolution")); + EXPECT_TRUE( + vs_capability_so["preferredResolution"].keyExists("resolutionWidth")); + EXPECT_TRUE( + vs_capability_so["preferredResolution"].keyExists("resolutionHeight")); + EXPECT_EQ(800, + vs_capability_so["preferredResolution"]["resolutionWidth"].asInt()); + EXPECT_EQ( + 350, vs_capability_so["preferredResolution"]["resolutionHeight"].asInt()); + EXPECT_TRUE(vs_capability_so.keyExists("maxBitrate")); + EXPECT_EQ(10000, vs_capability_so["maxBitrate"].asInt()); + EXPECT_TRUE(vs_capability_so.keyExists("supportedFormats")); + const uint32_t supported_formats_len = + vs_capability_so["supportedFormats"].length(); + EXPECT_EQ(2u, supported_formats_len); + EXPECT_TRUE(vs_capability_so["supportedFormats"][0].keyExists("protocol")); + EXPECT_TRUE(vs_capability_so["supportedFormats"][0].keyExists("codec")); + EXPECT_EQ(0, vs_capability_so["supportedFormats"][0]["protocol"].asInt()); + EXPECT_EQ(0, vs_capability_so["supportedFormats"][0]["codec"].asInt()); + EXPECT_TRUE(vs_capability_so["supportedFormats"][1].keyExists("protocol")); + EXPECT_TRUE(vs_capability_so["supportedFormats"][1].keyExists("codec")); + EXPECT_EQ(1, vs_capability_so["supportedFormats"][1]["protocol"].asInt()); + EXPECT_EQ(2, vs_capability_so["supportedFormats"][1]["codec"].asInt()); } TEST_F(HMICapabilitiesTest, VerifyImageType) { diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h index a59235e4fc..2f18b1ceb9 100644 --- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h +++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h @@ -154,6 +154,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities { MOCK_CONST_METHOD0(phone_call_supported, bool()); MOCK_METHOD1(set_phone_call_supported, void(const bool supported)); + MOCK_CONST_METHOD0(video_streaming_supported, bool()); + MOCK_METHOD1(set_video_streaming_supported, void(const bool supported)); + MOCK_CONST_METHOD0(navigation_capability, const smart_objects::SmartObject*()); MOCK_METHOD1(set_navigation_capability, @@ -163,6 +166,12 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities { MOCK_METHOD1(set_phone_capability, void(const smart_objects::SmartObject& phone_capability)); + MOCK_CONST_METHOD0(video_streaming_capability, + const smart_objects::SmartObject*()); + MOCK_METHOD1( + set_video_streaming_capability, + void(const smart_objects::SmartObject& video_streaming_capability)); + MOCK_METHOD1(Init, void(resumption::LastState* last_state)); MOCK_CONST_METHOD0(ccpu_version, const std::string&()); -- cgit v1.2.1 From a51cf183feed320093acd4a471e9eeec77c4a437 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 27 Jul 2017 21:30:29 +0900 Subject: Add Navi.SetVideoConfig request and response --- src/components/application_manager/CMakeLists.txt | 2 + .../commands/hmi/navi_set_video_config_request.h | 85 +++++++++++++ .../commands/hmi/navi_set_video_config_response.h | 74 +++++++++++ .../include/application_manager/message_helper.h | 12 ++ .../commands/hmi/navi_set_video_config_request.cc | 141 +++++++++++++++++++++ .../commands/hmi/navi_set_video_config_response.cc | 55 ++++++++ .../application_manager/src/hmi_command_factory.cc | 12 ++ .../application_manager/src/hmi_interfaces_impl.cc | 1 + .../src/message_helper/message_helper.cc | 20 +++ .../application_manager/mock_message_helper.h | 4 + .../test/mock_message_helper.cc | 7 + src/components/interfaces/HMI_API.xml | 37 ++++++ 12 files changed, 450 insertions(+) create mode 100644 src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h create mode 100644 src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h create mode 100644 src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc create mode 100644 src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index 0cfb80ed64..a5fcd469ef 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -306,6 +306,8 @@ set (HMI_COMMANDS_SOURCES ${COMMANDS_SOURCE_DIR}/hmi/navi_audio_stop_stream_response.cc ${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_request.cc ${COMMANDS_SOURCE_DIR}/hmi/navi_get_way_points_response.cc + ${COMMANDS_SOURCE_DIR}/hmi/navi_set_video_config_request.cc + ${COMMANDS_SOURCE_DIR}/hmi/navi_set_video_config_response.cc ${COMMANDS_SOURCE_DIR}/hmi/on_system_request_notification.cc ${COMMANDS_SOURCE_DIR}/hmi/on_put_file_notification.cc ${COMMANDS_SOURCE_DIR}/hmi/on_resume_audio_source_notification.cc diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h new file mode 100644 index 0000000000..bd0fa95565 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_ + +#include "application_manager/commands/hmi/request_to_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief NaviSetVideoConfigRequest command class + **/ +class NaviSetVideoConfigRequest : public RequestToHMI, + public event_engine::EventObserver { + public: + /** + * @brief NaviSetVideoConfigRequest class constructor + * + * @param message Incoming SmartObject message + * @param application_manager Reference of application manager + **/ + NaviSetVideoConfigRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief NaviSetVideoConfigRequest class destructor + **/ + virtual ~NaviSetVideoConfigRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + /** + * @brief On event callback + **/ + virtual void on_event(const event_engine::Event& event); + + /** + * @brief onTimeOut callback + */ + virtual void onTimeOut(); + + private: + DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigRequest); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h new file mode 100644 index 0000000000..9585202a98 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_ + +#include "application_manager/commands/hmi/response_from_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief NaviSetVideoConfigResponse command class + **/ +class NaviSetVideoConfigResponse : public ResponseFromHMI { + public: + /** + * @brief NaviSetVideoConfigResponse class constructor + * + * @param message Incoming SmartObject message + * @param application_manager Reference of application manager + **/ + NaviSetVideoConfigResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief NaviSetVideoConfigResponse class destructor + **/ + virtual ~NaviSetVideoConfigResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigResponse); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SET_VIDEO_CONFIG_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h index 8d10511d66..8ec1d4745e 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -380,6 +380,18 @@ class MessageHelper { ApplicationManager& app_mngr); #endif // EXTERNAL_PROPRIETARY_MODE + /* + * @brief Sends SetVideoConfig request to HMI to negotiate video parameters + * + * @param app_id the application which will start video streaming + * @param app_mngr reference of application manager + * @param video_params parameters of video streaming, notified by mobile + */ + static void SendNaviSetVideoConfig( + int32_t app_id, + ApplicationManager& app_mngr, + const smart_objects::SmartObject& video_params); + /* * @brief Sends notification to HMI to start video streaming * diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc new file mode 100644 index 0000000000..3a832e0255 --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "application_manager/commands/hmi/navi_set_video_config_request.h" +#include +#include + +namespace application_manager { + +namespace commands { + +NaviSetVideoConfigRequest::NaviSetVideoConfigRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) + , EventObserver(application_manager.event_dispatcher()) {} + +NaviSetVideoConfigRequest::~NaviSetVideoConfigRequest() {} + +void NaviSetVideoConfigRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + if (!CheckAvailabilityHMIInterfaces( + application_manager_, HmiInterfaces::HMI_INTERFACE_Navigation)) { + LOG4CXX_WARN(logger_, "HMI interface Navigation is not supported"); + return; + } + + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); + if (!app) { + LOG4CXX_ERROR(logger_, + "Application with hmi_app_id " << application_id() + << "does not exist"); + return; + } + + subscribe_on_event(hmi_apis::FunctionID::Navigation_SetVideoConfig, + correlation_id()); + SendRequest(); +} + +void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { + LOG4CXX_AUTO_TRACE(logger_); + + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); + if (!app) { + LOG4CXX_ERROR(logger_, + "Application is not found, abort NaviSetVideoConfigRequest"); + return; + } + + const smart_objects::SmartObject& message = event.smart_object(); + switch (event.id()) { + case hmi_apis::FunctionID::Navigation_SetVideoConfig: { + const hmi_apis::Common_Result::eType code = + static_cast( + message[strings::params][hmi_response::code].asInt()); + bool result = false; + std::vector rejected_params; + + if (code == hmi_apis::Common_Result::SUCCESS) { + LOG4CXX_DEBUG(logger_, "Received SetVideoConfig success response"); + result = true; + } else { + LOG4CXX_DEBUG(logger_, + "Received SetVideoConfig failure response (" << event.id() + << ")"); + result = false; + if (message[strings::msg_params].keyExists("rejectedParams")) { + const smart_objects::SmartArray* list = + message[strings::msg_params]["rejectedParams"].asArray(); + if (list != NULL) { + for (unsigned int i = 0; i < list->size(); i++) { + const std::string& param = (*list)[i].asString(); + // Make sure that we actually sent the parameter in the request + if ((*message_)[strings::msg_params].keyExists("config") && + (*message_)[strings::msg_params]["config"].keyExists(param)) { + rejected_params.push_back(param); + } + } + } + } + } +// app->OnNaviSetVideoConfigDone(result, rejected_params); + break; + } + default: + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + break; + } +} + +void NaviSetVideoConfigRequest::onTimeOut() { + LOG4CXX_WARN(logger_, "Timed out while waiting for SetVideoConfig response"); + + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not found"); + return; + } + +// std::vector empty; +// app->OnNaviSetVideoConfigDone(false, empty); + + application_manager_.TerminateRequest( + connection_key(), correlation_id(), function_id()); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc new file mode 100644 index 0000000000..c912dc4aac --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#include "application_manager/commands/hmi/navi_set_video_config_response.h" +#include "application_manager/event_engine/event.h" + +namespace application_manager { + +namespace commands { + +NaviSetVideoConfigResponse::NaviSetVideoConfigResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} + +NaviSetVideoConfigResponse::~NaviSetVideoConfigResponse() {} + +void NaviSetVideoConfigResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + event_engine::Event event(hmi_apis::FunctionID::Navigation_SetVideoConfig); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc index 3f8a60a4a5..d02d9060eb 100644 --- a/src/components/application_manager/src/hmi_command_factory.cc +++ b/src/components/application_manager/src/hmi_command_factory.cc @@ -246,6 +246,8 @@ #include "application_manager/commands/hmi/on_ui_keyboard_input_notification.h" #include "application_manager/commands/hmi/on_ui_touch_event_notification.h" #include "application_manager/commands/hmi/on_ui_reset_timeout_notification.h" +#include "application_manager/commands/hmi/navi_set_video_config_request.h" +#include "application_manager/commands/hmi/navi_set_video_config_response.h" #include "application_manager/commands/hmi/navi_start_stream_request.h" #include "application_manager/commands/hmi/navi_start_stream_response.h" #include "application_manager/commands/hmi/navi_stop_stream_request.h" @@ -2078,6 +2080,16 @@ CommandSharedPtr HMICommandFactory::CreateCommand( message, application_manager)); break; } + case hmi_apis::FunctionID::Navigation_SetVideoConfig: { + if (is_response) { + command.reset(new commands::NaviSetVideoConfigResponse( + message, application_manager)); + } else { + command.reset(new commands::NaviSetVideoConfigRequest( + message, application_manager)); + } + break; + } case hmi_apis::FunctionID::Navigation_StartStream: { if (is_response) { command.reset(new commands::NaviStartStreamResponse( diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc index 8a9944bec4..38f0fcf3a1 100644 --- a/src/components/application_manager/src/hmi_interfaces_impl.cc +++ b/src/components/application_manager/src/hmi_interfaces_impl.cc @@ -166,6 +166,7 @@ generate_function_to_interface_convert_map() { HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_OnTBTClientState] = HmiInterfaces::HMI_INTERFACE_Navigation; + convert_map[Navigation_SetVideoConfig] = HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_StartStream] = HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_StopStream] = HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_StartAudioStream] = diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 8e1b4aa125..c728dcce18 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -1745,6 +1745,26 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse( return utils::MakeShared(response_data); } +void MessageHelper::SendNaviSetVideoConfig( + int32_t app_id, + ApplicationManager& app_mngr, + const smart_objects::SmartObject& video_params) { + LOG4CXX_AUTO_TRACE(logger_); + smart_objects::SmartObjectSPtr request = + CreateRequestObject(app_mngr.GetNextHMICorrelationID()); + if (!request) { + return; + } + + (*request)[strings::params][strings::function_id] = + hmi_apis::FunctionID::Navigation_SetVideoConfig; + + (*request)[strings::msg_params][strings::app_id] = app_id; + (*request)[strings::msg_params]["config"] = video_params; + + app_mngr.ManageHMICommand(request); +} + void MessageHelper::SendNaviStartStream(const int32_t app_id, ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h index 0d28f9e522..4499605f5a 100644 --- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h +++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h @@ -70,6 +70,10 @@ class MockMessageHelper { const connection_handler::DeviceMap& devices, const policy::PolicyHandlerInterface& policy_handler, ApplicationManager& app_mngr)); + MOCK_METHOD3(SendNaviSetVideoConfig, + void(int32_t app_id, + ApplicationManager& app_mngr, + const smart_objects::SmartObject& video_params)); MOCK_METHOD2(SendNaviStartStream, void(int32_t connection_key, ApplicationManager& app_mngr)); MOCK_METHOD2(SendNaviStopStream, diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc index 01ce9cb066..3039e1f677 100644 --- a/src/components/application_manager/test/mock_message_helper.cc +++ b/src/components/application_manager/test/mock_message_helper.cc @@ -41,6 +41,13 @@ void MessageHelper::SendHashUpdateNotification(uint32_t const app_id, MockMessageHelper::message_helper_mock()->SendHashUpdateNotification( app_id, app_mngr); } +void MessageHelper::SendNaviSetVideoConfig( + int32_t app_id, + ApplicationManager& app_mngr, + const smart_objects::SmartObject& video_params) { + MockMessageHelper::message_helper_mock()->SendNaviSetVideoConfig( + app_id, app_mngr, video_params); +} void MessageHelper::SendNaviStartStream(int32_t connection_key, ApplicationManager& app_mngr) { MockMessageHelper::message_helper_mock()->SendNaviStartStream(connection_key, diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index bbc3ea6322..71860c9324 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1661,6 +1661,22 @@ + + Configuration of a video stream. + + The video protocol configuration + + + The video codec configuration + + + Width of the video stream, in pixels. + + + Height of the video stream, in pixels. + + + Contains information about the display capabilities. @@ -3507,6 +3523,27 @@ Current State of TBT client + + Request from SDL to HMI to ask whether HMI accepts a video stream with given configuration. + + Configuration of a video stream. + + + ID of application related to this RPC. + + + + + Response from HMI to SDL whether the configuration is accepted. + In a negative response, a list of rejected parameters are supplied. + + + + List of params of VideoConfig struct which are not accepted by HMI, e.g. "protocol" and "codec". + This param exists only when the response is negative. + + + Request from SmartDeviceLinkCore to HMI to start playing video streaming. -- cgit v1.2.1 From 394a1a6b46eb19010448e8c9dad6e49186e38b32 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Sat, 29 Jul 2017 14:28:36 +0900 Subject: Add implementation for video streaming parameters --- src/components/application_manager/CMakeLists.txt | 4 + .../include/application_manager/application.h | 20 +++ .../include/application_manager/application_impl.h | 4 + .../application_manager/application_manager_impl.h | 45 ++++- .../application_manager/src/application_impl.cc | 27 +++ .../src/application_manager_impl.cc | 167 +++++++++++++++-- .../commands/hmi/navi_set_video_config_request.cc | 6 +- .../include/application_manager/mock_application.h | 5 + .../connection_handler/connection_handler_impl.h | 86 ++++++++- .../src/connection_handler_impl.cc | 118 +++++++++--- .../test/connection_handler_impl_test.cc | 198 ++++++++++++++++----- .../application_manager/application_manager.h | 14 ++ .../connection_handler/connection_handler.h | 12 ++ .../connection_handler_observer.h | 9 +- .../include/protocol_handler/protocol_handler.h | 17 ++ .../include/protocol_handler/session_observer.h | 11 +- .../application_manager/mock_application_manager.h | 5 + .../connection_handler/mock_connection_handler.h | 2 + .../mock_connection_handler_observer.h | 7 +- .../test/protocol_handler/mock_protocol_handler.h | 5 + .../test/protocol_handler/mock_session_observer.h | 13 +- .../protocol_handler/protocol_handler_impl.h | 22 ++- .../protocol_handler/src/protocol_handler_impl.cc | 92 ++++++---- .../test/protocol_handler_tm_test.cc | 140 +++++++++++++-- 24 files changed, 869 insertions(+), 160 deletions(-) diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index a5fcd469ef..0d532c9a5c 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -57,6 +57,7 @@ include_directories ( ${ENCRYPTION_INCLUDE_DIRECTORY} ${MESSAGE_BROKER_INCLUDE_DIRECTORY} ${LOG4CXX_INCLUDE_DIRECTORY} + ${BSON_INCLUDE_DIRECTORY} ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") @@ -399,6 +400,8 @@ set(LIBRARIES formatters dbms Utils + bson -L${BSON_LIBS_DIRECTORY} + emhashmap -L${EMHASHMAP_LIBS_DIRECTORY} ) if (CMAKE_SYSTEM_NAME STREQUAL "Linux") @@ -437,6 +440,7 @@ if(ENABLE_LOG) list(APPEND LIBRARIES log4cxx -L${LOG4CXX_LIBS_DIRECTORY}) endif() +add_dependencies("ApplicationManager" libbson) target_link_libraries("ApplicationManager" ${LIBRARIES}) if(BUILD_TESTS) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 9543193ff9..4dfb8dbf7a 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -37,6 +37,7 @@ #include #include #include +#include #include "utils/shared_ptr.h" #include "utils/data_accessor.h" #include "interfaces/MOBILE_API.h" @@ -440,6 +441,25 @@ class Application : public virtual InitialApplicationData, virtual bool audio_streaming_allowed() const = 0; virtual void set_audio_streaming_allowed(bool state) = 0; + /** + * @brief Sends SetVideoConfig request to HMI to configure streaming + * @param service_type Type of streaming service, should be kMobileNav + * @param params parameters of video streaming in key-value format + * @return true if SetVideoConfig is sent, false otherwise + */ + virtual bool SetVideoConfig(protocol_handler::ServiceType service_type, + const smart_objects::SmartObject& params) = 0; + + /** + * @brief Callback when SetVideoConfig response is received + * @param result true if HMI accepts video streaming parameters, + * false otherwise + * @param rejected_params list of rejected parameters' names. Only + * valid when result is false + */ + virtual void OnNaviSetVideoConfigDone( + bool result, std::vector& rejected_params) = 0; + /** * @brief Starts streaming service for application * @param service_type Type of streaming service diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 9ef2fb936c..f5db389c7f 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -110,6 +110,10 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, bool audio_streaming_allowed() const; void set_audio_streaming_allowed(bool state); + bool SetVideoConfig(protocol_handler::ServiceType service_type, + const smart_objects::SmartObject& params); + void OnNaviSetVideoConfigDone(bool result, + std::vector& rejected_params); void StartStreaming(protocol_handler::ServiceType service_type); void StopStreamingForce(protocol_handler::ServiceType service_type); void StopStreaming(protocol_handler::ServiceType service_type); diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 313219116d..47a77a1f97 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -93,6 +93,8 @@ #include "utils/timer.h" #include "smart_objects/smart_object.h" +struct BsonObject; + namespace threads { class Thread; } @@ -792,10 +794,11 @@ class ApplicationManagerImpl void OnFindNewApplicationsRequest() OVERRIDE; void RemoveDevice( const connection_handler::DeviceHandle& device_handle) OVERRIDE; - bool OnServiceStartedCallback( + void OnServiceStartedCallback( const connection_handler::DeviceHandle& device_handle, const int32_t& session_key, - const protocol_handler::ServiceType& type) OVERRIDE; + const protocol_handler::ServiceType& type, + const BsonObject* params) OVERRIDE; void OnServiceEndedCallback( const int32_t& session_key, const protocol_handler::ServiceType& type, @@ -885,6 +888,19 @@ class ApplicationManagerImpl */ void ForbidStreaming(uint32_t app_id) OVERRIDE; + /** + * @brief Called when application completes streaming configuration + * @param app_id Streaming application id + * @param service_type Streaming service type + * @param result true if configuration is successful, false otherwise + * @param rejected_params list of rejected parameters' name. Valid + * only when result is false. + */ + void OnStreamingConfigured(uint32_t app_id, + protocol_handler::ServiceType service_type, + bool result, + std::vector& rejected_params); + /** * @brief Callback calls when application starts/stops data streaming * @param app_id Streaming application id @@ -1325,10 +1341,13 @@ class ApplicationManagerImpl * @brief Starts specified navi service for application * @param app_id Application to proceed * @param service_type Type of service to start - * @return True on success, false on fail + * @param params configuration parameters specified by mobile + * @return True if service is immediately started or configuration + * parameters are sent to HMI, false on other cases */ bool StartNaviService(uint32_t app_id, - protocol_handler::ServiceType service_type); + protocol_handler::ServiceType service_type, + const BsonObject* params); /** * @brief Stops specified navi service for application @@ -1399,6 +1418,24 @@ class ApplicationManagerImpl void ClearTTSGlobalPropertiesList(); + /** + * @brief Converts BSON object containing video parameters to + * smart object's map object + * @param output the smart object to add video parameters + * @param input BSON object to read parameters from + */ + static void ConvertVideoParamsToSO(smart_objects::SmartObject& output, + const BsonObject* input); + + /** + * @brief Converts rejected parameters' names acquired from HMI to + * SDL protocol's parameter names + * @param list of rejected parameters' names + * @return converted parameters' names + */ + static std::vector ConvertRejectedParamList( + const std::vector& input); + private: const ApplicationManagerSettings& settings_; /** diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 7e9215b0be..7d9025050a 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -416,6 +416,33 @@ bool ApplicationImpl::audio_streaming_allowed() const { return audio_streaming_allowed_; } +bool ApplicationImpl::SetVideoConfig(protocol_handler::ServiceType service_type, + const smart_objects::SmartObject& params) { + using namespace protocol_handler; + LOG4CXX_AUTO_TRACE(logger_); + + if (ServiceType::kMobileNav == service_type) { + // See StartStreaming(). We issue SetVideoConfig and StartStream + // only when streaming is not approved yet + if (!video_streaming_approved()) { + LOG4CXX_TRACE(logger_, "Video streaming not approved"); + MessageHelper::SendNaviSetVideoConfig( + app_id(), application_manager_, params); + return true; + } + } + return false; +} + +void ApplicationImpl::OnNaviSetVideoConfigDone( + bool result, std::vector& rejected_params) { + using namespace protocol_handler; + LOG4CXX_AUTO_TRACE(logger_); + + application_manager_.OnStreamingConfigured( + app_id(), ServiceType::kMobileNav, result, rejected_params); +} + void ApplicationImpl::StartStreaming( protocol_handler::ServiceType service_type) { using namespace protocol_handler; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 85c3469324..a76edc2747 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include "application_manager/application_manager_impl.h" #include "application_manager/mobile_command_factory.h" @@ -1138,7 +1139,9 @@ void ApplicationManagerImpl::ReplaceHMIByMobileAppId( } bool ApplicationManagerImpl::StartNaviService( - uint32_t app_id, protocol_handler::ServiceType service_type) { + uint32_t app_id, + protocol_handler::ServiceType service_type, + const BsonObject* params) { using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); @@ -1155,6 +1158,56 @@ bool ApplicationManagerImpl::StartNaviService( } it = res.first; } + + if (service_type == ServiceType::kMobileNav) { + smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); + ConvertVideoParamsToSO(converted_params, params); + + if (!converted_params.empty()) { + LOG4CXX_INFO(logger_, "Sending video configuration params"); +#ifdef DEBUG + MessageHelper::PrintSmartObject(converted_params); +#endif + bool request_sent = + application(app_id)->SetVideoConfig(service_type, converted_params); + if (request_sent) { + return true; + } + } + } + // no configuration is needed, or SetVideoConfig is not sent + std::vector empty; + OnStreamingConfigured(app_id, service_type, true, empty); + return true; + + } else { + LOG4CXX_WARN(logger_, "Refused navi service by HMI level"); + } + return false; +} + +void ApplicationManagerImpl::OnStreamingConfigured( + uint32_t app_id, + protocol_handler::ServiceType service_type, + bool result, + std::vector& rejected_params) { + using namespace protocol_handler; + LOG4CXX_AUTO_TRACE(logger_); + + std::vector empty; + + LOG4CXX_INFO(logger_, + "OnStreamingConfigured called for service " + << service_type << ", result=" << result); + + if (result) { + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() == it) { + LOG4CXX_WARN(logger_, "Application not found in navi status map"); + connection_handler().NotifyServiceStartedResult(false, empty); + return; + } + // Fill NaviServices map. Set true to first value of pair if // we've started video service or to second value if we've // started audio service @@ -1162,11 +1215,12 @@ bool ApplicationManagerImpl::StartNaviService( : it->second.second = true; application(app_id)->StartStreaming(service_type); - return true; + connection_handler().NotifyServiceStartedResult(true, empty); } else { - LOG4CXX_WARN(logger_, "Refused navi service by HMI level"); + std::vector converted_params = + ConvertRejectedParamList(rejected_params); + connection_handler().NotifyServiceStartedResult(false, converted_params); } - return false; } void ApplicationManagerImpl::StopNaviService( @@ -1194,40 +1248,47 @@ void ApplicationManagerImpl::StopNaviService( app->StopStreaming(service_type); } -bool ApplicationManagerImpl::OnServiceStartedCallback( +void ApplicationManagerImpl::OnServiceStartedCallback( const connection_handler::DeviceHandle& device_handle, const int32_t& session_key, - const protocol_handler::ServiceType& type) { + const protocol_handler::ServiceType& type, + const BsonObject* params) { using namespace helpers; using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "ServiceType = " << type << ". Session = " << std::hex << session_key); + std::vector empty; if (type == kRpc) { LOG4CXX_DEBUG(logger_, "RPC service is about to be started."); - return true; + connection_handler().NotifyServiceStartedResult(true, empty); + return; } ApplicationSharedPtr app = application(session_key); if (!app) { LOG4CXX_WARN(logger_, "The application with id:" << session_key << " doesn't exists."); - return false; + connection_handler().NotifyServiceStartedResult(false, empty); + return; } if (Compare( type, ServiceType::kMobileNav, ServiceType::kAudio)) { if (app->is_navi() || app->mobile_projection_enabled()) { - return StartNaviService(session_key, type); + if (!StartNaviService(session_key, type, params)) { + connection_handler().NotifyServiceStartedResult(false, empty); + } + return; } else { LOG4CXX_WARN(logger_, "Refuse not navi/projection application"); } } else { LOG4CXX_WARN(logger_, "Refuse unknown service"); } - return false; + connection_handler().NotifyServiceStartedResult(false, empty); } void ApplicationManagerImpl::OnServiceEndedCallback( @@ -3606,4 +3667,90 @@ const std::set ApplicationManagerImpl::GetAppsSubscribedForWayPoints() return subscribed_way_points_apps_list_; } +static hmi_apis::Common_VideoStreamingProtocol::eType ConvertVideoProtocol( + const char* str) { + if (strcmp(str, "RAW") == 0) { + return hmi_apis::Common_VideoStreamingProtocol::RAW; + } else if (strcmp(str, "RTP") == 0) { + return hmi_apis::Common_VideoStreamingProtocol::RTP; + } else if (strcmp(str, "RTSP") == 0) { + return hmi_apis::Common_VideoStreamingProtocol::RTSP; + } else if (strcmp(str, "RTMP") == 0) { + return hmi_apis::Common_VideoStreamingProtocol::RTMP; + } else if (strcmp(str, "WEBM") == 0) { + return hmi_apis::Common_VideoStreamingProtocol::WEBM; + } + return hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM; +} + +static hmi_apis::Common_VideoStreamingCodec::eType ConvertVideoCodec( + const char* str) { + if (strcmp(str, "H264") == 0) { + return hmi_apis::Common_VideoStreamingCodec::H264; + } else if (strcmp(str, "H265") == 0) { + return hmi_apis::Common_VideoStreamingCodec::H265; + } else if (strcmp(str, "Theora") == 0) { + return hmi_apis::Common_VideoStreamingCodec::Theora; + } else if (strcmp(str, "VP8") == 0) { + return hmi_apis::Common_VideoStreamingCodec::VP8; + } else if (strcmp(str, "VP9") == 0) { + return hmi_apis::Common_VideoStreamingCodec::VP9; + } + return hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM; +} + +// static +void ApplicationManagerImpl::ConvertVideoParamsToSO( + smart_objects::SmartObject& output, const BsonObject* input) { + if (input == NULL) { + return; + } + BsonObject* obj = const_cast(input); + + const char* protocol = bson_object_get_string(obj, "videoProtocol"); + if (protocol != NULL) { + hmi_apis::Common_VideoStreamingProtocol::eType protocol_enum = + ConvertVideoProtocol(protocol); + if (protocol_enum != + hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM) { + output["protocol"] = protocol_enum; + } + } + const char* codec = bson_object_get_string(obj, "videoCodec"); + if (codec != NULL) { + hmi_apis::Common_VideoStreamingCodec::eType codec_enum = + ConvertVideoCodec(codec); + if (codec_enum != hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM) { + output["codec"] = codec_enum; + } + } + BsonElement* element = bson_object_get(obj, "desiredHeight"); + if (element != NULL && element->type == TYPE_INT32) { + output["height"] = bson_object_get_int32(obj, "desiredHeight"); + } + element = bson_object_get(obj, "desiredWidth"); + if (element != NULL && element->type == TYPE_INT32) { + output["width"] = bson_object_get_int32(obj, "desiredWidth"); + } +} + +// static +std::vector ApplicationManagerImpl::ConvertRejectedParamList( + const std::vector& input) { + std::vector output; + for (unsigned int i = 0; i < input.size(); i++) { + if (input[i] == "protocol") { + output.push_back("videoProtocol"); + } else if (input[i] == "codec") { + output.push_back("videoCodec"); + } else if (input[i] == "height") { + output.push_back("desiredHeight"); + } else if (input[i] == "width") { + output.push_back("desiredWidth"); + } + // ignore unknown parameters + } + return output; +} + } // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc index 3a832e0255..8a51133b36 100644 --- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc @@ -110,7 +110,7 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { } } } -// app->OnNaviSetVideoConfigDone(result, rejected_params); + app->OnNaviSetVideoConfigDone(result, rejected_params); break; } default: @@ -129,8 +129,8 @@ void NaviSetVideoConfigRequest::onTimeOut() { return; } -// std::vector empty; -// app->OnNaviSetVideoConfigDone(false, empty); + std::vector empty; + app->OnNaviSetVideoConfigDone(false, empty); application_manager_.TerminateRequest( connection_key(), correlation_id(), function_id()); diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index ae9b05bb92..53c4be1c77 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -70,6 +70,11 @@ class MockApplication : public ::application_manager::Application { MOCK_CONST_METHOD0(audio_streaming_allowed, bool()); MOCK_METHOD1(set_audio_streaming_allowed, void(bool state)); MOCK_CONST_METHOD0(is_audio, bool()); + MOCK_METHOD2(SetVideoConfig, + bool(protocol_handler::ServiceType service_type, + const smart_objects::SmartObject& params)); + MOCK_METHOD2(OnNaviSetVideoConfigDone, + void(bool result, std::vector& rejected_params)); MOCK_METHOD1(StartStreaming, void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type)); diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h index a6651a6466..32a4086bc4 100644 --- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h +++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h @@ -49,6 +49,7 @@ #include "utils/logger.h" #include "utils/macro.h" +#include "utils/message_queue.h" #include "utils/lock.h" #include "utils/stl_utils.h" #include "utils/rwlock.h" @@ -174,20 +175,21 @@ class ConnectionHandlerImpl /** * \brief Callback function used by ProtocolHandler * when Mobile Application initiates start of new session. - * \param connection_handle Connection identifier within which session has to - * be started. - * \param session_id Identifier of the session to be started + * Result must be notified through NotifySessionStartedResult(). + * \param connection_handle Connection identifier within which session + * has to be started. + * \param sessionId Identifier of the session to be start * \param service_type Type of service + * \param protocol_version Version of protocol * \param is_protected would be service protected - * \param hash_id pointer for session hash identifier - * \return uint32_t Id (number) of new session if successful, otherwise 0. + * \param params configuration parameters specified by mobile */ - virtual uint32_t OnSessionStartedCallback( + virtual void OnSessionStartedCallback( const transport_manager::ConnectionUID connection_handle, const uint8_t session_id, const protocol_handler::ServiceType& service_type, const bool is_protected, - uint32_t* hash_id); + const BsonObject* params); // DEPRECATED uint32_t OnSessionEndedCallback( @@ -441,7 +443,67 @@ class ConnectionHandlerImpl const protocol_handler::SessionObserver& get_session_observer(); DevicesDiscoveryStarter& get_device_discovery_starter(); + /** + * \brief Invoked when observer's OnServiceStartedCallback is completed + * \param result true if observer accepts starting service, false otherwise + * \param rejected_params list of rejected parameters' name. Only valid when + * result is false. Note that even if result is false, this may be empty. + * + * \note This is invoked only once but can be invoked by multiple threads. + * Also it can be invoked before OnServiceStartedCallback() returns. + **/ + virtual void NotifyServiceStartedResult( + bool result, std::vector& rejected_params); + private: + /** + * \brief Struct to keep variables between OnSessionStartedCallback() and + * NotifyServiceStartedResult() + **/ + struct ServiceStartedContext { + transport_manager::ConnectionUID connection_handle_; + uint8_t session_id_; + uint32_t new_session_id_; + protocol_handler::ServiceType service_type_; + uint32_t hash_id_; + bool is_protected_; + + /** + * \brief Constructor + */ + ServiceStartedContext() + : connection_handle_(0) + , session_id_(0) + , new_session_id_(0) + , service_type_(protocol_handler::kInvalidServiceType) + , hash_id_(0) + , is_protected_(0) {} + + /** + * \brief Constructor + * \param connection_handle Connection identifier within which session is + * started. + * \param session_id Session ID specified to OnSessionStartedCallback() + * \param new_session_id Session ID generated + * \param service_type Type of service + * \param hash_id Hash ID generated from connection_handle and + * new_session_id + * \param is_protected Whether service will be protected + **/ + ServiceStartedContext(transport_manager::ConnectionUID connection_handle, + uint8_t session_id, + uint32_t new_session_id, + protocol_handler::ServiceType service_type, + uint32_t hash_id, + bool is_protected) + : connection_handle_(connection_handle) + , session_id_(session_id) + , new_session_id_(new_session_id) + , service_type_(service_type) + , hash_id_(hash_id) + , is_protected_(is_protected) {} + }; + /** * \brief Disconnect application. * @@ -452,6 +514,13 @@ class ConnectionHandlerImpl void OnConnectionEnded(const transport_manager::ConnectionUID connection_id); + /** + * \brief Convenient method to call NotifySessionStartedResult() with + * negative result. + * \param is_protected whether the service would be protected + **/ + void NotifySessionStartedFailure(bool is_protected); + const ConnectionHandlerSettings& settings_; /** * \brief Pointer to observer @@ -486,6 +555,9 @@ class ConnectionHandlerImpl */ utils::StlMapDeleter connection_list_deleter_; + // we need thread-safe queue + utils::MessageQueue start_service_context_queue_; + #ifdef BUILD_TESTS // Methods for test usage public: diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index 125a6cd769..735140e24f 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -69,7 +69,8 @@ ConnectionHandlerImpl::ConnectionHandlerImpl( , protocol_handler_(NULL) , connection_list_lock_() , connection_handler_observer_lock_() - , connection_list_deleter_(&connection_list_) {} + , connection_list_deleter_(&connection_list_) + , start_service_context_queue_() {} ConnectionHandlerImpl::~ConnectionHandlerImpl() { LOG4CXX_AUTO_TRACE(logger_); @@ -279,40 +280,42 @@ bool AllowProtection(const ConnectionHandlerSettings& settings, } #endif // ENABLE_SECURITY -uint32_t ConnectionHandlerImpl::OnSessionStartedCallback( +void ConnectionHandlerImpl::OnSessionStartedCallback( const transport_manager::ConnectionUID connection_handle, const uint8_t session_id, const protocol_handler::ServiceType& service_type, const bool is_protected, - uint32_t* hash_id) { + const BsonObject* params) { LOG4CXX_AUTO_TRACE(logger_); - if (hash_id) { - *hash_id = protocol_handler::HASH_ID_WRONG; - } + uint32_t new_session_id = 0; + uint32_t hash_id = protocol_handler::HASH_ID_WRONG; + #ifdef ENABLE_SECURITY if (!AllowProtection(get_settings(), service_type, is_protected)) { - return 0; + std::vector empty; + protocol_handler_->NotifySessionStartedResult( + new_session_id, hash_id, is_protected, empty); + return; } #endif // ENABLE_SECURITY sync_primitives::AutoReadLock lock(connection_list_lock_); ConnectionList::iterator it = connection_list_.find(connection_handle); if (connection_list_.end() == it) { LOG4CXX_ERROR(logger_, "Unknown connection!"); - return 0; + NotifySessionStartedFailure(is_protected); + return; } - uint32_t new_session_id = 0; Connection* connection = it->second; if ((0 == session_id) && (protocol_handler::kRpc == service_type)) { new_session_id = connection->AddNewSession(); if (0 == new_session_id) { LOG4CXX_ERROR(logger_, "Couldn't start new session!"); - return 0; - } - if (hash_id) { - *hash_id = KeyFromPair(connection_handle, new_session_id); + NotifySessionStartedFailure(is_protected); + return; } + hash_id = KeyFromPair(connection_handle, new_session_id); } else { // Could be create new service or protected exists one if (!connection->AddNewService(session_id, service_type, is_protected)) { LOG4CXX_ERROR(logger_, @@ -322,30 +325,87 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback( #endif // ENABLE_SECURITY << " service " << static_cast(service_type) << " for session " << static_cast(session_id)); - return 0; + NotifySessionStartedFailure(is_protected); + return; } new_session_id = session_id; - if (hash_id) { - *hash_id = protocol_handler::HASH_ID_NOT_SUPPORTED; - } + hash_id = protocol_handler::HASH_ID_NOT_SUPPORTED; } sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_); if (connection_handler_observer_) { const uint32_t session_key = KeyFromPair(connection_handle, new_session_id); - const bool success = connection_handler_observer_->OnServiceStartedCallback( - connection->connection_device_handle(), session_key, service_type); - if (!success) { - LOG4CXX_WARN(logger_, - "Service starting forbidden by connection_handler_observer"); - if (protocol_handler::kRpc == service_type) { - connection->RemoveSession(new_session_id); - } else { - connection->RemoveService(session_id, service_type); - } - return 0; + + ServiceStartedContext context(connection_handle, + session_id, + new_session_id, + service_type, + hash_id, + is_protected); + start_service_context_queue_.push(context); + + connection_handler_observer_->OnServiceStartedCallback( + connection->connection_device_handle(), + session_key, + service_type, + params); + } else { + if (protocol_handler_) { + std::vector empty; + protocol_handler_->NotifySessionStartedResult( + new_session_id, hash_id, is_protected, empty); + } + } +} + +void ConnectionHandlerImpl::NotifyServiceStartedResult( + bool result, std::vector& rejected_params) { + LOG4CXX_AUTO_TRACE(logger_); + + ServiceStartedContext context; + bool available = start_service_context_queue_.pop(context); + if (!available) { + LOG4CXX_ERROR(logger_, "context for start service not found!"); + return; + } + + Connection* connection = NULL; + { + sync_primitives::AutoReadLock lock(connection_list_lock_); + ConnectionList::iterator it = + connection_list_.find(context.connection_handle_); + if (connection_list_.end() == it) { + LOG4CXX_ERROR(logger_, "connection not found"); + return; } + connection = it->second; + } + + if (!result) { + LOG4CXX_WARN(logger_, + "Service starting forbidden by connection_handler_observer"); + if (protocol_handler::kRpc == context.service_type_) { + connection->RemoveSession(context.new_session_id_); + } else { + connection->RemoveService(context.session_id_, context.service_type_); + } + context.new_session_id_ = 0; + } + + if (protocol_handler_ != NULL) { + protocol_handler_->NotifySessionStartedResult(context.new_session_id_, + context.hash_id_, + context.is_protected_, + rejected_params); + } +} + +void ConnectionHandlerImpl::NotifySessionStartedFailure(bool is_protected) { + LOG4CXX_AUTO_TRACE(logger_); + if (protocol_handler_) { + std::vector empty; + protocol_handler_->NotifySessionStartedResult( + 0, protocol_handler::HASH_ID_WRONG, is_protected, empty); } - return new_session_id; } void ConnectionHandlerImpl::OnApplicationFloodCallBack( diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc index 7f4429500d..a8254af646 100644 --- a/src/components/connection_handler/test/connection_handler_impl_test.cc +++ b/src/components/connection_handler/test/connection_handler_impl_test.cc @@ -54,10 +54,18 @@ using namespace ::connection_handler; using ::protocol_handler::ServiceType; using namespace ::protocol_handler; using ::testing::_; +using ::testing::ByRef; +using ::testing::DoAll; using ::testing::InSequence; using ::testing::Mock; using ::testing::Return; using ::testing::ReturnRefOfCopy; +using ::testing::SaveArg; + +// custom action to call a member function with 4 arguments +ACTION_P4(InvokeMemberFuncWithArg2, ptr, memberFunc, a, b) { + (ptr->*memberFunc)(a, b); +} namespace { const uint32_t kAsyncExpectationsTimeout = 10000u; @@ -108,8 +116,15 @@ class ConnectionHandlerTest : public ::testing::Test { // Remove all specific services } void AddTestSession() { - start_session_id_ = connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_); + protocol_handler_test::MockProtocolHandler temp_protocol_handler; + connection_handler_->set_protocol_handler(&temp_protocol_handler); + EXPECT_CALL(temp_protocol_handler, NotifySessionStartedResult(_, _, _, _)) + .WillOnce( + DoAll(SaveArg<0>(&start_session_id_), SaveArg<1>(&out_hash_id_))); + + connection_handler_->OnSessionStartedCallback( + uid_, 0, kRpc, PROTECTION_OFF, NULL); + connection_handler_->set_protocol_handler(NULL); EXPECT_NE(0u, start_session_id_); EXPECT_EQ(SessionHash(uid_, start_session_id_), out_hash_id_); connection_key_ = connection_handler_->KeyFromPair(uid_, start_session_id_); @@ -123,8 +138,16 @@ class ConnectionHandlerTest : public ::testing::Test { EXPECT_EQ(SessionHash(uid_, start_session_id_), out_hash_id_); connection_key_ = connection_handler_->KeyFromPair(uid_, start_session_id_); CheckSessionExists(uid_, start_session_id_); - uint32_t session_id = connection_handler_->OnSessionStartedCallback( + + uint32_t session_id = 0; + protocol_handler_test::MockProtocolHandler temp_protocol_handler; + connection_handler_->set_protocol_handler(&temp_protocol_handler); + EXPECT_CALL(temp_protocol_handler, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(SaveArg<0>(&session_id)); + + connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, service_type, PROTECTION_OFF, 0); + connection_handler_->set_protocol_handler(NULL); EXPECT_EQ(session_id, start_session_id_); } @@ -267,8 +290,13 @@ TEST_F(ConnectionHandlerTest, StartSession_NoConnection) { // Null sessionId for start new session const uint8_t sessionID = 0; // Start new session with RPC service - const uint32_t result_fail = connection_handler_->OnSessionStartedCallback( - uid_, sessionID, kRpc, PROTECTION_ON, &out_hash_id_); + uint32_t result_fail = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(DoAll(SaveArg<0>(&result_fail), SaveArg<1>(&out_hash_id_))); + + connection_handler_->OnSessionStartedCallback( + uid_, sessionID, kRpc, PROTECTION_ON, NULL); // Unknown connection error is '0' EXPECT_EQ(0u, result_fail); EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_); @@ -1013,19 +1041,28 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) { AddTestDeviceConnection(); AddTestSession(); + uint32_t start_audio = 0; + uint32_t start_video = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(DoAll(SaveArg<0>(&start_audio), SaveArg<1>(&out_hash_id_))) + .WillOnce(DoAll(SaveArg<0>(&start_video), SaveArg<1>(&out_hash_id_))); + // Start Audio service - const uint32_t start_audio = connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); EXPECT_EQ(start_session_id_, start_audio); CheckServiceExists(uid_, start_session_id_, kAudio, true); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); // Start Audio service - const uint32_t start_video = connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kMobileNav, PROTECTION_OFF, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kMobileNav, PROTECTION_OFF, NULL); EXPECT_EQ(start_session_id_, start_video); CheckServiceExists(uid_, start_session_id_, kMobileNav, true); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); + + connection_handler_->set_protocol_handler(NULL); } TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) { @@ -1052,11 +1089,18 @@ TEST_F(ConnectionHandlerTest, ServiceStop_UnExistService) { TEST_F(ConnectionHandlerTest, ServiceStop) { AddTestDeviceConnection(); AddTestSession(); + + uint32_t start_audio = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillRepeatedly( + DoAll(SaveArg<0>(&start_audio), SaveArg<1>(&out_hash_id_))); + // Check ignoring hash_id on stop non-rpc service for (uint32_t some_hash_id = 0; some_hash_id < 0xFF; ++some_hash_id) { // Start audio service - const uint32_t start_audio = connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); EXPECT_EQ(start_session_id_, start_audio); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); @@ -1122,13 +1166,23 @@ TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) { &mock_connection_handler_observer); uint32_t session_key = connection_handler_->KeyFromPair(uid_, start_session_id_); + std::vector empty; EXPECT_CALL(mock_connection_handler_observer, - OnServiceStartedCallback(device_handle_, session_key, kRpc)) - .WillOnce(Return(true)); + OnServiceStartedCallback(device_handle_, session_key, kRpc, NULL)) + .WillOnce(InvokeMemberFuncWithArg2( + connection_handler_, + &ConnectionHandler::NotifyServiceStartedResult, + true, + ByRef(empty))); + + uint32_t new_session_id = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(DoAll(SaveArg<0>(&new_session_id), SaveArg<1>(&out_hash_id_))); // Start new session with RPC service - uint32_t new_session_id = connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, 0, kRpc, PROTECTION_OFF, NULL); EXPECT_NE(0u, new_session_id); } @@ -1142,10 +1196,17 @@ TEST_F(ConnectionHandlerTest, // Forbid start kRPC without encryption protected_services_.push_back(kRpc); SetSpecificServices(); + + uint32_t session_id_fail = 0; + uint32_t session_id = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(DoAll(SaveArg<0>(&session_id_fail), SaveArg<1>(&out_hash_id_))) + .WillOnce(DoAll(SaveArg<0>(&session_id), SaveArg<1>(&out_hash_id_))); + // Start new session with RPC service - const uint32_t session_id_fail = - connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, 0, kRpc, PROTECTION_OFF, NULL); #ifdef ENABLE_SECURITY EXPECT_EQ(0u, session_id_fail); EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_); @@ -1159,8 +1220,8 @@ TEST_F(ConnectionHandlerTest, protected_services_.push_back(kControl); SetSpecificServices(); // Start new session with RPC service - const uint32_t session_id = connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_OFF, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, 0, kRpc, PROTECTION_OFF, NULL); EXPECT_NE(0u, session_id); CheckService(uid_, session_id, kRpc, NULL, PROTECTION_OFF); EXPECT_EQ(SessionHash(uid_, session_id), out_hash_id_); @@ -1176,10 +1237,17 @@ TEST_F(ConnectionHandlerTest, unprotected_services_.push_back(UnnamedService::kServedService2); unprotected_services_.push_back(kControl); SetSpecificServices(); + + uint32_t session_id_fail = 0; + uint32_t session_id = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(SaveArg<0>(&session_id_fail)) + .WillOnce(DoAll(SaveArg<0>(&session_id), SaveArg<1>(&out_hash_id_))); + // Start new session with RPC service - const uint32_t session_id_fail = - connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback( + uid_, 0, kRpc, PROTECTION_ON, NULL); #ifdef ENABLE_SECURITY EXPECT_EQ(0u, session_id_fail); #else @@ -1191,8 +1259,8 @@ TEST_F(ConnectionHandlerTest, unprotected_services_.push_back(kControl); SetSpecificServices(); // Start new session with RPC service - const uint32_t session_id = connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_ON, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, 0, kRpc, PROTECTION_ON, NULL); EXPECT_NE(0u, session_id); EXPECT_EQ(SessionHash(uid_, session_id), out_hash_id_); @@ -1211,8 +1279,16 @@ TEST_F(ConnectionHandlerTest, protected_services_.push_back(UnnamedService::kServedService2); protected_services_.push_back(kControl); SetSpecificServices(); + + uint32_t session_id2 = 0; + uint32_t session_id3 = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(SaveArg<0>(&session_id2)) + .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); + // Start new session with Audio service - const uint32_t session_id2 = connection_handler_->OnSessionStartedCallback( + connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); #ifdef ENABLE_SECURITY EXPECT_EQ(0u, session_id2); @@ -1226,8 +1302,8 @@ TEST_F(ConnectionHandlerTest, protected_services_.push_back(UnnamedService::kServedService2); protected_services_.push_back(kControl); SetSpecificServices(); - const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); // Returned original session id #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id3); @@ -1250,10 +1326,17 @@ TEST_F(ConnectionHandlerTest, unprotected_services_.push_back(UnnamedService::kServedService2); unprotected_services_.push_back(kControl); SetSpecificServices(); + + uint32_t session_id_reject = 0; + uint32_t session_id3 = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(SaveArg<0>(&session_id_reject)) + .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); + // Start new session with Audio service - const uint32_t session_id_reject = - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); #ifdef ENABLE_SECURITY EXPECT_EQ(0u, session_id_reject); #else @@ -1262,8 +1345,8 @@ TEST_F(ConnectionHandlerTest, // Allow start kAudio with encryption unprotected_services_.clear(); SetSpecificServices(); - const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_ON, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); // Returned original session id #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id3); @@ -1280,9 +1363,18 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) { AddTestDeviceConnection(); AddTestSession(); + uint32_t session_id_new = 0; + uint32_t session_id2 = 0; + uint32_t session_id3 = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(DoAll(SaveArg<0>(&session_id_new), SaveArg<1>(&out_hash_id_))) + .WillOnce(DoAll(SaveArg<0>(&session_id2), SaveArg<1>(&out_hash_id_))) + .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); + // Start RPC protection - const uint32_t session_id_new = connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kRpc, PROTECTION_ON, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kRpc, PROTECTION_ON, NULL); #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id_new); // Post protection nedd no hash @@ -1296,15 +1388,15 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) { #endif // ENABLE_SECURITY // Start Audio session without protection - const uint32_t session_id2 = connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); EXPECT_EQ(start_session_id_, session_id2); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_OFF); // Start Audio protection - const uint32_t session_id3 = connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_ON, &out_hash_id_); + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id3); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); @@ -1320,7 +1412,11 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtectBulk) { AddTestDeviceConnection(); AddTestSession(); - const uint32_t session_id_new = connection_handler_->OnSessionStartedCallback( + uint32_t session_id_new = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(SaveArg<0>(&session_id_new)); + connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, kBulk, PROTECTION_ON, NULL); #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id_new); @@ -1416,8 +1512,14 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByProtectedService) { // kAudio is not exists yet EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kAudio), reinterpret_cast(NULL)); + + uint32_t session_id = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(SaveArg<0>(&session_id)); + // Open kAudio service - const uint32_t session_id = connection_handler_->OnSessionStartedCallback( + connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); EXPECT_EQ(session_id, start_session_id_); CheckService(uid_, session_id, kAudio, &mock_ssl_context, PROTECTION_ON); @@ -1441,8 +1543,13 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedRPC) { EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc), reinterpret_cast(NULL)); + uint32_t session_id = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(SaveArg<0>(&session_id)); + // Protect kRpc (Bulk will be protect also) - const uint32_t session_id = connection_handler_->OnSessionStartedCallback( + connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, kRpc, PROTECTION_ON, NULL); EXPECT_EQ(start_session_id_, session_id); CheckService(uid_, session_id, kRpc, &mock_ssl_context, PROTECTION_ON); @@ -1469,8 +1576,13 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedBulk) { EXPECT_EQ(connection_handler_->GetSSLContext(connection_key_, kRpc), reinterpret_cast(NULL)); + uint32_t session_id = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + .WillOnce(SaveArg<0>(&session_id)); + // Protect Bulk (kRpc will be protected also) - const uint32_t session_id = connection_handler_->OnSessionStartedCallback( + connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, kBulk, PROTECTION_ON, NULL); EXPECT_EQ(start_session_id_, session_id); CheckService(uid_, session_id, kRpc, &mock_ssl_context, PROTECTION_ON); diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index 98bb341657..7875c12ff5 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -592,6 +592,20 @@ class ApplicationManager { */ virtual void ForbidStreaming(uint32_t app_id) = 0; + /** + * @brief Called when application completes streaming configuration + * @param app_id Streaming application id + * @param service_type Streaming service type + * @param result true if configuration is successful, false otherwise + * @param rejected_params list of rejected parameters' name. Valid + * only when result is false. + */ + virtual void OnStreamingConfigured( + uint32_t app_id, + protocol_handler::ServiceType service_type, + bool result, + std::vector& rejected_params) = 0; + virtual const ApplicationManagerSettings& get_settings() const = 0; virtual event_engine::EventDispatcher& event_dispatcher() = 0; diff --git a/src/components/include/connection_handler/connection_handler.h b/src/components/include/connection_handler/connection_handler.h index e8e1af715a..ca1a0314c6 100644 --- a/src/components/include/connection_handler/connection_handler.h +++ b/src/components/include/connection_handler/connection_handler.h @@ -198,6 +198,18 @@ class ConnectionHandler { virtual DevicesDiscoveryStarter& get_device_discovery_starter() = 0; + /** + * \brief Invoked when observer's OnServiceStartedCallback is completed + * \param result true if observer accepts starting service, false otherwise + * \param rejected_params list of rejected parameters' name. Only valid when + * result is false. Note that even if result is false, this may be empty. + * + * \note This is invoked only once but can be invoked by multiple threads. + * Also it can be invoked before OnServiceStartedCallback() returns. + **/ + virtual void NotifyServiceStartedResult( + bool result, std::vector& rejected_params) = 0; + protected: /** * \brief Destructor diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h index e25b0aaea5..706f338d60 100644 --- a/src/components/include/connection_handler/connection_handler_observer.h +++ b/src/components/include/connection_handler/connection_handler_observer.h @@ -42,6 +42,8 @@ #include "security_manager/ssl_context.h" #endif // ENABLE_SECURITY +struct BsonObject; + /** * \namespace connection_handler * \brief SmartDeviceLink connection_handler namespace. @@ -83,15 +85,18 @@ class ConnectionHandlerObserver { /** * \brief Callback function used by connection_handler * when Mobile Application initiates start of new service. + * Result must be notified through NotifyServiceStartedResult(). * \param deviceHandle Device identifier within which session has to be * started. * \param sessionKey Key of started session. * \param type Established service type + * \param params Configuration parameters for this service */ - virtual bool OnServiceStartedCallback( + virtual void OnServiceStartedCallback( const connection_handler::DeviceHandle& device_handle, const int32_t& session_key, - const protocol_handler::ServiceType& type) = 0; + const protocol_handler::ServiceType& type, + const BsonObject* params) = 0; /** * \brief Callback function used by connection_handler diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h index 183db21532..5a3a2754cb 100644 --- a/src/components/include/protocol_handler/protocol_handler.h +++ b/src/components/include/protocol_handler/protocol_handler.h @@ -108,6 +108,23 @@ class ProtocolHandler { virtual const ProtocolHandlerSettings& get_settings() const = 0; virtual SessionObserver& get_session_observer() = 0; + /** + * \brief Called by connection handler to notify the result of + * OnSessionStartedCallback(). + * \param session_id Generated session ID, will be 0 if session is not + * started + * \param hash_id Generated Hash ID + * \param protection whether the service will be protected + * \param rejected_params list of parameters' name that are rejected. + * Only valid when session_id is 0. Note, even if session_id is 0, the + * list may be empty. + */ + virtual void NotifySessionStartedResult( + uint8_t session_id, + uint32_t hash_id, + bool protection, + std::vector& rejected_params) = 0; + protected: /** * \brief Destructor diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h index a5901baf0b..70035b5a3c 100644 --- a/src/components/include/protocol_handler/session_observer.h +++ b/src/components/include/protocol_handler/session_observer.h @@ -39,6 +39,9 @@ #ifdef ENABLE_SECURITY #include "security_manager/ssl_context.h" #endif // ENABLE_SECURITY + +struct BsonObject; + /** *\namespace protocol_handlerHandler *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality. @@ -64,21 +67,21 @@ class SessionObserver { /** * \brief Callback function used by ProtocolHandler * when Mobile Application initiates start of new session. + * Result must be notified through NotifySessionStartedResult(). * \param connection_handle Connection identifier within which session * has to be started. * \param sessionId Identifier of the session to be start * \param service_type Type of service * \param protocol_version Version of protocol * \param is_protected would be service protected - * \param hash_id pointer for session hash identifier, uint32_t* hash_id - * \return uint32_t Id (number) of new session if successful, otherwise 0. + * \param params configuration parameters specified by mobile */ - virtual uint32_t OnSessionStartedCallback( + virtual void OnSessionStartedCallback( const transport_manager::ConnectionUID connection_handle, const uint8_t sessionId, const protocol_handler::ServiceType& service_type, const bool is_protected, - uint32_t* hash_id) = 0; + const BsonObject *params) = 0; // DEPRECATED virtual uint32_t OnSessionEndedCallback( diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index fb15435ca0..8d1bb756c2 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -261,6 +261,11 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD0(OnTimerSendTTSGlobalProperties, void()); MOCK_METHOD0(OnLowVoltage, void()); MOCK_METHOD0(OnWakeUp, void()); + MOCK_METHOD4(OnStreamingConfigured, + void(uint32_t app_id, + protocol_handler::ServiceType service_type, + bool result, + std::vector& rejected_params)); }; } // namespace application_manager_test diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h index e17224b097..b6af1e1f15 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler.h +++ b/src/components/include/test/connection_handler/mock_connection_handler.h @@ -96,6 +96,8 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler { MOCK_METHOD0(get_device_discovery_starter, DevicesDiscoveryStarter&()); MOCK_CONST_METHOD1(GetConnectedDevicesMAC, void(std::vector& macs)); + MOCK_METHOD2(NotifyServiceStartedResult, + void(bool result, std::vector& rejected_params)); }; } // namespace connection_handler_test diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h index 6ca4557b35..d9a12d35c2 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h +++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h @@ -48,10 +48,11 @@ class MockConnectionHandlerObserver MOCK_METHOD0(OnFindNewApplicationsRequest, void()); MOCK_METHOD1(RemoveDevice, void(const connection_handler::DeviceHandle& device_handle)); - MOCK_METHOD3(OnServiceStartedCallback, - bool(const connection_handler::DeviceHandle& device_handle, + MOCK_METHOD4(OnServiceStartedCallback, + void(const connection_handler::DeviceHandle& device_handle, const int32_t& session_key, - const protocol_handler::ServiceType& type)); + const protocol_handler::ServiceType& type, + const BsonObject* params)); MOCK_METHOD3( OnServiceEndedCallback, void(const int32_t& session_key, diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h index 44287edd4d..acb06ea6df 100644 --- a/src/components/include/test/protocol_handler/mock_protocol_handler.h +++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h @@ -62,6 +62,11 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler { MOCK_CONST_METHOD0(get_settings, const ::protocol_handler::ProtocolHandlerSettings&()); MOCK_METHOD0(get_session_observer, protocol_handler::SessionObserver&()); + MOCK_METHOD4(NotifySessionStartedResult, + void(uint8_t session_id, + uint32_t hash_id, + bool protection, + std::vector& rejected_params)); }; } // namespace protocol_handler_test } // namespace components diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h index 0a86a29db5..40137c2e00 100644 --- a/src/components/include/test/protocol_handler/mock_session_observer.h +++ b/src/components/include/test/protocol_handler/mock_session_observer.h @@ -46,13 +46,12 @@ namespace protocol_handler_test { */ class MockSessionObserver : public ::protocol_handler::SessionObserver { public: - MOCK_METHOD5( - OnSessionStartedCallback, - uint32_t(const transport_manager::ConnectionUID connection_handle, - const uint8_t sessionId, - const protocol_handler::ServiceType& service_type, - const bool is_protected, - uint32_t* hash_id)); + MOCK_METHOD5(OnSessionStartedCallback, + void(const transport_manager::ConnectionUID connection_handle, + const uint8_t sessionId, + const protocol_handler::ServiceType& service_type, + const bool is_protected, + const BsonObject* params)); MOCK_METHOD4( OnSessionEndedCallback, uint32_t(const transport_manager::ConnectionUID connection_handle, diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index bb6483dd82..2370fd730f 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -349,6 +349,23 @@ class ProtocolHandlerImpl SessionObserver& get_session_observer() OVERRIDE; + /** + * \brief Called by connection handler to notify the result of + * OnSessionStartedCallback(). + * \param session_id Generated session ID, will be 0 if session is not + * started + * \param hash_id Generated Hash ID + * \param protection whether the service will be protected + * \param rejected_params list of parameters' name that are rejected. + * Only valid when session_id is 0. Note, even if session_id is 0, the + * list may be empty. + */ + void NotifySessionStartedResult( + uint8_t session_id, + uint32_t hash_id, + bool protection, + std::vector& rejected_params) OVERRIDE; + #ifdef BUILD_TESTS const impl::FromMobileQueue& get_from_mobile_queue() const { return raw_ford_messages_from_mobile_; @@ -505,7 +522,7 @@ class ProtocolHandlerImpl RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet); - RESULT_CODE HandleControlMessageStartSession(const ProtocolPacket& packet); + RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet); RESULT_CODE HandleControlMessageHeartBeat(const ProtocolPacket& packet); @@ -618,6 +635,9 @@ class ProtocolHandlerImpl sync_primitives::Lock protocol_observers_lock_; + // we need thread-safe queue + utils::MessageQueue start_session_frame_queue_; + #ifdef TELEMETRY_MONITOR PHTelemetryObserver* metric_observer_; #endif // TELEMETRY_MONITOR diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 938583125d..3592ce692d 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -81,6 +81,7 @@ ProtocolHandlerImpl::ProtocolHandlerImpl( "PH FromMobile", this, threads::ThreadOptions(kStackSize)) , raw_ford_messages_to_mobile_( "PH ToMobile", this, threads::ThreadOptions(kStackSize)) + , start_session_frame_queue_() #ifdef TELEMETRY_MONITOR , metric_observer_(NULL) #endif // TELEMETRY_MONITOR @@ -1029,7 +1030,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessage( switch (packet->frame_data()) { case FRAME_DATA_START_SERVICE: { LOG4CXX_TRACE(logger_, "FrameData: StartService"); - return HandleControlMessageStartSession(*packet); + return HandleControlMessageStartSession(packet); } case FRAME_DATA_END_SERVICE: { LOG4CXX_TRACE(logger_, "FrameData: StopService"); @@ -1253,37 +1254,63 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { #endif // ENABLE_SECURITY RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( - const ProtocolPacket& packet) { + const ProtocolFramePtr packet) { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG( logger_, - "Protocol version:" << static_cast(packet.protocol_version())); - const ServiceType service_type = ServiceTypeFromByte(packet.service_type()); - const uint8_t protocol_version = packet.protocol_version(); + "Protocol version:" << static_cast(packet->protocol_version())); + const ServiceType service_type = ServiceTypeFromByte(packet->service_type()); + const uint8_t protocol_version = packet->protocol_version(); + BsonObject bson_obj = bson_object_from_bytes(packet->data()); #ifdef ENABLE_SECURITY const bool protection = // Protocolo version 1 is not support protection - (protocol_version > PROTOCOL_VERSION_1) ? packet.protection_flag() + (protocol_version > PROTOCOL_VERSION_1) ? packet->protection_flag() : false; #else const bool protection = false; #endif // ENABLE_SECURITY - uint32_t hash_id; - const ConnectionID connection_id = packet.connection_id(); - const uint32_t session_id = session_observer_.OnSessionStartedCallback( - connection_id, packet.session_id(), service_type, protection, &hash_id); + const ConnectionID connection_id = packet->connection_id(); + + start_session_frame_queue_.push(packet); + + session_observer_.OnSessionStartedCallback( + connection_id, packet->session_id(), service_type, protection, &bson_obj); + bson_object_deinitialize(&bson_obj); + + return RESULT_OK; +} + +void ProtocolHandlerImpl::NotifySessionStartedResult( + uint8_t session_id, + uint32_t hash_id, + bool protection, + std::vector& rejected_params) { + + ProtocolFramePtr packet; + bool available = start_session_frame_queue_.pop(packet); + if (!available) { + LOG4CXX_ERROR(logger_, + "Cannot find Session Started packet"); + return; + } + + const ServiceType service_type = ServiceTypeFromByte(packet->service_type()); + const uint8_t protocol_version = packet->protocol_version(); + const ConnectionID connection_id = packet->connection_id(); if (0 == session_id) { LOG4CXX_WARN(logger_, "Refused by session_observer to create service " << static_cast(service_type) << " type."); SendStartSessionNAck(connection_id, - packet.session_id(), + session_id, protocol_version, - packet.service_type()); - return RESULT_OK; + packet->service_type(), + rejected_params); + return; } #ifdef ENABLE_SECURITY @@ -1304,19 +1331,19 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( // Start service without protection SendStartSessionAck(connection_id, session_id, - packet.protocol_version(), + packet->protocol_version(), hash_id, - packet.service_type(), + packet->service_type(), PROTECTION_OFF); - return RESULT_OK; + return; } ProtocolPacket::ProtocolVersion* fullVersion; std::vector rejectedParams; // Can't check protocol_version because the first packet is v1, but there // could still be a payload, in which case we can get the real protocol // version - if (packet.service_type() == kRpc && packet.data_size() != 0) { - BsonObject obj = bson_object_from_bytes(packet.data()); + if (packet->service_type() == kRpc && packet->data_size() != 0) { + BsonObject obj = bson_object_from_bytes(packet->data()); fullVersion = new ProtocolPacket::ProtocolVersion( std::string(bson_object_get_string(&obj, strings::protocol_version))); bson_object_deinitialize(&obj); @@ -1329,9 +1356,9 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( } if (!rejectedParams.empty()) { SendStartSessionNAck(connection_id, - packet.session_id(), + packet->session_id(), protocol_version, - packet.service_type(), + packet->service_type(), rejectedParams); } else if (ssl_context->IsInitCompleted()) { // mark service as protected @@ -1339,9 +1366,9 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( // Start service as protected with current SSLContext SendStartSessionAck(connection_id, session_id, - packet.protocol_version(), + packet->protocol_version(), hash_id, - packet.service_type(), + packet->service_type(), PROTECTION_ON, *fullVersion); } else { @@ -1351,7 +1378,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( session_observer_, connection_id, session_id, - packet.protocol_version(), + packet->protocol_version(), hash_id, service_type, get_settings().force_protected_service(), @@ -1365,11 +1392,11 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( LOG4CXX_DEBUG(logger_, "Protection establishing for connection " << connection_key << " is in progress"); - return RESULT_OK; + return; } #endif // ENABLE_SECURITY - if (packet.service_type() == kRpc && packet.data_size() != 0) { - BsonObject obj = bson_object_from_bytes(packet.data()); + if (packet->service_type() == kRpc && packet->data_size() != 0) { + BsonObject obj = bson_object_from_bytes(packet->data()); ProtocolPacket::ProtocolVersion fullVersion( bson_object_get_string(&obj, strings::protocol_version)); bson_object_deinitialize(&obj); @@ -1378,18 +1405,18 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( // Start service without protection SendStartSessionAck(connection_id, session_id, - packet.protocol_version(), + packet->protocol_version(), hash_id, - packet.service_type(), + packet->service_type(), PROTECTION_OFF, fullVersion); } else { std::vector rejectedParams( 1, std::string(strings::protocol_version)); SendStartSessionNAck(connection_id, - packet.session_id(), + packet->session_id(), protocol_version, - packet.service_type(), + packet->service_type(), rejectedParams); } @@ -1397,12 +1424,11 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( // Start service without protection SendStartSessionAck(connection_id, session_id, - packet.protocol_version(), + packet->protocol_version(), hash_id, - packet.service_type(), + packet->service_type(), PROTECTION_OFF); } - return RESULT_OK; } RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat( diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index 66226825ba..2729254869 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -98,6 +98,7 @@ using ::testing::ReturnRefOfCopy; using ::testing::ReturnNull; using ::testing::An; using ::testing::AnyOf; +using ::testing::ByRef; using ::testing::DoAll; using ::testing::_; using ::testing::Invoke; @@ -106,6 +107,11 @@ using ::testing::SetArgPointee; typedef std::vector UCharDataVector; +// custom action to call a member function with 4 arguments +ACTION_P6(InvokeMemberFuncWithArg4, ptr, memberFunc, a, b, c, d) { + (ptr->*memberFunc)(a, b, c, d); +} + namespace { const uint32_t kAsyncExpectationsTimeout = 10000u; } @@ -179,6 +185,7 @@ class ProtocolHandlerImplTest : public ::testing::Test { void AddSession(const ::utils::SharedPtr& waiter, uint32_t& times) { + using namespace protocol_handler; ASSERT_TRUE(NULL != waiter.get()); AddConnection(); @@ -192,6 +199,7 @@ class ProtocolHandlerImplTest : public ::testing::Test { // use protection OFF const bool callback_protection_flag = PROTECTION_OFF; #endif // ENABLE_SECURITY + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, @@ -202,7 +210,14 @@ class ProtocolHandlerImplTest : public ::testing::Test { _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(session_id))); + WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), + InvokeMemberFuncWithArg4( + protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + callback_protection_flag, + ByRef(empty)))); times++; // Expect send Ack with PROTECTION_OFF (on no Security Manager) @@ -342,11 +357,13 @@ TEST_F(ProtocolHandlerImplTest, RecieveOnUnknownConnection) { */ TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverReject) { + using namespace protocol_handler; const int call_times = 5; AddConnection(); TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -358,8 +375,14 @@ TEST_F(ProtocolHandlerImplTest, .Times(call_times) . // Return sessions start rejection - WillRepeatedly( - DoAll(NotifyTestAsyncWaiter(&waiter), Return(SESSION_START_REJECT))); + WillRepeatedly(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + SESSION_START_REJECT, + HASH_ID_WRONG, + PROTECTION_OFF, + ByRef(empty)))); times += call_times; // Expect send NAck @@ -390,6 +413,7 @@ TEST_F(ProtocolHandlerImplTest, * OFF */ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) { + using namespace protocol_handler; const int call_times = 5; AddConnection(); #ifdef ENABLE_SECURITY @@ -403,6 +427,7 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) { TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -414,8 +439,14 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) { .Times(call_times) . // Return sessions start rejection - WillRepeatedly( - DoAll(NotifyTestAsyncWaiter(&waiter), Return(SESSION_START_REJECT))); + WillRepeatedly(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + SESSION_START_REJECT, + HASH_ID_WRONG, + callback_protection_flag, + ByRef(empty)))); times += call_times; // Expect send NAck with encryption OFF @@ -445,11 +476,13 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) { */ TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_SessionObserverAccept) { + using namespace protocol_handler; AddConnection(); const ServiceType start_service = kRpc; TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -457,7 +490,14 @@ TEST_F(ProtocolHandlerImplTest, connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_OFF, + ByRef(empty)))); times++; SetProtocolVersion2(); @@ -567,6 +607,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) { * Check session_observer with PROTECTION_OFF and Ack with PROTECTION_OFF */ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { + using namespace protocol_handler; ::utils::SharedPtr waiter = utils::MakeShared(); uint32_t times = 0; @@ -576,6 +617,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { // Add security manager AddSecurityManager(); const ServiceType start_service = kRpc; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -583,7 +625,14 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_OFF, + ByRef(empty)))); times++; SetProtocolVersion2(); @@ -612,6 +661,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { * PROTECTION_OFF */ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) { + using namespace protocol_handler; AddConnection(); // Add security manager AddSecurityManager(); @@ -619,6 +669,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) { TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -626,7 +677,14 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) { connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_OFF, + ByRef(empty)))); times++; SetProtocolVersion2(); @@ -646,12 +704,14 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) { * ProtocolHandler shall send Ack with PROTECTION_OFF on fail SLL creation */ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) { + using namespace protocol_handler; AddConnection(); AddSecurityManager(); const ServiceType start_service = kRpc; TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -659,7 +719,14 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) { connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_ON, + ByRef(empty)))); times++; SetProtocolVersion2(); @@ -688,12 +755,14 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) { */ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_SSLInitialized) { + using namespace protocol_handler; AddConnection(); AddSecurityManager(); const ServiceType start_service = kRpc; TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -701,7 +770,14 @@ TEST_F(ProtocolHandlerImplTest, connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_ON, + ByRef(empty)))); times++; SetProtocolVersion2(); @@ -743,12 +819,14 @@ TEST_F(ProtocolHandlerImplTest, */ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeFail) { + using namespace protocol_handler; AddConnection(); AddSecurityManager(); const ServiceType start_service = kRpc; TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -756,7 +834,14 @@ TEST_F(ProtocolHandlerImplTest, connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_ON, + ByRef(empty)))); times++; std::vector services; @@ -818,6 +903,7 @@ TEST_F(ProtocolHandlerImplTest, */ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeSuccess) { + using namespace protocol_handler; AddConnection(); AddSecurityManager(); const ServiceType start_service = kRpc; @@ -829,6 +915,7 @@ TEST_F(ProtocolHandlerImplTest, TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -836,7 +923,14 @@ TEST_F(ProtocolHandlerImplTest, connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_ON, + ByRef(empty)))); times++; // call new SSLContext creation @@ -904,6 +998,7 @@ TEST_F(ProtocolHandlerImplTest, TEST_F( ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeSuccess_ServiceProtectedBefore) { + using namespace protocol_handler; AddConnection(); AddSecurityManager(); const ServiceType start_service = kRpc; @@ -914,6 +1009,7 @@ TEST_F( TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -921,7 +1017,14 @@ TEST_F( connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_ON, + ByRef(empty)))); times++; // call new SSLContext creation @@ -987,6 +1090,7 @@ TEST_F( */ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_HandshakeSuccess_SSLIsNotPending) { + using namespace protocol_handler; AddConnection(); AddSecurityManager(); const ServiceType start_service = kRpc; @@ -997,6 +1101,7 @@ TEST_F(ProtocolHandlerImplTest, TestAsyncWaiter waiter; uint32_t times = 0; + std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -1004,7 +1109,14 @@ TEST_F(ProtocolHandlerImplTest, connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) . // Return sessions start success - WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(session_id))); + WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + session_id, + HASH_ID_WRONG, + PROTECTION_ON, + ByRef(empty)))); times++; // call new SSLContext creation -- cgit v1.2.1 From 1ce0993636e0448c55ec0bccc018736c0395dfba Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Mon, 31 Jul 2017 21:07:13 +0900 Subject: Add unit tests for connection handler --- .../test/connection_handler_impl_test.cc | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc index a8254af646..efd22fe419 100644 --- a/src/components/connection_handler/test/connection_handler_impl_test.cc +++ b/src/components/connection_handler/test/connection_handler_impl_test.cc @@ -1065,6 +1065,29 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) { connection_handler_->set_protocol_handler(NULL); } +TEST_F(ConnectionHandlerTest, StartService_withServices_withParams) { + AddTestDeviceConnection(); + AddTestSession(); + + uint32_t start_video = 0; + // create a dummy pointer + int dummy = 0; + std::vector empty; + BsonObject* dummy_param = reinterpret_cast(&dummy); + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, empty)) + .WillOnce(DoAll(SaveArg<0>(&start_video), SaveArg<1>(&out_hash_id_))); + + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kMobileNav, PROTECTION_OFF, dummy_param); + EXPECT_EQ(start_session_id_, start_video); + CheckServiceExists(uid_, start_session_id_, kMobileNav, true); + EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); + + connection_handler_->set_protocol_handler(NULL); +} + TEST_F(ConnectionHandlerTest, ServiceStop_UnExistSession) { AddTestDeviceConnection(); uint32_t dummy_hash = 0u; @@ -1187,6 +1210,78 @@ TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) { EXPECT_NE(0u, new_session_id); } +TEST_F(ConnectionHandlerTest, ServiceStarted_Video_SUCCESS) { + AddTestDeviceConnection(); + AddTestSession(); + + int dummy = 0; + BsonObject* dummy_params = reinterpret_cast(&dummy); + + connection_handler_test::MockConnectionHandlerObserver + mock_connection_handler_observer; + connection_handler_->set_connection_handler_observer( + &mock_connection_handler_observer); + uint32_t session_key = + connection_handler_->KeyFromPair(uid_, start_session_id_); + std::vector empty; + EXPECT_CALL(mock_connection_handler_observer, + OnServiceStartedCallback( + device_handle_, session_key, kMobileNav, dummy_params)) + .WillOnce(InvokeMemberFuncWithArg2( + connection_handler_, + &ConnectionHandler::NotifyServiceStartedResult, + true, + ByRef(empty))); + + // confirm that NotifySessionStartedResult() is called + uint32_t new_session_id = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, false, empty)) + .WillOnce(DoAll(SaveArg<0>(&new_session_id), SaveArg<1>(&out_hash_id_))); + + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kMobileNav, PROTECTION_OFF, dummy_params); + + EXPECT_NE(0u, new_session_id); +} + +TEST_F(ConnectionHandlerTest, ServiceStarted_Video_FAILURE) { + AddTestDeviceConnection(); + AddTestSession(); + + int dummy = 0; + BsonObject* dummy_params = reinterpret_cast(&dummy); + + connection_handler_test::MockConnectionHandlerObserver + mock_connection_handler_observer; + connection_handler_->set_connection_handler_observer( + &mock_connection_handler_observer); + uint32_t session_key = + connection_handler_->KeyFromPair(uid_, start_session_id_); + std::vector empty; + EXPECT_CALL(mock_connection_handler_observer, + OnServiceStartedCallback( + device_handle_, session_key, kMobileNav, dummy_params)) + .WillOnce(InvokeMemberFuncWithArg2( + connection_handler_, + &ConnectionHandler::NotifyServiceStartedResult, + false, + ByRef(empty))); + + // confirm that NotifySessionStartedResult() is called + uint32_t new_session_id = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, false, empty)) + .WillOnce(DoAll(SaveArg<0>(&new_session_id), SaveArg<1>(&out_hash_id_))); + + connection_handler_->OnSessionStartedCallback( + uid_, start_session_id_, kMobileNav, PROTECTION_OFF, dummy_params); + + EXPECT_EQ(0u, new_session_id); +} + TEST_F(ConnectionHandlerTest, SessionStarted_StartSession_SecureSpecific_Unprotect) { EXPECT_CALL(mock_connection_handler_settings, heart_beat_timeout()) -- cgit v1.2.1 From eb9ff61c81dab06b0bb237276ded05a36e96863e Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Mon, 31 Jul 2017 16:09:34 +0900 Subject: Add unit tests for application manager --- .../application_manager/application_manager_impl.h | 6 + .../src/application_manager_impl.cc | 9 + .../application_manager/test/CMakeLists.txt | 6 +- .../test/application_manager_impl_test.cc | 428 +++++++++++++++++++++ 4 files changed, 448 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 47a77a1f97..d485d006a8 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1542,6 +1542,12 @@ class ApplicationManagerImpl volatile bool is_stopping_; +#ifdef BUILD_TESTS + // Methods for test usage + public: + void AddMockApplication(ApplicationSharedPtr mock_app); +#endif + DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl); }; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index a76edc2747..5c10bcba03 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -3753,4 +3753,13 @@ std::vector ApplicationManagerImpl::ConvertRejectedParamList( return output; } +#ifdef BUILD_TESTS +void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) { + applications_list_lock_.Acquire(); + applications_.insert(mock_app); + apps_size_ = applications_.size(); + applications_list_lock_.Release(); +} +#endif // BUILD_TESTS + } // namespace application_manager diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt index dba8d99a62..579fa787b9 100644 --- a/src/components/application_manager/test/CMakeLists.txt +++ b/src/components/application_manager/test/CMakeLists.txt @@ -51,6 +51,7 @@ include_directories( ${COMPONENTS_DIR}/security_manager/include/ ${COMPONENTS_DIR}/policy/test/include/ ${COMPONENTS_DIR}/application_manager/test/include/ + ${BSON_INCLUDE_DIRECTORY} ) set(testSources @@ -68,7 +69,7 @@ set(testSources ${AM_TEST_DIR}/usage_statistics_test.cc ${AM_TEST_DIR}/policy_handler_test.cc ${AM_TEST_DIR}/mock_message_helper.cc - #${AM_TEST_DIR}/application_manager_impl_test.cc + ${AM_TEST_DIR}/application_manager_impl_test.cc ) @@ -97,6 +98,8 @@ set(LIBRARIES Resumption ProtocolHandler SecurityManager + bson -L${BSON_LIBS_DIRECTORY} + emhashmap -L${EMHASHMAP_LIBS_DIRECTORY} ) if (${CMAKE_SYSTEM_NAME} MATCHES "QNX") @@ -123,6 +126,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}" ) create_test("application_manager_test" "${testSources}" "${LIBRARIES}") +add_dependencies("application_manager_test" libbson) create_test("request_controller_test" "${RequestController_SOURCES}" "${LIBRARIES}") # TODO [AKozoriz] : Fix not buildable tests diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc index 5b232e1dfc..ad6811afb1 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -32,11 +32,13 @@ #include #include #include +#include #include "gtest/gtest.h" #include "application_manager/application.h" #include "application_manager/application_impl.h" #include "application_manager/application_manager_impl.h" +#include "application_manager/mock_application.h" #include "application_manager/mock_application_manager_settings.h" #include "application_manager/mock_resumption_data.h" #include "application_manager/resumption/resume_ctrl_impl.h" @@ -61,14 +63,22 @@ namespace policy_test = test::components::policy_handler_test; namespace con_test = connection_handler_test; using testing::_; +using ::testing::ByRef; +using ::testing::DoAll; using ::testing::Mock; using ::testing::Return; using ::testing::ReturnRef; using ::testing::NiceMock; +using ::testing::SaveArg; using ::testing::SetArgPointee; using namespace application_manager; +// custom action to call a member function with 4 arguments +ACTION_P6(InvokeMemberFuncWithArg4, ptr, memberFunc, a, b, c, d) { + (ptr->*memberFunc)(a, b, c, d); +} + namespace { const std::string kDirectoryName = "./test_storage"; const uint32_t kTimeout = 10000u; @@ -124,8 +134,14 @@ class ApplicationManagerImplTest : public ::testing::Test { .WillByDefault(ReturnRef(kTimeout)); app_manager_impl_.reset(new am::ApplicationManagerImpl( mock_application_manager_settings_, mock_policy_settings_)); + mock_app_ptr_ = utils::SharedPtr(new MockApplication()); ASSERT_TRUE(app_manager_impl_.get()); + ASSERT_TRUE(mock_app_ptr_.get()); + } + + void AddMockApplication() { + app_manager_impl_->AddMockApplication(mock_app_ptr_); } NiceMock mock_policy_settings_; @@ -139,6 +155,7 @@ class ApplicationManagerImplTest : public ::testing::Test { application_manager::MockMessageHelper* mock_message_helper_; uint32_t app_id_; application_manager::MessageHelper* message_helper_; + utils::SharedPtr mock_app_ptr_; }; TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) { @@ -195,6 +212,417 @@ TEST_F( EXPECT_TRUE(result.find(app_id_) != result.end()); } +TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_RpcService) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kRpc; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, NULL); + + // check: return value is true and list is empty + EXPECT_TRUE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_UnknownApp) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kInvalidServiceType; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(456)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, NULL); + + // check: return value is false and list is empty + EXPECT_FALSE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_UnknownService) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kInvalidServiceType; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, NULL); + + // check: return value is false and list is empty + EXPECT_FALSE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_VideoServiceStart) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kMobileNav; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true)); + EXPECT_CALL(*mock_app_ptr_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + // check: SetVideoConfig() should not be called, StartStreaming() is called + EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); + EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return()); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, NULL); + + // check: return value is true and list is empty + EXPECT_TRUE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +TEST_F(ApplicationManagerImplTest, + OnServiceStartedCallback_VideoServiceNotStart1) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kMobileNav; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + // is_navi() is false + EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(false)); + EXPECT_CALL(*mock_app_ptr_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + // check: SetVideoConfig() and StartStreaming() should not be called + EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); + EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, NULL); + + // check: return value is false and list is empty + EXPECT_FALSE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +TEST_F(ApplicationManagerImplTest, + OnServiceStartedCallback_VideoServiceNotStart2) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kMobileNav; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true)); + // HMI level is not FULL nor LIMITED + EXPECT_CALL(*mock_app_ptr_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_BACKGROUND)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + // check: SetVideoConfig() and StartStreaming() should not be called + EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); + EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, NULL); + + // check: return value is false and list is empty + EXPECT_FALSE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +TEST_F(ApplicationManagerImplTest, + OnServiceStartedCallback_VideoSetConfig_SUCCESS) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kMobileNav; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true)); + EXPECT_CALL(*mock_app_ptr_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_LIMITED)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + BsonObject input_params; + bson_object_initialize_default(&input_params); + char protocol_version[] = "1.0.0"; + bson_object_put_string(&input_params, "protocolVersion", protocol_version); + bson_object_put_int64(&input_params, "mtu", 100); + char protocol_name[] = "RTP"; + bson_object_put_string(&input_params, "videoProtocol", protocol_name); + char codec_name[] = "VP9"; + bson_object_put_string(&input_params, "videoCodec", codec_name); + bson_object_put_int32(&input_params, "desiredHeight", 640); + bson_object_put_int32(&input_params, "desiredWidth", 480); + + smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); + converted_params["protocol"] = hmi_apis::Common_VideoStreamingProtocol::RTP; + converted_params["codec"] = hmi_apis::Common_VideoStreamingCodec::VP9; + converted_params["height"] = 640; + converted_params["width"] = 480; + + std::vector empty; + + // check: SetVideoConfig() and StartStreaming() are called + EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(service_type, converted_params)) + .WillOnce(DoAll(InvokeMemberFuncWithArg4( + app_manager_impl_.get(), + &ApplicationManagerImpl::OnStreamingConfigured, + session_key, + service_type, + true, + ByRef(empty)), + Return(true))); + EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return()); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, &input_params); + + // check: return value is true and list is empty + EXPECT_TRUE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +static bool ValidateList(std::vector& expected, + std::vector& actual) { + if (expected.size() != actual.size()) { + return false; + } + for (unsigned int i = 0; i < expected.size(); i++) { + std::string& param = expected[i]; + unsigned int j; + for (j = 0; j < actual.size(); j++) { + if (param == actual[j]) { + break; + } + } + if (j == actual.size()) { + // not found + return false; + } + } + return true; +} + +TEST_F(ApplicationManagerImplTest, + OnServiceStartedCallback_VideoSetConfig_FAILURE) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kMobileNav; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true)); + EXPECT_CALL(*mock_app_ptr_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + BsonObject input_params; + bson_object_initialize_default(&input_params); + char protocol_version[] = "1.0.0"; + bson_object_put_string(&input_params, "protocolVersion", protocol_version); + bson_object_put_int64(&input_params, "mtu", 100); + char protocol_name[] = "RTP"; + bson_object_put_string(&input_params, "videoProtocol", protocol_name); + char codec_name[] = "VP9"; + bson_object_put_string(&input_params, "videoCodec", codec_name); + bson_object_put_int32(&input_params, "desiredHeight", 640); + bson_object_put_int32(&input_params, "desiredWidth", 480); + + smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); + converted_params["protocol"] = hmi_apis::Common_VideoStreamingProtocol::RTP; + converted_params["codec"] = hmi_apis::Common_VideoStreamingCodec::VP9; + converted_params["height"] = 640; + converted_params["width"] = 480; + + std::vector rejected_list; + rejected_list.push_back(std::string("protocol")); + rejected_list.push_back(std::string("codec")); + + // simulate HMI returning negative response + EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(service_type, converted_params)) + .WillOnce(DoAll(InvokeMemberFuncWithArg4( + app_manager_impl_.get(), + &ApplicationManagerImpl::OnStreamingConfigured, + session_key, + service_type, + false, + ByRef(rejected_list)), + Return(true))); + + // check: StartStreaming() should not be called + EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).Times(0); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, &input_params); + + // check: return value is false + EXPECT_FALSE(result); + + // check: rejected param list contains "videoProtocol" and "videoCodec" + ASSERT_EQ(2u, rejected_params.size()); + std::vector expected_list; + expected_list.push_back(std::string("videoProtocol")); + expected_list.push_back(std::string("videoCodec")); + ASSERT_TRUE(ValidateList(expected_list, rejected_params)); +} + +TEST_F(ApplicationManagerImplTest, + OnServiceStartedCallback_VideoServiceWithoutVideoParams) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kMobileNav; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true)); + EXPECT_CALL(*mock_app_ptr_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + BsonObject input_params; + bson_object_initialize_default(&input_params); + char protocol_version[] = "1.0.0"; + bson_object_put_string(&input_params, "protocolVersion", protocol_version); + bson_object_put_int64(&input_params, "mtu", 100); + + // check: SetVideoConfig() should not be called, StartStreaming() is called + EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); + EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return()); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, &input_params); + + // check: return value is true and list is empty + EXPECT_TRUE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_AudioServiceStart) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kAudio; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true)); + EXPECT_CALL(*mock_app_ptr_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + // check: SetVideoConfig() should not be called, StartStreaming() is called + EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); + EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return()); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, NULL); + + // check: return value is true and list is empty + EXPECT_TRUE(result); + EXPECT_TRUE(rejected_params.empty()); +} + +TEST_F(ApplicationManagerImplTest, + OnServiceStartedCallback_AudioServiceWithParams) { + AddMockApplication(); + + const connection_handler::DeviceHandle device_handle = 0; + const protocol_handler::ServiceType service_type = + protocol_handler::ServiceType::kAudio; + const int32_t session_key = 123; + EXPECT_CALL(*mock_app_ptr_, app_id()).WillRepeatedly(Return(session_key)); + EXPECT_CALL(*mock_app_ptr_, is_navi()).WillRepeatedly(Return(true)); + EXPECT_CALL(*mock_app_ptr_, hmi_level()) + .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL)); + + bool result = false; + std::vector rejected_params; + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) + .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + + BsonObject input_params; + bson_object_initialize_default(&input_params); + char protocol_version[] = "1.0.0"; + bson_object_put_string(&input_params, "protocolVersion", protocol_version); + bson_object_put_int64(&input_params, "mtu", 100); + char protocol_name[] = "RTP"; + bson_object_put_string(&input_params, "videoProtocol", protocol_name); + char codec_name[] = "VP9"; + bson_object_put_string(&input_params, "videoCodec", codec_name); + bson_object_put_int32(&input_params, "desiredHeight", 640); + bson_object_put_int32(&input_params, "desiredWidth", 480); + + // check: SetVideoConfig() should not be called, StartStreaming() is called + EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); + EXPECT_CALL(*mock_app_ptr_, StartStreaming(service_type)).WillOnce(Return()); + + app_manager_impl_->OnServiceStartedCallback( + device_handle, session_key, service_type, &input_params); + + // check: return value is true and list is empty + EXPECT_TRUE(result); + EXPECT_TRUE(rejected_params.empty()); +} + } // application_manager_test } // namespace components } // namespace test -- cgit v1.2.1 From d8d74ef50345e39408abf4ebc02956f346168838 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Mon, 31 Jul 2017 17:02:30 +0900 Subject: Add unit tests for application --- .../test/application_impl_test.cc | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index 8f00284772..228c5c9b16 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -657,6 +657,42 @@ TEST_F(ApplicationImplTest, UpdateHash_AppMngrNotSuspended) { EXPECT_TRUE(app_impl->is_application_data_changed()); } +TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingNotApproved) { + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendNaviSetVideoConfig(app_id, _, _)); + + smart_objects::SmartObject params; + app_impl->SetVideoConfig(protocol_handler::ServiceType::kMobileNav, params); +} + +TEST_F(ApplicationImplTest, SetVideoConfig_MobileNavi_StreamingApproved) { + app_impl->set_video_streaming_approved(true); + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendNaviSetVideoConfig(app_id, _, _)).Times(0); + + smart_objects::SmartObject params; + app_impl->SetVideoConfig(protocol_handler::ServiceType::kMobileNav, params); +} + +TEST_F(ApplicationImplTest, SetVideoConfig_NotMobileNavi) { + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendNaviSetVideoConfig(app_id, _, _)).Times(0); + + smart_objects::SmartObject params; + app_impl->SetVideoConfig(protocol_handler::ServiceType::kAudio, params); +} + +TEST_F(ApplicationImplTest, OnNaviSetVideoConfigDone) { + bool result = true; + std::vector empty; + EXPECT_CALL( + mock_application_manager_, + OnStreamingConfigured( + app_id, protocol_handler::ServiceType::kMobileNav, result, empty)); + + app_impl->OnNaviSetVideoConfigDone(result, empty); +} + TEST_F(ApplicationImplTest, StartStreaming_MobileNavi_StreamingNotApproved) { EXPECT_CALL(*MockMessageHelper::message_helper_mock(), SendNaviStartStream(app_id, _)); -- cgit v1.2.1 From 44d0cd192824a0b8485e34dc724c6b0938b58d9d Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Mon, 31 Jul 2017 19:34:34 +0900 Subject: Add unit tests for message helper --- .../test/message_helper/message_helper_test.cc | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc index 3471c02901..7b02d37b87 100644 --- a/src/components/application_manager/test/message_helper/message_helper_test.cc +++ b/src/components/application_manager/test/message_helper/message_helper_test.cc @@ -1026,6 +1026,38 @@ TEST_F(MessageHelperTest, std::find(status_array->begin(), status_array->end(), item_2_so)); } #endif + +TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) { + smart_objects::SmartObjectSPtr result; + EXPECT_CALL(mock_application_manager, ManageHMICommand(_)) + .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); + + int32_t app_id = 123; + smart_objects::SmartObject video_params(smart_objects::SmartType_Map); + video_params["protocol"] = hmi_apis::Common_VideoStreamingProtocol::RTP; + video_params["codec"] = hmi_apis::Common_VideoStreamingCodec::H264; + video_params["width"] = 640; + video_params["height"] = 480; + + MessageHelper::SendNaviSetVideoConfig( + app_id, mock_application_manager, video_params); + + EXPECT_EQ(hmi_apis::FunctionID::Navigation_SetVideoConfig, + (*result)[strings::params][strings::function_id].asInt()); + + smart_objects::SmartObject& msg_params = (*result)[strings::msg_params]; + EXPECT_TRUE(msg_params.keyExists("config")); + + EXPECT_TRUE(msg_params["config"].keyExists("protocol")); + EXPECT_EQ(1, msg_params["config"]["protocol"].asInt()); + EXPECT_TRUE(msg_params["config"].keyExists("codec")); + EXPECT_EQ(0, msg_params["config"]["codec"].asInt()); + EXPECT_TRUE(msg_params["config"].keyExists("width")); + EXPECT_EQ(640, msg_params["config"]["width"].asInt()); + EXPECT_TRUE(msg_params["config"].keyExists("height")); + EXPECT_EQ(480, msg_params["config"]["height"].asInt()); +} + } // namespace application_manager_test } // namespace components } // namespace test -- cgit v1.2.1 From f342423a98f8ea27c477620b221a57fb0f4c33cc Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Mon, 31 Jul 2017 22:04:52 +0900 Subject: Add unit tests for Navi.SetVideoConfig request/response --- .../hmi/navi_set_video_config_request_test.cc | 188 +++++++++++++++++++++ .../hmi/navi_set_video_config_response_test.cc | 79 +++++++++ 2 files changed, 267 insertions(+) create mode 100644 src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc create mode 100644 src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc new file mode 100644 index 0000000000..7acdbda7d0 --- /dev/null +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "application_manager/commands/hmi/navi_set_video_config_request.h" + +#include "gtest/gtest.h" +#include "utils/shared_ptr.h" +#include "smart_objects/smart_object.h" +#include "application_manager/smart_object_keys.h" +#include "application_manager/commands/command_request_test.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/hmi_interfaces.h" +#include "application_manager/mock_hmi_interface.h" +#include "application_manager/event_engine/event.h" + +namespace test { +namespace components { +namespace commands_test { +namespace hmi_commands_test { +namespace navi_set_video_config_request { + +using ::testing::_; +using ::testing::ReturnRef; +namespace am = ::application_manager; +using am::commands::MessageSharedPtr; +using am::commands::NaviSetVideoConfigRequest; +using am::event_engine::Event; + +namespace { +const hmi_apis::FunctionID::eType kEventID = + hmi_apis::FunctionID::Navigation_SetVideoConfig; +} // namespace + +typedef SharedPtr NaviSetVideoConfigRequestPtr; + +class NaviSetVideoConfigRequestTest + : public CommandRequestTest { + public: + NaviSetVideoConfigRequestTest() { + mock_app_ptr_ = CreateMockApp(); + ON_CALL(app_mngr_, hmi_interfaces()) + .WillByDefault(ReturnRef(mock_hmi_interfaces_)); + ON_CALL(app_mngr_, application_by_hmi_app(_)) + .WillByDefault(Return(mock_app_ptr_)); + } + + MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_; + MockAppPtr mock_app_ptr_; +}; + +TEST_F(NaviSetVideoConfigRequestTest, OnEvent_SUCCESS) { + NaviSetVideoConfigRequestPtr command = + CreateCommand(); + + MessageSharedPtr event_msg = CreateMessage(); + (*event_msg)[am::strings::params][am::hmi_response::code] = + hmi_apis::Common_Result::SUCCESS; + Event event(kEventID); + event.set_smart_object(*event_msg); + + std::vector empty; + EXPECT_CALL(*mock_app_ptr_, OnNaviSetVideoConfigDone(true, empty)).Times(1); + + command->on_event(event); +} + +static bool ValidateList(std::vector& expected, + std::vector& actual) { + if (expected.size() != actual.size()) { + return false; + } + for (unsigned int i = 0; i < expected.size(); i++) { + std::string& param = expected[i]; + unsigned int j; + for (j = 0; j < actual.size(); j++) { + if (param == actual[j]) { + break; + } + } + if (j == actual.size()) { + // not found + return false; + } + } + return true; +} + +TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { + MessageSharedPtr request_msg = CreateMessage(); + (*request_msg)[am::strings::msg_params]["config"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + (*request_msg)[am::strings::msg_params]["config"]["protocol"] = + hmi_apis::Common_VideoStreamingProtocol::RTP; + (*request_msg)[am::strings::msg_params]["config"]["codec"] = + hmi_apis::Common_VideoStreamingCodec::H265; + (*request_msg)[am::strings::msg_params]["config"]["height"] = 640; + (*request_msg)[am::strings::msg_params]["config"]["width"] = 480; + + NaviSetVideoConfigRequestPtr command = + CreateCommand(request_msg); + + MessageSharedPtr event_msg = CreateMessage(); + (*event_msg)[am::strings::params][am::hmi_response::code] = + hmi_apis::Common_Result::REJECTED; + + (*event_msg)[am::strings::msg_params]["rejectedParams"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + (*event_msg)[am::strings::msg_params]["rejectedParams"][0] = "codec"; + (*event_msg)[am::strings::msg_params]["rejectedParams"][1] = "protocol"; + Event event(kEventID); + event.set_smart_object(*event_msg); + + std::vector rejected_params; + EXPECT_CALL(*mock_app_ptr_, OnNaviSetVideoConfigDone(false, _)) + .WillOnce(SaveArg<1>(&rejected_params)); + + command->on_event(event); + + ASSERT_EQ(2u, rejected_params.size()); + std::vector expected_list; + expected_list.push_back(std::string("protocol")); + expected_list.push_back(std::string("codec")); + ASSERT_TRUE(ValidateList(expected_list, rejected_params)); +} + +TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE_WithoutParams) { + NaviSetVideoConfigRequestPtr command = + CreateCommand(); + + MessageSharedPtr event_msg = CreateMessage(); + (*event_msg)[am::strings::params][am::hmi_response::code] = + hmi_apis::Common_Result::REJECTED; + + Event event(kEventID); + event.set_smart_object(*event_msg); + + std::vector empty; + EXPECT_CALL(*mock_app_ptr_, OnNaviSetVideoConfigDone(false, empty)).Times(1); + + command->on_event(event); +} + +TEST_F(NaviSetVideoConfigRequestTest, OnTimeout) { + NaviSetVideoConfigRequestPtr command = + CreateCommand(); + + std::vector empty; + EXPECT_CALL(*mock_app_ptr_, OnNaviSetVideoConfigDone(false, empty)).Times(1); + + EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(1); + + command->onTimeOut(); +} + +} // namespace navi_set_video_config_request +} // namespace hmi_commands_test +} // namespace commands_test +} // namespace components +} // namespace test diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc new file mode 100644 index 0000000000..f99345ec58 --- /dev/null +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "gtest/gtest.h" +#include "application_manager/commands/commands_test.h" +#include "application_manager/commands/hmi/navi_set_video_config_response.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/mock_event_dispatcher.h" +#include "application_manager/mock_hmi_capabilities.h" +#include "application_manager/smart_object_keys.h" + +namespace test { +namespace components { +namespace commands_test { +namespace hmi_commands_test { +namespace navi_set_video_config_response { + +using utils::SharedPtr; +using application_manager::commands::NaviSetVideoConfigResponse; +using test::components::event_engine_test::MockEventDispatcher; +using testing::_; +using testing::ReturnRef; +using ::testing::NiceMock; + +typedef NiceMock< + ::test::components::application_manager_test::MockHMICapabilities> + MockHMICapabilities; + +class NaviSetVideoConfigResponseTest + : public CommandsTest {}; + +TEST_F(NaviSetVideoConfigResponseTest, RUN_SUCCESS) { + MessageSharedPtr msg = CreateMessage(); + + SharedPtr command( + CreateCommand(msg)); + + MockEventDispatcher mock_event_dispatcher; + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher)); + EXPECT_CALL(mock_event_dispatcher, raise_event(_)); + + command->Run(); +} + +} // namespace navi_set_video_config_response +} // namespace hmi_commands_test +} // namespace commands_test +} // namespace components +} // namespace test -- cgit v1.2.1 From 4b52869251a730f9f47ab17dd7f68417670e300a Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Sun, 30 Jul 2017 20:10:42 +0900 Subject: fix: build break in protocol_header_validator_test.cc --- .../protocol_handler/test/protocol_header_validator_test.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/protocol_handler/test/protocol_header_validator_test.cc b/src/components/protocol_handler/test/protocol_header_validator_test.cc index 3f1414aeab..e42ba96251 100644 --- a/src/components/protocol_handler/test/protocol_header_validator_test.cc +++ b/src/components/protocol_handler/test/protocol_header_validator_test.cc @@ -68,7 +68,7 @@ TEST_F(ProtocolHeaderValidatorTest, MaxPayloadSizeSetGet) { } TEST_F(ProtocolHeaderValidatorTest, MaxControlPayloadSizeSetGet) { - EXPECT_EQ(0, header_validator.max_control_payload_size()); + EXPECT_EQ(0u, header_validator.max_control_payload_size()); for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { header_validator.set_max_control_payload_size(value); EXPECT_EQ(value, header_validator.max_control_payload_size()); @@ -76,7 +76,7 @@ TEST_F(ProtocolHeaderValidatorTest, MaxControlPayloadSizeSetGet) { } TEST_F(ProtocolHeaderValidatorTest, MaxRpcPayloadSizeSetGet) { - EXPECT_EQ(0, header_validator.max_rpc_payload_size()); + EXPECT_EQ(0u, header_validator.max_rpc_payload_size()); for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { header_validator.set_max_rpc_payload_size(value); EXPECT_EQ(value, header_validator.max_rpc_payload_size()); @@ -84,7 +84,7 @@ TEST_F(ProtocolHeaderValidatorTest, MaxRpcPayloadSizeSetGet) { } TEST_F(ProtocolHeaderValidatorTest, MaxAudioPayloadSizeSetGet) { - EXPECT_EQ(0, header_validator.max_audio_payload_size()); + EXPECT_EQ(0u, header_validator.max_audio_payload_size()); for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { header_validator.set_max_audio_payload_size(value); EXPECT_EQ(value, header_validator.max_audio_payload_size()); @@ -92,7 +92,7 @@ TEST_F(ProtocolHeaderValidatorTest, MaxAudioPayloadSizeSetGet) { } TEST_F(ProtocolHeaderValidatorTest, MaxVideoPayloadSizeSetGet) { - EXPECT_EQ(0, header_validator.max_video_payload_size()); + EXPECT_EQ(0u, header_validator.max_video_payload_size()); for (size_t value = 0; value < MAXIMUM_FRAME_DATA_V3_SIZE * 2; ++value) { header_validator.set_max_video_payload_size(value); EXPECT_EQ(value, header_validator.max_video_payload_size()); -- cgit v1.2.1 From 1fa0c4892bff1805f4fe1490f69f99f7b2ca72b6 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Mon, 31 Jul 2017 21:42:18 +0900 Subject: fix: protect navi_service_status_ navi_service_status_ is accessed by multiple threads, so I think a protection is needed to avoid issue. --- .../application_manager/application_manager_impl.h | 1 + .../src/application_manager_impl.cc | 180 +++++++++++++-------- 2 files changed, 115 insertions(+), 66 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index d485d006a8..0ba294005c 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1516,6 +1516,7 @@ class ApplicationManagerImpl HmiInterfacesImpl hmi_interfaces_; NaviServiceStatusMap navi_service_status_; + sync_primitives::Lock navi_service_status_lock_; std::deque navi_app_to_stop_; std::deque navi_app_to_end_stream_; uint32_t navi_close_app_timeout_; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 5c10bcba03..539686bdf2 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1146,17 +1146,21 @@ bool ApplicationManagerImpl::StartNaviService( LOG4CXX_AUTO_TRACE(logger_); if (HMILevelAllowsStreaming(app_id, service_type)) { - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() == it) { - std::pair res = - navi_service_status_.insert( - std::pair >( - app_id, std::make_pair(false, false))); - if (!res.second) { - LOG4CXX_WARN(logger_, "Navi service refused"); - return false; + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() == it) { + std::pair res = + navi_service_status_.insert( + std::pair >( + app_id, std::make_pair(false, false))); + if (!res.second) { + LOG4CXX_WARN(logger_, "Navi service refused"); + return false; + } + it = res.first; } - it = res.first; } if (service_type == ServiceType::kMobileNav) { @@ -1201,18 +1205,22 @@ void ApplicationManagerImpl::OnStreamingConfigured( << service_type << ", result=" << result); if (result) { - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() == it) { - LOG4CXX_WARN(logger_, "Application not found in navi status map"); - connection_handler().NotifyServiceStartedResult(false, empty); - return; - } + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() == it) { + LOG4CXX_WARN(logger_, "Application not found in navi status map"); + connection_handler().NotifyServiceStartedResult(false, empty); + return; + } - // Fill NaviServices map. Set true to first value of pair if - // we've started video service or to second value if we've - // started audio service - service_type == ServiceType::kMobileNav ? it->second.first = true - : it->second.second = true; + // Fill NaviServices map. Set true to first value of pair if + // we've started video service or to second value if we've + // started audio service + service_type == ServiceType::kMobileNav ? it->second.first = true + : it->second.second = true; + } application(app_id)->StartStreaming(service_type); connection_handler().NotifyServiceStartedResult(true, empty); @@ -1228,15 +1236,19 @@ void ApplicationManagerImpl::StopNaviService( using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() == it) { - LOG4CXX_WARN(logger_, "No Information about navi service " << service_type); - } else { - // Fill NaviServices map. Set false to first value of pair if - // we've stopped video service or to second value if we've - // stopped audio service - service_type == ServiceType::kMobileNav ? it->second.first = false - : it->second.second = false; + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() == it) { + LOG4CXX_WARN(logger_, "No Information about navi service " << service_type); + } else { + // Fill NaviServices map. Set false to first value of pair if + // we've stopped video service or to second value if we've + // stopped audio service + service_type == ServiceType::kMobileNav ? it->second.first = false + : it->second.second = false; + } } ApplicationSharedPtr app = application(app_id); @@ -2678,9 +2690,13 @@ void ApplicationManagerImpl::UnregisterApplication( MessageHelper::SendUnsubscribedWayPoints(*this); } - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() != it) { - navi_service_status_.erase(it); + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() != it) { + navi_service_status_.erase(it); + } } // remove appID from tts_global_properties_app_list_ @@ -3021,9 +3037,17 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) { return; } - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() == it || - (!it->second.first && !it->second.second)) { + bool unregister = false; + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() == it || + (!it->second.first && !it->second.second)) { + unregister = true; + } + } + if (unregister) { ManageMobileCommand( MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( app_id, PROTOCOL_VIOLATION), @@ -3069,19 +3093,27 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) { return; } - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() == it) { - LOG4CXX_ERROR(logger_, "No info about navi servicies for app"); - return; + bool end_video = false; + bool end_audio = false; + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() == it) { + LOG4CXX_ERROR(logger_, "No info about navi servicies for app"); + return; + } + end_video = it->second.first; + end_audio = it->second.second; } if (connection_handler_) { - if (it->second.first) { + if (end_video) { LOG4CXX_DEBUG(logger_, "Going to end video service"); connection_handler().SendEndService(app_id, ServiceType::kMobileNav); app->StopStreamingForce(ServiceType::kMobileNav); } - if (it->second.second) { + if (end_audio) { LOG4CXX_DEBUG(logger_, "Going to end audio service"); connection_handler().SendEndService(app_id, ServiceType::kAudio); app->StopStreamingForce(ServiceType::kAudio); @@ -3203,18 +3235,26 @@ void ApplicationManagerImpl::CloseNaviApp() { uint32_t app_id = navi_app_to_stop_.front(); navi_app_to_stop_.pop_front(); - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() != it) { - if (it->second.first || it->second.second) { - LOG4CXX_INFO(logger_, - "App haven't answered for EndService. Unregister it."); - ManageMobileCommand( - MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app_id, PROTOCOL_VIOLATION), - commands::Command::ORIGIN_SDL); - UnregisterApplication(app_id, ABORTED); + bool unregister = false; + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() != it) { + if (it->second.first || it->second.second) { + unregister = true; + } } } + if (unregister) { + LOG4CXX_INFO(logger_, + "App haven't answered for EndService. Unregister it."); + ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app_id, PROTOCOL_VIOLATION), + commands::Command::ORIGIN_SDL); + UnregisterApplication(app_id, ABORTED); + } } void ApplicationManagerImpl::EndNaviStreaming() { @@ -3243,13 +3283,17 @@ void ApplicationManagerImpl::DisallowStreaming(uint32_t app_id) { return; } - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() != it) { - if (it->second.first) { - app->set_video_streaming_allowed(false); - } - if (it->second.second) { - app->set_audio_streaming_allowed(false); + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() != it) { + if (it->second.first) { + app->set_video_streaming_allowed(false); + } + if (it->second.second) { + app->set_audio_streaming_allowed(false); + } } } } @@ -3264,13 +3308,17 @@ void ApplicationManagerImpl::AllowStreaming(uint32_t app_id) { return; } - NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); - if (navi_service_status_.end() != it) { - if (it->second.first) { - app->set_video_streaming_allowed(true); - } - if (it->second.second) { - app->set_audio_streaming_allowed(true); + { + sync_primitives::AutoLock lock(navi_service_status_lock_); + + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() != it) { + if (it->second.first) { + app->set_video_streaming_allowed(true); + } + if (it->second.second) { + app->set_audio_streaming_allowed(true); + } } } } -- cgit v1.2.1 From c214492773c542a53d94b34e1a75d64d384b2b41 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Sun, 30 Jul 2017 22:28:15 +0900 Subject: fix: avoid crash in bson_object_from_bytes() when data is NULL --- src/components/protocol_handler/src/protocol_handler_impl.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 3592ce692d..c887273400 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1261,7 +1261,12 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( "Protocol version:" << static_cast(packet->protocol_version())); const ServiceType service_type = ServiceTypeFromByte(packet->service_type()); const uint8_t protocol_version = packet->protocol_version(); - BsonObject bson_obj = bson_object_from_bytes(packet->data()); + BsonObject bson_obj; + if (packet->data() != NULL) { + bson_obj = bson_object_from_bytes(packet->data()); + } else { + bson_object_initialize_default(&bson_obj); + } #ifdef ENABLE_SECURITY const bool protection = -- cgit v1.2.1 From bef4473af634d7ebd17f507393e98cb616f0a19a Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 3 Aug 2017 15:47:08 +0900 Subject: fix: increase stack size of protocol handler threads Since we have more method calls starting from OnSessionStartedCallback(), we may encounter a stack overflow issue (tested on Ubuntu 16.04 x86_64 box). The stack size is increased to avoid such issue. --- src/components/protocol_handler/src/protocol_handler_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index c887273400..8f1d97cd40 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -57,7 +57,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ProtocolHandler") std::string ConvertPacketDataToString(const uint8_t* data, const size_t data_size); -const size_t kStackSize = 32768; +const size_t kStackSize = 65536; ProtocolPacket::ProtocolVersion defaultProtocolVersion(5, 0, 0); -- cgit v1.2.1 From b1744864f87f404438ba4936e01c4020f714a2f5 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 3 Aug 2017 14:01:13 +0900 Subject: Add videoStreamingCapability in SystemCapability struct Reflecting review comments. --- src/components/interfaces/MOBILE_API.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 64427b3781..621ec82029 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2527,6 +2527,8 @@ + + -- cgit v1.2.1 From c91d2fd8c12432f5f13d6c9678c8b8e88cee709e Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 3 Aug 2017 14:10:43 +0900 Subject: Add preferredResolution and maxBitrate in HMI capabilities file Reflecting review comments. --- src/appMain/hmi_capabilities.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index d3b7090e77..33ee842404 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -302,6 +302,11 @@ "dialNumberEnabled": true }, "videoStreamingCapability": { + "preferredResolution": { + "resolutionWidth": 800, + "resolutionHeight": 350 + }, + "maxBitrate": 10000, "supportedFormats": [{ "protocol": "RAW", "codec": "H264" -- cgit v1.2.1 From 02cda0ef2c5b25d48848b00f2a1edd449d29983b Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Wed, 9 Aug 2017 12:16:59 +0900 Subject: Deprecate HandleControlMessageStartSession() Reflecting review comments. --- .../protocol_handler/protocol_handler_impl.h | 3 + .../protocol_handler/src/protocol_handler_impl.cc | 154 +++++++++++++++++++++ 2 files changed, 157 insertions(+) diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index 2370fd730f..ad70dfc62b 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -522,6 +522,9 @@ class ProtocolHandlerImpl RESULT_CODE HandleControlMessageEndServiceACK(const ProtocolPacket& packet); + // DEPRECATED + RESULT_CODE HandleControlMessageStartSession(const ProtocolPacket& packet); + RESULT_CODE HandleControlMessageStartSession(const ProtocolFramePtr packet); RESULT_CODE HandleControlMessageHeartBeat(const ProtocolPacket& packet); diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 8f1d97cd40..f7da33deed 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1253,6 +1253,160 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { } // namespace #endif // ENABLE_SECURITY +// DEPRECATED +RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( + const ProtocolPacket& packet) { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG( + logger_, + "Protocol version:" << static_cast(packet.protocol_version())); + const ServiceType service_type = ServiceTypeFromByte(packet.service_type()); + const uint8_t protocol_version = packet.protocol_version(); + +#ifdef ENABLE_SECURITY + const bool protection = + // Protocolo version 1 is not support protection + (protocol_version > PROTOCOL_VERSION_1) ? packet.protection_flag() + : false; +#else + const bool protection = false; +#endif // ENABLE_SECURITY + + uint32_t hash_id; + const ConnectionID connection_id = packet.connection_id(); + const uint32_t session_id = session_observer_.OnSessionStartedCallback( + connection_id, packet.session_id(), service_type, protection, &hash_id); + + if (0 == session_id) { + LOG4CXX_WARN(logger_, + "Refused by session_observer to create service " + << static_cast(service_type) << " type."); + SendStartSessionNAck(connection_id, + packet.session_id(), + protocol_version, + packet.service_type()); + return RESULT_OK; + } + +#ifdef ENABLE_SECURITY + // for packet is encrypted and security plugin is enable + if (protection && security_manager_) { + const uint32_t connection_key = + session_observer_.KeyFromPair(connection_id, session_id); + + security_manager::SSLContext* ssl_context = + security_manager_->CreateSSLContext(connection_key); + if (!ssl_context) { + const std::string error("CreateSSLContext failed"); + LOG4CXX_ERROR(logger_, error); + security_manager_->SendInternalError( + connection_key, + security_manager::SecurityManager::ERROR_INTERNAL, + error); + // Start service without protection + SendStartSessionAck(connection_id, + session_id, + packet.protocol_version(), + hash_id, + packet.service_type(), + PROTECTION_OFF); + return RESULT_OK; + } + ProtocolPacket::ProtocolVersion* fullVersion; + std::vector rejectedParams(0, std::string("")); + // Can't check protocol_version because the first packet is v1, but there + // could still be a payload, in which case we can get the real protocol + // version + if (packet.service_type() == kRpc && packet.data_size() != 0) { + BsonObject obj = bson_object_from_bytes(packet.data()); + fullVersion = new ProtocolPacket::ProtocolVersion( + std::string(bson_object_get_string(&obj, "protocolVersion"))); + bson_object_deinitialize(&obj); + // Constructed payloads added in Protocol v5 + if (fullVersion->majorVersion < PROTOCOL_VERSION_5) { + rejectedParams.push_back(std::string("protocolVersion")); + } + } else { + fullVersion = new ProtocolPacket::ProtocolVersion(); + } + if (!rejectedParams.empty()) { + SendStartSessionNAck(connection_id, + packet.session_id(), + protocol_version, + packet.service_type(), + rejectedParams); + } else if (ssl_context->IsInitCompleted()) { + // mark service as protected + session_observer_.SetProtectionFlag(connection_key, service_type); + // Start service as protected with current SSLContext + SendStartSessionAck(connection_id, + session_id, + packet.protocol_version(), + hash_id, + packet.service_type(), + PROTECTION_ON, + *fullVersion); + } else { + security_manager_->AddListener( + new StartSessionHandler(connection_key, + this, + session_observer_, + connection_id, + session_id, + packet.protocol_version(), + hash_id, + service_type, + get_settings().force_protected_service(), + *fullVersion)); + if (!ssl_context->IsHandshakePending()) { + // Start handshake process + security_manager_->StartHandshake(connection_key); + } + } + delete fullVersion; + LOG4CXX_DEBUG(logger_, + "Protection establishing for connection " + << connection_key << " is in progress"); + return RESULT_OK; + } +#endif // ENABLE_SECURITY + if (packet.service_type() == kRpc && packet.data_size() != 0) { + BsonObject obj = bson_object_from_bytes(packet.data()); + ProtocolPacket::ProtocolVersion fullVersion( + bson_object_get_string(&obj, "protocolVersion")); + bson_object_deinitialize(&obj); + + if (fullVersion.majorVersion >= PROTOCOL_VERSION_5) { + // Start service without protection + SendStartSessionAck(connection_id, + session_id, + packet.protocol_version(), + hash_id, + packet.service_type(), + PROTECTION_OFF, + fullVersion); + } else { + std::vector rejectedParams(1, + std::string("protocolVersion")); + SendStartSessionNAck(connection_id, + packet.session_id(), + protocol_version, + packet.service_type(), + rejectedParams); + } + + } else { + // Start service without protection + SendStartSessionAck(connection_id, + session_id, + packet.protocol_version(), + hash_id, + packet.service_type(), + PROTECTION_OFF); + } + return RESULT_OK; +} + RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( const ProtocolFramePtr packet) { LOG4CXX_AUTO_TRACE(logger_); -- cgit v1.2.1 From 501c3fdd2e9b5194cd1a5a3070c500dc95be9147 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Wed, 9 Aug 2017 10:49:27 +0900 Subject: Deprecate OnSessionStartedCallback() Reflecting review comments. --- .../connection_handler/connection_handler_impl.h | 19 ++++ .../src/connection_handler_impl.cc | 70 ++++++++++++ .../test/connection_handler_impl_test.cc | 118 ++++++++++++++------- .../include/protocol_handler/session_observer.h | 20 ++++ .../test/protocol_handler/mock_session_observer.h | 8 ++ .../test/protocol_handler_tm_test.cc | 96 ++++++++++------- 6 files changed, 256 insertions(+), 75 deletions(-) diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h index 32a4086bc4..d1dbc08ec0 100644 --- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h +++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h @@ -172,6 +172,25 @@ class ConnectionHandlerImpl const connection_handler::DeviceHandle& device, const transport_manager::DisconnectDeviceError& error) OVERRIDE; + /** + * \brief Callback function used by ProtocolHandler + * when Mobile Application initiates start of new session. + * \param connection_handle Connection identifier within which session has to + * be started. + * \param session_id Identifier of the session to be started + * \param service_type Type of service + * \param is_protected would be service protected + * \param hash_id pointer for session hash identifier + * \return uint32_t Id (number) of new session if successful, otherwise 0. + */ + // DEPRECATED + virtual uint32_t OnSessionStartedCallback( + const transport_manager::ConnectionUID connection_handle, + const uint8_t session_id, + const protocol_handler::ServiceType& service_type, + const bool is_protected, + uint32_t* hash_id); + /** * \brief Callback function used by ProtocolHandler * when Mobile Application initiates start of new session. diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index 735140e24f..d805412666 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -280,6 +280,76 @@ bool AllowProtection(const ConnectionHandlerSettings& settings, } #endif // ENABLE_SECURITY +// DEPRECATED +uint32_t ConnectionHandlerImpl::OnSessionStartedCallback( + const transport_manager::ConnectionUID connection_handle, + const uint8_t session_id, + const protocol_handler::ServiceType& service_type, + const bool is_protected, + uint32_t* hash_id) { + LOG4CXX_AUTO_TRACE(logger_); + + if (hash_id) { + *hash_id = protocol_handler::HASH_ID_WRONG; + } +#ifdef ENABLE_SECURITY + if (!AllowProtection(get_settings(), service_type, is_protected)) { + return 0; + } +#endif // ENABLE_SECURITY + sync_primitives::AutoReadLock lock(connection_list_lock_); + ConnectionList::iterator it = connection_list_.find(connection_handle); + if (connection_list_.end() == it) { + LOG4CXX_ERROR(logger_, "Unknown connection!"); + return 0; + } + uint32_t new_session_id = 0; + + Connection* connection = it->second; + if ((0 == session_id) && (protocol_handler::kRpc == service_type)) { + new_session_id = connection->AddNewSession(); + if (0 == new_session_id) { + LOG4CXX_ERROR(logger_, "Couldn't start new session!"); + return 0; + } + if (hash_id) { + *hash_id = KeyFromPair(connection_handle, new_session_id); + } + } else { // Could be create new service or protected exists one + if (!connection->AddNewService(session_id, service_type, is_protected)) { + LOG4CXX_ERROR(logger_, + "Couldn't establish " +#ifdef ENABLE_SECURITY + << (is_protected ? "protected" : "non-protected") +#endif // ENABLE_SECURITY + << " service " << static_cast(service_type) + << " for session " << static_cast(session_id)); + return 0; + } + new_session_id = session_id; + if (hash_id) { + *hash_id = protocol_handler::HASH_ID_NOT_SUPPORTED; + } + } + sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_); + if (connection_handler_observer_) { + const uint32_t session_key = KeyFromPair(connection_handle, new_session_id); + const bool success = connection_handler_observer_->OnServiceStartedCallback( + connection->connection_device_handle(), session_key, service_type); + if (!success) { + LOG4CXX_WARN(logger_, + "Service starting forbidden by connection_handler_observer"); + if (protocol_handler::kRpc == service_type) { + connection->RemoveSession(new_session_id); + } else { + connection->RemoveService(session_id, service_type); + } + return 0; + } + } + return new_session_id; +} + void ConnectionHandlerImpl::OnSessionStartedCallback( const transport_manager::ConnectionUID connection_handle, const uint8_t session_id, diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc index efd22fe419..577b65f0e9 100644 --- a/src/components/connection_handler/test/connection_handler_impl_test.cc +++ b/src/components/connection_handler/test/connection_handler_impl_test.cc @@ -123,7 +123,7 @@ class ConnectionHandlerTest : public ::testing::Test { DoAll(SaveArg<0>(&start_session_id_), SaveArg<1>(&out_hash_id_))); connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_OFF, NULL); + uid_, 0, kRpc, PROTECTION_OFF, static_cast(NULL)); connection_handler_->set_protocol_handler(NULL); EXPECT_NE(0u, start_session_id_); EXPECT_EQ(SessionHash(uid_, start_session_id_), out_hash_id_); @@ -145,8 +145,11 @@ class ConnectionHandlerTest : public ::testing::Test { EXPECT_CALL(temp_protocol_handler, NotifySessionStartedResult(_, _, _, _)) .WillOnce(SaveArg<0>(&session_id)); - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, service_type, PROTECTION_OFF, 0); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + service_type, + PROTECTION_OFF, + static_cast(0)); connection_handler_->set_protocol_handler(NULL); EXPECT_EQ(session_id, start_session_id_); } @@ -296,7 +299,7 @@ TEST_F(ConnectionHandlerTest, StartSession_NoConnection) { .WillOnce(DoAll(SaveArg<0>(&result_fail), SaveArg<1>(&out_hash_id_))); connection_handler_->OnSessionStartedCallback( - uid_, sessionID, kRpc, PROTECTION_ON, NULL); + uid_, sessionID, kRpc, PROTECTION_ON, static_cast(NULL)); // Unknown connection error is '0' EXPECT_EQ(0u, result_fail); EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_); @@ -1049,15 +1052,21 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) { .WillOnce(DoAll(SaveArg<0>(&start_video), SaveArg<1>(&out_hash_id_))); // Start Audio service - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kAudio, + PROTECTION_OFF, + static_cast(NULL)); EXPECT_EQ(start_session_id_, start_audio); CheckServiceExists(uid_, start_session_id_, kAudio, true); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); // Start Audio service - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kMobileNav, PROTECTION_OFF, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kMobileNav, + PROTECTION_OFF, + static_cast(NULL)); EXPECT_EQ(start_session_id_, start_video); CheckServiceExists(uid_, start_session_id_, kMobileNav, true); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); @@ -1123,7 +1132,11 @@ TEST_F(ConnectionHandlerTest, ServiceStop) { for (uint32_t some_hash_id = 0; some_hash_id < 0xFF; ++some_hash_id) { // Start audio service connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); + uid_, + start_session_id_, + kAudio, + PROTECTION_OFF, + static_cast(NULL)); EXPECT_EQ(start_session_id_, start_audio); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); @@ -1205,7 +1218,7 @@ TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) { // Start new session with RPC service connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_OFF, NULL); + uid_, 0, kRpc, PROTECTION_OFF, static_cast(NULL)); EXPECT_NE(0u, new_session_id); } @@ -1301,7 +1314,7 @@ TEST_F(ConnectionHandlerTest, // Start new session with RPC service connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_OFF, NULL); + uid_, 0, kRpc, PROTECTION_OFF, static_cast(NULL)); #ifdef ENABLE_SECURITY EXPECT_EQ(0u, session_id_fail); EXPECT_EQ(protocol_handler::HASH_ID_WRONG, out_hash_id_); @@ -1316,7 +1329,7 @@ TEST_F(ConnectionHandlerTest, SetSpecificServices(); // Start new session with RPC service connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_OFF, NULL); + uid_, 0, kRpc, PROTECTION_OFF, static_cast(NULL)); EXPECT_NE(0u, session_id); CheckService(uid_, session_id, kRpc, NULL, PROTECTION_OFF); EXPECT_EQ(SessionHash(uid_, session_id), out_hash_id_); @@ -1342,7 +1355,7 @@ TEST_F(ConnectionHandlerTest, // Start new session with RPC service connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_ON, NULL); + uid_, 0, kRpc, PROTECTION_ON, static_cast(NULL)); #ifdef ENABLE_SECURITY EXPECT_EQ(0u, session_id_fail); #else @@ -1355,7 +1368,7 @@ TEST_F(ConnectionHandlerTest, SetSpecificServices(); // Start new session with RPC service connection_handler_->OnSessionStartedCallback( - uid_, 0, kRpc, PROTECTION_ON, NULL); + uid_, 0, kRpc, PROTECTION_ON, static_cast(NULL)); EXPECT_NE(0u, session_id); EXPECT_EQ(SessionHash(uid_, session_id), out_hash_id_); @@ -1383,8 +1396,11 @@ TEST_F(ConnectionHandlerTest, .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); // Start new session with Audio service - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kAudio, + PROTECTION_OFF, + static_cast(NULL)); #ifdef ENABLE_SECURITY EXPECT_EQ(0u, session_id2); #else @@ -1397,8 +1413,11 @@ TEST_F(ConnectionHandlerTest, protected_services_.push_back(UnnamedService::kServedService2); protected_services_.push_back(kControl); SetSpecificServices(); - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kAudio, + PROTECTION_OFF, + static_cast(NULL)); // Returned original session id #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id3); @@ -1430,8 +1449,11 @@ TEST_F(ConnectionHandlerTest, .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); // Start new session with Audio service - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kAudio, + PROTECTION_ON, + static_cast(NULL)); #ifdef ENABLE_SECURITY EXPECT_EQ(0u, session_id_reject); #else @@ -1440,8 +1462,11 @@ TEST_F(ConnectionHandlerTest, // Allow start kAudio with encryption unprotected_services_.clear(); SetSpecificServices(); - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kAudio, + PROTECTION_ON, + static_cast(NULL)); // Returned original session id #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id3); @@ -1468,8 +1493,11 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) { .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); // Start RPC protection - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kRpc, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kRpc, + PROTECTION_ON, + static_cast(NULL)); #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id_new); // Post protection nedd no hash @@ -1483,15 +1511,21 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) { #endif // ENABLE_SECURITY // Start Audio session without protection - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_OFF, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kAudio, + PROTECTION_OFF, + static_cast(NULL)); EXPECT_EQ(start_session_id_, session_id2); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); CheckService(uid_, start_session_id_, kAudio, NULL, PROTECTION_OFF); // Start Audio protection - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kAudio, + PROTECTION_ON, + static_cast(NULL)); #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id3); EXPECT_EQ(protocol_handler::HASH_ID_NOT_SUPPORTED, out_hash_id_); @@ -1511,8 +1545,11 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtectBulk) { connection_handler_->set_protocol_handler(&mock_protocol_handler_); EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) .WillOnce(SaveArg<0>(&session_id_new)); - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kBulk, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kBulk, + PROTECTION_ON, + static_cast(NULL)); #ifdef ENABLE_SECURITY EXPECT_EQ(start_session_id_, session_id_new); CheckService(uid_, start_session_id_, kRpc, NULL, PROTECTION_ON); @@ -1614,8 +1651,11 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByProtectedService) { .WillOnce(SaveArg<0>(&session_id)); // Open kAudio service - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kAudio, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kAudio, + PROTECTION_ON, + static_cast(NULL)); EXPECT_EQ(session_id, start_session_id_); CheckService(uid_, session_id, kAudio, &mock_ssl_context, PROTECTION_ON); @@ -1644,8 +1684,11 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedRPC) { .WillOnce(SaveArg<0>(&session_id)); // Protect kRpc (Bulk will be protect also) - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kRpc, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kRpc, + PROTECTION_ON, + static_cast(NULL)); EXPECT_EQ(start_session_id_, session_id); CheckService(uid_, session_id, kRpc, &mock_ssl_context, PROTECTION_ON); @@ -1677,8 +1720,11 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedBulk) { .WillOnce(SaveArg<0>(&session_id)); // Protect Bulk (kRpc will be protected also) - connection_handler_->OnSessionStartedCallback( - uid_, start_session_id_, kBulk, PROTECTION_ON, NULL); + connection_handler_->OnSessionStartedCallback(uid_, + start_session_id_, + kBulk, + PROTECTION_ON, + static_cast(NULL)); EXPECT_EQ(start_session_id_, session_id); CheckService(uid_, session_id, kRpc, &mock_ssl_context, PROTECTION_ON); diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h index 70035b5a3c..606c6e1d11 100644 --- a/src/components/include/protocol_handler/session_observer.h +++ b/src/components/include/protocol_handler/session_observer.h @@ -64,6 +64,26 @@ enum { HASH_ID_NOT_SUPPORTED = 0, HASH_ID_WRONG = 0xFFFF0000 }; // TODO(EZamakhov): Reconsider rename KeyFromPair and PairFromKey class SessionObserver { public: + /** + * \brief Callback function used by ProtocolHandler + * when Mobile Application initiates start of new session. + * \param connection_handle Connection identifier within which session + * has to be started. + * \param sessionId Identifier of the session to be start + * \param service_type Type of service + * \param protocol_version Version of protocol + * \param is_protected would be service protected + * \param hash_id pointer for session hash identifier, uint32_t* hash_id + * \return uint32_t Id (number) of new session if successful, otherwise 0. + */ + // DEPRECATED + virtual uint32_t OnSessionStartedCallback( + const transport_manager::ConnectionUID connection_handle, + const uint8_t sessionId, + const protocol_handler::ServiceType& service_type, + const bool is_protected, + uint32_t* hash_id) = 0; + /** * \brief Callback function used by ProtocolHandler * when Mobile Application initiates start of new session. diff --git a/src/components/include/test/protocol_handler/mock_session_observer.h b/src/components/include/test/protocol_handler/mock_session_observer.h index 40137c2e00..4d2072624d 100644 --- a/src/components/include/test/protocol_handler/mock_session_observer.h +++ b/src/components/include/test/protocol_handler/mock_session_observer.h @@ -46,6 +46,14 @@ namespace protocol_handler_test { */ class MockSessionObserver : public ::protocol_handler::SessionObserver { public: + // DEPRECATED + MOCK_METHOD5( + OnSessionStartedCallback, + uint32_t(const transport_manager::ConnectionUID connection_handle, + const uint8_t sessionId, + const protocol_handler::ServiceType& service_type, + const bool is_protected, + uint32_t* hash_id)); MOCK_METHOD5(OnSessionStartedCallback, void(const transport_manager::ConnectionUID connection_handle, const uint8_t sessionId, diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index 2729254869..397ee5bd3e 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -207,7 +207,7 @@ class ProtocolHandlerImplTest : public ::testing::Test { NEW_SESSION_ID, start_service, callback_protection_flag, - _)) + An())) . // Return sessions start success WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), @@ -371,7 +371,7 @@ TEST_F(ProtocolHandlerImplTest, NEW_SESSION_ID, AnyOf(kControl, kRpc, kAudio, kMobileNav, kBulk), PROTECTION_OFF, - _)) + An())) .Times(call_times) . // Return sessions start rejection @@ -435,7 +435,7 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) { NEW_SESSION_ID, AnyOf(kControl, kRpc, kAudio, kMobileNav, kBulk), callback_protection_flag, - _)) + An())) .Times(call_times) . // Return sessions start rejection @@ -484,10 +484,12 @@ TEST_F(ProtocolHandlerImplTest, uint32_t times = 0; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_OFF, + An())) . // Return sessions start success WillOnce(DoAll( @@ -619,10 +621,12 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { const ServiceType start_service = kRpc; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_OFF, + An())) . // Return sessions start success WillOnce(DoAll( @@ -671,10 +675,12 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) { uint32_t times = 0; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_OFF, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_OFF, + An())) . // Return sessions start success WillOnce(DoAll( @@ -713,10 +719,12 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) { uint32_t times = 0; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_ON, + An())) . // Return sessions start success WillOnce(DoAll( @@ -764,10 +772,12 @@ TEST_F(ProtocolHandlerImplTest, uint32_t times = 0; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_ON, + An())) . // Return sessions start success WillOnce(DoAll( @@ -828,10 +838,12 @@ TEST_F(ProtocolHandlerImplTest, uint32_t times = 0; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_ON, + An())) . // Return sessions start success WillOnce(DoAll( @@ -917,10 +929,12 @@ TEST_F(ProtocolHandlerImplTest, uint32_t times = 0; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_ON, + An())) . // Return sessions start success WillOnce(DoAll( @@ -1011,10 +1025,12 @@ TEST_F( uint32_t times = 0; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_ON, + An())) . // Return sessions start success WillOnce(DoAll( @@ -1103,10 +1119,12 @@ TEST_F(ProtocolHandlerImplTest, uint32_t times = 0; std::vector empty; // Expect ConnectionHandler check - EXPECT_CALL( - session_observer_mock, - OnSessionStartedCallback( - connection_id, NEW_SESSION_ID, start_service, PROTECTION_ON, _)) + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id, + NEW_SESSION_ID, + start_service, + PROTECTION_ON, + An())) . // Return sessions start success WillOnce(DoAll( -- cgit v1.2.1 From 7fbc5c9594a5028e3c684477357b7af2f12b47c5 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Wed, 9 Aug 2017 10:59:22 +0900 Subject: Deprecate OnServiceStartedCallback() Reflecting review comments. --- .../application_manager/application_manager_impl.h | 5 +++ .../src/application_manager_impl.cc | 37 ++++++++++++++++++++++ .../connection_handler_observer.h | 13 ++++++++ .../mock_connection_handler_observer.h | 5 +++ 4 files changed, 60 insertions(+) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 0ba294005c..0c95dfd0a1 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -794,6 +794,11 @@ class ApplicationManagerImpl void OnFindNewApplicationsRequest() OVERRIDE; void RemoveDevice( const connection_handler::DeviceHandle& device_handle) OVERRIDE; + // DEPRECATED + bool OnServiceStartedCallback( + const connection_handler::DeviceHandle& device_handle, + const int32_t& session_key, + const protocol_handler::ServiceType& type) OVERRIDE; void OnServiceStartedCallback( const connection_handler::DeviceHandle& device_handle, const int32_t& session_key, diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 539686bdf2..3c7d95e886 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1260,6 +1260,43 @@ void ApplicationManagerImpl::StopNaviService( app->StopStreaming(service_type); } +// DEPRECATED +bool ApplicationManagerImpl::OnServiceStartedCallback( + const connection_handler::DeviceHandle& device_handle, + const int32_t& session_key, + const protocol_handler::ServiceType& type) { + using namespace helpers; + using namespace protocol_handler; + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, + "ServiceType = " << type << ". Session = " << std::hex + << session_key); + + if (type == kRpc) { + LOG4CXX_DEBUG(logger_, "RPC service is about to be started."); + return true; + } + ApplicationSharedPtr app = application(session_key); + if (!app) { + LOG4CXX_WARN(logger_, + "The application with id:" << session_key + << " doesn't exists."); + return false; + } + + if (Compare( + type, ServiceType::kMobileNav, ServiceType::kAudio)) { + if (app->is_navi()) { + return StartNaviService(session_key, type); + } else { + LOG4CXX_WARN(logger_, "Refuse not navi application"); + } + } else { + LOG4CXX_WARN(logger_, "Refuse unknown service"); + } + return false; +} + void ApplicationManagerImpl::OnServiceStartedCallback( const connection_handler::DeviceHandle& device_handle, const int32_t& session_key, diff --git a/src/components/include/connection_handler/connection_handler_observer.h b/src/components/include/connection_handler/connection_handler_observer.h index 706f338d60..6bfc78af24 100644 --- a/src/components/include/connection_handler/connection_handler_observer.h +++ b/src/components/include/connection_handler/connection_handler_observer.h @@ -82,6 +82,19 @@ class ConnectionHandlerObserver { virtual void RemoveDevice( const connection_handler::DeviceHandle& device_handle) = 0; + /** + * \brief Callback function used by connection_handler + * when Mobile Application initiates start of new service. + * \param deviceHandle Device identifier within which session has to be + * started. + * \param sessionKey Key of started session. + * \param type Established service type + */ + virtual bool OnServiceStartedCallback( + const connection_handler::DeviceHandle& device_handle, + const int32_t& session_key, + const protocol_handler::ServiceType& type) = 0; + /** * \brief Callback function used by connection_handler * when Mobile Application initiates start of new service. diff --git a/src/components/include/test/connection_handler/mock_connection_handler_observer.h b/src/components/include/test/connection_handler/mock_connection_handler_observer.h index d9a12d35c2..dead5bc61e 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler_observer.h +++ b/src/components/include/test/connection_handler/mock_connection_handler_observer.h @@ -48,6 +48,11 @@ class MockConnectionHandlerObserver MOCK_METHOD0(OnFindNewApplicationsRequest, void()); MOCK_METHOD1(RemoveDevice, void(const connection_handler::DeviceHandle& device_handle)); + // DEPRECATED + MOCK_METHOD3(OnServiceStartedCallback, + bool(const connection_handler::DeviceHandle& device_handle, + const int32_t& session_key, + const protocol_handler::ServiceType& type)); MOCK_METHOD4(OnServiceStartedCallback, void(const connection_handler::DeviceHandle& device_handle, const int32_t& session_key, -- cgit v1.2.1 From c1ce23c23e0a31e802577eed4c4865a5502de800 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Wed, 9 Aug 2017 12:03:25 +0900 Subject: Deprecate StartNaviService() Reflecting review comments. --- .../application_manager/application_manager_impl.h | 10 +++++++ .../src/application_manager_impl.cc | 33 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 0c95dfd0a1..5fac4d476b 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1342,6 +1342,16 @@ class ApplicationManagerImpl */ void EndNaviStreaming(); + /** + * @brief Starts specified navi service for application + * @param app_id Application to proceed + * @param service_type Type of service to start + * @return True on success, false on fail + */ + // DEPRECATED + bool StartNaviService(uint32_t app_id, + protocol_handler::ServiceType service_type); + /** * @brief Starts specified navi service for application * @param app_id Application to proceed diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 3c7d95e886..a56a7342b9 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1138,6 +1138,39 @@ void ApplicationManagerImpl::ReplaceHMIByMobileAppId( } } +// DEPRECATED +bool ApplicationManagerImpl::StartNaviService( + uint32_t app_id, protocol_handler::ServiceType service_type) { + using namespace protocol_handler; + LOG4CXX_AUTO_TRACE(logger_); + + if (HMILevelAllowsStreaming(app_id, service_type)) { + NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); + if (navi_service_status_.end() == it) { + std::pair res = + navi_service_status_.insert( + std::pair >( + app_id, std::make_pair(false, false))); + if (!res.second) { + LOG4CXX_WARN(logger_, "Navi service refused"); + return false; + } + it = res.first; + } + // Fill NaviServices map. Set true to first value of pair if + // we've started video service or to second value if we've + // started audio service + service_type == ServiceType::kMobileNav ? it->second.first = true + : it->second.second = true; + + application(app_id)->StartStreaming(service_type); + return true; + } else { + LOG4CXX_WARN(logger_, "Refused navi service by HMI level"); + } + return false; +} + bool ApplicationManagerImpl::StartNaviService( uint32_t app_id, protocol_handler::ServiceType service_type, -- cgit v1.2.1 From 0db0d20350e0939f268873d8c462bf33bb1db349 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Wed, 9 Aug 2017 14:45:29 +0900 Subject: Add definitions of newly added keys Reflecting review comments. --- .../include/application_manager/smart_object_keys.h | 5 +++++ .../src/application_manager_impl.cc | 16 ++++++++-------- .../src/commands/hmi/navi_set_video_config_request.cc | 5 +++-- .../src/message_helper/message_helper.cc | 2 +- .../application_manager/src/smart_object_keys.cc | 5 +++++ .../commands/hmi/navi_set_video_config_request_test.cc | 18 +++++++++++------- 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index b8a6d3235f..ffdd7f26ce 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -339,6 +339,11 @@ extern const char* const status; extern const char* const external_consent_status; extern const char* const consented_functions; extern const char* const source; +extern const char* const config; +extern const char* const protocol; +extern const char* const codec; +extern const char* const width; +extern const char* const height; } // namespace strings namespace json { diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index a56a7342b9..14cd130a89 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -3831,7 +3831,7 @@ void ApplicationManagerImpl::ConvertVideoParamsToSO( ConvertVideoProtocol(protocol); if (protocol_enum != hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM) { - output["protocol"] = protocol_enum; + output[strings::protocol] = protocol_enum; } } const char* codec = bson_object_get_string(obj, "videoCodec"); @@ -3839,16 +3839,16 @@ void ApplicationManagerImpl::ConvertVideoParamsToSO( hmi_apis::Common_VideoStreamingCodec::eType codec_enum = ConvertVideoCodec(codec); if (codec_enum != hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM) { - output["codec"] = codec_enum; + output[strings::codec] = codec_enum; } } BsonElement* element = bson_object_get(obj, "desiredHeight"); if (element != NULL && element->type == TYPE_INT32) { - output["height"] = bson_object_get_int32(obj, "desiredHeight"); + output[strings::height] = bson_object_get_int32(obj, "desiredHeight"); } element = bson_object_get(obj, "desiredWidth"); if (element != NULL && element->type == TYPE_INT32) { - output["width"] = bson_object_get_int32(obj, "desiredWidth"); + output[strings::width] = bson_object_get_int32(obj, "desiredWidth"); } } @@ -3857,13 +3857,13 @@ std::vector ApplicationManagerImpl::ConvertRejectedParamList( const std::vector& input) { std::vector output; for (unsigned int i = 0; i < input.size(); i++) { - if (input[i] == "protocol") { + if (input[i] == strings::protocol) { output.push_back("videoProtocol"); - } else if (input[i] == "codec") { + } else if (input[i] == strings::codec) { output.push_back("videoCodec"); - } else if (input[i] == "height") { + } else if (input[i] == strings::height) { output.push_back("desiredHeight"); - } else if (input[i] == "width") { + } else if (input[i] == strings::width) { output.push_back("desiredWidth"); } // ignore unknown parameters diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc index 8a51133b36..7639a0a80a 100644 --- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc @@ -102,8 +102,9 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { for (unsigned int i = 0; i < list->size(); i++) { const std::string& param = (*list)[i].asString(); // Make sure that we actually sent the parameter in the request - if ((*message_)[strings::msg_params].keyExists("config") && - (*message_)[strings::msg_params]["config"].keyExists(param)) { + if ((*message_)[strings::msg_params].keyExists(strings::config) && + (*message_)[strings::msg_params][strings::config].keyExists( + param)) { rejected_params.push_back(param); } } diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index c728dcce18..7bc676620e 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -1760,7 +1760,7 @@ void MessageHelper::SendNaviSetVideoConfig( hmi_apis::FunctionID::Navigation_SetVideoConfig; (*request)[strings::msg_params][strings::app_id] = app_id; - (*request)[strings::msg_params]["config"] = video_params; + (*request)[strings::msg_params][strings::config] = video_params; app_mngr.ManageHMICommand(request); } diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index d5324273a7..3652656af3 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -300,6 +300,11 @@ const char* const status = "status"; const char* const external_consent_status = "externalConsentStatus"; const char* const consented_functions = "consentedFunctions"; const char* const source = "source"; +const char* const config = "config"; +const char* const protocol = "protocol"; +const char* const codec = "codec"; +const char* const width = "width"; +const char* const height = "height"; } // namespace strings namespace json { diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc index 7acdbda7d0..098366ad83 100644 --- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc @@ -116,14 +116,18 @@ static bool ValidateList(std::vector& expected, TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { MessageSharedPtr request_msg = CreateMessage(); - (*request_msg)[am::strings::msg_params]["config"] = + (*request_msg)[am::strings::msg_params][am::strings::config] = smart_objects::SmartObject(smart_objects::SmartType_Array); - (*request_msg)[am::strings::msg_params]["config"]["protocol"] = - hmi_apis::Common_VideoStreamingProtocol::RTP; - (*request_msg)[am::strings::msg_params]["config"]["codec"] = - hmi_apis::Common_VideoStreamingCodec::H265; - (*request_msg)[am::strings::msg_params]["config"]["height"] = 640; - (*request_msg)[am::strings::msg_params]["config"]["width"] = 480; + (*request_msg)[am::strings::msg_params][am::strings::config] + [am::strings::protocol] = + hmi_apis::Common_VideoStreamingProtocol::RTP; + (*request_msg)[am::strings::msg_params][am::strings::config] + [am::strings::codec] = + hmi_apis::Common_VideoStreamingCodec::H265; + (*request_msg)[am::strings::msg_params][am::strings::config] + [am::strings::height] = 640; + (*request_msg)[am::strings::msg_params][am::strings::config] + [am::strings::width] = 480; NaviSetVideoConfigRequestPtr command = CreateCommand(request_msg); -- cgit v1.2.1 From 8d7330735ed5d6a5ea5a01a1e8e674e83c1de252 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 3 Aug 2017 21:30:00 +0900 Subject: Remove OnNaviSetVideoConfigDone() Reflecting review comments. --- .../include/application_manager/application.h | 10 ----- .../include/application_manager/application_impl.h | 2 - .../application_manager/src/application_impl.cc | 9 ---- .../commands/hmi/navi_set_video_config_request.cc | 12 +++++- .../test/application_impl_test.cc | 11 ----- .../hmi/navi_set_video_config_request_test.cc | 49 ++++++++++++++++++---- .../include/application_manager/mock_application.h | 2 - 7 files changed, 51 insertions(+), 44 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 4dfb8dbf7a..aa0227efda 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -450,16 +450,6 @@ class Application : public virtual InitialApplicationData, virtual bool SetVideoConfig(protocol_handler::ServiceType service_type, const smart_objects::SmartObject& params) = 0; - /** - * @brief Callback when SetVideoConfig response is received - * @param result true if HMI accepts video streaming parameters, - * false otherwise - * @param rejected_params list of rejected parameters' names. Only - * valid when result is false - */ - virtual void OnNaviSetVideoConfigDone( - bool result, std::vector& rejected_params) = 0; - /** * @brief Starts streaming service for application * @param service_type Type of streaming service diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index f5db389c7f..089be323cf 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -112,8 +112,6 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, bool SetVideoConfig(protocol_handler::ServiceType service_type, const smart_objects::SmartObject& params); - void OnNaviSetVideoConfigDone(bool result, - std::vector& rejected_params); void StartStreaming(protocol_handler::ServiceType service_type); void StopStreamingForce(protocol_handler::ServiceType service_type); void StopStreaming(protocol_handler::ServiceType service_type); diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 7d9025050a..5764a7c5f7 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -434,15 +434,6 @@ bool ApplicationImpl::SetVideoConfig(protocol_handler::ServiceType service_type, return false; } -void ApplicationImpl::OnNaviSetVideoConfigDone( - bool result, std::vector& rejected_params) { - using namespace protocol_handler; - LOG4CXX_AUTO_TRACE(logger_); - - application_manager_.OnStreamingConfigured( - app_id(), ServiceType::kMobileNav, result, rejected_params); -} - void ApplicationImpl::StartStreaming( protocol_handler::ServiceType service_type) { using namespace protocol_handler; diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc index 7639a0a80a..8205cae679 100644 --- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc @@ -111,7 +111,11 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { } } } - app->OnNaviSetVideoConfigDone(result, rejected_params); + application_manager_.OnStreamingConfigured( + application_id(), + protocol_handler::ServiceType::kMobileNav, + result, + rejected_params); break; } default: @@ -131,7 +135,11 @@ void NaviSetVideoConfigRequest::onTimeOut() { } std::vector empty; - app->OnNaviSetVideoConfigDone(false, empty); + application_manager_.OnStreamingConfigured( + application_id(), + protocol_handler::ServiceType::kMobileNav, + false, + empty); application_manager_.TerminateRequest( connection_key(), correlation_id(), function_id()); diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index 228c5c9b16..a1e284b40d 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -682,17 +682,6 @@ TEST_F(ApplicationImplTest, SetVideoConfig_NotMobileNavi) { app_impl->SetVideoConfig(protocol_handler::ServiceType::kAudio, params); } -TEST_F(ApplicationImplTest, OnNaviSetVideoConfigDone) { - bool result = true; - std::vector empty; - EXPECT_CALL( - mock_application_manager_, - OnStreamingConfigured( - app_id, protocol_handler::ServiceType::kMobileNav, result, empty)); - - app_impl->OnNaviSetVideoConfigDone(result, empty); -} - TEST_F(ApplicationImplTest, StartStreaming_MobileNavi_StreamingNotApproved) { EXPECT_CALL(*MockMessageHelper::message_helper_mock(), SendNaviStartStream(app_id, _)); diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc index 098366ad83..978ac2876a 100644 --- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc @@ -41,6 +41,7 @@ #include "application_manager/hmi_interfaces.h" #include "application_manager/mock_hmi_interface.h" #include "application_manager/event_engine/event.h" +#include "application_manager/mock_event_dispatcher.h" namespace test { namespace components { @@ -56,6 +57,8 @@ using am::commands::NaviSetVideoConfigRequest; using am::event_engine::Event; namespace { +const uint32_t kAppId = 1u; +const uint32_t kHmiAppId = 13u; const hmi_apis::FunctionID::eType kEventID = hmi_apis::FunctionID::Navigation_SetVideoConfig; } // namespace @@ -69,17 +72,25 @@ class NaviSetVideoConfigRequestTest mock_app_ptr_ = CreateMockApp(); ON_CALL(app_mngr_, hmi_interfaces()) .WillByDefault(ReturnRef(mock_hmi_interfaces_)); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_ptr_)); ON_CALL(app_mngr_, application_by_hmi_app(_)) .WillByDefault(Return(mock_app_ptr_)); + ON_CALL(app_mngr_, event_dispatcher()) + .WillByDefault(ReturnRef(mock_event_dispatcher_)); + ON_CALL(*mock_app_ptr_, hmi_app_id()).WillByDefault(Return(kHmiAppId)); } MOCK(am::MockHmiInterfaces) mock_hmi_interfaces_; MockAppPtr mock_app_ptr_; + MockEventDispatcher mock_event_dispatcher_; }; TEST_F(NaviSetVideoConfigRequestTest, OnEvent_SUCCESS) { + MessageSharedPtr request_msg = CreateMessage(); + (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; + NaviSetVideoConfigRequestPtr command = - CreateCommand(); + CreateCommand(request_msg); MessageSharedPtr event_msg = CreateMessage(); (*event_msg)[am::strings::params][am::hmi_response::code] = @@ -88,7 +99,11 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEvent_SUCCESS) { event.set_smart_object(*event_msg); std::vector empty; - EXPECT_CALL(*mock_app_ptr_, OnNaviSetVideoConfigDone(true, empty)).Times(1); + EXPECT_CALL( + app_mngr_, + OnStreamingConfigured( + kHmiAppId, protocol_handler::ServiceType::kMobileNav, true, empty)) + .Times(1); command->on_event(event); } @@ -116,6 +131,7 @@ static bool ValidateList(std::vector& expected, TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { MessageSharedPtr request_msg = CreateMessage(); + (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; (*request_msg)[am::strings::msg_params][am::strings::config] = smart_objects::SmartObject(smart_objects::SmartType_Array); (*request_msg)[am::strings::msg_params][am::strings::config] @@ -144,8 +160,11 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { event.set_smart_object(*event_msg); std::vector rejected_params; - EXPECT_CALL(*mock_app_ptr_, OnNaviSetVideoConfigDone(false, _)) - .WillOnce(SaveArg<1>(&rejected_params)); + EXPECT_CALL( + app_mngr_, + OnStreamingConfigured( + kHmiAppId, protocol_handler::ServiceType::kMobileNav, false, _)) + .WillOnce(SaveArg<3>(&rejected_params)); command->on_event(event); @@ -157,8 +176,11 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { } TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE_WithoutParams) { + MessageSharedPtr request_msg = CreateMessage(); + (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; + NaviSetVideoConfigRequestPtr command = - CreateCommand(); + CreateCommand(request_msg); MessageSharedPtr event_msg = CreateMessage(); (*event_msg)[am::strings::params][am::hmi_response::code] = @@ -168,17 +190,28 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE_WithoutParams) { event.set_smart_object(*event_msg); std::vector empty; - EXPECT_CALL(*mock_app_ptr_, OnNaviSetVideoConfigDone(false, empty)).Times(1); + EXPECT_CALL( + app_mngr_, + OnStreamingConfigured( + kHmiAppId, protocol_handler::ServiceType::kMobileNav, false, empty)) + .WillOnce(Return()); command->on_event(event); } TEST_F(NaviSetVideoConfigRequestTest, OnTimeout) { + MessageSharedPtr request_msg = CreateMessage(); + (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; + NaviSetVideoConfigRequestPtr command = - CreateCommand(); + CreateCommand(request_msg); std::vector empty; - EXPECT_CALL(*mock_app_ptr_, OnNaviSetVideoConfigDone(false, empty)).Times(1); + EXPECT_CALL( + app_mngr_, + OnStreamingConfigured( + kHmiAppId, protocol_handler::ServiceType::kMobileNav, false, empty)) + .WillOnce(Return()); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(1); diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index 53c4be1c77..7702403cbe 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -73,8 +73,6 @@ class MockApplication : public ::application_manager::Application { MOCK_METHOD2(SetVideoConfig, bool(protocol_handler::ServiceType service_type, const smart_objects::SmartObject& params)); - MOCK_METHOD2(OnNaviSetVideoConfigDone, - void(bool result, std::vector& rejected_params)); MOCK_METHOD1(StartStreaming, void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type)); -- cgit v1.2.1 From 407627232b3a527b63c44ef3b77bdf52a54c7688 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 10:44:59 +0900 Subject: Use newly added SmartObject keys Reflecting review comments. --- .../test/application_manager_impl_test.cc | 18 ++++++++------ .../test/message_helper/message_helper_test.cc | 29 +++++++++++----------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc index ad6811afb1..66ddcaa032 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -400,10 +400,11 @@ TEST_F(ApplicationManagerImplTest, bson_object_put_int32(&input_params, "desiredWidth", 480); smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); - converted_params["protocol"] = hmi_apis::Common_VideoStreamingProtocol::RTP; - converted_params["codec"] = hmi_apis::Common_VideoStreamingCodec::VP9; - converted_params["height"] = 640; - converted_params["width"] = 480; + converted_params[strings::protocol] = + hmi_apis::Common_VideoStreamingProtocol::RTP; + converted_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::VP9; + converted_params[strings::height] = 640; + converted_params[strings::width] = 480; std::vector empty; @@ -479,10 +480,11 @@ TEST_F(ApplicationManagerImplTest, bson_object_put_int32(&input_params, "desiredWidth", 480); smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); - converted_params["protocol"] = hmi_apis::Common_VideoStreamingProtocol::RTP; - converted_params["codec"] = hmi_apis::Common_VideoStreamingCodec::VP9; - converted_params["height"] = 640; - converted_params["width"] = 480; + converted_params[strings::protocol] = + hmi_apis::Common_VideoStreamingProtocol::RTP; + converted_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::VP9; + converted_params[strings::height] = 640; + converted_params[strings::width] = 480; std::vector rejected_list; rejected_list.push_back(std::string("protocol")); diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc index 7b02d37b87..56f2b16145 100644 --- a/src/components/application_manager/test/message_helper/message_helper_test.cc +++ b/src/components/application_manager/test/message_helper/message_helper_test.cc @@ -1034,10 +1034,11 @@ TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) { int32_t app_id = 123; smart_objects::SmartObject video_params(smart_objects::SmartType_Map); - video_params["protocol"] = hmi_apis::Common_VideoStreamingProtocol::RTP; - video_params["codec"] = hmi_apis::Common_VideoStreamingCodec::H264; - video_params["width"] = 640; - video_params["height"] = 480; + video_params[strings::protocol] = + hmi_apis::Common_VideoStreamingProtocol::RTP; + video_params[strings::codec] = hmi_apis::Common_VideoStreamingCodec::H264; + video_params[strings::width] = 640; + video_params[strings::height] = 480; MessageHelper::SendNaviSetVideoConfig( app_id, mock_application_manager, video_params); @@ -1046,16 +1047,16 @@ TEST_F(MessageHelperTest, SendNaviSetVideoConfigRequest) { (*result)[strings::params][strings::function_id].asInt()); smart_objects::SmartObject& msg_params = (*result)[strings::msg_params]; - EXPECT_TRUE(msg_params.keyExists("config")); - - EXPECT_TRUE(msg_params["config"].keyExists("protocol")); - EXPECT_EQ(1, msg_params["config"]["protocol"].asInt()); - EXPECT_TRUE(msg_params["config"].keyExists("codec")); - EXPECT_EQ(0, msg_params["config"]["codec"].asInt()); - EXPECT_TRUE(msg_params["config"].keyExists("width")); - EXPECT_EQ(640, msg_params["config"]["width"].asInt()); - EXPECT_TRUE(msg_params["config"].keyExists("height")); - EXPECT_EQ(480, msg_params["config"]["height"].asInt()); + EXPECT_TRUE(msg_params.keyExists(strings::config)); + + EXPECT_TRUE(msg_params[strings::config].keyExists(strings::protocol)); + EXPECT_EQ(1, msg_params[strings::config][strings::protocol].asInt()); + EXPECT_TRUE(msg_params[strings::config].keyExists(strings::codec)); + EXPECT_EQ(0, msg_params[strings::config][strings::codec].asInt()); + EXPECT_TRUE(msg_params[strings::config].keyExists(strings::width)); + EXPECT_EQ(640, msg_params[strings::config][strings::width].asInt()); + EXPECT_TRUE(msg_params[strings::config].keyExists(strings::height)); + EXPECT_EQ(480, msg_params[strings::config][strings::height].asInt()); } } // namespace application_manager_test -- cgit v1.2.1 From d99989abb5cf10e8e9380b22b6d8a8f43db97f26 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 10:52:58 +0900 Subject: Add another definition of newly added key Reflecting review comments. --- .../include/application_manager/smart_object_keys.h | 1 + .../src/commands/hmi/navi_set_video_config_request.cc | 4 ++-- src/components/application_manager/src/smart_object_keys.cc | 1 + .../test/commands/hmi/navi_set_video_config_request_test.cc | 8 +++++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index ffdd7f26ce..fcbc191f4b 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -344,6 +344,7 @@ extern const char* const protocol; extern const char* const codec; extern const char* const width; extern const char* const height; +extern const char* const rejected_params; } // namespace strings namespace json { diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc index 8205cae679..f019512fa6 100644 --- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc @@ -95,9 +95,9 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { "Received SetVideoConfig failure response (" << event.id() << ")"); result = false; - if (message[strings::msg_params].keyExists("rejectedParams")) { + if (message[strings::msg_params].keyExists(strings::rejected_params)) { const smart_objects::SmartArray* list = - message[strings::msg_params]["rejectedParams"].asArray(); + message[strings::msg_params][strings::rejected_params].asArray(); if (list != NULL) { for (unsigned int i = 0; i < list->size(); i++) { const std::string& param = (*list)[i].asString(); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 3652656af3..a95480bcd5 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -305,6 +305,7 @@ const char* const protocol = "protocol"; const char* const codec = "codec"; const char* const width = "width"; const char* const height = "height"; +const char* const rejected_params = "rejectedParams"; } // namespace strings namespace json { diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc index 978ac2876a..d209a475c5 100644 --- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc @@ -152,10 +152,12 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { (*event_msg)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::REJECTED; - (*event_msg)[am::strings::msg_params]["rejectedParams"] = + (*event_msg)[am::strings::msg_params][am::strings::rejected_params] = smart_objects::SmartObject(smart_objects::SmartType_Array); - (*event_msg)[am::strings::msg_params]["rejectedParams"][0] = "codec"; - (*event_msg)[am::strings::msg_params]["rejectedParams"][1] = "protocol"; + (*event_msg)[am::strings::msg_params][am::strings::rejected_params][0] = + "codec"; + (*event_msg)[am::strings::msg_params][am::strings::rejected_params][1] = + "protocol"; Event event(kEventID); event.set_smart_object(*event_msg); -- cgit v1.2.1 From 44af4d4cf1410361ae9943702d10a398bbe30d8b Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 11:05:30 +0900 Subject: Add definitions of newly added keys Reflecting review comments. --- .../application_manager/smart_object_keys.h | 5 ++ .../application_manager/src/smart_object_keys.cc | 5 ++ .../hmi/ui_get_capabilities_response_test.cc | 32 ++++++++----- .../test/hmi_capabilities_test.cc | 55 ++++++++++++++-------- 4 files changed, 65 insertions(+), 32 deletions(-) diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index fcbc191f4b..78085078e0 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -345,6 +345,11 @@ extern const char* const codec; extern const char* const width; extern const char* const height; extern const char* const rejected_params; +extern const char* const preferred_resolution; +extern const char* const resolution_width; +extern const char* const resolution_height; +extern const char* const max_bitrate; +extern const char* const supported_formats; } // namespace strings namespace json { diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index a95480bcd5..75d324699c 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -306,6 +306,11 @@ const char* const codec = "codec"; const char* const width = "width"; const char* const height = "height"; const char* const rejected_params = "rejectedParams"; +const char* const preferred_resolution = "preferredResolution"; +const char* const resolution_width = "resolutionWidth"; +const char* const resolution_height = "resolutionHeight"; +const char* const max_bitrate = "maxBitrate"; +const char* const supported_formats = "supportedFormats"; } // namespace strings namespace json { diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index 1b91ccc5ac..4493b5997a 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -299,35 +299,43 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { smart_objects::SmartObject(smart_objects::SmartType_Map); (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]["preferredResolution"] = + [strings::video_streaming_capability] + [strings::preferred_resolution] = smart_objects::SmartObject(smart_objects::SmartType_Map); (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]["preferredResolution"] - ["resolutionWidth"] = 800; + [strings::video_streaming_capability] + [strings::preferred_resolution][strings::resolution_width] = + 800; (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]["preferredResolution"] - ["resolutionWidth"] = 350; + [strings::video_streaming_capability] + [strings::preferred_resolution][strings::resolution_width] = + 350; (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]["maxBitrate"] = 10000; + [strings::video_streaming_capability][strings::max_bitrate] = + 10000; (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]["supportedFormats"] = + [strings::video_streaming_capability] + [strings::supported_formats] = smart_objects::SmartObject(smart_objects::SmartType_Array); (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]["supportedFormats"][0] = + [strings::video_streaming_capability] + [strings::supported_formats][0] = smart_objects::SmartObject(smart_objects::SmartType_Map); (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]["supportedFormats"][0] - ["protocol"] = hmi_apis::Common_VideoStreamingProtocol::RAW; + [strings::video_streaming_capability] + [strings::supported_formats][0][strings::protocol] = + hmi_apis::Common_VideoStreamingProtocol::RAW; (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]["supportedFormats"][0] - ["codec"] = hmi_apis::Common_VideoStreamingCodec::H264; + [strings::video_streaming_capability] + [strings::supported_formats][0][strings::codec] = + hmi_apis::Common_VideoStreamingCodec::H264; ResponseFromHMIPtr command( CreateCommand(command_msg)); diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index cda885f4ae..6e4f5f0d65 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -375,29 +375,44 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { const smart_objects::SmartObject vs_capability_so = *(hmi_capabilities_test->video_streaming_capability()); - EXPECT_TRUE(vs_capability_so.keyExists("preferredResolution")); - EXPECT_TRUE( - vs_capability_so["preferredResolution"].keyExists("resolutionWidth")); - EXPECT_TRUE( - vs_capability_so["preferredResolution"].keyExists("resolutionHeight")); - EXPECT_EQ(800, - vs_capability_so["preferredResolution"]["resolutionWidth"].asInt()); + EXPECT_TRUE(vs_capability_so.keyExists(strings::preferred_resolution)); + EXPECT_TRUE(vs_capability_so[strings::preferred_resolution].keyExists( + strings::resolution_width)); + EXPECT_TRUE(vs_capability_so[strings::preferred_resolution].keyExists( + strings::resolution_height)); EXPECT_EQ( - 350, vs_capability_so["preferredResolution"]["resolutionHeight"].asInt()); - EXPECT_TRUE(vs_capability_so.keyExists("maxBitrate")); - EXPECT_EQ(10000, vs_capability_so["maxBitrate"].asInt()); - EXPECT_TRUE(vs_capability_so.keyExists("supportedFormats")); + 800, + vs_capability_so[strings::preferred_resolution][strings::resolution_width] + .asInt()); + EXPECT_EQ(350, + vs_capability_so[strings::preferred_resolution] + [strings::resolution_height].asInt()); + EXPECT_TRUE(vs_capability_so.keyExists(strings::max_bitrate)); + EXPECT_EQ(10000, vs_capability_so[strings::max_bitrate].asInt()); + EXPECT_TRUE(vs_capability_so.keyExists(strings::supported_formats)); const uint32_t supported_formats_len = - vs_capability_so["supportedFormats"].length(); + vs_capability_so[strings::supported_formats].length(); EXPECT_EQ(2u, supported_formats_len); - EXPECT_TRUE(vs_capability_so["supportedFormats"][0].keyExists("protocol")); - EXPECT_TRUE(vs_capability_so["supportedFormats"][0].keyExists("codec")); - EXPECT_EQ(0, vs_capability_so["supportedFormats"][0]["protocol"].asInt()); - EXPECT_EQ(0, vs_capability_so["supportedFormats"][0]["codec"].asInt()); - EXPECT_TRUE(vs_capability_so["supportedFormats"][1].keyExists("protocol")); - EXPECT_TRUE(vs_capability_so["supportedFormats"][1].keyExists("codec")); - EXPECT_EQ(1, vs_capability_so["supportedFormats"][1]["protocol"].asInt()); - EXPECT_EQ(2, vs_capability_so["supportedFormats"][1]["codec"].asInt()); + EXPECT_TRUE(vs_capability_so[strings::supported_formats][0].keyExists( + strings::protocol)); + EXPECT_TRUE(vs_capability_so[strings::supported_formats][0].keyExists( + strings::codec)); + EXPECT_EQ(0, + vs_capability_so[strings::supported_formats][0][strings::protocol] + .asInt()); + EXPECT_EQ( + 0, + vs_capability_so[strings::supported_formats][0][strings::codec].asInt()); + EXPECT_TRUE(vs_capability_so[strings::supported_formats][1].keyExists( + strings::protocol)); + EXPECT_TRUE(vs_capability_so[strings::supported_formats][1].keyExists( + strings::codec)); + EXPECT_EQ(1, + vs_capability_so[strings::supported_formats][1][strings::protocol] + .asInt()); + EXPECT_EQ( + 2, + vs_capability_so[strings::supported_formats][1][strings::codec].asInt()); } TEST_F(HMICapabilitiesTest, VerifyImageType) { -- cgit v1.2.1 From fcf4563ce4f0494777be7fe66b43a7b8808efd2f Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 11:07:00 +0900 Subject: fix: copy-paste mistake in test data --- .../test/commands/hmi/ui_get_capabilities_response_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index 4493b5997a..3b41284e9e 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -310,7 +310,7 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { (*command_msg)[strings::msg_params][strings::system_capabilities] [strings::video_streaming_capability] - [strings::preferred_resolution][strings::resolution_width] = + [strings::preferred_resolution][strings::resolution_height] = 350; (*command_msg)[strings::msg_params][strings::system_capabilities] -- cgit v1.2.1 From 65f356c44d339aa860a52cee1dff35a37047f35d Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 18:31:05 +0900 Subject: fix: session ID and hash ID may be notified to wrong proxy This commit includes following changes: - Add connection_id and session_id args in ProtocolHandler::NotifySessionStartedResult() - Use pair of connection_id and session_id to remember the request packet until NotifySessionStartedResult() is called Reflecting review comments. --- .../connection_handler/connection_handler_impl.h | 8 +- .../src/connection_handler_impl.cc | 38 ++++++-- .../test/connection_handler_impl_test.cc | 101 ++++++++++++--------- .../include/protocol_handler/protocol_handler.h | 12 ++- .../test/protocol_handler/mock_protocol_handler.h | 6 +- .../protocol_handler/protocol_handler_impl.h | 18 ++-- .../protocol_handler/src/protocol_handler_impl.cc | 48 ++++++---- .../test/protocol_handler_tm_test.cc | 54 ++++++++--- 8 files changed, 187 insertions(+), 98 deletions(-) diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h index d1dbc08ec0..01a8970680 100644 --- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h +++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h @@ -536,9 +536,15 @@ class ConnectionHandlerImpl /** * \brief Convenient method to call NotifySessionStartedResult() with * negative result. + * \param connection_handle Identifier of connection within which session + * exists + * \param session_id session ID passed to OnSessionStartedCallback() * \param is_protected whether the service would be protected **/ - void NotifySessionStartedFailure(bool is_protected); + void NotifySessionStartedFailure( + const transport_manager::ConnectionUID connection_handle, + const uint8_t session_id, + bool is_protected); const ConnectionHandlerSettings& settings_; /** diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index d805412666..d4bf9530dd 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -364,8 +364,12 @@ void ConnectionHandlerImpl::OnSessionStartedCallback( #ifdef ENABLE_SECURITY if (!AllowProtection(get_settings(), service_type, is_protected)) { std::vector empty; - protocol_handler_->NotifySessionStartedResult( - new_session_id, hash_id, is_protected, empty); + protocol_handler_->NotifySessionStartedResult(connection_handle, + session_id, + new_session_id, + hash_id, + is_protected, + empty); return; } #endif // ENABLE_SECURITY @@ -373,7 +377,7 @@ void ConnectionHandlerImpl::OnSessionStartedCallback( ConnectionList::iterator it = connection_list_.find(connection_handle); if (connection_list_.end() == it) { LOG4CXX_ERROR(logger_, "Unknown connection!"); - NotifySessionStartedFailure(is_protected); + NotifySessionStartedFailure(connection_handle, session_id, is_protected); return; } @@ -382,7 +386,7 @@ void ConnectionHandlerImpl::OnSessionStartedCallback( new_session_id = connection->AddNewSession(); if (0 == new_session_id) { LOG4CXX_ERROR(logger_, "Couldn't start new session!"); - NotifySessionStartedFailure(is_protected); + NotifySessionStartedFailure(connection_handle, session_id, is_protected); return; } hash_id = KeyFromPair(connection_handle, new_session_id); @@ -395,7 +399,7 @@ void ConnectionHandlerImpl::OnSessionStartedCallback( #endif // ENABLE_SECURITY << " service " << static_cast(service_type) << " for session " << static_cast(session_id)); - NotifySessionStartedFailure(is_protected); + NotifySessionStartedFailure(connection_handle, session_id, is_protected); return; } new_session_id = session_id; @@ -421,8 +425,12 @@ void ConnectionHandlerImpl::OnSessionStartedCallback( } else { if (protocol_handler_) { std::vector empty; - protocol_handler_->NotifySessionStartedResult( - new_session_id, hash_id, is_protected, empty); + protocol_handler_->NotifySessionStartedResult(connection_handle, + session_id, + new_session_id, + hash_id, + is_protected, + empty); } } } @@ -462,19 +470,29 @@ void ConnectionHandlerImpl::NotifyServiceStartedResult( } if (protocol_handler_ != NULL) { - protocol_handler_->NotifySessionStartedResult(context.new_session_id_, + protocol_handler_->NotifySessionStartedResult(context.connection_handle_, + context.session_id_, + context.new_session_id_, context.hash_id_, context.is_protected_, rejected_params); } } -void ConnectionHandlerImpl::NotifySessionStartedFailure(bool is_protected) { +void ConnectionHandlerImpl::NotifySessionStartedFailure( + const transport_manager::ConnectionUID connection_handle, + const uint8_t session_id, + bool is_protected) { LOG4CXX_AUTO_TRACE(logger_); if (protocol_handler_) { std::vector empty; protocol_handler_->NotifySessionStartedResult( - 0, protocol_handler::HASH_ID_WRONG, is_protected, empty); + connection_handle, + session_id, + 0, + protocol_handler::HASH_ID_WRONG, + is_protected, + empty); } } diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc index 577b65f0e9..99805b745c 100644 --- a/src/components/connection_handler/test/connection_handler_impl_test.cc +++ b/src/components/connection_handler/test/connection_handler_impl_test.cc @@ -118,9 +118,10 @@ class ConnectionHandlerTest : public ::testing::Test { void AddTestSession() { protocol_handler_test::MockProtocolHandler temp_protocol_handler; connection_handler_->set_protocol_handler(&temp_protocol_handler); - EXPECT_CALL(temp_protocol_handler, NotifySessionStartedResult(_, _, _, _)) + EXPECT_CALL(temp_protocol_handler, + NotifySessionStartedResult(_, _, _, _, _, _)) .WillOnce( - DoAll(SaveArg<0>(&start_session_id_), SaveArg<1>(&out_hash_id_))); + DoAll(SaveArg<2>(&start_session_id_), SaveArg<3>(&out_hash_id_))); connection_handler_->OnSessionStartedCallback( uid_, 0, kRpc, PROTECTION_OFF, static_cast(NULL)); @@ -142,8 +143,9 @@ class ConnectionHandlerTest : public ::testing::Test { uint32_t session_id = 0; protocol_handler_test::MockProtocolHandler temp_protocol_handler; connection_handler_->set_protocol_handler(&temp_protocol_handler); - EXPECT_CALL(temp_protocol_handler, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(SaveArg<0>(&session_id)); + EXPECT_CALL(temp_protocol_handler, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(SaveArg<2>(&session_id)); connection_handler_->OnSessionStartedCallback(uid_, start_session_id_, @@ -295,8 +297,9 @@ TEST_F(ConnectionHandlerTest, StartSession_NoConnection) { // Start new session with RPC service uint32_t result_fail = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(DoAll(SaveArg<0>(&result_fail), SaveArg<1>(&out_hash_id_))); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(DoAll(SaveArg<2>(&result_fail), SaveArg<3>(&out_hash_id_))); connection_handler_->OnSessionStartedCallback( uid_, sessionID, kRpc, PROTECTION_ON, static_cast(NULL)); @@ -1047,9 +1050,10 @@ TEST_F(ConnectionHandlerTest, StartService_withServices) { uint32_t start_audio = 0; uint32_t start_video = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(DoAll(SaveArg<0>(&start_audio), SaveArg<1>(&out_hash_id_))) - .WillOnce(DoAll(SaveArg<0>(&start_video), SaveArg<1>(&out_hash_id_))); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(DoAll(SaveArg<2>(&start_audio), SaveArg<3>(&out_hash_id_))) + .WillOnce(DoAll(SaveArg<2>(&start_video), SaveArg<3>(&out_hash_id_))); // Start Audio service connection_handler_->OnSessionStartedCallback(uid_, @@ -1085,8 +1089,8 @@ TEST_F(ConnectionHandlerTest, StartService_withServices_withParams) { BsonObject* dummy_param = reinterpret_cast(&dummy); connection_handler_->set_protocol_handler(&mock_protocol_handler_); EXPECT_CALL(mock_protocol_handler_, - NotifySessionStartedResult(_, _, _, empty)) - .WillOnce(DoAll(SaveArg<0>(&start_video), SaveArg<1>(&out_hash_id_))); + NotifySessionStartedResult(_, _, _, _, _, empty)) + .WillOnce(DoAll(SaveArg<2>(&start_video), SaveArg<3>(&out_hash_id_))); connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, kMobileNav, PROTECTION_OFF, dummy_param); @@ -1124,9 +1128,10 @@ TEST_F(ConnectionHandlerTest, ServiceStop) { uint32_t start_audio = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) .WillRepeatedly( - DoAll(SaveArg<0>(&start_audio), SaveArg<1>(&out_hash_id_))); + DoAll(SaveArg<2>(&start_audio), SaveArg<3>(&out_hash_id_))); // Check ignoring hash_id on stop non-rpc service for (uint32_t some_hash_id = 0; some_hash_id < 0xFF; ++some_hash_id) { @@ -1213,8 +1218,9 @@ TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) { uint32_t new_session_id = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(DoAll(SaveArg<0>(&new_session_id), SaveArg<1>(&out_hash_id_))); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(DoAll(SaveArg<2>(&new_session_id), SaveArg<3>(&out_hash_id_))); // Start new session with RPC service connection_handler_->OnSessionStartedCallback( @@ -1250,8 +1256,8 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_SUCCESS) { uint32_t new_session_id = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); EXPECT_CALL(mock_protocol_handler_, - NotifySessionStartedResult(_, _, false, empty)) - .WillOnce(DoAll(SaveArg<0>(&new_session_id), SaveArg<1>(&out_hash_id_))); + NotifySessionStartedResult(_, _, _, _, false, empty)) + .WillOnce(DoAll(SaveArg<2>(&new_session_id), SaveArg<3>(&out_hash_id_))); connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, kMobileNav, PROTECTION_OFF, dummy_params); @@ -1286,8 +1292,8 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_FAILURE) { uint32_t new_session_id = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); EXPECT_CALL(mock_protocol_handler_, - NotifySessionStartedResult(_, _, false, empty)) - .WillOnce(DoAll(SaveArg<0>(&new_session_id), SaveArg<1>(&out_hash_id_))); + NotifySessionStartedResult(_, _, _, _, false, empty)) + .WillOnce(DoAll(SaveArg<2>(&new_session_id), SaveArg<3>(&out_hash_id_))); connection_handler_->OnSessionStartedCallback( uid_, start_session_id_, kMobileNav, PROTECTION_OFF, dummy_params); @@ -1308,9 +1314,10 @@ TEST_F(ConnectionHandlerTest, uint32_t session_id_fail = 0; uint32_t session_id = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(DoAll(SaveArg<0>(&session_id_fail), SaveArg<1>(&out_hash_id_))) - .WillOnce(DoAll(SaveArg<0>(&session_id), SaveArg<1>(&out_hash_id_))); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(DoAll(SaveArg<2>(&session_id_fail), SaveArg<3>(&out_hash_id_))) + .WillOnce(DoAll(SaveArg<2>(&session_id), SaveArg<3>(&out_hash_id_))); // Start new session with RPC service connection_handler_->OnSessionStartedCallback( @@ -1349,9 +1356,10 @@ TEST_F(ConnectionHandlerTest, uint32_t session_id_fail = 0; uint32_t session_id = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(SaveArg<0>(&session_id_fail)) - .WillOnce(DoAll(SaveArg<0>(&session_id), SaveArg<1>(&out_hash_id_))); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(SaveArg<2>(&session_id_fail)) + .WillOnce(DoAll(SaveArg<2>(&session_id), SaveArg<3>(&out_hash_id_))); // Start new session with RPC service connection_handler_->OnSessionStartedCallback( @@ -1391,9 +1399,10 @@ TEST_F(ConnectionHandlerTest, uint32_t session_id2 = 0; uint32_t session_id3 = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(SaveArg<0>(&session_id2)) - .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(SaveArg<2>(&session_id2)) + .WillOnce(DoAll(SaveArg<2>(&session_id3), SaveArg<3>(&out_hash_id_))); // Start new session with Audio service connection_handler_->OnSessionStartedCallback(uid_, @@ -1444,9 +1453,10 @@ TEST_F(ConnectionHandlerTest, uint32_t session_id_reject = 0; uint32_t session_id3 = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(SaveArg<0>(&session_id_reject)) - .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(SaveArg<2>(&session_id_reject)) + .WillOnce(DoAll(SaveArg<2>(&session_id3), SaveArg<3>(&out_hash_id_))); // Start new session with Audio service connection_handler_->OnSessionStartedCallback(uid_, @@ -1487,10 +1497,11 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtect) { uint32_t session_id2 = 0; uint32_t session_id3 = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(DoAll(SaveArg<0>(&session_id_new), SaveArg<1>(&out_hash_id_))) - .WillOnce(DoAll(SaveArg<0>(&session_id2), SaveArg<1>(&out_hash_id_))) - .WillOnce(DoAll(SaveArg<0>(&session_id3), SaveArg<1>(&out_hash_id_))); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(DoAll(SaveArg<2>(&session_id_new), SaveArg<3>(&out_hash_id_))) + .WillOnce(DoAll(SaveArg<2>(&session_id2), SaveArg<3>(&out_hash_id_))) + .WillOnce(DoAll(SaveArg<2>(&session_id3), SaveArg<3>(&out_hash_id_))); // Start RPC protection connection_handler_->OnSessionStartedCallback(uid_, @@ -1543,8 +1554,9 @@ TEST_F(ConnectionHandlerTest, SessionStarted_DealyProtectBulk) { uint32_t session_id_new = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(SaveArg<0>(&session_id_new)); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(SaveArg<2>(&session_id_new)); connection_handler_->OnSessionStartedCallback(uid_, start_session_id_, kBulk, @@ -1647,8 +1659,9 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByProtectedService) { uint32_t session_id = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(SaveArg<0>(&session_id)); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(SaveArg<2>(&session_id)); // Open kAudio service connection_handler_->OnSessionStartedCallback(uid_, @@ -1680,8 +1693,9 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedRPC) { uint32_t session_id = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(SaveArg<0>(&session_id)); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(SaveArg<2>(&session_id)); // Protect kRpc (Bulk will be protect also) connection_handler_->OnSessionStartedCallback(uid_, @@ -1716,8 +1730,9 @@ TEST_F(ConnectionHandlerTest, GetSSLContext_ByDealyProtectedBulk) { uint32_t session_id = 0; connection_handler_->set_protocol_handler(&mock_protocol_handler_); - EXPECT_CALL(mock_protocol_handler_, NotifySessionStartedResult(_, _, _, _)) - .WillOnce(SaveArg<0>(&session_id)); + EXPECT_CALL(mock_protocol_handler_, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(SaveArg<2>(&session_id)); // Protect Bulk (kRpc will be protected also) connection_handler_->OnSessionStartedCallback(uid_, diff --git a/src/components/include/protocol_handler/protocol_handler.h b/src/components/include/protocol_handler/protocol_handler.h index 5a3a2754cb..34135617bd 100644 --- a/src/components/include/protocol_handler/protocol_handler.h +++ b/src/components/include/protocol_handler/protocol_handler.h @@ -111,16 +111,20 @@ class ProtocolHandler { /** * \brief Called by connection handler to notify the result of * OnSessionStartedCallback(). - * \param session_id Generated session ID, will be 0 if session is not - * started + * \param connection_id Identifier of connection within which session exists + * \param session_id session ID passed to OnSessionStartedCallback() + * \param generated_session_id Generated session ID, will be 0 if session is + * not started * \param hash_id Generated Hash ID * \param protection whether the service will be protected * \param rejected_params list of parameters' name that are rejected. - * Only valid when session_id is 0. Note, even if session_id is 0, the - * list may be empty. + * Only valid when generated_session_id is 0. Note, even if + * generated_session_id is 0, the list may be empty. */ virtual void NotifySessionStartedResult( + int32_t connection_id, uint8_t session_id, + uint8_t generated_session_id, uint32_t hash_id, bool protection, std::vector& rejected_params) = 0; diff --git a/src/components/include/test/protocol_handler/mock_protocol_handler.h b/src/components/include/test/protocol_handler/mock_protocol_handler.h index acb06ea6df..37fbbb9742 100644 --- a/src/components/include/test/protocol_handler/mock_protocol_handler.h +++ b/src/components/include/test/protocol_handler/mock_protocol_handler.h @@ -62,8 +62,10 @@ class MockProtocolHandler : public ::protocol_handler::ProtocolHandler { MOCK_CONST_METHOD0(get_settings, const ::protocol_handler::ProtocolHandlerSettings&()); MOCK_METHOD0(get_session_observer, protocol_handler::SessionObserver&()); - MOCK_METHOD4(NotifySessionStartedResult, - void(uint8_t session_id, + MOCK_METHOD6(NotifySessionStartedResult, + void(int32_t connection_id, + uint8_t session_id, + uint8_t generated_session_id, uint32_t hash_id, bool protection, std::vector& rejected_params)); diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index ad70dfc62b..c312d34aed 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -84,6 +84,8 @@ class MessagesToMobileAppHandler; using transport_manager::TransportManagerListenerEmpty; typedef std::multimap MessagesOverNaviMap; +typedef std::map, ProtocolFramePtr> + StartSessionFrameMap; typedef std::set ProtocolObservers; typedef transport_manager::ConnectionUID ConnectionID; @@ -352,16 +354,20 @@ class ProtocolHandlerImpl /** * \brief Called by connection handler to notify the result of * OnSessionStartedCallback(). - * \param session_id Generated session ID, will be 0 if session is not - * started + * \param connection_id Identifier of connection within which session exists + * \param session_id session ID passed to OnSessionStartedCallback() + * \param generated_session_id Generated session ID, will be 0 if session is + * not started * \param hash_id Generated Hash ID * \param protection whether the service will be protected * \param rejected_params list of parameters' name that are rejected. - * Only valid when session_id is 0. Note, even if session_id is 0, the - * list may be empty. + * Only valid when generated_session_id is 0. Note, even if + * generated_session_id is 0, the list may be empty. */ void NotifySessionStartedResult( + int32_t connection_id, uint8_t session_id, + uint8_t generated_session_id, uint32_t hash_id, bool protection, std::vector& rejected_params) OVERRIDE; @@ -638,8 +644,8 @@ class ProtocolHandlerImpl sync_primitives::Lock protocol_observers_lock_; - // we need thread-safe queue - utils::MessageQueue start_session_frame_queue_; + sync_primitives::Lock start_session_frame_map_lock_; + StartSessionFrameMap start_session_frame_map_; #ifdef TELEMETRY_MONITOR PHTelemetryObserver* metric_observer_; diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index f7da33deed..4eb01cec12 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -81,7 +81,8 @@ ProtocolHandlerImpl::ProtocolHandlerImpl( "PH FromMobile", this, threads::ThreadOptions(kStackSize)) , raw_ford_messages_to_mobile_( "PH ToMobile", this, threads::ThreadOptions(kStackSize)) - , start_session_frame_queue_() + , start_session_frame_map_lock_() + , start_session_frame_map_() #ifdef TELEMETRY_MONITOR , metric_observer_(NULL) #endif // TELEMETRY_MONITOR @@ -1432,8 +1433,13 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( #endif // ENABLE_SECURITY const ConnectionID connection_id = packet->connection_id(); + const uint8_t session_id = packet->session_id(); - start_session_frame_queue_.push(packet); + { + sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_); + start_session_frame_map_[std::make_pair(connection_id, session_id)] = + packet; + } session_observer_.OnSessionStartedCallback( connection_id, packet->session_id(), service_type, protection, &bson_obj); @@ -1443,29 +1449,34 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( } void ProtocolHandlerImpl::NotifySessionStartedResult( + int32_t connection_id, uint8_t session_id, + uint8_t generated_session_id, uint32_t hash_id, bool protection, std::vector& rejected_params) { - ProtocolFramePtr packet; - bool available = start_session_frame_queue_.pop(packet); - if (!available) { - LOG4CXX_ERROR(logger_, - "Cannot find Session Started packet"); - return; + { + sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_); + StartSessionFrameMap::iterator it = start_session_frame_map_.find( + std::make_pair(connection_id, session_id)); + if (it == start_session_frame_map_.end()) { + LOG4CXX_ERROR(logger_, "Cannot find Session Started packet"); + return; + } + packet = it->second; + start_session_frame_map_.erase(it); } const ServiceType service_type = ServiceTypeFromByte(packet->service_type()); const uint8_t protocol_version = packet->protocol_version(); - const ConnectionID connection_id = packet->connection_id(); - if (0 == session_id) { + if (0 == generated_session_id) { LOG4CXX_WARN(logger_, "Refused by session_observer to create service " << static_cast(service_type) << " type."); SendStartSessionNAck(connection_id, - session_id, + packet->session_id(), protocol_version, packet->service_type(), rejected_params); @@ -1476,7 +1487,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( // for packet is encrypted and security plugin is enable if (protection && security_manager_) { const uint32_t connection_key = - session_observer_.KeyFromPair(connection_id, session_id); + session_observer_.KeyFromPair(connection_id, generated_session_id); security_manager::SSLContext* ssl_context = security_manager_->CreateSSLContext(connection_key); @@ -1489,7 +1500,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( error); // Start service without protection SendStartSessionAck(connection_id, - session_id, + generated_session_id, packet->protocol_version(), hash_id, packet->service_type(), @@ -1524,7 +1535,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( session_observer_.SetProtectionFlag(connection_key, service_type); // Start service as protected with current SSLContext SendStartSessionAck(connection_id, - session_id, + generated_session_id, packet->protocol_version(), hash_id, packet->service_type(), @@ -1536,7 +1547,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( this, session_observer_, connection_id, - session_id, + generated_session_id, packet->protocol_version(), hash_id, service_type, @@ -1563,7 +1574,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( if (fullVersion.majorVersion >= PROTOCOL_VERSION_5) { // Start service without protection SendStartSessionAck(connection_id, - session_id, + generated_session_id, packet->protocol_version(), hash_id, packet->service_type(), @@ -1582,7 +1593,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( } else { // Start service without protection SendStartSessionAck(connection_id, - session_id, + generated_session_id, packet->protocol_version(), hash_id, packet->service_type(), @@ -1756,6 +1767,9 @@ void ProtocolHandlerImpl::Handle(const impl::RawFordMessageToMobile message) { void ProtocolHandlerImpl::Stop() { raw_ford_messages_from_mobile_.Shutdown(); raw_ford_messages_to_mobile_.Shutdown(); + + sync_primitives::AutoLock auto_lock(start_session_frame_map_lock_); + start_session_frame_map_.clear(); } #ifdef ENABLE_SECURITY diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index 397ee5bd3e..d0ffef39a5 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -107,9 +107,9 @@ using ::testing::SetArgPointee; typedef std::vector UCharDataVector; -// custom action to call a member function with 4 arguments -ACTION_P6(InvokeMemberFuncWithArg4, ptr, memberFunc, a, b, c, d) { - (ptr->*memberFunc)(a, b, c, d); +// custom action to call a member function with 6 arguments +ACTION_P8(InvokeMemberFuncWithArg6, ptr, memberFunc, a, b, c, d, e, f) { + (ptr->*memberFunc)(a, b, c, d, e, f); } namespace { @@ -211,9 +211,11 @@ class ProtocolHandlerImplTest : public ::testing::Test { . // Return sessions start success WillOnce(DoAll(NotifyTestAsyncWaiter(waiter), - InvokeMemberFuncWithArg4( + InvokeMemberFuncWithArg6( protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, callback_protection_flag, @@ -377,8 +379,10 @@ TEST_F(ProtocolHandlerImplTest, // Return sessions start rejection WillRepeatedly(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, SESSION_START_REJECT, HASH_ID_WRONG, PROTECTION_OFF, @@ -441,8 +445,10 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) { // Return sessions start rejection WillRepeatedly(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, SESSION_START_REJECT, HASH_ID_WRONG, callback_protection_flag, @@ -494,8 +500,10 @@ TEST_F(ProtocolHandlerImplTest, // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_OFF, @@ -631,8 +639,10 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_OFF, @@ -685,8 +695,10 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) { // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_OFF, @@ -729,8 +741,10 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) { // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_ON, @@ -782,8 +796,10 @@ TEST_F(ProtocolHandlerImplTest, // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_ON, @@ -848,8 +864,10 @@ TEST_F(ProtocolHandlerImplTest, // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_ON, @@ -939,8 +957,10 @@ TEST_F(ProtocolHandlerImplTest, // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_ON, @@ -1035,8 +1055,10 @@ TEST_F( // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_ON, @@ -1129,8 +1151,10 @@ TEST_F(ProtocolHandlerImplTest, // Return sessions start success WillOnce(DoAll( NotifyTestAsyncWaiter(&waiter), - InvokeMemberFuncWithArg4(protocol_handler_impl.get(), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), &ProtocolHandler::NotifySessionStartedResult, + connection_id, + NEW_SESSION_ID, session_id, HASH_ID_WRONG, PROTECTION_ON, -- cgit v1.2.1 From 521d90dd97c5f50909fe775b6286983dfcf5b5da Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 15:53:44 +0900 Subject: Add unit test to simulate two video StartService packets --- .../test/protocol_handler_tm_test.cc | 172 +++++++++++++++++++++ 1 file changed, 172 insertions(+) diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index d0ffef39a5..7a7a8dd611 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -45,6 +45,7 @@ #include "transport_manager/mock_transport_manager.h" #include "utils/make_shared.h" #include "utils/test_async_waiter.h" +#include namespace test { namespace components { @@ -100,6 +101,7 @@ using ::testing::An; using ::testing::AnyOf; using ::testing::ByRef; using ::testing::DoAll; +using ::testing::Eq; using ::testing::_; using ::testing::Invoke; using ::testing::SetArgReferee; @@ -540,6 +542,176 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) { EXPECT_TRUE(waiter->WaitFor(times, kAsyncExpectationsTimeout)); } + +static std::vector CreateVectorFromBsonObject(const BsonObject* bo) { + std::vector output; + if (bo != NULL) { + size_t len = bson_object_size(const_cast(bo)); + uint8_t* bytes = bson_object_to_bytes(const_cast(bo)); + output.assign(bytes, bytes + len); + free(bytes); + } + return output; +} + +/* + * Simulate two StartService messages of video service from mobile. + * Session observer accepts the first message with delay, while rejects the + * second message immediately. + */ +TEST_F(ProtocolHandlerImplTest, + StartSession_Unprotected_Multiple_SessionObserverAcceptAndReject) { + using namespace protocol_handler; + + ON_CALL(protocol_handler_settings_mock, enable_protocol_5()) + .WillByDefault(Return(true)); + + const size_t maximum_payload_size = 1000; + InitProtocolHandlerImpl(0u, 0u, false, 0u, 0u, 0, maximum_payload_size); + + const ServiceType start_service = kMobileNav; + const ::transport_manager::ConnectionUID connection_id1 = 0xAu; + const uint8_t session_id1 = 1u; + const ::transport_manager::ConnectionUID connection_id2 = 0xBu; + const uint8_t session_id2 = 2u; + + EXPECT_CALL(session_observer_mock, IsHeartBeatSupported(connection_id1, _)) + .WillRepeatedly(Return(false)); + EXPECT_CALL(session_observer_mock, IsHeartBeatSupported(connection_id2, _)) + .WillRepeatedly(Return(false)); + + // Add two connections + tm_listener->OnConnectionEstablished(DeviceInfo(DeviceHandle(1u), + std::string("mac"), + std::string("name"), + std::string("BTMAC")), + connection_id1); + tm_listener->OnConnectionEstablished(DeviceInfo(DeviceHandle(2u), + std::string("mac"), + std::string("name"), + std::string("BTMAC")), + connection_id2); + + TestAsyncWaiter waiter; + uint32_t times = 0; + + BsonObject bson_params1; + bson_object_initialize_default(&bson_params1); + bson_object_put_string( + &bson_params1, "videoProtocol", const_cast("RAW")); + bson_object_put_string( + &bson_params1, "videoCodec", const_cast("H264")); + std::vector params1 = CreateVectorFromBsonObject(&bson_params1); + + uint8_t generated_session_id1 = 100; + std::vector empty; + + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id1, + session_id1, + start_service, + PROTECTION_OFF, + An())) + // don't call NotifySessionStartedResult() immediately, instead call it + // after second OnSessionStartedCallback() + .WillOnce(NotifyTestAsyncWaiter(&waiter)); + times++; + + BsonObject bson_params2; + bson_object_initialize_default(&bson_params2); + bson_object_put_string( + &bson_params2, "videoProtocol", const_cast("RTP")); + bson_object_put_string( + &bson_params2, "videoCodec", const_cast("H265")); + std::vector params2 = CreateVectorFromBsonObject(&bson_params2); + + std::vector rejected_param_list; + rejected_param_list.push_back("videoCodec"); + + EXPECT_CALL(session_observer_mock, + OnSessionStartedCallback(connection_id2, + session_id2, + start_service, + PROTECTION_OFF, + An())) + .WillOnce(DoAll( + NotifyTestAsyncWaiter(&waiter), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + connection_id2, + session_id2, + SESSION_START_REJECT, + HASH_ID_WRONG, + PROTECTION_OFF, + ByRef(rejected_param_list)), + InvokeMemberFuncWithArg6(protocol_handler_impl.get(), + &ProtocolHandler::NotifySessionStartedResult, + connection_id1, + session_id1, + generated_session_id1, + HASH_ID_WRONG, + PROTECTION_OFF, + ByRef(empty)))); + times++; + + EXPECT_CALL(transport_manager_mock, + SendMessageToDevice(ControlMessage( + FRAME_DATA_START_SERVICE_ACK, + PROTECTION_OFF, + connection_id1, + _))) // skip checking of non-video parameters like mtu + .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS))); + times++; + + BsonArray bson_arr; + bson_array_initialize(&bson_arr, rejected_param_list.size()); + for (unsigned int i = 0; i < rejected_param_list.size(); i++) { + bson_array_add_string(&bson_arr, + const_cast(rejected_param_list[i].c_str())); + } + BsonObject bson_nack_params; + bson_object_initialize_default(&bson_nack_params); + bson_object_put_array(&bson_nack_params, "rejectedParams", &bson_arr); + std::vector nack_params = + CreateVectorFromBsonObject(&bson_nack_params); + bson_object_deinitialize(&bson_nack_params); + + EXPECT_CALL(transport_manager_mock, + SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_NACK, + PROTECTION_OFF, + connection_id2, + Eq(nack_params)))) + .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS))); + times++; + + SendTMMessage(connection_id1, + PROTOCOL_VERSION_5, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + start_service, + FRAME_DATA_START_SERVICE, + session_id1, + params1.size(), + message_id, + params1.size() > 0 ? ¶ms1[0] : NULL); + + SendTMMessage(connection_id2, + PROTOCOL_VERSION_5, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + start_service, + FRAME_DATA_START_SERVICE, + session_id2, + params2.size(), + message_id, + params2.size() > 0 ? ¶ms2[0] : NULL); + + EXPECT_TRUE(waiter.WaitFor(times, kAsyncExpectationsTimeout)); + + bson_object_deinitialize(&bson_params1); + bson_object_deinitialize(&bson_params2); +} + // TODO(EZamakhov): add test for get_hash_id/set_hash_id from // protocol_handler_impl.cc /* -- cgit v1.2.1 From 4aedeac1c16c977a34102bbe7e0900cb23f1032c Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 21:24:07 +0900 Subject: fix: wrong service started result may be notified This commit includes following changes: - Add session_key arg in ConnectionHandler::NotifyServiceStartedResult() - Use the session key to remember ServiceStartedContext until NotifyServiceStartedResult() is called Reflecting review comments. --- .../src/application_manager_impl.cc | 16 ++++---- .../test/application_manager_impl_test.cc | 44 +++++++++++----------- .../connection_handler/connection_handler_impl.h | 10 +++-- .../src/connection_handler_impl.cc | 29 ++++++++++---- .../test/connection_handler_impl_test.cc | 15 +++++--- .../connection_handler/connection_handler.h | 6 ++- .../connection_handler/mock_connection_handler.h | 6 ++- 7 files changed, 78 insertions(+), 48 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 14cd130a89..9d0dbee421 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1244,7 +1244,7 @@ void ApplicationManagerImpl::OnStreamingConfigured( NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); if (navi_service_status_.end() == it) { LOG4CXX_WARN(logger_, "Application not found in navi status map"); - connection_handler().NotifyServiceStartedResult(false, empty); + connection_handler().NotifyServiceStartedResult(app_id, false, empty); return; } @@ -1256,11 +1256,12 @@ void ApplicationManagerImpl::OnStreamingConfigured( } application(app_id)->StartStreaming(service_type); - connection_handler().NotifyServiceStartedResult(true, empty); + connection_handler().NotifyServiceStartedResult(app_id, true, empty); } else { std::vector converted_params = ConvertRejectedParamList(rejected_params); - connection_handler().NotifyServiceStartedResult(false, converted_params); + connection_handler().NotifyServiceStartedResult( + app_id, false, converted_params); } } @@ -1345,7 +1346,7 @@ void ApplicationManagerImpl::OnServiceStartedCallback( if (type == kRpc) { LOG4CXX_DEBUG(logger_, "RPC service is about to be started."); - connection_handler().NotifyServiceStartedResult(true, empty); + connection_handler().NotifyServiceStartedResult(session_key, true, empty); return; } ApplicationSharedPtr app = application(session_key); @@ -1353,7 +1354,7 @@ void ApplicationManagerImpl::OnServiceStartedCallback( LOG4CXX_WARN(logger_, "The application with id:" << session_key << " doesn't exists."); - connection_handler().NotifyServiceStartedResult(false, empty); + connection_handler().NotifyServiceStartedResult(session_key, false, empty); return; } @@ -1361,7 +1362,8 @@ void ApplicationManagerImpl::OnServiceStartedCallback( type, ServiceType::kMobileNav, ServiceType::kAudio)) { if (app->is_navi() || app->mobile_projection_enabled()) { if (!StartNaviService(session_key, type, params)) { - connection_handler().NotifyServiceStartedResult(false, empty); + connection_handler().NotifyServiceStartedResult( + session_key, false, empty); } return; } else { @@ -1370,7 +1372,7 @@ void ApplicationManagerImpl::OnServiceStartedCallback( } else { LOG4CXX_WARN(logger_, "Refuse unknown service"); } - connection_handler().NotifyServiceStartedResult(false, empty); + connection_handler().NotifyServiceStartedResult(session_key, false, empty); } void ApplicationManagerImpl::OnServiceEndedCallback( diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc index 66ddcaa032..0f402fea56 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -223,8 +223,8 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_RpcService) { bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); app_manager_impl_->OnServiceStartedCallback( device_handle, session_key, service_type, NULL); @@ -245,8 +245,8 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_UnknownApp) { bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); app_manager_impl_->OnServiceStartedCallback( device_handle, session_key, service_type, NULL); @@ -267,8 +267,8 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_UnknownService) { bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); app_manager_impl_->OnServiceStartedCallback( device_handle, session_key, service_type, NULL); @@ -292,8 +292,8 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_VideoServiceStart) { bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); // check: SetVideoConfig() should not be called, StartStreaming() is called EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); @@ -323,8 +323,8 @@ TEST_F(ApplicationManagerImplTest, bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); // check: SetVideoConfig() and StartStreaming() should not be called EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); @@ -354,8 +354,8 @@ TEST_F(ApplicationManagerImplTest, bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); // check: SetVideoConfig() and StartStreaming() should not be called EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); @@ -384,8 +384,8 @@ TEST_F(ApplicationManagerImplTest, bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); BsonObject input_params; bson_object_initialize_default(&input_params); @@ -464,8 +464,8 @@ TEST_F(ApplicationManagerImplTest, bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); BsonObject input_params; bson_object_initialize_default(&input_params); @@ -533,8 +533,8 @@ TEST_F(ApplicationManagerImplTest, bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); BsonObject input_params; bson_object_initialize_default(&input_params); @@ -568,8 +568,8 @@ TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_AudioServiceStart) { bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); // check: SetVideoConfig() should not be called, StartStreaming() is called EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); @@ -598,8 +598,8 @@ TEST_F(ApplicationManagerImplTest, bool result = false; std::vector rejected_params; - EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _)) - .WillOnce(DoAll(SaveArg<0>(&result), SaveArg<1>(&rejected_params))); + EXPECT_CALL(mock_connection_handler_, NotifyServiceStartedResult(_, _, _)) + .WillOnce(DoAll(SaveArg<1>(&result), SaveArg<2>(&rejected_params))); BsonObject input_params; bson_object_initialize_default(&input_params); diff --git a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h index 01a8970680..aebc612a22 100644 --- a/src/components/connection_handler/include/connection_handler/connection_handler_impl.h +++ b/src/components/connection_handler/include/connection_handler/connection_handler_impl.h @@ -464,6 +464,8 @@ class ConnectionHandlerImpl /** * \brief Invoked when observer's OnServiceStartedCallback is completed + * \param session_key the key of started session passed to + * OnServiceStartedCallback(). * \param result true if observer accepts starting service, false otherwise * \param rejected_params list of rejected parameters' name. Only valid when * result is false. Note that even if result is false, this may be empty. @@ -472,7 +474,9 @@ class ConnectionHandlerImpl * Also it can be invoked before OnServiceStartedCallback() returns. **/ virtual void NotifyServiceStartedResult( - bool result, std::vector& rejected_params); + uint32_t session_key, + bool result, + std::vector& rejected_params); private: /** @@ -580,8 +584,8 @@ class ConnectionHandlerImpl */ utils::StlMapDeleter connection_list_deleter_; - // we need thread-safe queue - utils::MessageQueue start_service_context_queue_; + sync_primitives::Lock start_service_context_map_lock_; + std::map start_service_context_map_; #ifdef BUILD_TESTS // Methods for test usage diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc index d4bf9530dd..daca42d3c2 100644 --- a/src/components/connection_handler/src/connection_handler_impl.cc +++ b/src/components/connection_handler/src/connection_handler_impl.cc @@ -70,7 +70,8 @@ ConnectionHandlerImpl::ConnectionHandlerImpl( , connection_list_lock_() , connection_handler_observer_lock_() , connection_list_deleter_(&connection_list_) - , start_service_context_queue_() {} + , start_service_context_map_lock_() + , start_service_context_map_() {} ConnectionHandlerImpl::~ConnectionHandlerImpl() { LOG4CXX_AUTO_TRACE(logger_); @@ -83,6 +84,9 @@ void ConnectionHandlerImpl::Stop() { RemoveConnection(itr->second->connection_handle()); itr = connection_list_.begin(); } + + sync_primitives::AutoLock auto_lock(start_service_context_map_lock_); + start_service_context_map_.clear(); } void ConnectionHandlerImpl::set_connection_handler_observer( @@ -415,7 +419,10 @@ void ConnectionHandlerImpl::OnSessionStartedCallback( service_type, hash_id, is_protected); - start_service_context_queue_.push(context); + { + sync_primitives::AutoLock auto_lock(start_service_context_map_lock_); + start_service_context_map_[session_key] = context; + } connection_handler_observer_->OnServiceStartedCallback( connection->connection_device_handle(), @@ -436,14 +443,22 @@ void ConnectionHandlerImpl::OnSessionStartedCallback( } void ConnectionHandlerImpl::NotifyServiceStartedResult( - bool result, std::vector& rejected_params) { + uint32_t session_key, + bool result, + std::vector& rejected_params) { LOG4CXX_AUTO_TRACE(logger_); ServiceStartedContext context; - bool available = start_service_context_queue_.pop(context); - if (!available) { - LOG4CXX_ERROR(logger_, "context for start service not found!"); - return; + { + sync_primitives::AutoLock auto_lock(start_service_context_map_lock_); + std::map::iterator it = + start_service_context_map_.find(session_key); + if (it == start_service_context_map_.end()) { + LOG4CXX_ERROR(logger_, "context for start service not found!"); + return; + } + context = it->second; + start_service_context_map_.erase(it); } Connection* connection = NULL; diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc index 99805b745c..0789660ca1 100644 --- a/src/components/connection_handler/test/connection_handler_impl_test.cc +++ b/src/components/connection_handler/test/connection_handler_impl_test.cc @@ -62,9 +62,9 @@ using ::testing::Return; using ::testing::ReturnRefOfCopy; using ::testing::SaveArg; -// custom action to call a member function with 4 arguments -ACTION_P4(InvokeMemberFuncWithArg2, ptr, memberFunc, a, b) { - (ptr->*memberFunc)(a, b); +// custom action to call a member function with 3 arguments +ACTION_P5(InvokeMemberFuncWithArg3, ptr, memberFunc, a, b, c) { + (ptr->*memberFunc)(a, b, c); } namespace { @@ -1210,9 +1210,10 @@ TEST_F(ConnectionHandlerTest, SessionStarted_WithRpc) { std::vector empty; EXPECT_CALL(mock_connection_handler_observer, OnServiceStartedCallback(device_handle_, session_key, kRpc, NULL)) - .WillOnce(InvokeMemberFuncWithArg2( + .WillOnce(InvokeMemberFuncWithArg3( connection_handler_, &ConnectionHandler::NotifyServiceStartedResult, + session_key, true, ByRef(empty))); @@ -1246,9 +1247,10 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_SUCCESS) { EXPECT_CALL(mock_connection_handler_observer, OnServiceStartedCallback( device_handle_, session_key, kMobileNav, dummy_params)) - .WillOnce(InvokeMemberFuncWithArg2( + .WillOnce(InvokeMemberFuncWithArg3( connection_handler_, &ConnectionHandler::NotifyServiceStartedResult, + session_key, true, ByRef(empty))); @@ -1282,9 +1284,10 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_FAILURE) { EXPECT_CALL(mock_connection_handler_observer, OnServiceStartedCallback( device_handle_, session_key, kMobileNav, dummy_params)) - .WillOnce(InvokeMemberFuncWithArg2( + .WillOnce(InvokeMemberFuncWithArg3( connection_handler_, &ConnectionHandler::NotifyServiceStartedResult, + session_key, false, ByRef(empty))); diff --git a/src/components/include/connection_handler/connection_handler.h b/src/components/include/connection_handler/connection_handler.h index ca1a0314c6..c70861b5f6 100644 --- a/src/components/include/connection_handler/connection_handler.h +++ b/src/components/include/connection_handler/connection_handler.h @@ -200,6 +200,8 @@ class ConnectionHandler { /** * \brief Invoked when observer's OnServiceStartedCallback is completed + * \param session_key the key of started session passed to + * OnServiceStartedCallback(). * \param result true if observer accepts starting service, false otherwise * \param rejected_params list of rejected parameters' name. Only valid when * result is false. Note that even if result is false, this may be empty. @@ -208,7 +210,9 @@ class ConnectionHandler { * Also it can be invoked before OnServiceStartedCallback() returns. **/ virtual void NotifyServiceStartedResult( - bool result, std::vector& rejected_params) = 0; + uint32_t session_key, + bool result, + std::vector& rejected_params) = 0; protected: /** diff --git a/src/components/include/test/connection_handler/mock_connection_handler.h b/src/components/include/test/connection_handler/mock_connection_handler.h index b6af1e1f15..5cb5f471b5 100644 --- a/src/components/include/test/connection_handler/mock_connection_handler.h +++ b/src/components/include/test/connection_handler/mock_connection_handler.h @@ -96,8 +96,10 @@ class MockConnectionHandler : public connection_handler::ConnectionHandler { MOCK_METHOD0(get_device_discovery_starter, DevicesDiscoveryStarter&()); MOCK_CONST_METHOD1(GetConnectedDevicesMAC, void(std::vector& macs)); - MOCK_METHOD2(NotifyServiceStartedResult, - void(bool result, std::vector& rejected_params)); + MOCK_METHOD3(NotifyServiceStartedResult, + void(uint32_t session_key, + bool result, + std::vector& rejected_params)); }; } // namespace connection_handler_test -- cgit v1.2.1 From 00be37c0510250e1f3d73fc2719997cf5f8c64a5 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 21:24:23 +0900 Subject: Add unit test to simulate two out-of-order NotifyServiceStartedResult calls --- .../test/connection_handler_impl_test.cc | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/src/components/connection_handler/test/connection_handler_impl_test.cc b/src/components/connection_handler/test/connection_handler_impl_test.cc index 0789660ca1..ec4e12ffe2 100644 --- a/src/components/connection_handler/test/connection_handler_impl_test.cc +++ b/src/components/connection_handler/test/connection_handler_impl_test.cc @@ -1304,6 +1304,100 @@ TEST_F(ConnectionHandlerTest, ServiceStarted_Video_FAILURE) { EXPECT_EQ(0u, new_session_id); } +/* + * Simulate two OnSessionStartedCallback calls, and connection handler observer + * returns a positive reply for the first call with delay and a negative reply + * for the second call immediately. + */ +TEST_F(ConnectionHandlerTest, ServiceStarted_Video_Multiple) { + AddTestDeviceConnection(); + + uint32_t rpc_session_id1; + uint32_t rpc_session_id2; + uint32_t hash_id1; + uint32_t hash_id2; + + protocol_handler_test::MockProtocolHandler temp_protocol_handler; + connection_handler_->set_protocol_handler(&temp_protocol_handler); + EXPECT_CALL(temp_protocol_handler, + NotifySessionStartedResult(_, _, _, _, _, _)) + .WillOnce(DoAll(SaveArg<2>(&rpc_session_id1), SaveArg<3>(&hash_id1))) + .WillOnce(DoAll(SaveArg<2>(&rpc_session_id2), SaveArg<3>(&hash_id2))); + + // add two sessions + connection_handler_->OnSessionStartedCallback( + uid_, 0, kRpc, PROTECTION_OFF, static_cast(NULL)); + connection_handler_->OnSessionStartedCallback( + uid_, 0, kRpc, PROTECTION_OFF, static_cast(NULL)); + + EXPECT_NE(0u, rpc_session_id1); + EXPECT_NE(0u, rpc_session_id2); + EXPECT_EQ(SessionHash(uid_, rpc_session_id1), hash_id1); + EXPECT_EQ(SessionHash(uid_, rpc_session_id2), hash_id2); + CheckSessionExists(uid_, rpc_session_id1); + CheckSessionExists(uid_, rpc_session_id2); + + connection_handler_->set_protocol_handler(NULL); + + int dummy = 0; + BsonObject* dummy_params = reinterpret_cast(&dummy); + + connection_handler_test::MockConnectionHandlerObserver + mock_connection_handler_observer; + connection_handler_->set_connection_handler_observer( + &mock_connection_handler_observer); + uint32_t session_key1 = + connection_handler_->KeyFromPair(uid_, rpc_session_id1); + uint32_t session_key2 = + connection_handler_->KeyFromPair(uid_, rpc_session_id2); + + std::vector empty; + + EXPECT_CALL(mock_connection_handler_observer, + OnServiceStartedCallback( + device_handle_, session_key1, kMobileNav, dummy_params)) + // don't call NotifyServiceStartedResult() with this event + .Times(1); + EXPECT_CALL(mock_connection_handler_observer, + OnServiceStartedCallback( + device_handle_, session_key2, kMobileNav, dummy_params)) + // call NotifyServiceStartedResult() twice, first for the second session + // then for the first session + .WillOnce(DoAll(InvokeMemberFuncWithArg3( + connection_handler_, + &ConnectionHandler::NotifyServiceStartedResult, + session_key2, + false, + ByRef(empty)), + InvokeMemberFuncWithArg3( + connection_handler_, + &ConnectionHandler::NotifyServiceStartedResult, + session_key1, + true, + ByRef(empty)))); + + // verify that connection handler will not mix up the two results + uint32_t new_session_id1 = 0; + uint32_t new_session_id2 = 0; + connection_handler_->set_protocol_handler(&mock_protocol_handler_); + EXPECT_CALL( + mock_protocol_handler_, + NotifySessionStartedResult(_, rpc_session_id1, _, _, false, empty)) + .WillOnce(SaveArg<2>(&new_session_id1)); + EXPECT_CALL( + mock_protocol_handler_, + NotifySessionStartedResult(_, rpc_session_id2, _, _, false, empty)) + .WillOnce(SaveArg<2>(&new_session_id2)); + + connection_handler_->OnSessionStartedCallback( + uid_, rpc_session_id1, kMobileNav, PROTECTION_OFF, dummy_params); + connection_handler_->OnSessionStartedCallback( + uid_, rpc_session_id2, kMobileNav, PROTECTION_OFF, dummy_params); + + EXPECT_NE(0u, new_session_id1); // result is positive + EXPECT_EQ(0u, new_session_id2); // result is negative +} + TEST_F(ConnectionHandlerTest, SessionStarted_StartSession_SecureSpecific_Unprotect) { EXPECT_CALL(mock_connection_handler_settings, heart_beat_timeout()) -- cgit v1.2.1 From 2f9746c4c3f09cc90be0fbaa7a9e58038fe363ec Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 21:41:30 +0900 Subject: Rename 'desiredHeight' and 'desiredWidth' tags This is to keep consistency with Control Frame Payloads v1.0.0 proposal. Reflecting review comments. --- .../application_manager/src/application_manager_impl.cc | 12 ++++++------ .../test/application_manager_impl_test.cc | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 9d0dbee421..1da7ec12c8 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -3844,13 +3844,13 @@ void ApplicationManagerImpl::ConvertVideoParamsToSO( output[strings::codec] = codec_enum; } } - BsonElement* element = bson_object_get(obj, "desiredHeight"); + BsonElement* element = bson_object_get(obj, "height"); if (element != NULL && element->type == TYPE_INT32) { - output[strings::height] = bson_object_get_int32(obj, "desiredHeight"); + output[strings::height] = bson_object_get_int32(obj, "height"); } - element = bson_object_get(obj, "desiredWidth"); + element = bson_object_get(obj, "width"); if (element != NULL && element->type == TYPE_INT32) { - output[strings::width] = bson_object_get_int32(obj, "desiredWidth"); + output[strings::width] = bson_object_get_int32(obj, "width"); } } @@ -3864,9 +3864,9 @@ std::vector ApplicationManagerImpl::ConvertRejectedParamList( } else if (input[i] == strings::codec) { output.push_back("videoCodec"); } else if (input[i] == strings::height) { - output.push_back("desiredHeight"); + output.push_back("height"); } else if (input[i] == strings::width) { - output.push_back("desiredWidth"); + output.push_back("width"); } // ignore unknown parameters } diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc index 0f402fea56..f95ec52bda 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -396,8 +396,8 @@ TEST_F(ApplicationManagerImplTest, bson_object_put_string(&input_params, "videoProtocol", protocol_name); char codec_name[] = "VP9"; bson_object_put_string(&input_params, "videoCodec", codec_name); - bson_object_put_int32(&input_params, "desiredHeight", 640); - bson_object_put_int32(&input_params, "desiredWidth", 480); + bson_object_put_int32(&input_params, "height", 640); + bson_object_put_int32(&input_params, "width", 480); smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); converted_params[strings::protocol] = @@ -476,8 +476,8 @@ TEST_F(ApplicationManagerImplTest, bson_object_put_string(&input_params, "videoProtocol", protocol_name); char codec_name[] = "VP9"; bson_object_put_string(&input_params, "videoCodec", codec_name); - bson_object_put_int32(&input_params, "desiredHeight", 640); - bson_object_put_int32(&input_params, "desiredWidth", 480); + bson_object_put_int32(&input_params, "height", 640); + bson_object_put_int32(&input_params, "width", 480); smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); converted_params[strings::protocol] = @@ -610,8 +610,8 @@ TEST_F(ApplicationManagerImplTest, bson_object_put_string(&input_params, "videoProtocol", protocol_name); char codec_name[] = "VP9"; bson_object_put_string(&input_params, "videoCodec", codec_name); - bson_object_put_int32(&input_params, "desiredHeight", 640); - bson_object_put_int32(&input_params, "desiredWidth", 480); + bson_object_put_int32(&input_params, "height", 640); + bson_object_put_int32(&input_params, "width", 480); // check: SetVideoConfig() should not be called, StartStreaming() is called EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); -- cgit v1.2.1 From 6c3aa1059982dd9012edb6fb747f1ed77d000db4 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 23:13:38 +0900 Subject: Append video releated parameters in Start Service ACK packet Reflecting review comments. --- .../protocol_handler/protocol_handler_impl.h | 49 +++++++++++++ .../protocol_handler/src/protocol_handler_impl.cc | 84 +++++++++++++++++++++- .../test/protocol_handler_tm_test.cc | 20 ++++-- 3 files changed, 145 insertions(+), 8 deletions(-) diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index c312d34aed..af12fc288d 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -252,6 +252,29 @@ class ProtocolHandlerImpl uint8_t service_type, bool protection); + /** + * \brief Sends acknowledgement of starting session to mobile application + * with session number and hash code for second version of protocol + * was started + * \param connection_id Identifier of connection within which session + * \param session_id ID of session to be sent to mobile application + * \param protocol_version Version of protocol used for communication + * \param hash_code For second version of protocol: identifier of session + * to be sent to + * mobile app for using when ending session + * \param service_type Type of session: RPC or BULK Data. RPC by default + * \param protection Protection flag + * \param additional_params Additional parameters added in the payload. Can + * be NULL. + */ + void SendStartSessionAck(ConnectionID connection_id, + uint8_t session_id, + uint8_t protocol_version, + uint32_t hash_code, + uint8_t service_type, + bool protection, + const BsonObject* additional_params); + /** * \brief Sends acknowledgement of starting session to mobile application * with session number and hash code for second version of protocol @@ -275,6 +298,32 @@ class ProtocolHandlerImpl bool protection, ProtocolPacket::ProtocolVersion& full_version); + /** + * \brief Sends acknowledgement of starting session to mobile application + * with session number and hash code for second version of protocol + * was started + * \param connection_id Identifier of connection within which session + * \param session_id ID of session to be sent to mobile application + * \param protocol_version Version of protocol used for communication + * \param hash_code For second version of protocol: identifier of session + * to be sent to + * mobile app for using when ending session + * \param service_type Type of session: RPC or BULK Data. RPC by default + * \param protection Protection flag + * \param full_version full protocol version (major.minor.patch) used by the + * mobile proxy + * \param additional_params Additional parameters added in the payload. Can + * be NULL. + */ + void SendStartSessionAck(ConnectionID connection_id, + uint8_t session_id, + uint8_t protocol_version, + uint32_t hash_code, + uint8_t service_type, + bool protection, + ProtocolPacket::ProtocolVersion& full_version, + const BsonObject* additional_params); + const ProtocolHandlerSettings& get_settings() const OVERRIDE { return settings_; } diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 4eb01cec12..a8f0c5a65d 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -205,6 +205,28 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id, fullVersion); } +void ProtocolHandlerImpl::SendStartSessionAck( + ConnectionID connection_id, + uint8_t session_id, + uint8_t protocol_version, + uint32_t hash_id, + uint8_t service_type, + bool protection, + const BsonObject* additional_params) { + LOG4CXX_AUTO_TRACE(logger_); + ProtocolPacket::ProtocolVersion* fullVersion = + new ProtocolPacket::ProtocolVersion(); + SendStartSessionAck(connection_id, + session_id, + protocol_version, + hash_id, + service_type, + protection, + *fullVersion, + additional_params); + delete fullVersion; +} + void ProtocolHandlerImpl::SendStartSessionAck( ConnectionID connection_id, uint8_t session_id, @@ -214,6 +236,26 @@ void ProtocolHandlerImpl::SendStartSessionAck( bool protection, ProtocolPacket::ProtocolVersion& full_version) { LOG4CXX_AUTO_TRACE(logger_); + SendStartSessionAck(connection_id, + session_id, + protocol_version, + hash_id, + service_type, + protection, + full_version, + NULL); +} + +void ProtocolHandlerImpl::SendStartSessionAck( + ConnectionID connection_id, + uint8_t session_id, + uint8_t protocol_version, + uint32_t hash_id, + uint8_t service_type, + bool protection, + ProtocolPacket::ProtocolVersion& full_version, + const BsonObject* additional_params) { + LOG4CXX_AUTO_TRACE(logger_); uint8_t maxProtocolVersion = SupportedSDLProtocolVersion(); @@ -259,6 +301,27 @@ void ProtocolHandlerImpl::SendStartSessionAck( strncpy(protocolVersionString, (*minVersion).to_string().c_str(), 255); bson_object_put_string( &payloadObj, strings::protocol_version, protocolVersionString); + } else if (serviceTypeValue == kMobileNav && additional_params != NULL) { + BsonObject* input = const_cast(additional_params); + BsonElement* element = NULL; + if ((element = bson_object_get(input, "height")) != NULL && + element->type == TYPE_INT32) { + bson_object_put_int32( + &payloadObj, "height", bson_object_get_int32(input, "height")); + } + if ((element = bson_object_get(input, "width")) != NULL && + element->type == TYPE_INT32) { + bson_object_put_int32( + &payloadObj, "width", bson_object_get_int32(input, "width")); + } + char* protocol = bson_object_get_string(input, "videoProtocol"); + if (protocol != NULL) { + bson_object_put_string(&payloadObj, "videoProtocol", protocol); + } + char* codec = bson_object_get_string(input, "videoCodec"); + if (codec != NULL) { + bson_object_put_string(&payloadObj, "videoCodec", codec); + } } uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); ptr->set_data(payloadBytes, bson_object_size(&payloadObj)); @@ -1483,6 +1546,15 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( return; } + BsonObject input_param; + if (packet->service_type() == kMobileNav && packet->data() != NULL) { + // when video service is successfully started, copy input parameters + // ("width", "height", "videoProtocol", "videoCodec") to the ACK packet + input_param = bson_object_from_bytes(packet->data()); + } else { + bson_object_initialize_default(&input_param); + } + #ifdef ENABLE_SECURITY // for packet is encrypted and security plugin is enable if (protection && security_manager_) { @@ -1504,7 +1576,9 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( packet->protocol_version(), hash_id, packet->service_type(), - PROTECTION_OFF); + PROTECTION_OFF, + &input_param); + bson_object_deinitialize(&input_param); return; } ProtocolPacket::ProtocolVersion* fullVersion; @@ -1540,7 +1614,8 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( hash_id, packet->service_type(), PROTECTION_ON, - *fullVersion); + *fullVersion, + &input_param); } else { security_manager_->AddListener( new StartSessionHandler(connection_key, @@ -1559,6 +1634,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( } } delete fullVersion; + bson_object_deinitialize(&input_param); LOG4CXX_DEBUG(logger_, "Protection establishing for connection " << connection_key << " is in progress"); @@ -1597,8 +1673,10 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( packet->protocol_version(), hash_id, packet->service_type(), - PROTECTION_OFF); + PROTECTION_OFF, + &input_param); } + bson_object_deinitialize(&input_param); } RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat( diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index 7a7a8dd611..ce167f1177 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -654,12 +654,22 @@ TEST_F(ProtocolHandlerImplTest, ByRef(empty)))); times++; + BsonObject bson_ack_params; + bson_object_initialize_default(&bson_ack_params); + bson_object_put_int64(&bson_ack_params, "mtu", maximum_payload_size); + bson_object_put_string( + &bson_ack_params, "videoProtocol", const_cast("RAW")); + bson_object_put_string( + &bson_ack_params, "videoCodec", const_cast("H264")); + std::vector ack_params = + CreateVectorFromBsonObject(&bson_ack_params); + bson_object_deinitialize(&bson_ack_params); + EXPECT_CALL(transport_manager_mock, - SendMessageToDevice(ControlMessage( - FRAME_DATA_START_SERVICE_ACK, - PROTECTION_OFF, - connection_id1, - _))) // skip checking of non-video parameters like mtu + SendMessageToDevice(ControlMessage(FRAME_DATA_START_SERVICE_ACK, + PROTECTION_OFF, + connection_id1, + Eq(ack_params)))) .WillOnce(DoAll(NotifyTestAsyncWaiter(&waiter), Return(E_SUCCESS))); times++; -- cgit v1.2.1 From b1334cb3b351f6c08173649284cbd93b0fd3b54d Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 10 Aug 2017 23:21:50 +0900 Subject: Format code --- src/components/application_manager/src/application_manager_impl.cc | 3 ++- src/components/application_manager/src/hmi_interfaces_impl.cc | 3 ++- src/components/include/protocol_handler/session_observer.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 1da7ec12c8..4a54cf108d 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1275,7 +1275,8 @@ void ApplicationManagerImpl::StopNaviService( NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); if (navi_service_status_.end() == it) { - LOG4CXX_WARN(logger_, "No Information about navi service " << service_type); + LOG4CXX_WARN(logger_, + "No Information about navi service " << service_type); } else { // Fill NaviServices map. Set false to first value of pair if // we've stopped video service or to second value if we've diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc index 38f0fcf3a1..3f05252b02 100644 --- a/src/components/application_manager/src/hmi_interfaces_impl.cc +++ b/src/components/application_manager/src/hmi_interfaces_impl.cc @@ -166,7 +166,8 @@ generate_function_to_interface_convert_map() { HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_OnTBTClientState] = HmiInterfaces::HMI_INTERFACE_Navigation; - convert_map[Navigation_SetVideoConfig] = HmiInterfaces::HMI_INTERFACE_Navigation; + convert_map[Navigation_SetVideoConfig] = + HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_StartStream] = HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_StopStream] = HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_StartAudioStream] = diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h index 606c6e1d11..3386112134 100644 --- a/src/components/include/protocol_handler/session_observer.h +++ b/src/components/include/protocol_handler/session_observer.h @@ -101,7 +101,7 @@ class SessionObserver { const uint8_t sessionId, const protocol_handler::ServiceType& service_type, const bool is_protected, - const BsonObject *params) = 0; + const BsonObject* params) = 0; // DEPRECATED virtual uint32_t OnSessionEndedCallback( -- cgit v1.2.1 From f11831aa529870067a31c484971738b06a5f35b0 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 11:03:07 +0900 Subject: Add video related keys in bson_object_keys.cc --- .../src/application_manager_impl.cc | 26 +++++++---- .../test/application_manager_impl_test.cc | 54 ++++++++++++++-------- src/components/include/protocol/bson_object_keys.h | 4 ++ src/components/protocol/src/bson_object_keys.cc | 4 ++ .../protocol_handler/src/protocol_handler_impl.cc | 22 +++++---- .../test/protocol_handler_tm_test.cc | 39 ++++++++++------ 6 files changed, 94 insertions(+), 55 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 4a54cf108d..3625429653 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -56,6 +56,7 @@ #include "formatters/formatter_json_rpc.h" #include "formatters/CFormatterJsonSDLRPCv2.h" #include "formatters/CFormatterJsonSDLRPCv1.h" +#include "protocol/bson_object_keys.h" #include "utils/threads/thread.h" #include "utils/file_system.h" @@ -3828,7 +3829,8 @@ void ApplicationManagerImpl::ConvertVideoParamsToSO( } BsonObject* obj = const_cast(input); - const char* protocol = bson_object_get_string(obj, "videoProtocol"); + const char* protocol = + bson_object_get_string(obj, protocol_handler::strings::video_protocol); if (protocol != NULL) { hmi_apis::Common_VideoStreamingProtocol::eType protocol_enum = ConvertVideoProtocol(protocol); @@ -3837,7 +3839,8 @@ void ApplicationManagerImpl::ConvertVideoParamsToSO( output[strings::protocol] = protocol_enum; } } - const char* codec = bson_object_get_string(obj, "videoCodec"); + const char* codec = + bson_object_get_string(obj, protocol_handler::strings::video_codec); if (codec != NULL) { hmi_apis::Common_VideoStreamingCodec::eType codec_enum = ConvertVideoCodec(codec); @@ -3845,13 +3848,16 @@ void ApplicationManagerImpl::ConvertVideoParamsToSO( output[strings::codec] = codec_enum; } } - BsonElement* element = bson_object_get(obj, "height"); + BsonElement* element = + bson_object_get(obj, protocol_handler::strings::height); if (element != NULL && element->type == TYPE_INT32) { - output[strings::height] = bson_object_get_int32(obj, "height"); + output[strings::height] = + bson_object_get_int32(obj, protocol_handler::strings::height); } - element = bson_object_get(obj, "width"); + element = bson_object_get(obj, protocol_handler::strings::width); if (element != NULL && element->type == TYPE_INT32) { - output[strings::width] = bson_object_get_int32(obj, "width"); + output[strings::width] = + bson_object_get_int32(obj, protocol_handler::strings::width); } } @@ -3861,13 +3867,13 @@ std::vector ApplicationManagerImpl::ConvertRejectedParamList( std::vector output; for (unsigned int i = 0; i < input.size(); i++) { if (input[i] == strings::protocol) { - output.push_back("videoProtocol"); + output.push_back(protocol_handler::strings::video_protocol); } else if (input[i] == strings::codec) { - output.push_back("videoCodec"); + output.push_back(protocol_handler::strings::video_codec); } else if (input[i] == strings::height) { - output.push_back("height"); + output.push_back(protocol_handler::strings::height); } else if (input[i] == strings::width) { - output.push_back("width"); + output.push_back(protocol_handler::strings::width); } // ignore unknown parameters } diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc index f95ec52bda..d19d3cd8ed 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -47,6 +47,7 @@ #include "hmi_message_handler/mock_hmi_message_handler.h" #include "policy/mock_policy_settings.h" #include "policy/usage_statistics/mock_statistics_manager.h" +#include "protocol/bson_object_keys.h" #include "protocol_handler/mock_session_observer.h" #include "utils/custom_string.h" #include "utils/file_system.h" @@ -390,14 +391,18 @@ TEST_F(ApplicationManagerImplTest, BsonObject input_params; bson_object_initialize_default(&input_params); char protocol_version[] = "1.0.0"; - bson_object_put_string(&input_params, "protocolVersion", protocol_version); - bson_object_put_int64(&input_params, "mtu", 100); + bson_object_put_string(&input_params, + protocol_handler::strings::protocol_version, + protocol_version); + bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100); char protocol_name[] = "RTP"; - bson_object_put_string(&input_params, "videoProtocol", protocol_name); + bson_object_put_string( + &input_params, protocol_handler::strings::video_protocol, protocol_name); char codec_name[] = "VP9"; - bson_object_put_string(&input_params, "videoCodec", codec_name); - bson_object_put_int32(&input_params, "height", 640); - bson_object_put_int32(&input_params, "width", 480); + bson_object_put_string( + &input_params, protocol_handler::strings::video_codec, codec_name); + bson_object_put_int32(&input_params, protocol_handler::strings::height, 640); + bson_object_put_int32(&input_params, protocol_handler::strings::width, 480); smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); converted_params[strings::protocol] = @@ -470,14 +475,18 @@ TEST_F(ApplicationManagerImplTest, BsonObject input_params; bson_object_initialize_default(&input_params); char protocol_version[] = "1.0.0"; - bson_object_put_string(&input_params, "protocolVersion", protocol_version); - bson_object_put_int64(&input_params, "mtu", 100); + bson_object_put_string(&input_params, + protocol_handler::strings::protocol_version, + protocol_version); + bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100); char protocol_name[] = "RTP"; - bson_object_put_string(&input_params, "videoProtocol", protocol_name); + bson_object_put_string( + &input_params, protocol_handler::strings::video_protocol, protocol_name); char codec_name[] = "VP9"; - bson_object_put_string(&input_params, "videoCodec", codec_name); - bson_object_put_int32(&input_params, "height", 640); - bson_object_put_int32(&input_params, "width", 480); + bson_object_put_string( + &input_params, protocol_handler::strings::video_codec, codec_name); + bson_object_put_int32(&input_params, protocol_handler::strings::height, 640); + bson_object_put_int32(&input_params, protocol_handler::strings::width, 480); smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); converted_params[strings::protocol] = @@ -513,8 +522,9 @@ TEST_F(ApplicationManagerImplTest, // check: rejected param list contains "videoProtocol" and "videoCodec" ASSERT_EQ(2u, rejected_params.size()); std::vector expected_list; - expected_list.push_back(std::string("videoProtocol")); - expected_list.push_back(std::string("videoCodec")); + expected_list.push_back( + std::string(protocol_handler::strings::video_protocol)); + expected_list.push_back(std::string(protocol_handler::strings::video_codec)); ASSERT_TRUE(ValidateList(expected_list, rejected_params)); } @@ -604,14 +614,18 @@ TEST_F(ApplicationManagerImplTest, BsonObject input_params; bson_object_initialize_default(&input_params); char protocol_version[] = "1.0.0"; - bson_object_put_string(&input_params, "protocolVersion", protocol_version); - bson_object_put_int64(&input_params, "mtu", 100); + bson_object_put_string(&input_params, + protocol_handler::strings::protocol_version, + protocol_version); + bson_object_put_int64(&input_params, protocol_handler::strings::mtu, 100); char protocol_name[] = "RTP"; - bson_object_put_string(&input_params, "videoProtocol", protocol_name); + bson_object_put_string( + &input_params, protocol_handler::strings::video_protocol, protocol_name); char codec_name[] = "VP9"; - bson_object_put_string(&input_params, "videoCodec", codec_name); - bson_object_put_int32(&input_params, "height", 640); - bson_object_put_int32(&input_params, "width", 480); + bson_object_put_string( + &input_params, protocol_handler::strings::video_codec, codec_name); + bson_object_put_int32(&input_params, protocol_handler::strings::height, 640); + bson_object_put_int32(&input_params, protocol_handler::strings::width, 480); // check: SetVideoConfig() should not be called, StartStreaming() is called EXPECT_CALL(*mock_app_ptr_, SetVideoConfig(_, _)).Times(0); diff --git a/src/components/include/protocol/bson_object_keys.h b/src/components/include/protocol/bson_object_keys.h index 08e47ebdab..6f80aeec2b 100644 --- a/src/components/include/protocol/bson_object_keys.h +++ b/src/components/include/protocol/bson_object_keys.h @@ -38,6 +38,10 @@ extern const char* hash_id; extern const char* protocol_version; extern const char* mtu; extern const char* rejected_params; +extern const char* height; +extern const char* width; +extern const char* video_protocol; +extern const char* video_codec; } // namespace strings diff --git a/src/components/protocol/src/bson_object_keys.cc b/src/components/protocol/src/bson_object_keys.cc index fba2b4a166..fb225b1461 100644 --- a/src/components/protocol/src/bson_object_keys.cc +++ b/src/components/protocol/src/bson_object_keys.cc @@ -8,6 +8,10 @@ const char* hash_id = "hashId"; const char* protocol_version = "protocolVersion"; const char* mtu = "mtu"; const char* rejected_params = "rejectedParams"; +const char* height = "height"; +const char* width = "width"; +const char* video_protocol = "videoProtocol"; +const char* video_codec = "videoCodec"; } // namespace strings diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index a8f0c5a65d..5838fd6019 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -304,23 +304,25 @@ void ProtocolHandlerImpl::SendStartSessionAck( } else if (serviceTypeValue == kMobileNav && additional_params != NULL) { BsonObject* input = const_cast(additional_params); BsonElement* element = NULL; - if ((element = bson_object_get(input, "height")) != NULL && + if ((element = bson_object_get(input, strings::height)) != NULL && element->type == TYPE_INT32) { - bson_object_put_int32( - &payloadObj, "height", bson_object_get_int32(input, "height")); + bson_object_put_int32(&payloadObj, + strings::height, + bson_object_get_int32(input, strings::height)); } - if ((element = bson_object_get(input, "width")) != NULL && + if ((element = bson_object_get(input, strings::width)) != NULL && element->type == TYPE_INT32) { - bson_object_put_int32( - &payloadObj, "width", bson_object_get_int32(input, "width")); + bson_object_put_int32(&payloadObj, + strings::width, + bson_object_get_int32(input, strings::width)); } - char* protocol = bson_object_get_string(input, "videoProtocol"); + char* protocol = bson_object_get_string(input, strings::video_protocol); if (protocol != NULL) { - bson_object_put_string(&payloadObj, "videoProtocol", protocol); + bson_object_put_string(&payloadObj, strings::video_protocol, protocol); } - char* codec = bson_object_get_string(input, "videoCodec"); + char* codec = bson_object_get_string(input, strings::video_codec); if (codec != NULL) { - bson_object_put_string(&payloadObj, "videoCodec", codec); + bson_object_put_string(&payloadObj, strings::video_codec, codec); } } uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index ce167f1177..7442e9ab2a 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -33,6 +33,7 @@ #include #include "protocol_handler/protocol_handler.h" #include "protocol_handler/protocol_handler_impl.h" +#include "protocol/bson_object_keys.h" #include "protocol/common.h" #include "protocol_handler/control_message_matcher.h" #include "protocol_handler/mock_protocol_handler.h" @@ -597,10 +598,12 @@ TEST_F(ProtocolHandlerImplTest, BsonObject bson_params1; bson_object_initialize_default(&bson_params1); - bson_object_put_string( - &bson_params1, "videoProtocol", const_cast("RAW")); - bson_object_put_string( - &bson_params1, "videoCodec", const_cast("H264")); + bson_object_put_string(&bson_params1, + protocol_handler::strings::video_protocol, + const_cast("RAW")); + bson_object_put_string(&bson_params1, + protocol_handler::strings::video_codec, + const_cast("H264")); std::vector params1 = CreateVectorFromBsonObject(&bson_params1); uint8_t generated_session_id1 = 100; @@ -619,14 +622,16 @@ TEST_F(ProtocolHandlerImplTest, BsonObject bson_params2; bson_object_initialize_default(&bson_params2); - bson_object_put_string( - &bson_params2, "videoProtocol", const_cast("RTP")); - bson_object_put_string( - &bson_params2, "videoCodec", const_cast("H265")); + bson_object_put_string(&bson_params2, + protocol_handler::strings::video_protocol, + const_cast("RTP")); + bson_object_put_string(&bson_params2, + protocol_handler::strings::video_codec, + const_cast("H265")); std::vector params2 = CreateVectorFromBsonObject(&bson_params2); std::vector rejected_param_list; - rejected_param_list.push_back("videoCodec"); + rejected_param_list.push_back(protocol_handler::strings::video_codec); EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id2, @@ -656,11 +661,14 @@ TEST_F(ProtocolHandlerImplTest, BsonObject bson_ack_params; bson_object_initialize_default(&bson_ack_params); - bson_object_put_int64(&bson_ack_params, "mtu", maximum_payload_size); - bson_object_put_string( - &bson_ack_params, "videoProtocol", const_cast("RAW")); - bson_object_put_string( - &bson_ack_params, "videoCodec", const_cast("H264")); + bson_object_put_int64( + &bson_ack_params, protocol_handler::strings::mtu, maximum_payload_size); + bson_object_put_string(&bson_ack_params, + protocol_handler::strings::video_protocol, + const_cast("RAW")); + bson_object_put_string(&bson_ack_params, + protocol_handler::strings::video_codec, + const_cast("H264")); std::vector ack_params = CreateVectorFromBsonObject(&bson_ack_params); bson_object_deinitialize(&bson_ack_params); @@ -681,7 +689,8 @@ TEST_F(ProtocolHandlerImplTest, } BsonObject bson_nack_params; bson_object_initialize_default(&bson_nack_params); - bson_object_put_array(&bson_nack_params, "rejectedParams", &bson_arr); + bson_object_put_array( + &bson_nack_params, protocol_handler::strings::rejected_params, &bson_arr); std::vector nack_params = CreateVectorFromBsonObject(&bson_nack_params); bson_object_deinitialize(&bson_nack_params); -- cgit v1.2.1 From a530ae00b481eef63bd9be8bbb2205a725c04ba6 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 11:13:45 +0900 Subject: Remove deprecated enable_protocol_5() method in test code Reflecting review comments. --- src/components/protocol_handler/test/protocol_handler_tm_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index 7442e9ab2a..f4baaf7d58 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -564,8 +564,8 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Unprotected_Multiple_SessionObserverAcceptAndReject) { using namespace protocol_handler; - ON_CALL(protocol_handler_settings_mock, enable_protocol_5()) - .WillByDefault(Return(true)); + ON_CALL(protocol_handler_settings_mock, max_supported_protocol_version()) + .WillByDefault(Return(PROTOCOL_VERSION_5)); const size_t maximum_payload_size = 1000; InitProtocolHandlerImpl(0u, 0u, false, 0u, 0u, 0, maximum_payload_size); -- cgit v1.2.1 From f5fb4e9ad9d6a4bfcec512ea7173fdc39f1bdd86 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 11:23:27 +0900 Subject: Add description of ApplicationManagerImpl::AddMockApplication() Reflecting review comments. --- .../include/application_manager/application_manager_impl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 5fac4d476b..9a056914d3 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1559,8 +1559,12 @@ class ApplicationManagerImpl volatile bool is_stopping_; #ifdef BUILD_TESTS - // Methods for test usage public: + /** + * @brief register a mock application without going through the formal + * registration process. Only for unit testing. + * @param mock_app the mock app to be registered + */ void AddMockApplication(ApplicationSharedPtr mock_app); #endif -- cgit v1.2.1 From 59bb7896b331352adedfa1c8f2d378fc6407e78a Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 11:24:20 +0900 Subject: fix: DISALLOW_COPY_AND_ASSIGN not working if BUILD_TESTS --- .../include/application_manager/application_manager_impl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 9a056914d3..be02db35a1 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -1566,6 +1566,8 @@ class ApplicationManagerImpl * @param mock_app the mock app to be registered */ void AddMockApplication(ApplicationSharedPtr mock_app); + + private: #endif DISALLOW_COPY_AND_ASSIGN(ApplicationManagerImpl); -- cgit v1.2.1 From bb7ca6c2f11a37c01701deb7dc43537332b0f4be Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 11:33:57 +0900 Subject: Use OVERRIDE keyword Reflecting review comments. --- .../commands/hmi/navi_set_video_config_request.h | 6 +++--- .../commands/hmi/navi_set_video_config_response.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h index bd0fa95565..8f45a97df4 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h @@ -62,17 +62,17 @@ class NaviSetVideoConfigRequest : public RequestToHMI, /** * @brief Execute command **/ - virtual void Run(); + void Run() OVERRIDE; /** * @brief On event callback **/ - virtual void on_event(const event_engine::Event& event); + void on_event(const event_engine::Event& event) OVERRIDE; /** * @brief onTimeOut callback */ - virtual void onTimeOut(); + void onTimeOut() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigRequest); diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h index 9585202a98..afa98ac40d 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h @@ -61,7 +61,7 @@ class NaviSetVideoConfigResponse : public ResponseFromHMI { /** * @brief Execute command **/ - virtual void Run(); + void Run() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(NaviSetVideoConfigResponse); -- cgit v1.2.1 From 75cd84feeacda7162e213a721b7d0d5086e4cb36 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 11:39:47 +0900 Subject: Reduce the scope of a variable Reflecting review comments. --- src/components/application_manager/src/application_manager_impl.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 3625429653..d309d144e5 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1232,13 +1232,12 @@ void ApplicationManagerImpl::OnStreamingConfigured( using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); - std::vector empty; - LOG4CXX_INFO(logger_, "OnStreamingConfigured called for service " << service_type << ", result=" << result); if (result) { + std::vector empty; { sync_primitives::AutoLock lock(navi_service_status_lock_); -- cgit v1.2.1 From c808f7140d9051250f8f3d1c65d92016edfeb369 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 11:45:37 +0900 Subject: Use iterator for vector loop Reflecting review comments. --- .../application_manager/src/application_manager_impl.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index d309d144e5..c141a16515 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -3864,14 +3864,16 @@ void ApplicationManagerImpl::ConvertVideoParamsToSO( std::vector ApplicationManagerImpl::ConvertRejectedParamList( const std::vector& input) { std::vector output; - for (unsigned int i = 0; i < input.size(); i++) { - if (input[i] == strings::protocol) { + for (std::vector::const_iterator it = input.begin(); + it != input.end(); + ++it) { + if (*it == strings::protocol) { output.push_back(protocol_handler::strings::video_protocol); - } else if (input[i] == strings::codec) { + } else if (*it == strings::codec) { output.push_back(protocol_handler::strings::video_codec); - } else if (input[i] == strings::height) { + } else if (*it == strings::height) { output.push_back(protocol_handler::strings::height); - } else if (input[i] == strings::width) { + } else if (*it == strings::width) { output.push_back(protocol_handler::strings::width); } // ignore unknown parameters -- cgit v1.2.1 From 48ecad1ebf4b1cd7c6c555a3834833bd9f1fa8df Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 11:59:12 +0900 Subject: Smarter implementation of ValidateList Reflecting review comments. --- .../hmi/navi_set_video_config_request_test.cc | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc index d209a475c5..a6248ed3c4 100644 --- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc @@ -30,6 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include + #include "application_manager/commands/hmi/navi_set_video_config_request.h" #include "gtest/gtest.h" @@ -110,23 +112,9 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEvent_SUCCESS) { static bool ValidateList(std::vector& expected, std::vector& actual) { - if (expected.size() != actual.size()) { - return false; - } - for (unsigned int i = 0; i < expected.size(); i++) { - std::string& param = expected[i]; - unsigned int j; - for (j = 0; j < actual.size(); j++) { - if (param == actual[j]) { - break; - } - } - if (j == actual.size()) { - // not found - return false; - } - } - return true; + std::sort(expected.begin(), expected.end()); + std::sort(actual.begin(), actual.end()); + return std::equal(expected.begin(), expected.end(), actual.begin()); } TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { -- cgit v1.2.1 From 63424e01d206472a49ff7703642b85ae0f2a7e26 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 12:19:26 +0900 Subject: Rename some test cases for better description Reflecting review comments. --- .../test/commands/hmi/navi_set_video_config_request_test.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc index a6248ed3c4..b233d228d9 100644 --- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc @@ -87,7 +87,7 @@ class NaviSetVideoConfigRequestTest MockEventDispatcher mock_event_dispatcher_; }; -TEST_F(NaviSetVideoConfigRequestTest, OnEvent_SUCCESS) { +TEST_F(NaviSetVideoConfigRequestTest, OnEventWithSuccessResponse) { MessageSharedPtr request_msg = CreateMessage(); (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; @@ -117,7 +117,7 @@ static bool ValidateList(std::vector& expected, return std::equal(expected.begin(), expected.end(), actual.begin()); } -TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { +TEST_F(NaviSetVideoConfigRequestTest, OnEventWithRejectedResponse) { MessageSharedPtr request_msg = CreateMessage(); (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; (*request_msg)[am::strings::msg_params][am::strings::config] = @@ -165,7 +165,8 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE) { ASSERT_TRUE(ValidateList(expected_list, rejected_params)); } -TEST_F(NaviSetVideoConfigRequestTest, OnEvent_FAILURE_WithoutParams) { +TEST_F(NaviSetVideoConfigRequestTest, + OnEventWithRejectedResponseWithoutParams) { MessageSharedPtr request_msg = CreateMessage(); (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; -- cgit v1.2.1 From 57766b7d08b92b40275d968ce8d001f974f91a36 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 12:24:30 +0900 Subject: Clean up SetVideoStreamingCapability_SUCCESS test case Reflecting review comments. --- .../hmi/ui_get_capabilities_response_test.cc | 57 ++++++++-------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index 3b41284e9e..57cafd75e2 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -297,45 +297,30 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { (*command_msg)[strings::msg_params][strings::system_capabilities] [strings::video_streaming_capability] = smart_objects::SmartObject(smart_objects::SmartType_Map); + smart_objects::SmartObject& video_streaming_capability = + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::video_streaming_capability]; - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability] - [strings::preferred_resolution] = - smart_objects::SmartObject(smart_objects::SmartType_Map); - - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability] - [strings::preferred_resolution][strings::resolution_width] = - 800; - - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability] - [strings::preferred_resolution][strings::resolution_height] = - 350; + video_streaming_capability[strings::preferred_resolution] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + video_streaming_capability[strings::preferred_resolution] + [strings::resolution_width] = 800; + video_streaming_capability[strings::preferred_resolution] + [strings::resolution_height] = 350; - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability][strings::max_bitrate] = - 10000; + video_streaming_capability[strings::max_bitrate] = 10000; - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability] - [strings::supported_formats] = - smart_objects::SmartObject(smart_objects::SmartType_Array); + video_streaming_capability[strings::supported_formats] = + smart_objects::SmartObject(smart_objects::SmartType_Array); - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability] - [strings::supported_formats][0] = - smart_objects::SmartObject(smart_objects::SmartType_Map); + video_streaming_capability[strings::supported_formats][0] = + smart_objects::SmartObject(smart_objects::SmartType_Map); - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability] - [strings::supported_formats][0][strings::protocol] = - hmi_apis::Common_VideoStreamingProtocol::RAW; + video_streaming_capability[strings::supported_formats][0][strings::protocol] = + hmi_apis::Common_VideoStreamingProtocol::RAW; - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability] - [strings::supported_formats][0][strings::codec] = - hmi_apis::Common_VideoStreamingCodec::H264; + video_streaming_capability[strings::supported_formats][0][strings::codec] = + hmi_apis::Common_VideoStreamingCodec::H264; ResponseFromHMIPtr command( CreateCommand(command_msg)); @@ -343,12 +328,8 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { EXPECT_CALL(app_mngr_, hmi_capabilities()) .WillOnce(ReturnRef(mock_hmi_capabilities_)); - smart_objects::SmartObject vs_capability_so = - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::video_streaming_capability]; - EXPECT_CALL(mock_hmi_capabilities_, - set_video_streaming_capability(vs_capability_so)); + set_video_streaming_capability(video_streaming_capability)); command->Run(); } -- cgit v1.2.1 From f6ea1262c4b6a3d1e10dc89fa570720a6c85ea9d Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 13:42:23 +0900 Subject: Update SendStartSessionAck() to always receive params SendStartSessionAck() now uses given BSON object instance to append generic parameters such as mtu, instead of creating another BSON instance. Reflecting review comments. --- .../protocol_handler/protocol_handler_impl.h | 28 +---- .../protocol_handler/src/protocol_handler_impl.cc | 120 +++++++++------------ 2 files changed, 55 insertions(+), 93 deletions(-) diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index af12fc288d..7521137d5a 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -252,29 +252,6 @@ class ProtocolHandlerImpl uint8_t service_type, bool protection); - /** - * \brief Sends acknowledgement of starting session to mobile application - * with session number and hash code for second version of protocol - * was started - * \param connection_id Identifier of connection within which session - * \param session_id ID of session to be sent to mobile application - * \param protocol_version Version of protocol used for communication - * \param hash_code For second version of protocol: identifier of session - * to be sent to - * mobile app for using when ending session - * \param service_type Type of session: RPC or BULK Data. RPC by default - * \param protection Protection flag - * \param additional_params Additional parameters added in the payload. Can - * be NULL. - */ - void SendStartSessionAck(ConnectionID connection_id, - uint8_t session_id, - uint8_t protocol_version, - uint32_t hash_code, - uint8_t service_type, - bool protection, - const BsonObject* additional_params); - /** * \brief Sends acknowledgement of starting session to mobile application * with session number and hash code for second version of protocol @@ -312,8 +289,7 @@ class ProtocolHandlerImpl * \param protection Protection flag * \param full_version full protocol version (major.minor.patch) used by the * mobile proxy - * \param additional_params Additional parameters added in the payload. Can - * be NULL. + * \param params Parameters added in the payload */ void SendStartSessionAck(ConnectionID connection_id, uint8_t session_id, @@ -322,7 +298,7 @@ class ProtocolHandlerImpl uint8_t service_type, bool protection, ProtocolPacket::ProtocolVersion& full_version, - const BsonObject* additional_params); + BsonObject& params); const ProtocolHandlerSettings& get_settings() const OVERRIDE { return settings_; diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 5838fd6019..e4b09de8b3 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -205,28 +205,6 @@ void ProtocolHandlerImpl::SendStartSessionAck(ConnectionID connection_id, fullVersion); } -void ProtocolHandlerImpl::SendStartSessionAck( - ConnectionID connection_id, - uint8_t session_id, - uint8_t protocol_version, - uint32_t hash_id, - uint8_t service_type, - bool protection, - const BsonObject* additional_params) { - LOG4CXX_AUTO_TRACE(logger_); - ProtocolPacket::ProtocolVersion* fullVersion = - new ProtocolPacket::ProtocolVersion(); - SendStartSessionAck(connection_id, - session_id, - protocol_version, - hash_id, - service_type, - protection, - *fullVersion, - additional_params); - delete fullVersion; -} - void ProtocolHandlerImpl::SendStartSessionAck( ConnectionID connection_id, uint8_t session_id, @@ -236,6 +214,10 @@ void ProtocolHandlerImpl::SendStartSessionAck( bool protection, ProtocolPacket::ProtocolVersion& full_version) { LOG4CXX_AUTO_TRACE(logger_); + + BsonObject empty_param; + bson_object_initialize_default(&empty_param); + SendStartSessionAck(connection_id, session_id, protocol_version, @@ -243,7 +225,9 @@ void ProtocolHandlerImpl::SendStartSessionAck( service_type, protection, full_version, - NULL); + empty_param); + + bson_object_deinitialize(&empty_param); } void ProtocolHandlerImpl::SendStartSessionAck( @@ -254,7 +238,7 @@ void ProtocolHandlerImpl::SendStartSessionAck( uint8_t service_type, bool protection, ProtocolPacket::ProtocolVersion& full_version, - const BsonObject* additional_params) { + BsonObject& params) { LOG4CXX_AUTO_TRACE(logger_); uint8_t maxProtocolVersion = SupportedSDLProtocolVersion(); @@ -279,10 +263,8 @@ void ProtocolHandlerImpl::SendStartSessionAck( if (proxy_supports_v5_protocol && maxProtocolVersion >= PROTOCOL_VERSION_5) { ServiceType serviceTypeValue = ServiceTypeFromByte(service_type); - BsonObject payloadObj; - bson_object_initialize_default(&payloadObj); bson_object_put_int64( - &payloadObj, + ¶ms, strings::mtu, static_cast( protocol_header_validator_.max_payload_size_by_service_type( @@ -290,7 +272,7 @@ void ProtocolHandlerImpl::SendStartSessionAck( if (serviceTypeValue == kRpc) { // Hash ID is only used in RPC case bson_object_put_int32( - &payloadObj, strings::hash_id, static_cast(hash_id)); + ¶ms, strings::hash_id, static_cast(hash_id)); // Minimum protocol version supported by both ProtocolPacket::ProtocolVersion* minVersion = (full_version.majorVersion < PROTOCOL_VERSION_5) @@ -300,35 +282,11 @@ void ProtocolHandlerImpl::SendStartSessionAck( char protocolVersionString[255]; strncpy(protocolVersionString, (*minVersion).to_string().c_str(), 255); bson_object_put_string( - &payloadObj, strings::protocol_version, protocolVersionString); - } else if (serviceTypeValue == kMobileNav && additional_params != NULL) { - BsonObject* input = const_cast(additional_params); - BsonElement* element = NULL; - if ((element = bson_object_get(input, strings::height)) != NULL && - element->type == TYPE_INT32) { - bson_object_put_int32(&payloadObj, - strings::height, - bson_object_get_int32(input, strings::height)); - } - if ((element = bson_object_get(input, strings::width)) != NULL && - element->type == TYPE_INT32) { - bson_object_put_int32(&payloadObj, - strings::width, - bson_object_get_int32(input, strings::width)); - } - char* protocol = bson_object_get_string(input, strings::video_protocol); - if (protocol != NULL) { - bson_object_put_string(&payloadObj, strings::video_protocol, protocol); - } - char* codec = bson_object_get_string(input, strings::video_codec); - if (codec != NULL) { - bson_object_put_string(&payloadObj, strings::video_codec, codec); - } + ¶ms, strings::protocol_version, protocolVersionString); } - uint8_t* payloadBytes = bson_object_to_bytes(&payloadObj); - ptr->set_data(payloadBytes, bson_object_size(&payloadObj)); + uint8_t* payloadBytes = bson_object_to_bytes(¶ms); + ptr->set_data(payloadBytes, bson_object_size(¶ms)); free(payloadBytes); - bson_object_deinitialize(&payloadObj); } else { set_hash_id(hash_id, *ptr); } @@ -1548,13 +1506,37 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( return; } - BsonObject input_param; + BsonObject start_session_ack_params; + bson_object_initialize_default(&start_session_ack_params); + // when video service is successfully started, copy input parameters + // ("width", "height", "videoProtocol", "videoCodec") to the ACK packet if (packet->service_type() == kMobileNav && packet->data() != NULL) { - // when video service is successfully started, copy input parameters - // ("width", "height", "videoProtocol", "videoCodec") to the ACK packet - input_param = bson_object_from_bytes(packet->data()); - } else { - bson_object_initialize_default(&input_param); + BsonObject req_param = bson_object_from_bytes(packet->data()); + BsonElement* element = NULL; + + if ((element = bson_object_get(&req_param, strings::height)) != NULL && + element->type == TYPE_INT32) { + bson_object_put_int32(&start_session_ack_params, + strings::height, + bson_object_get_int32(&req_param, strings::height)); + } + if ((element = bson_object_get(&req_param, strings::width)) != NULL && + element->type == TYPE_INT32) { + bson_object_put_int32(&start_session_ack_params, + strings::width, + bson_object_get_int32(&req_param, strings::width)); + } + char* protocol = + bson_object_get_string(&req_param, strings::video_protocol); + if (protocol != NULL) { + bson_object_put_string( + &start_session_ack_params, strings::video_protocol, protocol); + } + char* codec = bson_object_get_string(&req_param, strings::video_codec); + if (codec != NULL) { + bson_object_put_string( + &start_session_ack_params, strings::video_codec, codec); + } } #ifdef ENABLE_SECURITY @@ -1572,6 +1554,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( connection_key, security_manager::SecurityManager::ERROR_INTERNAL, error); + ProtocolPacket::ProtocolVersion fullVersion; // Start service without protection SendStartSessionAck(connection_id, generated_session_id, @@ -1579,8 +1562,9 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( hash_id, packet->service_type(), PROTECTION_OFF, - &input_param); - bson_object_deinitialize(&input_param); + fullVersion, + start_session_ack_params); + bson_object_deinitialize(&start_session_ack_params); return; } ProtocolPacket::ProtocolVersion* fullVersion; @@ -1617,7 +1601,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( packet->service_type(), PROTECTION_ON, *fullVersion, - &input_param); + start_session_ack_params); } else { security_manager_->AddListener( new StartSessionHandler(connection_key, @@ -1636,7 +1620,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( } } delete fullVersion; - bson_object_deinitialize(&input_param); + bson_object_deinitialize(&start_session_ack_params); LOG4CXX_DEBUG(logger_, "Protection establishing for connection " << connection_key << " is in progress"); @@ -1670,15 +1654,17 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( } else { // Start service without protection + ProtocolPacket::ProtocolVersion fullVersion; SendStartSessionAck(connection_id, generated_session_id, packet->protocol_version(), hash_id, packet->service_type(), PROTECTION_OFF, - &input_param); + fullVersion, + start_session_ack_params); } - bson_object_deinitialize(&input_param); + bson_object_deinitialize(&start_session_ack_params); } RESULT_CODE ProtocolHandlerImpl::HandleControlMessageHeartBeat( -- cgit v1.2.1 From 02cfd4222ea25099900e285cd2a9981b00a2e168 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Fri, 11 Aug 2017 14:19:08 +0900 Subject: fix: missing deinit of temporary BSON object --- src/components/protocol_handler/src/protocol_handler_impl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index e4b09de8b3..30c910848d 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1537,6 +1537,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( bson_object_put_string( &start_session_ack_params, strings::video_codec, codec); } + bson_object_deinitialize(&req_param); } #ifdef ENABLE_SECURITY -- cgit v1.2.1 From 5f53669ead7fb8de513bb2ec18e119a27e1f91de Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Fri, 11 Aug 2017 15:42:33 -0400 Subject: - removed some extraneous logging to clean up the code a bit --- .../src/commands/mobile/show_request.cc | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc index 53c6ece67c..8f51afa9b6 100644 --- a/src/components/application_manager/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_request.cc @@ -56,31 +56,25 @@ void ShowRequest::HandleMetadata(const char* field_id, (*message_)[strings::msg_params][strings::text_field_metadata]; if (metadata_struct.keyExists(field_id)) { - LOG4CXX_INFO(logger_, "field " << field_id << " exists."); - if (field_index != -1) { - LOG4CXX_INFO(logger_, "have a field index of " << field_index); msg_params[hmi_request::show_strings][field_index] [hmi_request::field_types] = smart_objects::SmartObject(smart_objects::SmartType_Array); const size_t num_tags = metadata_struct[field_id].length(); - LOG4CXX_INFO(logger_, "num_tags = " << num_tags); - for (size_t i = 0; i < num_tags; ++i) { const int32_t current_tag = metadata_struct[field_id][i].asInt(); msg_params[hmi_request::show_strings][field_index] [hmi_request::field_types][i] = current_tag; - LOG4CXX_INFO(logger_, "tag " << i << ": " << current_tag); } } else { LOG4CXX_INFO(logger_, - "tag provided with no item for " << field_id - << ", ignore with warning"); - // tag provided with no item, ignore with warning + "metadata tag provided with no item for " << field_id + << ", ignoring"); } } else { - LOG4CXX_INFO(logger_, "field " << field_id << " does not exist."); + LOG4CXX_INFO(logger_, + "No metadata tagging provided for field: " << field_id); } } @@ -202,8 +196,6 @@ void ShowRequest::Run() { if ((*message_)[strings::msg_params].keyExists( strings::text_field_metadata)) { - LOG4CXX_INFO(logger_, "TextFieldMetadata exists."); - HandleMetadata(strings::main_field_1, main_field_1_index, msg_params); HandleMetadata(strings::main_field_2, main_field_2_index, msg_params); HandleMetadata(strings::main_field_3, main_field_3_index, msg_params); -- cgit v1.2.1 From 510fb1ab849847976cbfef69187e208154138b1d Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Fri, 11 Aug 2017 19:40:42 -0400 Subject: Just copy the parameters from the original message rather than check and copy individually --- .../protocol_handler/src/protocol_handler_impl.cc | 32 +++------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 30c910848d..23054f5123 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1507,37 +1507,13 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( } BsonObject start_session_ack_params; - bson_object_initialize_default(&start_session_ack_params); // when video service is successfully started, copy input parameters // ("width", "height", "videoProtocol", "videoCodec") to the ACK packet if (packet->service_type() == kMobileNav && packet->data() != NULL) { - BsonObject req_param = bson_object_from_bytes(packet->data()); - BsonElement* element = NULL; - - if ((element = bson_object_get(&req_param, strings::height)) != NULL && - element->type == TYPE_INT32) { - bson_object_put_int32(&start_session_ack_params, - strings::height, - bson_object_get_int32(&req_param, strings::height)); - } - if ((element = bson_object_get(&req_param, strings::width)) != NULL && - element->type == TYPE_INT32) { - bson_object_put_int32(&start_session_ack_params, - strings::width, - bson_object_get_int32(&req_param, strings::width)); - } - char* protocol = - bson_object_get_string(&req_param, strings::video_protocol); - if (protocol != NULL) { - bson_object_put_string( - &start_session_ack_params, strings::video_protocol, protocol); - } - char* codec = bson_object_get_string(&req_param, strings::video_codec); - if (codec != NULL) { - bson_object_put_string( - &start_session_ack_params, strings::video_codec, codec); - } - bson_object_deinitialize(&req_param); + start_session_ack_params = bson_object_from_bytes(packet->data()); + } + else { + bson_object_initialize_default(&start_session_ack_params); } #ifdef ENABLE_SECURITY -- cgit v1.2.1 From 7423ce23a1bed695d29664edba340d66c432790b Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Fri, 11 Aug 2017 19:42:22 -0400 Subject: Fix usage of StartSessionHandler to include payload params. --- .../protocol_handler/src/protocol_handler_impl.cc | 31 +++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 23054f5123..2622c164f3 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1209,7 +1209,8 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { uint32_t hash_id, ServiceType service_type, const std::vector& force_protected_service, - ProtocolPacket::ProtocolVersion& full_version) + ProtocolPacket::ProtocolVersion& full_version, + uint8_t* payload) : connection_key_(connection_key) , protocol_handler_(protocol_handler) , session_observer_(session_observer) @@ -1219,12 +1220,14 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { , hash_id_(hash_id) , service_type_(service_type) , force_protected_service_(force_protected_service) - , full_version_(full_version) {} + , full_version_(full_version) + , payload_(payload) {} bool OnHandshakeDone( const uint32_t connection_key, security_manager::SSLContext::HandshakeResult result) OVERRIDE { if (connection_key != connection_key_) { + delete[] payload_; return false; } const bool success = @@ -1244,13 +1247,24 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { if (success) { session_observer_.SetProtectionFlag(connection_key_, service_type_); } + BsonObject params; + if (payload_ != NULL) { + params = bson_object_from_bytes(payload_); + } + else { + bson_object_initialize_default(¶ms); + } protocol_handler_->SendStartSessionAck(connection_id_, session_id_, protocol_version_, hash_id_, service_type_, - success); + success, + full_version_, + params); + bson_object_deinitialize(¶ms); } + delete[] payload_; delete this; return true; } @@ -1272,7 +1286,8 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { const uint32_t hash_id_; const ServiceType service_type_; const std::vector force_protected_service_; - const ProtocolPacket::ProtocolVersion full_version_; + ProtocolPacket::ProtocolVersion full_version_; + uint8_t* payload_; }; } // namespace #endif // ENABLE_SECURITY @@ -1381,7 +1396,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleControlMessageStartSession( hash_id, service_type, get_settings().force_protected_service(), - *fullVersion)); + *fullVersion, + NULL)); if (!ssl_context->IsHandshakePending()) { // Start handshake process security_manager_->StartHandshake(connection_key); @@ -1580,6 +1596,8 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( *fullVersion, start_session_ack_params); } else { + //Need a copy because fullVersion will be deleted + ProtocolPacket::ProtocolVersion fullVersionCopy(*fullVersion); security_manager_->AddListener( new StartSessionHandler(connection_key, this, @@ -1590,7 +1608,8 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( hash_id, service_type, get_settings().force_protected_service(), - *fullVersion)); + fullVersionCopy, + bson_object_to_bytes(&start_session_ack_params))); if (!ssl_context->IsHandshakePending()) { // Start handshake process security_manager_->StartHandshake(connection_key); -- cgit v1.2.1 From 8db2ab794bdb07bd292513a79ada296345fa1061 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Sat, 12 Aug 2017 11:32:44 +0900 Subject: fix: wrong arg of OnStreamingConfigured() Reflecting review comments. --- .../src/commands/hmi/navi_set_video_config_request.cc | 7 ++----- .../commands/hmi/navi_set_video_config_request_test.cc | 14 +++++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc index f019512fa6..031ba2023c 100644 --- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc @@ -112,7 +112,7 @@ void NaviSetVideoConfigRequest::on_event(const event_engine::Event& event) { } } application_manager_.OnStreamingConfigured( - application_id(), + app->app_id(), protocol_handler::ServiceType::kMobileNav, result, rejected_params); @@ -136,10 +136,7 @@ void NaviSetVideoConfigRequest::onTimeOut() { std::vector empty; application_manager_.OnStreamingConfigured( - application_id(), - protocol_handler::ServiceType::kMobileNav, - false, - empty); + app->app_id(), protocol_handler::ServiceType::kMobileNav, false, empty); application_manager_.TerminateRequest( connection_key(), correlation_id(), function_id()); diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc index b233d228d9..7e81fc3115 100644 --- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc @@ -79,6 +79,7 @@ class NaviSetVideoConfigRequestTest .WillByDefault(Return(mock_app_ptr_)); ON_CALL(app_mngr_, event_dispatcher()) .WillByDefault(ReturnRef(mock_event_dispatcher_)); + ON_CALL(*mock_app_ptr_, app_id()).WillByDefault(Return(kAppId)); ON_CALL(*mock_app_ptr_, hmi_app_id()).WillByDefault(Return(kHmiAppId)); } @@ -104,7 +105,7 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEventWithSuccessResponse) { EXPECT_CALL( app_mngr_, OnStreamingConfigured( - kHmiAppId, protocol_handler::ServiceType::kMobileNav, true, empty)) + kAppId, protocol_handler::ServiceType::kMobileNav, true, empty)) .Times(1); command->on_event(event); @@ -150,10 +151,9 @@ TEST_F(NaviSetVideoConfigRequestTest, OnEventWithRejectedResponse) { event.set_smart_object(*event_msg); std::vector rejected_params; - EXPECT_CALL( - app_mngr_, - OnStreamingConfigured( - kHmiAppId, protocol_handler::ServiceType::kMobileNav, false, _)) + EXPECT_CALL(app_mngr_, + OnStreamingConfigured( + kAppId, protocol_handler::ServiceType::kMobileNav, false, _)) .WillOnce(SaveArg<3>(&rejected_params)); command->on_event(event); @@ -184,7 +184,7 @@ TEST_F(NaviSetVideoConfigRequestTest, EXPECT_CALL( app_mngr_, OnStreamingConfigured( - kHmiAppId, protocol_handler::ServiceType::kMobileNav, false, empty)) + kAppId, protocol_handler::ServiceType::kMobileNav, false, empty)) .WillOnce(Return()); command->on_event(event); @@ -201,7 +201,7 @@ TEST_F(NaviSetVideoConfigRequestTest, OnTimeout) { EXPECT_CALL( app_mngr_, OnStreamingConfigured( - kHmiAppId, protocol_handler::ServiceType::kMobileNav, false, empty)) + kAppId, protocol_handler::ServiceType::kMobileNav, false, empty)) .WillOnce(Return()); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(1); -- cgit v1.2.1 From 0f937b880bd48c1838cdfbb306d4c39057a89eb2 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Sat, 12 Aug 2017 12:36:58 +0900 Subject: fix: don't use local var for mock OnSessionStartedCallback() call Reflecting review comments. --- .../test/protocol_handler_tm_test.cc | 40 ++++++++-------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index f4baaf7d58..89b9faedaa 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -202,7 +202,6 @@ class ProtocolHandlerImplTest : public ::testing::Test { // use protection OFF const bool callback_protection_flag = PROTECTION_OFF; #endif // ENABLE_SECURITY - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, @@ -222,7 +221,7 @@ class ProtocolHandlerImplTest : public ::testing::Test { session_id, HASH_ID_WRONG, callback_protection_flag, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; // Expect send Ack with PROTECTION_OFF (on no Security Manager) @@ -315,6 +314,7 @@ class ProtocolHandlerImplTest : public ::testing::Test { security_manager_mock; testing::NiceMock ssl_context_mock; #endif // ENABLE_SECURITY + std::vector empty_rejected_param_; }; #ifdef ENABLE_SECURITY @@ -368,7 +368,6 @@ TEST_F(ProtocolHandlerImplTest, TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -389,7 +388,7 @@ TEST_F(ProtocolHandlerImplTest, SESSION_START_REJECT, HASH_ID_WRONG, PROTECTION_OFF, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times += call_times; // Expect send NAck @@ -434,7 +433,6 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) { TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL( session_observer_mock, @@ -455,7 +453,7 @@ TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverReject) { SESSION_START_REJECT, HASH_ID_WRONG, callback_protection_flag, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times += call_times; // Expect send NAck with encryption OFF @@ -491,7 +489,6 @@ TEST_F(ProtocolHandlerImplTest, TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -510,7 +507,7 @@ TEST_F(ProtocolHandlerImplTest, session_id, HASH_ID_WRONG, PROTECTION_OFF, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; SetProtocolVersion2(); @@ -607,7 +604,6 @@ TEST_F(ProtocolHandlerImplTest, std::vector params1 = CreateVectorFromBsonObject(&bson_params1); uint8_t generated_session_id1 = 100; - std::vector empty; EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id1, @@ -656,7 +652,7 @@ TEST_F(ProtocolHandlerImplTest, generated_session_id1, HASH_ID_WRONG, PROTECTION_OFF, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; BsonObject bson_ack_params; @@ -818,7 +814,6 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { // Add security manager AddSecurityManager(); const ServiceType start_service = kRpc; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -837,7 +832,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { session_id, HASH_ID_WRONG, PROTECTION_OFF, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; SetProtocolVersion2(); @@ -874,7 +869,6 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) { TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -893,7 +887,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionUnprotected) { session_id, HASH_ID_WRONG, PROTECTION_OFF, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; SetProtocolVersion2(); @@ -920,7 +914,6 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) { TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -939,7 +932,7 @@ TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtected_Fail) { session_id, HASH_ID_WRONG, PROTECTION_ON, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; SetProtocolVersion2(); @@ -975,7 +968,6 @@ TEST_F(ProtocolHandlerImplTest, TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -994,7 +986,7 @@ TEST_F(ProtocolHandlerImplTest, session_id, HASH_ID_WRONG, PROTECTION_ON, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; SetProtocolVersion2(); @@ -1043,7 +1035,6 @@ TEST_F(ProtocolHandlerImplTest, TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -1062,7 +1053,7 @@ TEST_F(ProtocolHandlerImplTest, session_id, HASH_ID_WRONG, PROTECTION_ON, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; std::vector services; @@ -1136,7 +1127,6 @@ TEST_F(ProtocolHandlerImplTest, TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -1155,7 +1145,7 @@ TEST_F(ProtocolHandlerImplTest, session_id, HASH_ID_WRONG, PROTECTION_ON, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; // call new SSLContext creation @@ -1234,7 +1224,6 @@ TEST_F( TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -1253,7 +1242,7 @@ TEST_F( session_id, HASH_ID_WRONG, PROTECTION_ON, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; // call new SSLContext creation @@ -1330,7 +1319,6 @@ TEST_F(ProtocolHandlerImplTest, TestAsyncWaiter waiter; uint32_t times = 0; - std::vector empty; // Expect ConnectionHandler check EXPECT_CALL(session_observer_mock, OnSessionStartedCallback(connection_id, @@ -1349,7 +1337,7 @@ TEST_F(ProtocolHandlerImplTest, session_id, HASH_ID_WRONG, PROTECTION_ON, - ByRef(empty)))); + ByRef(empty_rejected_param_)))); times++; // call new SSLContext creation -- cgit v1.2.1 From fe754c475d29a635d6c338e8f235341e21b97724 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Sat, 12 Aug 2017 13:01:23 +0900 Subject: fix: build break in set_app_icon_request.cc --- .../src/commands/mobile/set_app_icon_request.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc index a1c0d3ba5c..5afddfb4d0 100644 --- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc @@ -120,10 +120,10 @@ void SetAppIconRequest::Run() { void SetAppIconRequest::CopyToIconStorage( const std::string& path_to_file) const { - if (!application_manager_.protocol_handler() - .get_settings() - .max_supported_protocol_version() >= - protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4) { + if (!(application_manager_.protocol_handler() + .get_settings() + .max_supported_protocol_version() >= + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)) { LOG4CXX_WARN(logger_, "Icon copying skipped, since protocol ver. 4 is not enabled."); return; -- cgit v1.2.1 From 63eb7c774cd77589f7bff6d36301d174a0458070 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Sat, 12 Aug 2017 14:57:08 +0900 Subject: fix: build break in protocol_packet_test.cc --- src/components/protocol_handler/test/protocol_packet_test.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/protocol_handler/test/protocol_packet_test.cc b/src/components/protocol_handler/test/protocol_packet_test.cc index 7819c4b5b0..60a984c17f 100644 --- a/src/components/protocol_handler/test/protocol_packet_test.cc +++ b/src/components/protocol_handler/test/protocol_packet_test.cc @@ -125,7 +125,8 @@ TEST_F(ProtocolPacketTest, SerializePacketWithDiffServiceType) { for (size_t i = 0; i < serv_types.size(); ++i) { RawMessagePtr res = GetRawMessage(PROTOCOL_VERSION_3, FRAME_TYPE_CONTROL, serv_types[i]); - EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version()); + EXPECT_EQ(static_cast(PROTOCOL_VERSION_3), + res->protocol_version()); EXPECT_EQ(serv_types[i], res->service_type()); EXPECT_EQ(PROTOCOL_HEADER_V2_SIZE, res->data_size()); } @@ -146,7 +147,8 @@ TEST_F(ProtocolPacketTest, SerializePacketWithWrongServiceType) { for (size_t i = 0; i < serv_types.size(); ++i) { RawMessagePtr res = GetRawMessage(PROTOCOL_VERSION_3, FRAME_TYPE_CONTROL, serv_types[i]); - EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version()); + EXPECT_EQ(static_cast(PROTOCOL_VERSION_3), + res->protocol_version()); EXPECT_EQ(kInvalidServiceType, res->service_type()); } } @@ -156,7 +158,8 @@ TEST_F(ProtocolPacketTest, SetPacketWithDiffFrameType) { for (frame_type = FRAME_TYPE_CONTROL + 1; frame_type <= FRAME_TYPE_MAX_VALUE; ++frame_type) { RawMessagePtr res = GetRawMessage(PROTOCOL_VERSION_3, frame_type, kControl); - EXPECT_EQ(PROTOCOL_VERSION_3, res->protocol_version()); + EXPECT_EQ(static_cast(PROTOCOL_VERSION_3), + res->protocol_version()); EXPECT_EQ(kControl, res->service_type()); } } -- cgit v1.2.1 From f74a95b4c8730cf362b1b3dceecf2fe05c262818 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 14 Aug 2017 10:35:27 -0400 Subject: Refactoring of NotifySessionStartedResult --- .../protocol_handler/src/protocol_handler_impl.cc | 80 ++++++++-------------- 1 file changed, 30 insertions(+), 50 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 2622c164f3..0f0aca69ba 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1532,6 +1532,22 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( bson_object_initialize_default(&start_session_ack_params); } + ProtocolPacket::ProtocolVersion* fullVersion; + + // Can't check protocol_version because the first packet is v1, but there + // could still be a payload, in which case we can get the real protocol + // version + if (packet->service_type() == kRpc && packet->data() != NULL) { + fullVersion = new ProtocolPacket::ProtocolVersion( + std::string(bson_object_get_string(&start_session_ack_params, strings::protocol_version))); + // Constructed payloads added in Protocol v5 + if (fullVersion->majorVersion < PROTOCOL_VERSION_5) { + rejected_params.push_back(std::string(strings::protocol_version)); + } + } else { + fullVersion = new ProtocolPacket::ProtocolVersion(); + } + #ifdef ENABLE_SECURITY // for packet is encrypted and security plugin is enable if (protection && security_manager_) { @@ -1547,7 +1563,6 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( connection_key, security_manager::SecurityManager::ERROR_INTERNAL, error); - ProtocolPacket::ProtocolVersion fullVersion; // Start service without protection SendStartSessionAck(connection_id, generated_session_id, @@ -1555,34 +1570,19 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( hash_id, packet->service_type(), PROTECTION_OFF, - fullVersion, + *fullVersion, start_session_ack_params); + delete fullVersion; bson_object_deinitialize(&start_session_ack_params); return; } - ProtocolPacket::ProtocolVersion* fullVersion; - std::vector rejectedParams; - // Can't check protocol_version because the first packet is v1, but there - // could still be a payload, in which case we can get the real protocol - // version - if (packet->service_type() == kRpc && packet->data_size() != 0) { - BsonObject obj = bson_object_from_bytes(packet->data()); - fullVersion = new ProtocolPacket::ProtocolVersion( - std::string(bson_object_get_string(&obj, strings::protocol_version))); - bson_object_deinitialize(&obj); - // Constructed payloads added in Protocol v5 - if (fullVersion->majorVersion < PROTOCOL_VERSION_5) { - rejectedParams.push_back(std::string(strings::protocol_version)); - } - } else { - fullVersion = new ProtocolPacket::ProtocolVersion(); - } - if (!rejectedParams.empty()) { + + if (!rejected_params.empty()) { SendStartSessionNAck(connection_id, packet->session_id(), protocol_version, packet->service_type(), - rejectedParams); + rejected_params); } else if (ssl_context->IsInitCompleted()) { // mark service as protected session_observer_.SetProtectionFlag(connection_key, service_type); @@ -1623,43 +1623,23 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( return; } #endif // ENABLE_SECURITY - if (packet->service_type() == kRpc && packet->data_size() != 0) { - BsonObject obj = bson_object_from_bytes(packet->data()); - ProtocolPacket::ProtocolVersion fullVersion( - bson_object_get_string(&obj, strings::protocol_version)); - bson_object_deinitialize(&obj); - - if (fullVersion.majorVersion >= PROTOCOL_VERSION_5) { - // Start service without protection - SendStartSessionAck(connection_id, - generated_session_id, - packet->protocol_version(), - hash_id, - packet->service_type(), - PROTECTION_OFF, - fullVersion); - } else { - std::vector rejectedParams( - 1, std::string(strings::protocol_version)); - SendStartSessionNAck(connection_id, - packet->session_id(), - protocol_version, - packet->service_type(), - rejectedParams); - } - - } else { - // Start service without protection - ProtocolPacket::ProtocolVersion fullVersion; + if (rejected_params.empty()) { SendStartSessionAck(connection_id, generated_session_id, packet->protocol_version(), hash_id, packet->service_type(), PROTECTION_OFF, - fullVersion, + *fullVersion, start_session_ack_params); + } else { + SendStartSessionNAck(connection_id, + packet->session_id(), + protocol_version, + packet->service_type(), + rejected_params); } + delete fullVersion; bson_object_deinitialize(&start_session_ack_params); } -- cgit v1.2.1 From 66569e1fe7adda31381d806652148384894f16c1 Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Mon, 14 Aug 2017 14:52:21 -0400 Subject: - adding warning result code and info message to ShowResponse to handle the case where metadata tags are provided without a corresponding mainField entry. --- .../commands/mobile/show_request.h | 3 +++ .../src/commands/mobile/show_request.cc | 22 ++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h index 7e07be1c9a..a10997bacd 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h @@ -86,6 +86,9 @@ class ShowRequest : public CommandRequestImpl { int32_t field_index, smart_objects::SmartObject& msg_params); + mobile_apis::Result::eType core_result_code_; + std::string core_response_info_; + DISALLOW_COPY_AND_ASSIGN(ShowRequest); }; diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc index 8f51afa9b6..00cdc2a603 100644 --- a/src/components/application_manager/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_request.cc @@ -45,7 +45,8 @@ namespace commands { ShowRequest::ShowRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) {} + : CommandRequestImpl(message, application_manager) + , core_result_code_(mobile_apis::Result::INVALID_ENUM) {} ShowRequest::~ShowRequest() {} @@ -69,8 +70,14 @@ void ShowRequest::HandleMetadata(const char* field_id, } } else { LOG4CXX_INFO(logger_, - "metadata tag provided with no item for " << field_id - << ", ignoring"); + "metadata tag provided with no item for " + << field_id << ", ignoring with warning"); + // tag provided with no item, ignore with warning + if (mobile_apis::Result::INVALID_ENUM == core_result_code_) { + core_result_code_ = mobile_apis::Result::IGNORED; + core_response_info_ = + "Metadata tag was provided for a field with no data."; + } } } else { LOG4CXX_INFO(logger_, @@ -284,8 +291,15 @@ void ShowRequest::on_event(const event_engine::Event& event) { response_info = message[strings::params][hmi_response::message].asString(); } + mobile_apis::Result::eType converted_result_code = + MessageHelper::HMIToMobileResult(result_code); + if (mobile_apis::Result::SUCCESS == converted_result_code && + mobile_apis::Result::INVALID_ENUM != core_result_code_) { + converted_result_code = core_result_code_; + response_info = core_response_info_; + } SendResponse(result, - MessageHelper::HMIToMobileResult(result_code), + converted_result_code, response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); break; -- cgit v1.2.1 From 19a7dc5dc54c8b0cb9075d7432adb76b628943f2 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 14 Aug 2017 15:44:32 -0400 Subject: Fix crash related to previous refactoring The `protocolVersion` parameter was being read from `start_session_act_params`, which was not populated in the `RPC` service case. This change fixes this and adds a check to make sure that the parameter exists before constructing a version object from the payload. --- src/components/protocol_handler/src/protocol_handler_impl.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 0f0aca69ba..17408b44b0 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1538,8 +1538,11 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( // could still be a payload, in which case we can get the real protocol // version if (packet->service_type() == kRpc && packet->data() != NULL) { - fullVersion = new ProtocolPacket::ProtocolVersion( - std::string(bson_object_get_string(&start_session_ack_params, strings::protocol_version))); + BsonObject request_params = bson_object_from_bytes(packet->data()); + char* version_param = + bson_object_get_string(&request_params, strings::protocol_version); + std::string version_string(version_param == NULL ? "" : version_param); + fullVersion = new ProtocolPacket::ProtocolVersion(version_string); // Constructed payloads added in Protocol v5 if (fullVersion->majorVersion < PROTOCOL_VERSION_5) { rejected_params.push_back(std::string(strings::protocol_version)); -- cgit v1.2.1 From 1c531a872b34c57d8f88b806fd360e7cdcddd847 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 14 Aug 2017 15:44:52 -0400 Subject: Fix style issues --- .../include/protocol_handler/session_observer.h | 8 +++--- .../protocol_handler/src/protocol_handler_impl.cc | 32 ++++++++++------------ 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/components/include/protocol_handler/session_observer.h b/src/components/include/protocol_handler/session_observer.h index 3386112134..e58d959c8c 100644 --- a/src/components/include/protocol_handler/session_observer.h +++ b/src/components/include/protocol_handler/session_observer.h @@ -42,10 +42,10 @@ struct BsonObject; - /** - *\namespace protocol_handlerHandler - *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality. - */ +/** + *\namespace protocol_handler + *\brief Namespace for SmartDeviceLink ProtocolHandler related functionality. + */ namespace protocol_handler { /** * \brief HASH_ID constants. diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 17408b44b0..5f53552564 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1250,8 +1250,7 @@ class StartSessionHandler : public security_manager::SecurityManagerListener { BsonObject params; if (payload_ != NULL) { params = bson_object_from_bytes(payload_); - } - else { + } else { bson_object_initialize_default(¶ms); } protocol_handler_->SendStartSessionAck(connection_id_, @@ -1527,8 +1526,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( // ("width", "height", "videoProtocol", "videoCodec") to the ACK packet if (packet->service_type() == kMobileNav && packet->data() != NULL) { start_session_ack_params = bson_object_from_bytes(packet->data()); - } - else { + } else { bson_object_initialize_default(&start_session_ack_params); } @@ -1599,20 +1597,20 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( *fullVersion, start_session_ack_params); } else { - //Need a copy because fullVersion will be deleted + // Need a copy because fullVersion will be deleted ProtocolPacket::ProtocolVersion fullVersionCopy(*fullVersion); - security_manager_->AddListener( - new StartSessionHandler(connection_key, - this, - session_observer_, - connection_id, - generated_session_id, - packet->protocol_version(), - hash_id, - service_type, - get_settings().force_protected_service(), - fullVersionCopy, - bson_object_to_bytes(&start_session_ack_params))); + security_manager_->AddListener(new StartSessionHandler( + connection_key, + this, + session_observer_, + connection_id, + generated_session_id, + packet->protocol_version(), + hash_id, + service_type, + get_settings().force_protected_service(), + fullVersionCopy, + bson_object_to_bytes(&start_session_ack_params))); if (!ssl_context->IsHandshakePending()) { // Start handshake process security_manager_->StartHandshake(connection_key); -- cgit v1.2.1 From 50d4acad4d327b7b64fe454201b4cff6ab766dd0 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 14 Aug 2017 16:38:19 -0400 Subject: Fix: deinitialize BSON object --- src/components/protocol_handler/src/protocol_handler_impl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 5f53552564..a4d263a00c 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1545,6 +1545,7 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( if (fullVersion->majorVersion < PROTOCOL_VERSION_5) { rejected_params.push_back(std::string(strings::protocol_version)); } + bson_object_deinitialize(&request_params); } else { fullVersion = new ProtocolPacket::ProtocolVersion(); } -- cgit v1.2.1 From a145743eb128a7d0b82bd1fb47e18fa7936dfb1f Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Tue, 15 Aug 2017 11:56:37 +0900 Subject: fix: add OVERRIDE keyword to OnStreamingConfigured() --- .../include/application_manager/application_manager_impl.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index be02db35a1..c0b7b7bd46 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -901,10 +901,11 @@ class ApplicationManagerImpl * @param rejected_params list of rejected parameters' name. Valid * only when result is false. */ - void OnStreamingConfigured(uint32_t app_id, - protocol_handler::ServiceType service_type, - bool result, - std::vector& rejected_params); + void OnStreamingConfigured( + uint32_t app_id, + protocol_handler::ServiceType service_type, + bool result, + std::vector& rejected_params) OVERRIDE; /** * @brief Callback calls when application starts/stops data streaming -- cgit v1.2.1 From fb4f46d24fb968d36b52a2239900771781353bdb Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Tue, 15 Aug 2017 13:47:27 +0900 Subject: fix: inconsistency in license headers --- .../application_manager/commands/hmi/navi_set_video_config_request.h | 2 +- .../application_manager/commands/hmi/navi_set_video_config_response.h | 2 +- .../src/commands/hmi/navi_set_video_config_request.cc | 2 +- .../src/commands/hmi/navi_set_video_config_response.cc | 2 +- .../test/commands/hmi/navi_set_video_config_request_test.cc | 2 +- .../test/commands/hmi/navi_set_video_config_response_test.cc | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h index 8f45a97df4..0788a5595e 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_request.h @@ -13,7 +13,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the names of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h index afa98ac40d..3c53687a93 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_set_video_config_response.h @@ -13,7 +13,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the names of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc index 031ba2023c..d19db515ab 100644 --- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_request.cc @@ -13,7 +13,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the names of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc b/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc index c912dc4aac..03679eb3b1 100644 --- a/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_set_video_config_response.cc @@ -13,7 +13,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the names of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc index 7e81fc3115..7c04aa724c 100644 --- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_request_test.cc @@ -13,7 +13,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the names of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc index f99345ec58..753c2a9179 100644 --- a/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/navi_set_video_config_response_test.cc @@ -13,7 +13,7 @@ * disclaimer in the documentation and/or other materials provided with the * distribution. * - * Neither the name of the Ford Motor Company nor the names of its contributors + * Neither the names of the copyright holders nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * -- cgit v1.2.1 From 38b4426e797c6cde7e4e88467f85bd31e7464644 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Wed, 9 Aug 2017 17:30:02 +0300 Subject: Fix instalation of bson to avoid root access --- src/3rd_party/CMakeLists.txt | 51 +++++++++++++++++++++++++++++++------------- src/3rd_party/FindBSON.cmake | 26 ++++++++++++++++++++++ 2 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 src/3rd_party/FindBSON.cmake diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index f9abfb55ce..9abc187d0c 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -283,22 +283,43 @@ if(HMI_DBUS_API) add_subdirectory(dbus-cmake) endif() -set(BSON_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) -set(BSON_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) -set(EMHASHMAP_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include PARENT_SCOPE) -set(EMHASHMAP_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX_ARCH}/lib PARENT_SCOPE) -set(BSON_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bson_c_lib) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}") +set(CMAKE_SOURCE_PREFIX ${CMAKE_SOURCE_PREFIX} "${3RD_PARTY_INSTALL_PREFIX}") +find_package (BSON) +message (STATUS "bson installed in " ${BSON_LIBS_DIRECTORY} " , " ${BSON_INCLUDE_DIRECTORY}) +message (STATUS "emhashmap installed in " ${EMHASHMAP_LIBS_DIRECTORY} " , " ${EMHASHMAP_INCLUDE_DIRECTORY}) -include(ExternalProject) -ExternalProject_Add(libbson - GIT_REPOSITORY "http://github.com/smartdevicelink/bson_c_lib.git" - GIT_TAG "master" - BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY} - DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY} - SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY} - CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure && ./configure - BUILD_COMMAND make - INSTALL_COMMAND sudo make install) +if (${BSON_LIB} MATCHES "BSON_LIB-NOTFOUND") + message (STATUS "Building bson required") + set(BSON_LIB_SOURCE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bson_c_lib CACHE INTERNAL "Sources of bson library" FORCE) + set(BSON_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib CACHE INTERNAL "Installation path of bson libraries" FORCE) + set(BSON_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include CACHE INTERNAL "Installation path of bson headers" FORCE) + set(EMHASHMAP_LIBS_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/lib CACHE INTERNAL "Installation path of emashmap libraries" FORCE) + set(EMHASHMAP_INCLUDE_DIRECTORY ${3RD_PARTY_INSTALL_PREFIX}/include CACHE INTERNAL "Installation path of emashmap headers" FORCE) + + set(BSON_INSTALL_COMMAND make install) + if (${3RD_PARTY_INSTALL_PREFIX} MATCHES "/usr/local") + set(BSON_INSTALL_COMMAND sudo make install) + endif() + include(ExternalProject) + ExternalProject_Add(libbson + GIT_REPOSITORY "http://github.com/LuxoftAKutsan/bson_c_lib.git" +# TODO Change GIT_REPOSITORY to http://github.com/smartdevicelink/bson_c_lib.git +# after merge of https://github.com/smartdevicelink/bson_c_lib/pull/2 + GIT_TAG "master" + BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY} + INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX} + DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY} + SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY} + CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure && ./configure --prefix=${3RD_PARTY_INSTALL_PREFIX} + BUILD_COMMAND make + INSTALL_COMMAND ${BSON_INSTALL_COMMAND}) +else() + get_filename_component(BSON_LIBS_DIRECTORY ${BSON_LIB} DIRECTORY) + get_filename_component(EMHASHMAP_LIBS_DIRECTORY ${EMHASHMAP_LIB} DIRECTORY) + set(BSON_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of bson libraries" FORCE) + set(EMHASHMAP_LIBS_DIRECTORY ${BSON_LIBS_DIRECTORY} CACHE INTERNAL "Installation path of emashmap libraries" FORCE) +endif() add_custom_target(install-3rd_party DEPENDS ${install-3rd_party_logger_var} diff --git a/src/3rd_party/FindBSON.cmake b/src/3rd_party/FindBSON.cmake new file mode 100644 index 0000000000..91d53624f1 --- /dev/null +++ b/src/3rd_party/FindBSON.cmake @@ -0,0 +1,26 @@ +set(INCLUDE_PATH "${CMAKE_SOURCE_PREFIX}/include") +set(LIB_PATH "${CMAKE_SOURCE_PREFIX}/lib") + +find_path(BSON_INCLUDE_DIRECTORY bson_object.h bson_array.h bson_util.h + PATHS "${INCLUDE_PATH}") + +find_library(BSON_LIB + NAMES bson + PATHS ${LIB_PATH}) + +find_path(EMHASHMAP_INCLUDE_DIRECTORY emhashmap.h + PATHS ${INCLUDE_PATH} + PATH_SUFFIXES emhashmap) + +find_library(EMHASHMAP_LIB + NAMES emhashmap + PATHS ${LIB_PATH}) + + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_LIB + EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB) + +mark_as_advanced(BSON_INCLUDE_DIRECTORY BSON_LIB) +mark_as_advanced(EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB) -- cgit v1.2.1 From 3c02c69a10240f4838e05d7fd0e10e12ed9ea808 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Tue, 15 Aug 2017 16:20:58 -0400 Subject: Update clone URL and fix build step Updated the clone URL of the repository, because the necessary changes were merged in. Updated the pre-configure `touch` command due to changes in the BSON library --- src/3rd_party/CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index 9abc187d0c..adafe686ab 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -303,15 +303,13 @@ if (${BSON_LIB} MATCHES "BSON_LIB-NOTFOUND") endif() include(ExternalProject) ExternalProject_Add(libbson - GIT_REPOSITORY "http://github.com/LuxoftAKutsan/bson_c_lib.git" -# TODO Change GIT_REPOSITORY to http://github.com/smartdevicelink/bson_c_lib.git -# after merge of https://github.com/smartdevicelink/bson_c_lib/pull/2 + GIT_REPOSITORY "http://github.com/smartdevicelink/bson_c_lib.git" GIT_TAG "master" BINARY_DIR ${BSON_LIB_SOURCE_DIRECTORY} INSTALL_DIR ${3RD_PARTY_INSTALL_PREFIX} DOWNLOAD_DIR ${BSON_LIB_SOURCE_DIRECTORY} SOURCE_DIR ${BSON_LIB_SOURCE_DIRECTORY} - CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure && ./configure --prefix=${3RD_PARTY_INSTALL_PREFIX} + CONFIGURE_COMMAND touch aclocal.m4 configure.ac Makefile.am Makefile.in configure config.h.in && ./configure --prefix=${3RD_PARTY_INSTALL_PREFIX} BUILD_COMMAND make INSTALL_COMMAND ${BSON_INSTALL_COMMAND}) else() -- cgit v1.2.1 From 2bbffa835fdbab4972b31ced36e7929b461e5fdf Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Wed, 9 Aug 2017 17:29:38 +0300 Subject: Switch off ditcc build by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e68df883f..6a62aed45c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ option(ENABLE_EXTENDED_POLICY "Turns extended flow which requires embedded syste option(USE_COTIRE "Use Cotire to speed up build (currently only for commands tests)" ON) option(USE_GOLD_LD "Use gold linker intead of GNU linker" ON) option(USE_CCACHE "Turn on ccache usage" ON) -option(USE_DISTCC "Turn on distributed build_usage" ON) +option(USE_DISTCC "Turn on distributed build_usage" OFF) set (EXTENDED_POLICY "PROPRIETARY" CACHE STRING "Policy mode (PROPRIETARY, HTTP or EXTERNAL_PROPRIETARY)") set_property(CACHE EXTENDED_POLICY PROPERTY STRINGS PROPRIETARY HTTP EXTERNAL_PROPRIETARY) -- cgit v1.2.1 From 41fe2979a5f1f8a13428ae4fe88f37ee9824c92e Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Wed, 9 Aug 2017 17:30:02 +0300 Subject: Fix instalation of bson to avoid root access --- src/appMain/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index a1f7b6e115..cd67dc5f60 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -139,7 +139,7 @@ if(ENABLE_LOG) list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY}) list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY}) endif() - +MESSAGE(INFO BSON_LIBS_DIRECTORY "${BSON_LIBS_DIRECTORY}") list(APPEND LIBRARIES bson -L${BSON_LIBS_DIRECTORY}) list(APPEND LIBRARIES emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}) -- cgit v1.2.1 From 06729e8b744374a4d9694f669101b6c554ce42e0 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Thu, 10 Aug 2017 14:07:07 +0300 Subject: Arhitecture changes for support RC plugin --- CMakeLists.txt | 19 +- src/appMain/CMakeLists.txt | 24 +- src/appMain/life_cycle.h | 4 + src/components/CMakeLists.txt | 6 + .../include/application_manager/app_extension.h | 58 +++ .../include/application_manager/core_service.h | 248 +++++++++++++ .../include/application_manager/service.h | 243 +++++++++++++ .../application_manager/src/core_service.cc | 306 ++++++++++++++++ .../include/config_profile/profile.h | 23 +- src/components/config_profile/src/profile.cc | 11 +- src/components/functional_module/CMakeLists.txt | 58 +++ .../include/functional_module/function_ids.h | 61 ++++ .../include/functional_module/generic_module.h | 175 +++++++++ .../include/functional_module/module_observer.h | 48 +++ .../include/functional_module/plugin_manager.h | 128 +++++++ .../include/functional_module/settings.h | 125 +++++++ .../include/functional_module/timer/module_timer.h | 231 ++++++++++++ .../functional_module/timer/timer_director.h | 92 +++++ .../functional_module/src/generic_module.cc | 63 ++++ .../functional_module/src/plugin_manager.cc | 405 +++++++++++++++++++++ src/components/functional_module/src/settings.cc | 64 ++++ .../functional_module/src/timer/timer_director.cc | 156 ++++++++ .../functional_module/test/CMakeLists.txt | 56 +++ .../test/include/driver_generic_module_test.h | 77 ++++ .../test/include/mock_application.h | 248 +++++++++++++ .../test/include/mock_module_observer.h | 50 +++ .../functional_module/test/include/mock_service.h | 92 +++++ .../test/include/module_timer_test.h | 56 +++ .../functional_module/test/plugins/CMakeLists.txt | 17 + .../test/plugins/mock_generic_module.cc | 23 ++ .../test/plugins/mock_generic_module.h | 72 ++++ .../test/src/generic_module_test.cc | 137 +++++++ .../test/src/module_timer_test.cc | 123 +++++++ .../test/src/plugin_manager_test.cc | 206 +++++++++++ .../functional_module/test/src/settings_test.cc | 92 +++++ src/components/functional_module/test/test.ini | 36 ++ .../hmi_message_handler/hmi_message_adapter_impl.h | 9 +- .../hmi_message_handler/hmi_message_handler_impl.h | 28 +- .../hmi_message_handler/messagebroker_adapter.h | 7 + .../src/hmi_message_adapter_impl.cc | 6 + .../src/hmi_message_handler_impl.cc | 14 + .../application_manager/mock_application_manager.h | 25 ++ .../mock_application_manager_settings.h | 1 + src/components/include/utils/macro.h | 11 +- 44 files changed, 3914 insertions(+), 20 deletions(-) create mode 100644 src/components/application_manager/include/application_manager/app_extension.h create mode 100644 src/components/application_manager/include/application_manager/core_service.h create mode 100644 src/components/application_manager/include/application_manager/service.h create mode 100644 src/components/application_manager/src/core_service.cc create mode 100644 src/components/functional_module/CMakeLists.txt create mode 100644 src/components/functional_module/include/functional_module/function_ids.h create mode 100644 src/components/functional_module/include/functional_module/generic_module.h create mode 100644 src/components/functional_module/include/functional_module/module_observer.h create mode 100644 src/components/functional_module/include/functional_module/plugin_manager.h create mode 100644 src/components/functional_module/include/functional_module/settings.h create mode 100644 src/components/functional_module/include/functional_module/timer/module_timer.h create mode 100644 src/components/functional_module/include/functional_module/timer/timer_director.h create mode 100644 src/components/functional_module/src/generic_module.cc create mode 100644 src/components/functional_module/src/plugin_manager.cc create mode 100644 src/components/functional_module/src/settings.cc create mode 100644 src/components/functional_module/src/timer/timer_director.cc create mode 100644 src/components/functional_module/test/CMakeLists.txt create mode 100644 src/components/functional_module/test/include/driver_generic_module_test.h create mode 100644 src/components/functional_module/test/include/mock_application.h create mode 100644 src/components/functional_module/test/include/mock_module_observer.h create mode 100644 src/components/functional_module/test/include/mock_service.h create mode 100644 src/components/functional_module/test/include/module_timer_test.h create mode 100644 src/components/functional_module/test/plugins/CMakeLists.txt create mode 100644 src/components/functional_module/test/plugins/mock_generic_module.cc create mode 100644 src/components/functional_module/test/plugins/mock_generic_module.h create mode 100644 src/components/functional_module/test/src/generic_module_test.cc create mode 100644 src/components/functional_module/test/src/module_timer_test.cc create mode 100644 src/components/functional_module/test/src/plugin_manager_test.cc create mode 100644 src/components/functional_module/test/src/settings_test.cc create mode 100644 src/components/functional_module/test/test.ini diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a62aed45c..b8fd497a09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ option(ENABLE_GCOV "gcov code coverage feature" OFF) option(ENABLE_SANITIZE "Sanitize tool" OFF) option(ENABLE_SECURITY "Security Ford protocol protection" ON) option(ENABLE_HMI_PTU_DECRYPTION "Policy table update parsed by hmi" ON) -option(ENABLE_EXTENDED_POLICY "Turns extended flow which requires embedded system interaction" ON) +option(REMOTE_CONTROL "Enable Reverse functionality" ON) option(USE_COTIRE "Use Cotire to speed up build (currently only for commands tests)" ON) option(USE_GOLD_LD "Use gold linker intead of GNU linker" ON) option(USE_CCACHE "Turn on ccache usage" ON) @@ -160,6 +160,11 @@ if (OS_TYPE_OPTION) endif() endif() +if (REMOTE_CONTROL) + add_definitions(-DSDL_REMOTE_CONTROL) + message(STATUS "Remote control support is enabled (aka Reverse SDL or SDL-RC)") +endif() + #Jenkins integration section end add_custom_target(pasa-tarball @@ -409,6 +414,18 @@ if(CMAKE_SYSTEM_NAME STREQUAL "QNX") set(RTLIB ) endif() +SET(RPATH_DIRECTORIES + ${CMAKE_INSTALL_PREFIX}/bin/plugins + /usr/local/lib + /usr/local + ${CMAKE_INSTALL_PREFIX}/bin +) +SET(CMAKE_SKIP_BUILD_RPATH FALSE) +SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +SET(CMAKE_INSTALL_RPATH "${RPATH_DIRECTORIES}") +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + + # Building tests if(BUILD_TESTS) enable_testing() diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index cd67dc5f60..64c88bf22f 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -44,6 +44,7 @@ endif() include_directories( ${COMPONENTS_DIR}/protocol_handler/include ${COMPONENTS_DIR}/application_manager/include + ${COMPONENTS_DIR}/remote_control/include ${COMPONENTS_DIR}/formatters/include ${COMPONENTS_DIR}/transport_manager/include ${COMPONENTS_DIR}/security_manager/include @@ -56,9 +57,10 @@ include_directories( ${COMPONENTS_DIR}/smart_objects/include ${COMPONENTS_DIR}/media_manager/include ${COMPONENTS_DIR}/telemetry_monitor/include - ${POLICY_PATH}/include/ + ${COMPONENTS_DIR}/functional_module/include + ${POLICY_PATH}/include ${POLICY_GLOBAL_INCLUDE_PATH}/ - ${COMPONENTS_DIR}/rpc_base/include/ + ${COMPONENTS_DIR}/rpc_base/include ${COMPONENTS_DIR}/resumption/include ${COMPONENTS_DIR}/dbus/include ${CMAKE_BINARY_DIR}/src/components @@ -115,6 +117,12 @@ set(LIBRARIES ConfigProfile Resumption ) +if(REMOTE_CONTROL) + SET (LIBRARIES + ${LIBRARIES} + FunctionalModule + ) +endif(REMOTE_CONTROL) if (CMAKE_SYSTEM_NAME STREQUAL "Linux") list(APPEND LIBRARIES pthread) @@ -210,6 +218,18 @@ install( ${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem DESTINATION bin ) +if (REMOTE_CONTROL) + install( + FILES "${CMAKE_SOURCE_DIR}/src/components/remote_control/remote_sdl_pt.json" + DESTINATION ${CMAKE_BINARY_DIR}/bin + RENAME sdl_preloaded_pt.json + ) +else () + install( + FILES sdl_preloaded_pt.json + DESTINATION bin + ) +endif () if (${QT_HMI}) if (CMAKE_SYSTEM_NAME STREQUAL "QNX") diff --git a/src/appMain/life_cycle.h b/src/appMain/life_cycle.h index f1b3800254..586711d53e 100644 --- a/src/appMain/life_cycle.h +++ b/src/appMain/life_cycle.h @@ -44,6 +44,10 @@ #include "hmi_message_handler/messagebroker_adapter.h" #endif // #if ( defined (MESSAGEBROKER_HMIADAPTER) || defined(PASA_HMI) ) #include "application_manager/application_manager_impl.h" +#ifdef SDL_REMOTE_CONTROL +#include "application_manager/core_service.h" +#include "functional_module/plugin_manager.h" +#endif // SDL_REMOTE_CONTROL #include "connection_handler/connection_handler_impl.h" #include "protocol_handler/protocol_handler_impl.h" #include "transport_manager/transport_manager.h" diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt index 0304ce986f..e1071e826f 100644 --- a/src/components/CMakeLists.txt +++ b/src/components/CMakeLists.txt @@ -86,6 +86,12 @@ add_subdirectory(./config_profile) # --- Media Manager add_subdirectory(./media_manager) +if(REMOTE_CONTROL) + # --- CAN Module + add_subdirectory(./remote_control) + # --- Functional module + add_subdirectory(./functional_module) +endif() # --- Telemetry Monitor if(TELEMETRY_MONITOR) add_subdirectory(./telemetry_monitor) diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h new file mode 100644 index 0000000000..221601a307 --- /dev/null +++ b/src/components/application_manager/include/application_manager/app_extension.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ + +#include "utils/shared_ptr.h" + +namespace application_manager { + +typedef int AppExtensionUID; + +class AppExtension { + public: + explicit AppExtension(AppExtensionUID uid) : kUid_(uid) {} + virtual ~AppExtension() {} + AppExtensionUID uid() const { + return kUid_; + } + + private: + const AppExtensionUID kUid_; +}; + +typedef utils::SharedPtr AppExtensionPtr; + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h new file mode 100644 index 0000000000..d746b953dc --- /dev/null +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -0,0 +1,248 @@ +/** + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_ + +#include +#include +#include "application_manager/service.h" +#include "application_manager/application.h" +#include "policy/policy_types.h" + +namespace Json { +class Value; +} + +namespace application_manager { + +struct CommandParametersPermissions; + +/** + * @brief Class through which the plug-in can interact with the core + */ +class CoreService : public Service { + public: + /** + * @brief CoreService class destructor + */ + explicit CoreService(ApplicationManager& application_manager); + + /** + * @brief CoreService class destructor + */ + virtual ~CoreService(); + + /** + * @brief Checks message permissions and cuts parameters according + * to policy table permissions + * @param msg message to cut disallowed parameters + * @return result according by mobile API + */ + mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) FINAL; + + /** + * Checks access to requested equipment of vehicle + * @param app_id id of application + * @param module type + * @param rpc name of rpc + * @param params parameters list + * @return return allowed if access exist, + * manual if need to send question to driver otherwise disallowed + */ + TypeAccess CheckAccess(const ApplicationId& app_id, + const std::string& module, + const std::string& rpc, + const std::vector& params) FINAL; + + /** + * Checks access to module for application + * @param app_id id of application + * @param module type + * @return true if module is allowed for application + */ + bool CheckModule(const ApplicationId& app_id, + const std::string& module) FINAL; + + /** + * Sets access to functional group which contains given RPC for application + * @param app_id id of application + * @param module type + * @param allowed true if driver has given access + */ + void SetAccess(const ApplicationId& app_id, + const std::string& module, + bool allowed) FINAL; + + /** + * Resets access by group name for all applications + * @param group_name group name + */ + void ResetAccess(const ApplicationId& app_id) FINAL; + + /** + * Resets access by module type for all applications + * @param module type + */ + void ResetAccess(const std::string& module) FINAL; + + /** + * Gets device handler for device with certain ID + * @param device_id the ID of the connected device + * @return device handler if device with requested ID was found + */ + uint32_t GetDeviceHandlerById(const std::string& device_id) FINAL; + + /** + * Sets device as primary device + * @param dev_id ID device + */ + void SetPrimaryDevice(const uint32_t dev_id) FINAL; + + /** + * Resets driver's device + */ + void ResetPrimaryDevice() FINAL; + + /** + * Return id of primary device + */ + uint32_t PrimaryDevice() const FINAL; + + /** + * Sets mode of remote control (on/off) + * @param enabled true if remote control is turned on + */ + void SetRemoteControl(bool enabled) FINAL; + + /** + * @brief Is Remote Control allowed by Policy and User + */ + bool IsRemoteControlAllowed() const FINAL; + + /** + * Checks if application has remote control functions + * @param app application + * @return true if application has remote control functions + */ + bool IsRemoteControlApplication(ApplicationSharedPtr app) const FINAL; + + /** + * Removes fake parameters from request to HMI + * @param message message to handle + */ + void RemoveHMIFakeParameters(application_manager::MessagePtr& message) FINAL; + + /** + * @brief Get pointer to application by application id + * @param app_id application id + * return pointer to application + */ + ApplicationSharedPtr GetApplication(ApplicationId app_id) FINAL; + + /** + * @brief Send message to HMI + * @param message Message to HMI + */ + void SendMessageToHMI(const MessagePtr& message) FINAL; + + /** + * @brief Send message to mobile device + * @param message Message to mobile + */ + void SendMessageToMobile(const MessagePtr& message) FINAL; + + /** + * @brief Returns unique correlation ID for next HMI request + * + * @return Unique correlation ID + */ + uint32_t GetNextCorrelationID() FINAL; + + /** + * @brief Returns all applications + * + * @return List with shared pointers to applications + */ + std::vector GetApplications(AppExtensionUID uid) FINAL; + + /** + * @brief Subscribes to notification from HMI + * @param hmi_notification string with notification name + */ + void SubscribeToHMINotification(const std::string& hmi_notification) FINAL; + + /** + * @brief Change hmi level of app and notify it + * @param app Application to be changed and notified + * @param level New HMI level of app + */ + void ChangeNotifyHMILevel(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level) FINAL; + + /** + * @brief Notify HMI about app changing HMI Level + * only NONE, BACKGROUND and LIMITED levels are sent + * @param app Application to be changed and notified + * @param level New HMI level of app + */ + void NotifyHMIAboutHMILevel(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level) FINAL; + + /** + * Gets all allowed module types + * @param app_id unique identifier of application + * @param list of allowed module types + * @return true if application has allowed modules + */ + bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const FINAL; + + MessageValidationResult ValidateMessageBySchema( + const Message& message) OVERRIDE; + + private: + bool AreParametersAllowed(MessagePtr msg, + const CommandParametersPermissions& params); + bool CheckParams(const Json::Value& object, + const policy::RPCParams& allowed_params); + bool IsAllowed(const std::string& name, + const policy::RPCParams& allowed_params); + + ApplicationManager& application_manager_; + + DISALLOW_COPY_AND_ASSIGN(CoreService); +}; + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_CORE_SERVICE_H_ diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h new file mode 100644 index 0000000000..4eea2b0b0f --- /dev/null +++ b/src/components/application_manager/include/application_manager/service.h @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_ + +#include +#include +#include +#include "application_manager/application.h" +#include "application_manager/message.h" + +namespace application_manager { + +enum TypeAccess { kNone, kDisallowed, kAllowed, kManual }; + +enum MessageValidationResult { + SUCCESS = 0, + INVALID_JSON, + INVALID_METADATA, + SCHEMA_MISMATCH, + UNSUPPORTED_PROTOCOL +}; + +typedef std::string PluginFunctionID; + +/** + * @brief Interface to core service + */ +class Service { + public: + virtual ~Service() {} + + /** + * @brief Checks message permissions and cuts parameters according + * to policy table permissions + * @param msg message to cut disallowed parameters + * @return result according by mobile API + */ + virtual mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) = 0; + + /** + * Checks access to requested equipment of vehicle + * @param app_id id of application + * @param module type + * @param rpc name of rpc + * @param params parameters list + * @return return allowed if access exist, + * manual if need to send question to driver otherwise disallowed + */ + virtual TypeAccess CheckAccess(const ApplicationId& app_id, + const std::string& module, + const std::string& rpc, + const std::vector& params) = 0; + + /** + * Checks access to module for application + * @param app_id id of application + * @param module type + * @return true if module is allowed for application + */ + virtual bool CheckModule(const ApplicationId& app_id, + const std::string& module) = 0; + + /** + * Sets access to functional group which contains given RPC for application + * @param app_id id of application + * @param module type + * @param allowed true if driver has given access + */ + virtual void SetAccess(const ApplicationId& app_id, + const std::string& module, + bool allowed) = 0; + + /** + * Resets access application to all resources + * @param app_id ID application + */ + virtual void ResetAccess(const ApplicationId& app_id) = 0; + + /** + * Resets access by module and interior zone for all applications + * @param module type + */ + virtual void ResetAccess(const std::string& module) = 0; + + /** + * Gets device handler for device with certain ID + * @param device_id the ID of the connected device + * @return device handler if device with requested ID was found + */ + virtual uint32_t GetDeviceHandlerById(const std::string& device_id) = 0; + + /** + * Sets device as primary device + * @param dev_id ID device + */ + virtual void SetPrimaryDevice(const uint32_t dev_id) = 0; + + /** + * Resets driver's device + */ + virtual void ResetPrimaryDevice() = 0; + + /** + * Return id of primary device + */ + virtual uint32_t PrimaryDevice() const = 0; + + /** + * Sets mode of remote control (on/off) + * @param enabled true if remote control is turned on + */ + virtual void SetRemoteControl(bool enabled) = 0; + + /** + * @brief Is Remote Control allowed by Policy and User + */ + virtual bool IsRemoteControlAllowed() const = 0; + + /** + * @brief Get pointer to application by application id + * @param app_id application id + * return pointer to application + */ + virtual ApplicationSharedPtr GetApplication(ApplicationId app_id) = 0; + + /** + * Removes fake parameters from request to HMI + * @param message message to handle + */ + virtual void RemoveHMIFakeParameters( + application_manager::MessagePtr& message) = 0; + /** + * @brief Send message to HMI + * @param message Message to HMI + */ + virtual void SendMessageToHMI(const MessagePtr& message) = 0; + + /** + * @brief Send message to mobile device + * @param message Message to mobile + */ + virtual void SendMessageToMobile(const MessagePtr& message) = 0; + + /** + * @brief Returns unique correlation ID for next HMI request + * + * @return Unique correlation ID + */ + virtual uint32_t GetNextCorrelationID() = 0; + + /** + * @brief Returns all applications related to plugin + * @param uid ID provided by plugin to its extension to app. + * @return List with shared pointers to applications + */ + virtual std::vector GetApplications( + AppExtensionUID uid) = 0; + + /** + * @brief Subscribes to notification from HMI + * @param hmi_notification string with notification name + */ + virtual void SubscribeToHMINotification( + const std::string& hmi_notification) = 0; + + /** + * @brief Change hmi level of app and notify it + * @param app Application to be changed and notified + * @param level New HMI level of app + */ + virtual void ChangeNotifyHMILevel(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level) = 0; + + /** + * @brief Notify HMI about app changing HMI Level + * only NONE, BACKGROUND and LIMITED levels are sent + * @param app Application to be changed and notified + * @param level New HMI level of app + */ + virtual void NotifyHMIAboutHMILevel(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level) = 0; + + /** + * Checks if application has remote control functions + * @param app application + * @return true if application has remote control functions + */ + virtual bool IsRemoteControlApplication(ApplicationSharedPtr app) const = 0; + + /** + * Gets all allowed module types + * @param app_id unique identifier of application + * @param list of allowed module types + * @return true if application has allowed modules + */ + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const = 0; + + /** + * @brief ValidateMessageBySchema validates message by xml schema + * @param message message for validation + * @return true if message is valid according to schema, otherwise false + */ + virtual MessageValidationResult ValidateMessageBySchema( + const Message& message) = 0; +}; + +typedef utils::SharedPtr ServicePtr; + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_H_ diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc new file mode 100644 index 0000000000..5aca2e4c34 --- /dev/null +++ b/src/components/application_manager/src/core_service.cc @@ -0,0 +1,306 @@ +/** + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include +#include +#include "application_manager/core_service.h" +#include "application_manager/application_manager_impl.h" +#include "application_manager/policies/policy_handler.h" +#include "application_manager/message_helper.h" +#include "json/json.h" +#include "interfaces/HMI_API.h" + +namespace application_manager { + +namespace { +struct AppExtensionPredicate { + AppExtensionUID uid; + bool operator()(const ApplicationSharedPtr app) { + return app ? app->QueryInterface(uid).valid() : false; + } +}; +} + +CoreService::CoreService(ApplicationManager& application_manager) + : application_manager_(application_manager) {} + +CoreService::~CoreService() {} + +mobile_apis::Result::eType CoreService::CheckPolicyPermissions(MessagePtr msg) { + ApplicationSharedPtr app = GetApplication(msg->connection_key()); + if (!app) { + return mobile_apis::Result::eType::APPLICATION_NOT_REGISTERED; + } + +#ifdef SDL_REMOTE_CONTROL + const RPCParams rpc_params; + CommandParametersPermissions params; + const mobile_apis::Result::eType ret = + application_manager_.CheckPolicyPermissions( + app, msg->function_name(), rpc_params, ¶ms); + + if (ret != mobile_apis::Result::eType::SUCCESS) { + return ret; + } + + if (!AreParametersAllowed(msg, params)) { + return mobile_apis::Result::eType::DISALLOWED; + } + + return ret; +#else + return mobile_apis::Result::eType::SUCCESS; +#endif // SDL_REMOTE_CONTROL +} + +TypeAccess CoreService::CheckAccess(const ApplicationId& app_id, + const std::string& module, + const std::string& rpc, + const std::vector& params) { +#ifdef SDL_REMOTE_CONTROL + ApplicationSharedPtr app = GetApplication(app_id); + if (app) { + std::string device_handle = MessageHelper::GetDeviceMacAddressForHandle( + app->device(), application_manager_); + return application_manager_.GetPolicyHandler().CheckAccess( + device_handle, app->policy_app_id(), module, rpc, params); + } +#endif // SDL_REMOTE_CONTROL + return kNone; +} + +bool CoreService::CheckModule(const ApplicationId& app_id, + const std::string& module) { +#ifdef SDL_REMOTE_CONTROL + ApplicationSharedPtr app = GetApplication(app_id); + if (app) { + return application_manager_.GetPolicyHandler().CheckModule( + app->policy_app_id(), module); + } +#endif // SDL_REMOTE_CONTROL + return false; +} + +void CoreService::SetAccess(const ApplicationId& app_id, + const std::string& module, + bool allowed) { +#ifdef SDL_REMOTE_CONTROL + ApplicationSharedPtr app = GetApplication(app_id); + if (app) { + std::string device_handle = MessageHelper::GetDeviceMacAddressForHandle( + app->device(), application_manager_); + application_manager_.GetPolicyHandler().SetAccess( + device_handle, app->policy_app_id(), module, allowed); + } +#endif // SDL_REMOTE_CONTROL +} + +void CoreService::ResetAccess(const ApplicationId& app_id) { +#ifdef SDL_REMOTE_CONTROL + ApplicationSharedPtr app = GetApplication(app_id); + if (app) { + std::string device_handle = MessageHelper::GetDeviceMacAddressForHandle( + app->device(), application_manager_); + application_manager_.GetPolicyHandler().ResetAccess(device_handle, + app->policy_app_id()); + } +#endif // SDL_REMOTE_CONTROL +} + +void CoreService::ResetAccess(const std::string& module) { +#ifdef SDL_REMOTE_CONTROL + application_manager_.GetPolicyHandler().ResetAccess(module); +#endif // SDL_REMOTE_CONTROL +} + +uint32_t CoreService::GetDeviceHandlerById(const std::string& device_id) { + uint32_t device_handle = 0; + application_manager_.connection_handler().GetDeviceID(device_id, + &device_handle); + return device_handle; +} + +void CoreService::SetPrimaryDevice(const uint32_t dev_id) { +#ifdef SDL_REMOTE_CONTROL + std::string device_handle = + MessageHelper::GetDeviceMacAddressForHandle(dev_id, application_manager_); + application_manager_.GetPolicyHandler().SetPrimaryDevice(device_handle); +#endif // SDL_REMOTE_CONTROL +} + +void CoreService::ResetPrimaryDevice() { +#ifdef SDL_REMOTE_CONTROL + application_manager_.GetPolicyHandler().ResetPrimaryDevice(); +#endif // SDL_REMOTE_CONTROL +} + +uint32_t CoreService::PrimaryDevice() const { +#ifdef SDL_REMOTE_CONTROL + return application_manager_.GetPolicyHandler().PrimaryDevice(); +#endif // SDL_REMOTE_CONTROL + return 0; +} + +void CoreService::SetRemoteControl(bool enabled) { +#ifdef SDL_REMOTE_CONTROL + application_manager_.GetPolicyHandler().SetRemoteControl(enabled); +#endif // SDL_REMOTE_CONTROL +} + +bool CoreService::IsRemoteControlAllowed() const { +#ifdef SDL_REMOTE_CONTROL + return application_manager_.GetPolicyHandler().GetRemoteControl(); +#endif // SDL_REMOTE_CONTROL + return false; +} + +bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const { +#ifdef SDL_REMOTE_CONTROL + return application_manager_.GetPolicyHandler().CheckHMIType( + app->policy_app_id(), + mobile_apis::AppHMIType::eType::REMOTE_CONTROL, + app->app_types()); +#endif // SDL_REMOTE_CONTROL + return false; +} + +void CoreService::RemoveHMIFakeParameters( + application_manager::MessagePtr& message) { + application_manager_.RemoveHMIFakeParameters(message); +} + +ApplicationSharedPtr CoreService::GetApplication(ApplicationId app_id) { + return application_manager_.application(app_id); +} + +void CoreService::SendMessageToHMI(const MessagePtr& message) { + application_manager_.SendPostMessageToHMI(message); +} + +void CoreService::SendMessageToMobile(const MessagePtr& message) { + application_manager_.SendPostMessageToMobile(message); +} + +uint32_t CoreService::GetNextCorrelationID() { + return application_manager_.GetNextHMICorrelationID(); +} + +std::vector CoreService::GetApplications( + AppExtensionUID uid) { + ApplicationSet accessor = application_manager_.applications().GetData(); + AppExtensionPredicate predicate; + predicate.uid = uid; + + std::vector result; + ApplicationSetConstIt it = + std::find_if(accessor.begin(), accessor.end(), predicate); + while (it != accessor.end()) { + result.push_back(*it); + it = std::find_if(++it, accessor.end(), predicate); + } + return result; +} + +void CoreService::SubscribeToHMINotification( + const std::string& hmi_notification) { + if (!hmi_notification.empty()) { + application_manager_.SubscribeToHMINotification(hmi_notification); + } +} + +void CoreService::ChangeNotifyHMILevel(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level) { + application_manager_.ChangeAppsHMILevel(app->app_id(), level); + MessageHelper::SendHMIStatusNotification(*app, application_manager_); +} + +void CoreService::NotifyHMIAboutHMILevel(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level) { + if (app->hmi_level() != mobile_apis::HMILevel::eType::HMI_FULL) { + MessageHelper::SendActivateAppToHMI( + app->app_id(), + application_manager_, + static_cast(level), + true); + } +} + +bool CoreService::AreParametersAllowed( + MessagePtr msg, const CommandParametersPermissions& params) { + Json::Reader reader; + Json::Value json; + bool ret = reader.parse(msg->json_message(), json); + if (ret) { + return CheckParams(json.get(strings::params, Json::Value(Json::nullValue)), + params.allowed_params); + } + return false; +} + +bool CoreService::CheckParams(const Json::Value& object, + const RPCParams& allowed_params) { + if (!object.isObject()) { + return true; + } + for (Json::Value::iterator i = object.begin(); i != object.end(); ++i) { + std::string name = i.memberName(); + if (!IsAllowed(name, allowed_params)) { + return false; + } + } + return true; +} + +bool CoreService::IsAllowed(const std::string& name, + const RPCParams& allowed_params) { + return std::find(allowed_params.begin(), allowed_params.end(), name) != + allowed_params.end(); +} + +bool CoreService::GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const { +#ifdef SDL_REMOTE_CONTROL + return application_manager_.GetPolicyHandler().GetModuleTypes(policy_app_id, + modules); +#endif // SDL_REMOTE_CONTROL + return false; +} + +MessageValidationResult CoreService::ValidateMessageBySchema( + const Message& message) { + const MessageValidationResult result = + application_manager_.ValidateMessageBySchema(message); + LOG4CXX_DEBUG(logger_, "Validation result : " << result); + return result; +} + +} // namespace application_manager diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index 8a25bcf648..a177d7c410 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -176,9 +176,9 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, const uint16_t video_streaming_port() const OVERRIDE; /** - * @brief Returns port for audio streaming - */ - const uint16_t audio_streaming_port() const; + * @brief Returns port for audio streaming + */ + const uint16_t audio_streaming_port() const OVERRIDE; /** * @brief Returns streaming timeout @@ -211,6 +211,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, */ const std::vector& vr_commands() const; + /** + * @brief Returns folder containing all plugins + */ + const std::string& plugins_folder() const; + /** * @brief Maximum command id available for mobile app */ @@ -230,7 +235,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, /** * @brief Returns desirable thread stack size */ - const uint64_t& thread_min_stack_size() const; + const uint64_t thread_min_stack_size() const; /** * @brief Returns true if audio mixing is supported @@ -365,10 +370,19 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, // TransportManageSettings interface + /* + * @brief Returns true if last state singleton is used + */ bool use_last_state() const OVERRIDE; + /** + * @brief Timeout in transport manager before disconnect + */ uint32_t transport_manager_disconnect_timeout() const OVERRIDE; + /** + * @brief Returns port for TCP transport adapter + */ uint16_t transport_manager_tcp_adapter_port() const OVERRIDE; // TransportManageMMESettings interface @@ -880,6 +894,7 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, std::string iap_pool_protocol_mask_; std::string iap_system_config_; std::string iap2_system_config_; + std::string plugins_folder_; int iap2_hub_connect_attempts_; int iap_hub_connection_wait_timeout_; uint16_t tts_global_properties_timeout_; diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index 58709b876c..6389375bb8 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -141,6 +141,7 @@ const char* kTimeoutPromptKey = "TimeOutPromt"; const char* kHelpTitleKey = "HelpTitle"; const char* kHelpCommandKey = "HelpCommand"; const char* kSystemFilesPathKey = "SystemFilesPath"; +const char* kPluginsFolderKey = "PluginFolder"; const char* kHeartBeatTimeoutKey = "HeartBeatTimeout"; const char* kMaxSupportedProtocolVersionKey = "MaxSupportedProtocolVersion"; const char* kUseLastStateKey = "UseLastState"; @@ -219,6 +220,7 @@ const char* kDefaultPreloadedPTFileName = "sdl_preloaded_pt.json"; const char* kDefaultServerAddress = "127.0.0.1"; const char* kDefaultAppInfoFileName = "app_info.dat"; const char* kDefaultSystemFilesPath = "/tmp/fs/mp/images/ivsu_cache"; +const char* kDefaultPluginsPath = "plugins"; const char* kDefaultTtsDelimiter = ","; const uint32_t kDefaultAudioDataStoppedTimeout = 1000; const uint32_t kDefaultVideoDataStoppedTimeout = 1000; @@ -541,7 +543,7 @@ const uint16_t& Profile::time_testing_port() const { return time_testing_port_; } -const uint64_t& Profile::thread_min_stack_size() const { +const uint64_t Profile::thread_min_stack_size() const { return min_tread_stack_size_; } @@ -661,6 +663,9 @@ const std::string& Profile::system_files_path() const { return system_files_path_; } +const std::string& Profile::plugins_folder() const { + return plugins_folder_; +} const std::vector& Profile::supported_diag_modes() const { return supported_diag_modes_; } @@ -1556,6 +1561,10 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE(system_files_path_, kSystemFilesPathKey, kMainSection); + // Plugins folder + ReadStringValue( + &plugins_folder_, kDefaultPluginsPath, kMainSection, kPluginsFolderKey); + LOG_UPDATED_VALUE(plugins_folder_, kPluginsFolderKey, kMainSection); // Heartbeat timeout ReadUIntValue(&heart_beat_timeout_, kDefaultHeartBeatTimeout, diff --git a/src/components/functional_module/CMakeLists.txt b/src/components/functional_module/CMakeLists.txt new file mode 100644 index 0000000000..756a1dd2fe --- /dev/null +++ b/src/components/functional_module/CMakeLists.txt @@ -0,0 +1,58 @@ +if (ENABLE_GCOV) + set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs") +else() + set(GCOV_FLAGS "") +endif() + +set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++0x -Wno-deprecated-declarations -Wall -Werror ${GCOV_FLAGS}") + +if (CMAKE_BUILD_TYPE) + if (${CMAKE_BUILD_TYPE} STREQUAL "Release") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "") + else () + set(CMAKE_CXX_FLAGS_RELEASE "") + set(CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG") + endif() +endif() + +set(GCOV gcov) + +include_directories ( + ${COMPONENTS_DIR}/functional_module/include/ + ${COMPONENTS_DIR}/remote_control/include/ + ${COMPONENTS_DIR}/include/ + ${COMPONENTS_DIR}/application_manager/include + ${COMPONENTS_DIR}/connection_handler/include/ + ${COMPONENTS_DIR}/utils/include + ${POLICY_PATH}/include/ + ${POLICY_GLOBAL_INCLUDE_PATH}/ + ${COMPONENTS_DIR}/config_profile/include + ${COMPONENTS_DIR}/smart_objects/include + ${JSONCPP_INCLUDE_DIRECTORY} + ${LOG4CXX_INCLUDE_DIRECTORY} + ${CMAKE_BINARY_DIR}/src/components/ + + ${COMPONENTS_DIR}/application_manager/test/include/ +) + +set (SOURCES + ./src/generic_module.cc + ./src/plugin_manager.cc + ./src/settings.cc + ./src/timer/timer_director.cc +) +set (LIBRARIES + ApplicationManager +) + +add_library("FunctionalModule" ${SOURCES}) +target_link_libraries("FunctionalModule" ${LIBRARIES} ) + +if(ENABLE_LOG) + target_link_libraries("FunctionalModule" log4cxx -L${LOG4CXX_LIBS_DIRECTORY} ${GCOV}) +endif() + +if(BUILD_TESTS) + add_subdirectory(test) +endif() diff --git a/src/components/functional_module/include/functional_module/function_ids.h b/src/components/functional_module/include/functional_module/function_ids.h new file mode 100644 index 0000000000..5b8218e37b --- /dev/null +++ b/src/components/functional_module/include/functional_module/function_ids.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_ + +namespace functional_modules { + +enum RCFunctionID { + // Remote SDL functions ids + BUTTON_PRESS = 41, + GET_INTERIOR_VEHICLE_DATA = 43, + SET_INTERIOR_VEHICLE_DATA = 44, + ON_INTERIOR_VEHICLE_DATA = 32783, + ON_REMOTE_CONTROL_SETTINGS, +}; + +namespace hmi_api { +const char get_interior_vehicle_data[] = "RC.GetInteriorVehicleData"; +const char set_interior_vehicle_data[] = "RC.SetInteriorVehicleData"; +const char on_interior_vehicle_data[] = "RC.OnInteriorVehicleData"; +const char button_press[] = "Buttons.ButtonPress"; +const char on_remote_control_settings[] = "RC.OnRemoteControlSettings"; + +const char get_user_consent[] = "RC.GetInteriorVehicleDataConsent"; +const char on_app_deactivated[] = "BasicCommunication.OnAppDeactivated"; +const char sdl_activate_app[] = "SDL.ActivateApp"; +} + +} // namespace functional_modules + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_ diff --git a/src/components/functional_module/include/functional_module/generic_module.h b/src/components/functional_module/include/functional_module/generic_module.h new file mode 100644 index 0000000000..9d003f4e28 --- /dev/null +++ b/src/components/functional_module/include/functional_module/generic_module.h @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_ + +#include +#include +#include "functional_module/module_observer.h" +#include "functional_module/function_ids.h" +#include "utils/shared_ptr.h" +#include "application_manager/service.h" + +namespace functional_modules { + +enum ProcessResult { + NONE = -1, + PROCESSED, + PARTIALLY_PROCESSED, + CANNOT_PROCESS, + FAILED +}; + +enum ServiceState { IDLE = 0, SUSPENDED, LOWVOLTAGE, HMI_ADAPTER_INITIALIZED }; + +typedef std::string HMIFunctionID; + +class GenericModule; +typedef utils::SharedPtr ModulePtr; + +struct PluginInfo { + std::string name; + int version; + std::deque rc_function_list; + std::deque hmi_function_list; +}; + +class GenericModule { + public: + typedef std::deque Observers; + + virtual ~GenericModule(); + ModuleID GetModuleID() const { + return kModuleId_; + } + virtual PluginInfo GetPluginInfo() const = 0; + + virtual void set_service(application_manager::ServicePtr service); + + /** + * @brief Returns pointer to SDL core service interface + * @return pointer to core service interface + */ + virtual application_manager::ServicePtr service(); + + virtual ProcessResult ProcessMessage(application_manager::MessagePtr msg) = 0; + virtual ProcessResult ProcessHMIMessage( + application_manager::MessagePtr msg) = 0; + virtual void OnServiceStateChanged(ServiceState state); + + /** + * @brief Adds pointer to observer of module to be notified about + * exceptional sutiations in module. + * Raw pointer is passed to avoid circular dependencies. + * Module is not responsible for freeing observer's memory. + */ + void AddObserver(ModuleObserver* const observer); + + /** + * @brief Removes pointer to observer of module when it's no loger + * wants to be notified about exceptional sutiations in module. + * Raw pointer is passed to avoid circular dependencies. + * Module is not responsible for freeing observer's memory. + */ + void RemoveObserver(ModuleObserver* const observer); + + /** + * @brief Remove extension created for specified application + * @param app_id application id + */ + virtual void RemoveAppExtension(uint32_t app_id) = 0; + + /** + * @brief Check registering app can be handled by plugin + * @param msg Registration message + * @param app Application basis already create by Core + */ + virtual bool IsAppForPlugin( + application_manager::ApplicationSharedPtr app) = 0; + + /** + * @brief Notify about change of HMILevel of plugin's app + * @param app App with new HMILevel + * @param old_level Old HMILevel of app + */ + virtual void OnAppHMILevelChanged( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType old_level) = 0; + + /** + * @brief Checks if plugin hasn't put restrictions on app's HMI Level + * @param app App with old HMILevel + * @param new_level HMILevel which is about to be set to app + */ + virtual bool CanAppChangeHMILevel( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType new_level) { + return true; + } + + /** + * Handles removing (disconnecting) device + * @param device removed + */ + virtual void OnDeviceRemoved( + const connection_handler::DeviceHandle& device) = 0; + + /** + * @brief OnUnregisterApplication handles application unregistering event + * @param app_id application id which was unregistered + */ + virtual void OnUnregisterApplication(const uint32_t app_id) = 0; + + protected: + explicit GenericModule(ModuleID module_id); + void NotifyObservers(ModuleObserver::Errors error); + + /** + * @brief Remove extension for all applications + */ + virtual void RemoveAppExtensions() = 0; + + private: + application_manager::ServicePtr service_; + const ModuleID kModuleId_; + + Observers observers_; + ServiceState state_; + + friend class DriverGenericModuleTest; + DISALLOW_COPY_AND_ASSIGN(GenericModule); +}; + +} // namespace functional_modules + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_ diff --git a/src/components/functional_module/include/functional_module/module_observer.h b/src/components/functional_module/include/functional_module/module_observer.h new file mode 100644 index 0000000000..1608ef5d42 --- /dev/null +++ b/src/components/functional_module/include/functional_module/module_observer.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_ + +namespace functional_modules { + +typedef int ModuleID; + +class ModuleObserver { + public: + enum Errors { NONE = -1, OUT_OF_MEMORY, FS_FAILURE }; + virtual ~ModuleObserver() {} + virtual void OnError(Errors error, ModuleID module_id) = 0; +}; +} // namespace functional_modules { + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_MODULE_OBSERVER_H_ diff --git a/src/components/functional_module/include/functional_module/plugin_manager.h b/src/components/functional_module/include/functional_module/plugin_manager.h new file mode 100644 index 0000000000..38368ab01a --- /dev/null +++ b/src/components/functional_module/include/functional_module/plugin_manager.h @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_ + +#include +#include +#include "functional_module/generic_module.h" +#include "application_manager/service.h" +#include "application_manager/message.h" + +namespace functional_modules { + +class PluginManager : public ModuleObserver { + public: + PluginManager(); + ~PluginManager(); + typedef std::map Modules; + int LoadPlugins(const std::string& plugin_path); + void UnloadPlugins(); + void ProcessMessage(application_manager::MessagePtr msg); + ProcessResult ProcessHMIMessage(application_manager::MessagePtr msg); + void SetServiceHandler(application_manager::ServicePtr service) { + service_ = service; + } + bool IsMessageForPlugin(application_manager::MessagePtr msg); + bool IsHMIMessageForPlugin(application_manager::MessagePtr msg); + void OnServiceStateChanged(ServiceState state); + void OnHMIResponse(application_manager::MessagePtr msg); + void OnError(ModuleObserver::Errors error, ModuleID module_id); + + /** + * @brief Remove extension created for specified application + * @param app_id application id + */ + void RemoveAppExtension(uint32_t app_id); + + /** + * @brief Check if app cooperates with one or more plugins, init it + * inside plugin accordingly if needed. + * @param app Application in question. + */ + bool IsAppForPlugins(application_manager::ApplicationSharedPtr app); + + /** + * Check if app cooperates with plugin + * @param app application + * @param module_id unique identifier of plugin + * @return true if application cooperates with this plugin + */ + bool IsAppForPlugin(application_manager::ApplicationSharedPtr app, + ModuleID module_id) const; + + /** + * @brief Notify plugins about change of HMILevel of app + * if app is related to plugin + * @param app App with new HMILevel + * @param old_level Old HMILevel of app + */ + void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType old_level); + + /** + * @brief Checks if plugin hasn't put restrictions on app's HMI Level + * @param app App with old HMILevel + * @param new_level HMILevel which is about to be set to app + * @return false if any of the plugins returns false. + */ + bool CanAppChangeHMILevel(application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType new_level); + + /** + * Handles removing (disconnecting) device + * @param device removed + */ + void OnDeviceRemoved(const connection_handler::DeviceHandle& device); + + /** + * @brief OnUnregisterApplication handles application unregistering event + * @param app_id application id which was unregistered + */ + void OnUnregisterApplication(const uint32_t app_id); + + Modules& plugins(); + + private: + Modules plugins_; + std::map dlls_; + std::map mobile_subscribers_; + std::map hmi_subscribers_; + application_manager::ServicePtr service_; + + DISALLOW_COPY_AND_ASSIGN(PluginManager); +}; + +} // namespace functional_modules + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_ diff --git a/src/components/functional_module/include/functional_module/settings.h b/src/components/functional_module/include/functional_module/settings.h new file mode 100644 index 0000000000..cf78c24e8b --- /dev/null +++ b/src/components/functional_module/include/functional_module/settings.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_SETTINGS_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_SETTINGS_H_ + +#include +#include +#include "json/json.h" +#include "utils/macro.h" + +namespace functional_modules { + +/* + * @brief Settings class reads configuration for app from + * default location - smartDeviceLink.ini - or set location + * and provides access to them basing on template methods. + */ +class Settings { + public: + /* + * @brief Constrctor + */ + Settings(); + + /* + * @brief Destructor + */ + virtual ~Settings(); + + /* + * @brief Template method reads value from config file + * stored under param_name in section_name paragraph + * @param section_name Section name i.e [HMI] + * @param param_name Parameter name i.e. ServerAddress + * @returns True if value was read from config file, false otherwise + */ + template + bool ReadParameter(const std::string& section_name, + const std::string& param_name, + T* param_value) const; + + /* + * @brief Template method reads value from config file + * stored under param_name in [MAIN] paragraph + * @param param_name Parameter name i.e. ServerAddress + * @returns True if value was read from config file, false otherwise + */ + template + bool ReadParameter(const std::string& param_name, T* param_value) const; + + /* + * @brief Changes path to configuration file + * @param new_path Path to config file + */ + void ChangeConfigFile(const std::string& new_path); + + protected: + virtual std::string ReadParameter(const std::string& section_name, + const std::string& param_name) const; + + private: + const std::string kConfigFile_; + std::string config_file_; +}; + +template +bool Settings::ReadParameter(const std::string& section_name, + const std::string& param_name, + T* param_value) const { + DCHECK(param_value); + bool result = false; + if (!param_value) { + return result; + } + + std::string param_string = ReadParameter(section_name, param_name); + + if (!param_string.empty()) { + std::stringstream stream(param_string); + stream >> (*param_value); + result = true; + } + + return result; +} + +template +bool Settings::ReadParameter(const std::string& param_name, + T* param_value) const { + return ReadParameter("MAIN", param_name, param_value); +} + +} // namespace functional_modules + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_SETTINGS_H_ diff --git a/src/components/functional_module/include/functional_module/timer/module_timer.h b/src/components/functional_module/include/functional_module/timer/module_timer.h new file mode 100644 index 0000000000..d7fc0ba043 --- /dev/null +++ b/src/components/functional_module/include/functional_module/timer/module_timer.h @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_ + +#include +#include +#include +#include +#include "utils/lock.h" + +namespace functional_modules { + +typedef unsigned int TimeUnit; // seconds + +class Trackable { + public: + Trackable() : start_time_(0) {} + virtual ~Trackable() {} + virtual TimeUnit custom_interval() const { + return 0; + } + virtual TimeUnit start_time() const { + return start_time_; + } + virtual void set_start_time(TimeUnit start_time) { + start_time_ = start_time; + } + + private: + TimeUnit start_time_; +}; + +template +class TimerObserver { + public: + virtual ~TimerObserver() {} + virtual void OnTimeoutTriggered(const Trackable& expired) = 0; +}; + +template +class ModuleTimer { + public: + ModuleTimer(); + ~ModuleTimer(); + void set_period(TimeUnit period) { + period_ = period; + } + TimeUnit period() const { + return period_; + } + void AddObserver(TimerObserver* observer); + void RemoveObserver(TimerObserver* observer); + + void CheckTimeout(); + /** + * @brief Gets time in seconds when the nearest request timeout will be + * triggered + * @return time in seconds when the nearest request timeout will be triggered + */ + TimeUnit GetSecondsToNearestTimeout(); + + /* + * @brief Adds object to be tracked by timer. + If same object is already added replaces it with new one + correspondingly updating start time of tracking. + */ + void AddTrackable(const Trackable& object); + void RemoveTrackable(const Trackable& object); + + protected: + void Notify(const Trackable& object); + void OnTimeout(const Trackable& object); + TimeUnit CurrentTime() const; + typename std::list trackables_; + volatile TimeUnit period_; + + private: + std::deque*> observers_; + mutable sync_primitives::Lock trackables_lock_; + friend class ModuleTimerTest; +}; + +template +ModuleTimer::ModuleTimer() + : period_(10) {} + +template +ModuleTimer::~ModuleTimer() { + observers_.clear(); + sync_primitives::AutoLock auto_lock(trackables_lock_); + trackables_.clear(); +} + +template +void ModuleTimer::AddObserver(TimerObserver* observer) { + DCHECK(observer); + if (!observer) { + return; + } + observers_.push_back(observer); +} + +template +void ModuleTimer::RemoveObserver( + TimerObserver* observer) { + DCHECK(observer); + if (!observer) { + return; + } + for (typename std::deque*>::iterator it = + observers_.begin(); + observers_.end() != it; + ++it) { + if (*it == observer) { + observers_.erase(it); + return; + } + } +} + +template +void ModuleTimer::CheckTimeout() { + sync_primitives::AutoLock trackables_lock(trackables_lock_); + for (typename std::list::iterator it = trackables_.begin(); + trackables_.end() != it; + ++it) { + TimeUnit period = it->custom_interval(); + if (!period) { + period = period_; + } + if (CurrentTime() - it->start_time() >= period) { + OnTimeout(*it); + it = trackables_.erase(it); + } + } +} + +template +TimeUnit ModuleTimer::GetSecondsToNearestTimeout() { + sync_primitives::AutoLock trackables_lock(trackables_lock_); + TimeUnit result = period_; + for (typename std::list::iterator it = trackables_.begin(); + trackables_.end() != it; + ++it) { + TimeUnit period = it->custom_interval(); + if (!period) { + period = period_; + } + const TimeUnit current_secs_to_timeout = + period - (CurrentTime() - it->start_time()); + if (result > current_secs_to_timeout) { + result = current_secs_to_timeout; + } + } + return result; +} + +template +void ModuleTimer::AddTrackable(const Trackable& object) { + sync_primitives::AutoLock trackables_lock(trackables_lock_); + trackables_.remove(object); + trackables_.push_back(object); + trackables_.back().set_start_time(CurrentTime()); +} + +template +void ModuleTimer::RemoveTrackable(const Trackable& object) { + sync_primitives::AutoLock trackables_lock(trackables_lock_); + trackables_.remove(object); +} + +template +void ModuleTimer::Notify(const Trackable& object) { + for (typename std::deque*>::const_iterator it = + observers_.begin(); + observers_.end() != it; + ++it) { + (*it)->OnTimeoutTriggered(object); + } +} + +template +void ModuleTimer::OnTimeout(const Trackable& object) { + Notify(object); +} + +template +TimeUnit ModuleTimer::CurrentTime() const { + // TODO(PV): move outside to platform-dependant parts + struct timespec current_time; + if (0 == clock_gettime(CLOCK_MONOTONIC, ¤t_time)) { + return current_time.tv_sec; + } else { + return 0; + } +} + +} // namespace functional_modules + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_ diff --git a/src/components/functional_module/include/functional_module/timer/timer_director.h b/src/components/functional_module/include/functional_module/timer/timer_director.h new file mode 100644 index 0000000000..65f9f4a6d5 --- /dev/null +++ b/src/components/functional_module/include/functional_module/timer/timer_director.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_ + +#include +#include "utils/threads/thread.h" +#include "utils/conditional_variable.h" +#include "functional_module/timer/module_timer.h" + +namespace functional_modules { + +template +class TimerThreadDelegate : public threads::ThreadDelegate { + public: + explicit TimerThreadDelegate(ModuleTimer& timer); + void threadMain(); + void exitThreadMain(); + + /** + * @brief Reset awaiting timer by notifying cond var + */ + void ResetTimer(); + + private: + ModuleTimer& timer_; + volatile bool keep_running_; + mutable sync_primitives::Lock keep_running_lock_; + mutable sync_primitives::ConditionalVariable keep_running_cond_; + friend class TimerThreadDelegateTest; +}; + +class TimerDirector { + public: + TimerDirector(); + ~TimerDirector(); + + /** + * @brief Register timer for execution in separate thread. + Registers only one timer of a type. Attempt to register timer + of already existing type will fail. + */ + template + void RegisterTimer(ModuleTimer& timer); + template + void UnregisterTimer(const ModuleTimer& timer); + void UnregisterAllTimers(); + /** + * @brief Reset awaiting timeout for specified module timer + * @param timer timer to reset awaiting timeout + */ + template + void ResetTimer(ModuleTimer& timer); + + private: + DISALLOW_COPY_AND_ASSIGN(TimerDirector); + std::map timer_threads_; +}; + +} // namespace functional_modules + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_ diff --git a/src/components/functional_module/src/generic_module.cc b/src/components/functional_module/src/generic_module.cc new file mode 100644 index 0000000000..eec4f7b6d3 --- /dev/null +++ b/src/components/functional_module/src/generic_module.cc @@ -0,0 +1,63 @@ +#include "functional_module/generic_module.h" +namespace functional_modules { + +typedef std::deque::iterator ModuleObserverIterator; + +GenericModule::GenericModule(ModuleID module_id) + : kModuleId_(module_id), state_(ServiceState::IDLE) {} + +GenericModule::~GenericModule() { + observers_.clear(); +} + +void GenericModule::AddObserver(ModuleObserver* const observer) { + DCHECK(observer); + if (!observer) { + return; + } + observers_.push_back(observer); +} + +void GenericModule::RemoveObserver(ModuleObserver* const observer) { + DCHECK(observer); + if (!observer) { + return; + } + for (ModuleObserverIterator it = observers_.begin(); observers_.end() != it; + ++it) { + if (*it == observer) { + observers_.erase(it); + return; + } + } +} + +void GenericModule::NotifyObservers(ModuleObserver::Errors error) { + for (ModuleObserverIterator it = observers_.begin(); observers_.end() != it; + ++it) { + (*it)->OnError(error, kModuleId_); + } +} + +void GenericModule::set_service(application_manager::ServicePtr service) { + service_ = service; +} + +void GenericModule::OnServiceStateChanged(ServiceState state) { + state_ = state; + + if (HMI_ADAPTER_INITIALIZED == state_) { + // We must subscribe to necessary HMI notifications + service_->SubscribeToHMINotification(hmi_api::on_interior_vehicle_data); + service_->SubscribeToHMINotification(hmi_api::on_remote_control_settings); + // Disabled + // service_->SubscribeToHMINotification(hmi_api::on_reverse_apps_allowing); + // service_->SubscribeToHMINotification(hmi_api::on_device_rank_changed); + } +} + +application_manager::ServicePtr GenericModule::service() { + return service_; +} + +} // namespace functional_modules diff --git a/src/components/functional_module/src/plugin_manager.cc b/src/components/functional_module/src/plugin_manager.cc new file mode 100644 index 0000000000..ab3b0bda05 --- /dev/null +++ b/src/components/functional_module/src/plugin_manager.cc @@ -0,0 +1,405 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include +#include +#include "functional_module/plugin_manager.h" +#include "functional_module/function_ids.h" +#include "utils/file_system.h" +#include "utils/logger.h" +#include "json/json.h" + +namespace functional_modules { + +CREATE_LOGGERPTR_GLOBAL(logger_, "PluginManager") + +typedef std::map::iterator PluginsIterator; +typedef std::map::iterator PluginFunctionsIterator; +typedef std::map::iterator PluginHMIFunctionsIterator; + +PluginManager::PluginManager() : service_() { + LOG4CXX_DEBUG(logger_, "Creating plugin mgr"); +} + +PluginManager::~PluginManager() { + // TODO(PV): unsubscribe plugins from functions + mobile_subscribers_.clear(); + hmi_subscribers_.clear(); + UnloadPlugins(); +} + +int PluginManager::LoadPlugins(const std::string& plugin_path) { + LOG4CXX_INFO(logger_, "Loading plugins from " << plugin_path); + std::vector plugin_files = file_system::ListFiles(plugin_path); + for (size_t i = 0; i < plugin_files.size(); ++i) { + size_t pos = plugin_files[i].find_last_of("."); + if (std::string::npos != pos) { + if (plugin_files[i].substr(pos + 1).compare("so") != 0) { + continue; + } + } else { + continue; + } + std::string full_name = plugin_path + '/' + plugin_files[i]; + void* generic_plugin_dll = dlopen(full_name.c_str(), RTLD_LAZY); + if (NULL == generic_plugin_dll) { + LOG4CXX_ERROR(logger_, + "Failed to open dll " << plugin_files[i] << "\n" + << dlerror()); + continue; + } + typedef GenericModule* (*Create)(); + Create create_manager = + reinterpret_cast(dlsym(generic_plugin_dll, "Create")); + char* error_string = dlerror(); + if (NULL != error_string) { + LOG4CXX_ERROR(logger_, + "Failed to export dll's " << plugin_files[i] << " symbols\n" + << error_string); + dlclose(generic_plugin_dll); + continue; + } + ModulePtr module = create_manager(); + if (!module) { + LOG4CXX_ERROR(logger_, + "Failed to create plugin main class " << plugin_files[i]); + dlclose(generic_plugin_dll); + continue; + } else { + LOG4CXX_DEBUG(logger_, + "Opened and working plugin from " << plugin_files[i] + << " with id " + << module->GetModuleID()); + dlls_.insert(std::pair(module->GetModuleID(), + generic_plugin_dll)); + plugins_.insert( + std::pair(module->GetModuleID(), module)); + std::deque subscribers = + module->GetPluginInfo().rc_function_list; + for (size_t i = 0; i < subscribers.size(); ++i) { + mobile_subscribers_.insert( + std::pair(subscribers[i], module)); + } + + std::deque hmi_subscribers = + module->GetPluginInfo().hmi_function_list; + for (size_t i = 0; i < hmi_subscribers.size(); ++i) { + hmi_subscribers_.insert( + std::pair(hmi_subscribers[i], module)); + } + module->set_service(service_); + module->AddObserver(this); + } + } + return plugins_.size(); +} + +void PluginManager::UnloadPlugins() { + for (Modules::iterator it = plugins_.begin(); plugins_.end() != it; ++it) { + it->second->RemoveObserver(this); + } + plugins_.clear(); + + for (std::map::iterator it = dlls_.begin(); + dlls_.end() != it; + ++it) { + dlclose(it->second); + } + dlls_.clear(); +} + +// TODO(VS): Optimize similar code in ProcessMessage, IsMessageForPlugin, +// ProcessHMIMessage, IsHMIMessageForPlugin methods +// (also we have similar code in can module) +void PluginManager::ProcessMessage(application_manager::MessagePtr msg) { + DCHECK(msg); + if (!msg) { + LOG4CXX_ERROR(logger_, "Null pointer message was received."); + return; + } + if (application_manager::ProtocolVersion::kUnknownProtocol != + msg->protocol_version() && + application_manager::ProtocolVersion::kHMI != msg->protocol_version()) { + PluginFunctionsIterator subscribed_plugin_itr = + mobile_subscribers_.find(static_cast(msg->function_id())); + if (mobile_subscribers_.end() != subscribed_plugin_itr) { + if (subscribed_plugin_itr->second->ProcessMessage(msg) != + ProcessResult::PROCESSED) { + LOG4CXX_ERROR(logger_, "Failed process message!"); + } + } + } +} + +const std::string ExtractMethodName(const Json::Value& value) { + const char* kMethod = "method"; + const char* kResult = "result"; + const char* kError = "error"; + const char* kData = "data"; + + if (value.isMember(kMethod)) { + return value.get(kMethod, "").asCString(); + // Response from HMI + } + if (value.isMember(kResult)) { + const Json::Value& result = value.get(kResult, Json::Value()); + return result.get(kMethod, "").asCString(); + } + if (value.isMember(kError)) { + const Json::Value& error = value.get(kError, Json::Value()); + const Json::Value& data = error.get(kData, Json::Value()); + return data.get(kMethod, "").asCString(); + } + LOG4CXX_WARN(logger_, + "Message with HMI protocol version can not be handled by " + "plugin manager, because required 'method' field was not " + "found, or was containing an invalid string."); + return std::string(); +} + +ProcessResult PluginManager::ProcessHMIMessage( + application_manager::MessagePtr msg) { + DCHECK(msg); + if (!msg) { + LOG4CXX_ERROR(logger_, "Null pointer message was received."); + return ProcessResult::CANNOT_PROCESS; + } + + Json::Value value; + Json::Reader reader; + reader.parse(msg->json_message(), value); + + if (application_manager::ProtocolVersion::kHMI == msg->protocol_version()) { + const std::string& msg_method = ExtractMethodName(value); + if (msg_method.empty()) { + return ProcessResult::CANNOT_PROCESS; + } + PluginHMIFunctionsIterator subscribed_plugin_itr = + hmi_subscribers_.find(msg_method); + if (hmi_subscribers_.end() != subscribed_plugin_itr) { + return subscribed_plugin_itr->second->ProcessHMIMessage(msg); + } + } + + return ProcessResult::CANNOT_PROCESS; +} + +bool PluginManager::IsMessageForPlugin(application_manager::MessagePtr msg) { + DCHECK(msg); + if (!msg) { + LOG4CXX_ERROR(logger_, "Null pointer message was received."); + return false; + } + if (application_manager::ProtocolVersion::kUnknownProtocol != + msg->protocol_version() && + application_manager::ProtocolVersion::kHMI != msg->protocol_version()) { + RCFunctionID id = static_cast(msg->function_id()); + return (mobile_subscribers_.find(id) != mobile_subscribers_.end()); + } else { + return false; + } +} + +bool PluginManager::IsHMIMessageForPlugin(application_manager::MessagePtr msg) { + DCHECK(msg); + if (!msg) { + LOG4CXX_ERROR(logger_, "Null pointer message was received."); + return false; + } + + Json::Value value; + Json::Reader reader; + reader.parse(msg->json_message(), value); + if (application_manager::ProtocolVersion::kHMI == msg->protocol_version()) { + std::string msg_method; + // Request or notification from HMI + if (value.isMember("method") && value["method"].isString()) { + msg_method = value["method"].asCString(); + // Response from HMI + } else if (value.isMember("result") && value["result"].isMember("method") && + value["result"]["method"].isString()) { + msg_method = value["result"]["method"].asCString(); + // Error response from HMI + } else if (value.isMember("error") && value["error"].isMember("data") && + value["error"]["data"].isMember("method") && + value["error"]["data"]["method"].isString()) { + msg_method = value["error"]["data"]["method"].asCString(); + } else { + LOG4CXX_WARN(logger_, + "Message with HMI protocol version can not be handled by " + "plugin manager, because required 'method' field was not " + "found, or was containing an invalid string."); + return false; + } + + return (hmi_subscribers_.find(msg_method) != hmi_subscribers_.end()); + } + + return false; +} + +void PluginManager::OnServiceStateChanged(ServiceState state) { + for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) { + it->second->OnServiceStateChanged(state); + } +} + +void PluginManager::OnHMIResponse(application_manager::MessagePtr msg) { + // TODO(PV) +} + +void PluginManager::OnError(ModuleObserver::Errors error, ModuleID module_id) { + std::string error_string; + switch (error) { + case ModuleObserver::Errors::OUT_OF_MEMORY: + error_string = "Module run out of memory."; + break; + case ModuleObserver::Errors::FS_FAILURE: + error_string = "Plugin failed to run file system operation."; + break; + default: + break; + } + LOG4CXX_ERROR(logger_, + "Error " << error_string << " was received from module " + << module_id); + // TODO(PV) +} + +void PluginManager::RemoveAppExtension(uint32_t app_id) { + for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) { + it->second->RemoveAppExtension(app_id); + } +} + +bool PluginManager::IsAppForPlugins( + application_manager::ApplicationSharedPtr app) { + DCHECK(app); + if (!app) { + return false; + } + + bool res = false; + for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) { + res = res || it->second->IsAppForPlugin(app); + } + return res; +} + +bool PluginManager::IsAppForPlugin( + application_manager::ApplicationSharedPtr app, ModuleID module_id) const { + Modules::const_iterator i = plugins_.find(module_id); + return i != plugins_.end() ? i->second->IsAppForPlugin(app) : false; +} + +void PluginManager::OnAppHMILevelChanged( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType old_level) { + DCHECK(app); + if (!app) { + return; + } + for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) { + if (it->second->IsAppForPlugin(app)) { + LOG4CXX_DEBUG(logger_, + "Application " << app->name().AsMBString() << " of plugin " + << it->second->GetModuleID() + << " has changed level from " << old_level + << " to " << app->hmi_level()); + it->second->OnAppHMILevelChanged(app, old_level); + } + } +} + +bool PluginManager::CanAppChangeHMILevel( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType new_level) { + DCHECK(app); + if (!app) { + return false; + } + bool result = true; + for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) { + if (it->second->IsAppForPlugin(app)) { + result = result && it->second->CanAppChangeHMILevel(app, new_level); + LOG4CXX_DEBUG(logger_, + "Application " << app->name().AsMBString() << " of plugin " + << it->second->GetModuleID() << " is " + << (result ? "allowed" : "not allowed") + << " to change level to " << new_level); + } + } + return result; +} + +typedef std::map::value_type PluginsValueType; +struct HandleDeviceRemoved { + private: + const connection_handler::DeviceHandle& device_; + + public: + explicit HandleDeviceRemoved(const connection_handler::DeviceHandle& device) + : device_(device) {} + void operator()(PluginsValueType& x) { + x.second->OnDeviceRemoved(device_); + } +}; + +void PluginManager::OnDeviceRemoved( + const connection_handler::DeviceHandle& device) { + LOG4CXX_AUTO_TRACE(logger_); + std::for_each(plugins_.begin(), plugins_.end(), HandleDeviceRemoved(device)); +} + +struct HandleApplicationUnregistered { + private: + const uint32_t app_id_; + + public: + explicit HandleApplicationUnregistered(const uint32_t app_id) + : app_id_(app_id) {} + void operator()(PluginsValueType& x) { + x.second->OnUnregisterApplication(app_id_); + } +}; + +void PluginManager::OnUnregisterApplication(const uint32_t app_id) { + LOG4CXX_AUTO_TRACE(logger_); + std::for_each( + plugins_.begin(), plugins_.end(), HandleApplicationUnregistered(app_id)); +} + +PluginManager::Modules& PluginManager::plugins() { + return plugins_; +} + +} // namespace functional_modules diff --git a/src/components/functional_module/src/settings.cc b/src/components/functional_module/src/settings.cc new file mode 100644 index 0000000000..29a96ba63b --- /dev/null +++ b/src/components/functional_module/src/settings.cc @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "functional_module/settings.h" +#include "config_profile/ini_file.h" + +namespace functional_modules { + +Settings::Settings() : kConfigFile_("smartDeviceLink.ini") { + config_file_ = kConfigFile_; +} + +Settings::~Settings() { + config_file_ = ""; +} + +void Settings::ChangeConfigFile(const std::string& new_path) { + config_file_ = new_path; +} + +std::string Settings::ReadParameter(const std::string& section_name, + const std::string& param_name) const { + std::string result; + char param_string[INI_LINE_LEN + 1]; + param_string[0] = '\0'; + if (0 != profile::ini_read_value(config_file_.c_str(), + section_name.c_str(), + param_name.c_str(), + param_string)) { + result = param_string; + } + return result; +} + +} // namespace functional_modules diff --git a/src/components/functional_module/src/timer/timer_director.cc b/src/components/functional_module/src/timer/timer_director.cc new file mode 100644 index 0000000000..51d7408fcd --- /dev/null +++ b/src/components/functional_module/src/timer/timer_director.cc @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#include +#include "functional_module/timer/timer_director.h" +#include "remote_control/rc_module_timer.h" +#include "utils/logger.h" + +namespace functional_modules { + +template +TimerThreadDelegate::TimerThreadDelegate(ModuleTimer& timer) + : timer_(timer), keep_running_(false) {} + +template +void TimerThreadDelegate::threadMain() { + if (keep_running_) { + this->exitThreadMain(); + } + { + sync_primitives::AutoLock run_lock(keep_running_lock_); + keep_running_ = true; + } + sync_primitives::AutoLock run_lock(keep_running_lock_); + while (keep_running_) { + const TimeUnit msecs_to_wait = timer_.GetSecondsToNearestTimeout() * 1000; + sync_primitives::ConditionalVariable::WaitStatus wait_status = + keep_running_cond_.WaitFor(run_lock, msecs_to_wait); + if (sync_primitives::ConditionalVariable::kTimeout == wait_status && + keep_running_) { + timer_.CheckTimeout(); + } + } +} + +template +void TimerThreadDelegate::exitThreadMain() { + if (keep_running_) { + sync_primitives::AutoLock run_lock(keep_running_lock_); + keep_running_ = false; + keep_running_cond_.NotifyOne(); + } +} + +template +void TimerThreadDelegate::ResetTimer() { + if (keep_running_) { + sync_primitives::AutoLock run_lock(keep_running_lock_); + keep_running_cond_.NotifyOne(); + } +} + +TimerDirector::TimerDirector() {} + +TimerDirector::~TimerDirector() { + UnregisterAllTimers(); +} + +template +void TimerDirector::RegisterTimer(ModuleTimer& timer) { + std::string type_name = typeid(timer).name(); + std::map::iterator it = + timer_threads_.find(type_name); + if (timer_threads_.end() != it) { + // Attempt to register timer of already existing type fail. + return; + } + TimerThreadDelegate* delegate = new TimerThreadDelegate(timer); + threads::Thread* thread = threads::CreateThread(type_name.c_str(), delegate); + + const size_t kStackSize = 16384; + if (thread->start(threads::ThreadOptions(kStackSize))) { + timer_threads_.insert(std::make_pair(type_name, thread)); + } else { + // Failed to start timer thread for + } +} + +template void TimerDirector::RegisterTimer( + ModuleTimer& timer); + +template +void TimerDirector::UnregisterTimer(const ModuleTimer& timer) { + std::string type_name = typeid(timer).name(); + std::map::iterator it = + timer_threads_.find(type_name); + if (timer_threads_.end() == it) { + /// Failed to unregister timer that was not registered + return; + } + threads::ThreadDelegate* delegate = it->second->delegate(); + DeleteThread(it->second); + delete delegate; + timer_threads_.erase(it); +} + +template void TimerDirector::UnregisterTimer( + const ModuleTimer& timer); + +template +void TimerDirector::ResetTimer(ModuleTimer& timer) { + const std::string type_name = typeid(timer).name(); + std::map::iterator it = + timer_threads_.find(type_name); + if (timer_threads_.end() == it) { + return; + } + TimerThreadDelegate* delegate = + static_cast*>(it->second->delegate()); + delegate->ResetTimer(); +} + +template void TimerDirector::ResetTimer( + ModuleTimer& timer); + +void TimerDirector::UnregisterAllTimers() { + for (std::map::iterator it = + timer_threads_.begin(); + timer_threads_.end() != it; + ++it) { + threads::ThreadDelegate* delegate = it->second->delegate(); + DeleteThread(it->second); + delete delegate; + } + timer_threads_.clear(); +} + +} // namespace functional_modules diff --git a/src/components/functional_module/test/CMakeLists.txt b/src/components/functional_module/test/CMakeLists.txt new file mode 100644 index 0000000000..e1cb673252 --- /dev/null +++ b/src/components/functional_module/test/CMakeLists.txt @@ -0,0 +1,56 @@ +include_directories ( + ${LOG4CXX_INCLUDE_DIRECTORY} + ${GMOCK_INCLUDE_DIRECTORY} + ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/ + ${CMAKE_SOURCE_DIR}/src/components/include/ + ${CMAKE_SOURCE_DIR}/src/components/application_manager/include + ${CMAKE_SOURCE_DIR}/src/components/connection_handler/include + ${CMAKE_SOURCE_DIR}/src/components/utils/include + ${CMAKE_SOURCE_DIR}/src/components/policy/include + ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include + ${JSONCPP_INCLUDE_DIRECTORY} + ${CMAKE_BINARY_DIR}/src/components/ + include + plugins +) + +set (LIBRARIES + gtest + gmock + gmock_main + FunctionalModule + dl + ApplicationManager + jsoncpp + Utils + ConfigProfile + gcov +) + +set(SOURCES + ./src/generic_module_test.cc + ./src/plugin_manager_test.cc + ./src/module_timer_test.cc + ./src/settings_test.cc +) + +# use, i.e. don't skip the full RPATH for the build tree +SET(CMAKE_SKIP_BUILD_RPATH FALSE) + +# when building, don't use the install RPATH already +# (but later on when installing) +SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + +SET(RPATH_DIRECTORIES + /usr/local/lib + /usr/local + ${CMAKE_BINARY_DIR}/src/components/utils +) + +SET(CMAKE_INSTALL_RPATH "${RPATH_DIRECTORIES}") + +configure_file("test.ini" "test.ini" COPYONLY) + +add_subdirectory(plugins) + +create_test("function_module_test" "${SOURCES}" "${LIBRARIES}") diff --git a/src/components/functional_module/test/include/driver_generic_module_test.h b/src/components/functional_module/test/include/driver_generic_module_test.h new file mode 100644 index 0000000000..f41a274055 --- /dev/null +++ b/src/components/functional_module/test/include/driver_generic_module_test.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_ + +#include "functional_module/generic_module.h" + +namespace functional_modules { + +class DriverGenericModuleTest : public GenericModule { + public: + explicit DriverGenericModuleTest(ModuleID module_id) + : GenericModule(module_id) {} + virtual ~DriverGenericModuleTest() {} + virtual PluginInfo GetPluginInfo() const { + PluginInfo info; + info.name = "DriverGenericModuleTest"; + info.version = 1; + return info; + } + virtual ProcessResult ProcessMessage(application_manager::MessagePtr msg) { + NotifyObservers(ModuleObserver::FS_FAILURE); + return ProcessResult::FAILED; + } + virtual ProcessResult ProcessHMIMessage(application_manager::MessagePtr msg) { + return ProcessResult::PROCESSED; + } + virtual void RemoveAppExtension(uint32_t app_id) {} + virtual void RemoveAppExtensions() {} + bool IsAppForPlugin(application_manager::ApplicationSharedPtr app) { + return true; + } + + void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr, + mobile_apis::HMILevel::eType) {} + + const Observers& observers() { + return observers_; + } + + void OnDeviceRemoved(const connection_handler::DeviceHandle&) {} + + void OnUnregisterApplication(const uint32_t app_id) {} +}; + +} // namespace functional_modules + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_DRIVER_GENERIC_MODULE_TEST_H_ diff --git a/src/components/functional_module/test/include/mock_application.h b/src/components/functional_module/test/include/mock_application.h new file mode 100644 index 0000000000..e73851094e --- /dev/null +++ b/src/components/functional_module/test/include/mock_application.h @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_ + +#include "gmock/gmock.h" +#include "application_manager/application.h" +#include "application_manager/usage_statistics.h" +#include "smart_objects/smart_object.h" + +namespace application_manager { + +class MockApplication : public Application { + public: + MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(curHash, const std::string&()); + MOCK_METHOD0(UpdateHash, void()); + MOCK_METHOD0(CloseActiveMessage, void()); + MOCK_CONST_METHOD0(IsFullscreen, bool()); + MOCK_METHOD0(MakeFullscreen, bool()); + MOCK_CONST_METHOD0(IsAudible, bool()); + MOCK_METHOD0(MakeNotAudible, void()); + MOCK_CONST_METHOD0(allowed_support_navigation, bool()); + MOCK_METHOD1(set_allowed_support_navigation, void(bool allow)); + MOCK_CONST_METHOD0(hmi_supports_navi_streaming, bool()); + MOCK_METHOD1(set_hmi_supports_navi_streaming, void(const bool& supports)); + MOCK_CONST_METHOD0(app_allowed, bool()); + MOCK_CONST_METHOD0(has_been_activated, bool()); + MOCK_CONST_METHOD0(version, const Version&()); + MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id)); + MOCK_CONST_METHOD0(hmi_app_id, uint32_t()); + MOCK_CONST_METHOD0(app_id, uint32_t()); + MOCK_CONST_METHOD0(name, const std::string&()); + MOCK_CONST_METHOD0(folder_name, const std::string()); + MOCK_CONST_METHOD0(is_media_application, bool()); + MOCK_CONST_METHOD0(hmi_level, const mobile_api::HMILevel::eType&()); + MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(system_context, const mobile_api::SystemContext::eType&()); + MOCK_CONST_METHOD0(audio_streaming_state, + const mobile_api::AudioStreamingState::eType&()); + MOCK_CONST_METHOD0(app_icon_path, const std::string&()); + MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle()); + MOCK_METHOD1(set_tts_speak_state, void(bool state_tts_speak)); + MOCK_METHOD0(tts_speak_state, bool()); + MOCK_METHOD1(set_tts_properties_in_none, void(bool active)); + MOCK_METHOD0(tts_properties_in_none, bool()); + MOCK_METHOD1(set_tts_properties_in_full, void(bool active)); + MOCK_METHOD0(tts_properties_in_full, bool()); + MOCK_METHOD1(set_version, void(const Version& version)); + MOCK_METHOD1(set_name, void(const std::string& name)); + MOCK_METHOD1(set_is_media_application, void(bool is_media)); + MOCK_METHOD1(set_hmi_level, + void(const mobile_api::HMILevel::eType& hmi_level)); + MOCK_METHOD0(increment_put_file_in_none_count, void()); + MOCK_METHOD0(increment_delete_file_in_none_count, void()); + MOCK_METHOD0(increment_list_files_in_none_count, void()); + MOCK_METHOD1(set_system_context, + void(const mobile_api::SystemContext::eType& system_context)); + MOCK_METHOD1(set_audio_streaming_state, + void(const mobile_api::AudioStreamingState::eType& state)); + MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name)); + MOCK_METHOD1(set_app_allowed, void(const bool& allowed)); + MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device)); + MOCK_CONST_METHOD0(get_grammar_id, uint32_t()); + MOCK_METHOD1(set_grammar_id, void(uint32_t value)); + MOCK_METHOD1(set_protocol_version, + void(const ProtocolVersion& protocol_version)); + MOCK_CONST_METHOD0(protocol_version, ProtocolVersion()); + MOCK_METHOD1(AddFile, bool(AppFile& file)); + MOCK_CONST_METHOD0(getAppFiles, const AppFilesMap&()); + MOCK_METHOD1(UpdateFile, bool(AppFile& file)); + MOCK_METHOD1(DeleteFile, bool(const std::string& file_name)); + MOCK_METHOD1(GetFile, const AppFile*(const std::string& file_name)); + MOCK_METHOD1(SubscribeToButton, + bool(mobile_apis::ButtonName::eType btn_name)); + MOCK_METHOD1(IsSubscribedToButton, + bool(mobile_apis::ButtonName::eType btn_name)); + MOCK_METHOD1(UnsubscribeFromButton, + bool(mobile_apis::ButtonName::eType btn_name)); + MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type_)); + MOCK_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type_)); + MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type_)); + MOCK_METHOD2(IsCommandLimitsExceeded, + bool(mobile_apis::FunctionID::eType cmd_id, + TLimitSource source)); + MOCK_METHOD0(usage_report, UsageStatistics&()); + MOCK_METHOD2(SubscribeToSoftButtons, + void(int32_t cmd_id, const SoftButtonID& softbuttons_id)); + MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id)); + MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id)); + MOCK_METHOD1(QueryInterface, AppExtensionPtr(AppExtensionUID uid)); + MOCK_METHOD1(AddExtension, bool(AppExtensionPtr extention)); + MOCK_METHOD1(RemoveExtension, bool(AppExtensionUID uid)); + MOCK_METHOD0(RemoveExtensions, void()); + MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_help_title, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_help, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(tbt_state, const mobile_api::TBTState::eType&()); + MOCK_CONST_METHOD0(show_command, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(SubscribedButtons, + const std::set&()); + MOCK_CONST_METHOD0(SubscribesIVI, const std::set&()); + MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*()); + MOCK_METHOD1(set_help_prompt, + void(const smart_objects::SmartObject& help_prompt)); + MOCK_METHOD1(set_timeout_prompt, + void(const smart_objects::SmartObject& timeout_prompt)); + MOCK_METHOD1(set_vr_help_title, + void(const smart_objects::SmartObject& vr_help_title)); + MOCK_METHOD0(reset_vr_help_title, void()); + MOCK_METHOD1(set_vr_help, void(const smart_objects::SmartObject& vr_help)); + MOCK_METHOD0(reset_vr_help, void()); + MOCK_METHOD1(set_tbt_state, + void(const mobile_api::TBTState::eType& tbt_state)); + MOCK_METHOD1(set_show_command, + void(const smart_objects::SmartObject& show_command)); + MOCK_METHOD1(set_tbt_show_command, + void(const smart_objects::SmartObject& tbt_show)); + MOCK_METHOD1(set_keyboard_props, + void(const smart_objects::SmartObject& keyboard_props)); + MOCK_METHOD1(set_menu_title, + void(const smart_objects::SmartObject& menu_title)); + MOCK_METHOD1(set_menu_icon, + void(const smart_objects::SmartObject& menu_icon)); + MOCK_METHOD2(AddCommand, + void(uint32_t cmd_id, + const smart_objects::SmartObject& command)); + MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id)); + MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id)); + MOCK_METHOD2(AddSubMenu, + void(uint32_t menu_id, const smart_objects::SmartObject& menu)); + MOCK_METHOD1(RemoveSubMenu, void(uint32_t menu_id)); + MOCK_CONST_METHOD1(FindSubMenu, + smart_objects::SmartObject*(uint32_t menu_id)); + MOCK_METHOD1(IsSubMenuNameAlreadyExist, bool(const std::string& name)); + MOCK_METHOD2(AddChoiceSet, + void(uint32_t choice_set_id, + const smart_objects::SmartObject& choice_set)); + MOCK_METHOD1(RemoveChoiceSet, void(uint32_t choice_set_id)); + MOCK_METHOD1(FindChoiceSet, + smart_objects::SmartObject*(uint32_t choice_set_id)); + MOCK_METHOD2(AddPerformInteractionChoiceSet, + void(uint32_t choice_set_id, + const smart_objects::SmartObject& choice_set)); + MOCK_METHOD0(DeletePerformInteractionChoiceSetMap, void()); + MOCK_CONST_METHOD0(performinteraction_choice_set_map, + DataAccessor()); + MOCK_CONST_METHOD1(FindPerformInteractionChoiceSet, + smart_objects::SmartObject*(uint32_t choice_set_id)); + MOCK_CONST_METHOD0(commands_map, DataAccessor()); + MOCK_CONST_METHOD0(sub_menu_map, DataAccessor()); + MOCK_CONST_METHOD0(choice_set_map, DataAccessor()); + MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active)); + MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t()); + MOCK_METHOD1(set_perform_interaction_ui_corrid, void(uint32_t choice)); + MOCK_CONST_METHOD0(perform_interaction_ui_corrid, uint32_t()); + MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode)); + MOCK_CONST_METHOD0(perform_interaction_mode, int32_t()); + MOCK_METHOD1(set_reset_global_properties_active, void(bool active)); + MOCK_CONST_METHOD0(is_reset_global_properties_active, bool()); + MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(mobile_app_id, std::string()); + MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(ngn_media_screen_name, + const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(language, const mobile_api::Language::eType&()); + MOCK_CONST_METHOD0(ui_language, const mobile_api::Language::eType&()); + MOCK_METHOD1(set_app_types, + void(const smart_objects::SmartObject& app_types)); + MOCK_METHOD1(set_vr_synonyms, + void(const smart_objects::SmartObject& vr_synonyms)); + MOCK_METHOD1(set_mobile_app_id, + void(const smart_objects::SmartObject& mobile_app_id)); + MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name)); + MOCK_METHOD1(set_ngn_media_screen_name, + void(const smart_objects::SmartObject& ngn_name)); + MOCK_METHOD1(set_language, void(const mobile_api::Language::eType& language)); + MOCK_METHOD1(set_ui_language, + void(const mobile_api::Language::eType& ui_language)); + MOCK_METHOD1(load_global_properties, + void(const smart_objects::SmartObject& so)); + MOCK_METHOD1(set_mobile_app_id, void(const std::string& mobile_app_id)); + MOCK_METHOD0(ChangeSupportingAppHMIType, void()); + MOCK_CONST_METHOD0(is_navi, bool()); + MOCK_METHOD1(set_is_navi, void(bool allow)); + MOCK_CONST_METHOD0(hmi_supports_navi_video_streaming, bool()); + MOCK_METHOD1(set_hmi_supports_navi_video_streaming, void(bool supports)); + MOCK_CONST_METHOD0(hmi_supports_navi_audio_streaming, bool()); + MOCK_METHOD1(set_hmi_supports_navi_audio_streaming, void(bool supports)); + MOCK_CONST_METHOD0(is_voice_communication_supported, bool()); + MOCK_METHOD1(set_voice_communication_supported, void(bool)); + MOCK_METHOD1(set_activated, bool(bool is_active)); + MOCK_CONST_METHOD0(is_foreground, bool()); + MOCK_METHOD1(set_foreground, void(bool is_foreground)); + MOCK_CONST_METHOD0(IsAudioApplication, bool()); + MOCK_CONST_METHOD0(video_stream_retry_active, bool()); + MOCK_METHOD1(set_video_stream_retry_active, void(bool active)); + MOCK_CONST_METHOD0(audio_stream_retry_active, bool()); + MOCK_METHOD1(set_audio_stream_retry_active, void(bool active)); + MOCK_METHOD0(OnVideoStreamRetry, void()); + MOCK_METHOD0(OnAudioStreamRetry, void()); + MOCK_METHOD1(SubscribeToInteriorVehicleData, + bool(smart_objects::SmartObject module)); + MOCK_METHOD1(IsSubscribedToInteriorVehicleData, + bool(smart_objects::SmartObject module)); + MOCK_METHOD1(UnsubscribeFromInteriorVehicleData, + bool(smart_objects::SmartObject module)); +}; + +} // namespace application_manager + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_APPLICATION_H_ diff --git a/src/components/functional_module/test/include/mock_module_observer.h b/src/components/functional_module/test/include/mock_module_observer.h new file mode 100644 index 0000000000..bfa5117b29 --- /dev/null +++ b/src/components/functional_module/test/include/mock_module_observer.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_ + +#include "gmock/gmock.h" +#include "functional_module/module_observer.h" + +namespace functional_modules { + +class MockModuleObserver : public ModuleObserver { + public: + MOCK_METHOD2(OnError, void(Errors error, ModuleID module_id)); + int ObserverMethod() { + return 13; + } +}; + +} // namespace functional_modules + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_MODULE_OBSERVER_H_ diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h new file mode 100644 index 0000000000..560fa91359 --- /dev/null +++ b/src/components/functional_module/test/include/mock_service.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_ +#define SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_ + +#include "gmock/gmock.h" +#include "application_manager/service.h" + +namespace application_manager { + +class MockService : public Service { + public: + MOCK_METHOD1(CheckPolicyPermissions, + mobile_apis::Result::eType(MessagePtr msg)); + MOCK_METHOD1(GetApplication, ApplicationSharedPtr(ApplicationId app_id)); + MOCK_METHOD1(SendMessageToHMI, void(const MessagePtr& message)); + MOCK_METHOD1(SendMessageToMobile, void(const MessagePtr& message)); + MOCK_METHOD0(GetNextCorrelationID, uint32_t()); + MOCK_METHOD1(GetApplications, + std::vector(AppExtensionUID)); + MOCK_METHOD1(SubscribeToHMINotification, + void(const std::string& hmi_notification)); + MOCK_METHOD2(ChangeNotifyHMILevel, + void(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level)); + MOCK_METHOD2(NotifyHMIAboutHMILevel, + void(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level)); + MOCK_METHOD4(CheckAccess, + TypeAccess(const ApplicationId& app_id, + const std::string& module, + const std::string& rpc, + const std::vector& params)); + MOCK_METHOD2(CheckModule, + bool(const ApplicationId& app_id, const std::string& module)); + MOCK_METHOD3(SetAccess, + void(const ApplicationId& app_id, + const std::string& module, + bool allowed)); + MOCK_METHOD1(ResetAccess, void(const ApplicationId& app_id)); + MOCK_METHOD1(ResetAccess, void(const std::string& module)); + MOCK_METHOD1(GetDeviceHandlerById, uint32_t(const std::string& device_id)); + MOCK_METHOD1(SetPrimaryDevice, void(const uint32_t dev_id)); + MOCK_METHOD0(ResetPrimaryDevice, void()); + MOCK_CONST_METHOD0(PrimaryDevice, uint32_t()); + MOCK_METHOD1(SetRemoteControl, void(bool enabled)); + MOCK_METHOD1(RemoveHMIFakeParameters, + void(application_manager::MessagePtr& message)); + MOCK_CONST_METHOD0(IsRemoteControlAllowed, bool()); + + MOCK_CONST_METHOD1(IsRemoteControlApplication, + bool(ApplicationSharedPtr app)); + MOCK_CONST_METHOD2(GetModuleTypes, + bool(const std::string& application_id, + std::vector* modules)); + MOCK_METHOD1(ValidateMessageBySchema, + application_manager::MessageValidationResult( + const application_manager::Message& message)); +}; +} +// namespace application_manager + +#endif // SRC_COMPONENTS_FUNCTIONAL_MODULE_TEST_INCLUDE_MOCK_SERVICE_H_ diff --git a/src/components/functional_module/test/include/module_timer_test.h b/src/components/functional_module/test/include/module_timer_test.h new file mode 100644 index 0000000000..456346b544 --- /dev/null +++ b/src/components/functional_module/test/include/module_timer_test.h @@ -0,0 +1,56 @@ +#include "utils/macro.h" +#include "functional_module/timer/module_timer.h" + +namespace functional_modules { + +class TestTrackable : public Trackable { + public: + explicit TestTrackable(TimeUnit interval = 0) + : Trackable(), custom_interval_(interval) {} + + virtual TimeUnit custom_interval() const { + return custom_interval_; + } + + bool operator==(const TestTrackable& other) const { + return custom_interval_ == other.custom_interval_; + } + + private: + TimeUnit custom_interval_; +}; + +class ModuleTimerTest { + public: + ModuleTimerTest(ModuleTimer& timer) : timer_(timer) {} + + TimeUnit period() const { + return timer_.period_; + } + + int observers_size() const { + return timer_.observers_.size(); + } + + int trackables_size() const { + return timer_.trackables_.size(); + } + + TestTrackable trackable(const TestTrackable& track) const { + return *std::find( + timer_.trackables_.begin(), timer_.trackables_.end(), track); + } + + TimeUnit current_time() const { + return timer_.CurrentTime(); + } + + private: + ModuleTimer& timer_; +}; + +class MockTimerObserver : public TimerObserver { + public: + MOCK_METHOD1(OnTimeoutTriggered, void(const TestTrackable& expired)); +}; +} // namespace functional_modules diff --git a/src/components/functional_module/test/plugins/CMakeLists.txt b/src/components/functional_module/test/plugins/CMakeLists.txt new file mode 100644 index 0000000000..7afe8387b8 --- /dev/null +++ b/src/components/functional_module/test/plugins/CMakeLists.txt @@ -0,0 +1,17 @@ +set(target PluginMock) + +include_directories ( + ${LOG4CXX_INCLUDE_DIRECTORY} + ${GMOCK_INCLUDE_DIRECTORY} + ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/ + ${CMAKE_SOURCE_DIR}/src/components/include/ + ${JSONCPP_INCLUDE_DIRECTORY} +) + +set(SOURCES + ./mock_generic_module.cc +) + +add_library(${target} SHARED ${SOURCES}) +target_link_libraries(${target}) +add_dependencies(${target} MOBILE_API HMI_API) diff --git a/src/components/functional_module/test/plugins/mock_generic_module.cc b/src/components/functional_module/test/plugins/mock_generic_module.cc new file mode 100644 index 0000000000..dcf6d7d4fe --- /dev/null +++ b/src/components/functional_module/test/plugins/mock_generic_module.cc @@ -0,0 +1,23 @@ +#include "mock_generic_module.h" + +using functional_modules::GenericModule; +using functional_modules::RCFunctionID; +using functional_modules::PluginInfo; + +using ::testing::_; +using ::testing::Return; + +MockGenericModule::MockGenericModule() : GenericModule(19) { + PluginInfo info; + info.name = "MockGenericModule"; + info.version = 1; + info.rc_function_list.push_back(static_cast(101)); + info.hmi_function_list.push_back("HMI-Func-1"); + + EXPECT_CALL(*this, GetPluginInfo()).Times(2).WillRepeatedly(Return(info)); + EXPECT_CALL(*this, set_service(_)).Times(1); +} + +extern "C" GenericModule* Create() { + return new MockGenericModule(); +} diff --git a/src/components/functional_module/test/plugins/mock_generic_module.h b/src/components/functional_module/test/plugins/mock_generic_module.h new file mode 100644 index 0000000000..aef0a68f19 --- /dev/null +++ b/src/components/functional_module/test/plugins/mock_generic_module.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_ +#define TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_ + +#include "gmock/gmock.h" +#include "functional_module/generic_module.h" + +using functional_modules::GenericModule; +using functional_modules::PluginInfo; +using functional_modules::ProcessResult; +using functional_modules::ServiceState; + +using ::testing::_; +using ::testing::Return; + +class MockGenericModule : public GenericModule { + public: + MockGenericModule(); + MOCK_CONST_METHOD0(GetPluginInfo, PluginInfo()); + MOCK_METHOD1(set_service, void(application_manager::ServicePtr service)); + MOCK_METHOD0(service, application_manager::ServicePtr()); + MOCK_METHOD1(ProcessMessage, + ProcessResult(application_manager::MessagePtr msg)); + MOCK_METHOD1(ProcessHMIMessage, + ProcessResult(application_manager::MessagePtr msg)); + MOCK_METHOD1(OnServiceStateChanged, void(ServiceState state)); + MOCK_METHOD1(RemoveAppExtension, void(uint32_t app_id)); + MOCK_METHOD1(IsAppForPlugin, + bool(application_manager::ApplicationSharedPtr app)); + MOCK_METHOD2(OnAppHMILevelChanged, + void(application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType old_level)); + MOCK_METHOD1(OnDeviceRemoved, + void(const connection_handler::DeviceHandle& device)); + MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id)); + MOCK_METHOD2(CanAppChangeHMILevel, + bool(application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType new_level)); + MOCK_METHOD0(RemoveAppExtensions, void()); +}; + +#endif // TEST_COMPONENTS_FUNCTIONAL_MODULE_PLUGINS_MOCK_GENERIC_MODULE_H_ diff --git a/src/components/functional_module/test/src/generic_module_test.cc b/src/components/functional_module/test/src/generic_module_test.cc new file mode 100644 index 0000000000..b052050cdb --- /dev/null +++ b/src/components/functional_module/test/src/generic_module_test.cc @@ -0,0 +1,137 @@ +#include "gtest/gtest.h" +#include "gmock/gmock.h" + +#include "driver_generic_module_test.h" + +#include "mock_module_observer.h" +#include "mock_service.h" + +using application_manager::ServicePtr; +using application_manager::MockService; + +using ::testing::_; + +namespace functional_modules { + +TEST(GenericModuleTest, SetService) { + DriverGenericModuleTest module(18); + MockService* mock_service = new MockService(); + ServicePtr exp_service(mock_service); + + module.set_service(exp_service); + ServicePtr out_service = module.service(); + + EXPECT_EQ(exp_service.get(), out_service.get()); +} + +TEST(GenericModuleTest, OnServiceStateChangedFail) { + DriverGenericModuleTest module(18); + MockService* mock_service = new MockService(); + ServicePtr exp_service(mock_service); + module.set_service(exp_service); + + EXPECT_CALL(*mock_service, SubscribeToHMINotification(_)).Times(0); + + module.OnServiceStateChanged(LOWVOLTAGE); +} + +TEST(GenericModuleTest, OnServiceStateChangedPass) { + DriverGenericModuleTest module(18); + MockService* mock_service = new MockService(); + ServicePtr exp_service(mock_service); + module.set_service(exp_service); + + EXPECT_CALL(*mock_service, SubscribeToHMINotification(_)).Times(2); + + module.OnServiceStateChanged(HMI_ADAPTER_INITIALIZED); +} + +TEST(GenericModuleTest, AddObserver) { + DriverGenericModuleTest module(18); + MockModuleObserver observer; + module.AddObserver(&observer); + const DriverGenericModuleTest::Observers& full = module.observers(); + ASSERT_EQ(1u, full.size()); + EXPECT_EQ(&observer, full[0]); +} + +TEST(GenericModuleTest, RemoveObserver) { + DriverGenericModuleTest module(18); + MockModuleObserver* observer = new MockModuleObserver(); + module.AddObserver(observer); + + module.RemoveObserver(observer); + const DriverGenericModuleTest::Observers& empty = module.observers(); + ASSERT_TRUE(empty.empty()); + delete observer; +} + +TEST(GenericModuleTest, EmptyRemoveObserver) { + DriverGenericModuleTest module(18); + MockModuleObserver* observer = new MockModuleObserver(); + module.RemoveObserver(observer); + const DriverGenericModuleTest::Observers& empty = module.observers(); + ASSERT_TRUE(empty.empty()); + delete observer; +} + +TEST(GenericModuleTest, WrongRemoveObserver) { + DriverGenericModuleTest module(18); + MockModuleObserver observer; + module.AddObserver(&observer); + + MockModuleObserver* wrong_observer = new MockModuleObserver(); + module.RemoveObserver(wrong_observer); + const DriverGenericModuleTest::Observers& empty = module.observers(); + ASSERT_EQ(1u, empty.size()); + EXPECT_EQ(&observer, empty[0]); + delete wrong_observer; +} + +TEST(GenericModuleTest, CrashRemovedObserver) { + DriverGenericModuleTest module(18); + MockModuleObserver* observer = new MockModuleObserver(); + module.AddObserver(observer); + EXPECT_EQ(13, observer->ObserverMethod()); + module.RemoveObserver(observer); + EXPECT_EQ(13, observer->ObserverMethod()); + delete observer; + MockModuleObserver second_observer; + module.AddObserver(&second_observer); + EXPECT_EQ(13, second_observer.ObserverMethod()); + module.RemoveObserver(&second_observer); + EXPECT_EQ(13, second_observer.ObserverMethod()); +} + +TEST(GenericModuleTest, NotifyObservers) { + DriverGenericModuleTest module(3); + MockModuleObserver observer; + module.AddObserver(&observer); + + EXPECT_CALL(observer, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1); + + application_manager::MessagePtr message; + module.ProcessMessage(message); +} + +TEST(GenericModuleTest, NotifyObserversComplex) { + DriverGenericModuleTest module(3); + MockModuleObserver observer_1; + module.AddObserver(&observer_1); + MockModuleObserver observer_2; + module.AddObserver(&observer_2); + + EXPECT_CALL(observer_1, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1); + EXPECT_CALL(observer_2, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1); + + application_manager::MessagePtr message; + module.ProcessMessage(message); + + module.RemoveObserver(&observer_1); + EXPECT_CALL(observer_1, OnError(ModuleObserver::FS_FAILURE, 3)).Times(0); + EXPECT_CALL(observer_2, OnError(ModuleObserver::FS_FAILURE, 3)).Times(1); + + module.ProcessMessage(message); +} + +} // namespace functional_modules diff --git a/src/components/functional_module/test/src/module_timer_test.cc b/src/components/functional_module/test/src/module_timer_test.cc new file mode 100644 index 0000000000..668c3e2955 --- /dev/null +++ b/src/components/functional_module/test/src/module_timer_test.cc @@ -0,0 +1,123 @@ +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "module_timer_test.h" + +namespace functional_modules { + +TEST(ModuleTimerTest, set_period) { + ModuleTimer timer; + timer.set_period(10000); + ModuleTimerTest test(timer); + EXPECT_EQ(10000u, test.period()); +} + +TEST(ModuleTimerTest, add_observer) { + ModuleTimer timer; + ModuleTimerTest test(timer); + for (size_t i = 0; i < 5; ++i) { + MockTimerObserver observer; + timer.AddObserver(&observer); + } + EXPECT_EQ(5, test.observers_size()); +} + +TEST(ModuleTimerTest, remove_observer) { + ModuleTimer timer; + ModuleTimerTest test(timer); + + MockTimerObserver observer; + timer.AddObserver(&observer); + MockTimerObserver observer2; + timer.AddObserver(&observer2); + timer.RemoveObserver(&observer); + EXPECT_EQ(1, test.observers_size()); + MockTimerObserver observer3; + timer.RemoveObserver(&observer3); + EXPECT_EQ(1, test.observers_size()); + timer.RemoveObserver(&observer2); + EXPECT_EQ(0, test.observers_size()); +} + +TEST(ModuleTimerTest, start) { + ModuleTimer timer; + ModuleTimerTest test(timer); + timer.set_period(1); + MockTimerObserver observer; + timer.AddObserver(&observer); + TestTrackable track; + timer.AddTrackable(track); + sleep(2); + EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(1); + timer.CheckTimeout(); + EXPECT_EQ(0, test.trackables_size()); + timer.set_period(4); + timer.AddTrackable(track); + sleep(2); + EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(0); + timer.CheckTimeout(); + EXPECT_EQ(1, test.trackables_size()); + TestTrackable track2(1); + timer.AddTrackable(track2); + timer.AddTrackable(track); + sleep(2); + EXPECT_CALL(observer, OnTimeoutTriggered(track2)).Times(1); + EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(0); + timer.CheckTimeout(); + EXPECT_EQ(1, test.trackables_size()); +} + +TEST(ModuleTimerTest, add_trackable) { + ModuleTimer timer; + ModuleTimerTest test(timer); + timer.AddTrackable(TestTrackable()); + ASSERT_EQ(1, test.trackables_size()); + // adding the same object twice + timer.AddTrackable(TestTrackable()); + EXPECT_EQ(1, test.trackables_size()); + // adding another object + TestTrackable track(3); + timer.AddTrackable(track); + ASSERT_EQ(2, test.trackables_size()); + EXPECT_TRUE(test.trackable(track).start_time() - test.current_time() < 1); + timer.AddTrackable(track); + sleep(3); + EXPECT_TRUE(test.current_time() - test.trackable(track).start_time() < 4 && + test.current_time() - test.trackable(track).start_time() > 2); +} + +TEST(ModuleTimerTest, remove_trackable) { + ModuleTimer timer; + ModuleTimerTest test(timer); + EXPECT_EQ(0, test.trackables_size()); + TestTrackable track1; + TestTrackable track2(1); + timer.AddTrackable(track1); + timer.AddTrackable(track2); + EXPECT_EQ(2, test.trackables_size()); + timer.RemoveTrackable(track2); + ASSERT_EQ(1, test.trackables_size()); + TestTrackable track3(2); + timer.RemoveTrackable(track3); + ASSERT_EQ(1, test.trackables_size()); + timer.RemoveTrackable(track1); + ASSERT_EQ(0, test.trackables_size()); +} + +TEST(ModuleTimerTest, notify) { + ModuleTimer timer; + ModuleTimerTest test(timer); + timer.set_period(1); + MockTimerObserver observer; + timer.AddObserver(&observer); + TestTrackable track; + timer.AddTrackable(track); + TestTrackable track2(2); + timer.AddTrackable(track2); + sleep(2); + EXPECT_CALL(observer, OnTimeoutTriggered(track)).Times(1); + EXPECT_CALL(observer, OnTimeoutTriggered(track2)).Times(0); + timer.CheckTimeout(); + EXPECT_EQ(1, test.trackables_size()); +} + +} // namespace functional_modules diff --git a/src/components/functional_module/test/src/plugin_manager_test.cc b/src/components/functional_module/test/src/plugin_manager_test.cc new file mode 100644 index 0000000000..09a44ceb58 --- /dev/null +++ b/src/components/functional_module/test/src/plugin_manager_test.cc @@ -0,0 +1,206 @@ +#include "gtest/gtest.h" +#include "gmock/gmock.h" +#include "functional_module/plugin_manager.h" +#include "mock_generic_module.h" +#include "mock_service.h" +#include "application_manager/mock_application.h" +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" + +using application_manager::Message; +using application_manager::ProtocolVersion; +using application_manager::MockService; +using ::testing::NiceMock; +using ::testing::Expectation; +using ::testing::ReturnRef; + +namespace functional_modules { + +class PluginManagerTest : public ::testing::Test { + public: + PluginManagerTest() + : manager(utils::MakeShared()) + , service(utils::MakeShared()) {} + + protected: + utils::SharedPtr manager; + utils::SharedPtr service; + MockGenericModule* module; + + void SetUp() OVERRIDE { + manager->SetServiceHandler(service); + + ASSERT_EQ(1, manager->LoadPlugins("./plugins/")); + const PluginManager::Modules& plugins = manager->plugins(); + PluginManager::Modules::const_iterator i = plugins.begin(); + module = static_cast(i->second.get()); + } +}; + +TEST_F(PluginManagerTest, ChangePluginsState) { + ServiceState kState = ServiceState::SUSPENDED; + EXPECT_CALL(*module, OnServiceStateChanged(kState)); + manager->OnServiceStateChanged(kState); +} + +TEST_F(PluginManagerTest, IsMessageForPluginFail) { + Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc)); + msg->set_protocol_version(ProtocolVersion::kUnknownProtocol); + EXPECT_FALSE(manager->IsMessageForPlugin(msg)); +} + +TEST_F(PluginManagerTest, IsMessageForPluginPass) { + Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc)); + msg->set_protocol_version(ProtocolVersion::kV3); + msg->set_function_id(101); // see MockGenericModule + EXPECT_TRUE(manager->IsMessageForPlugin(msg)); +} + +TEST_F(PluginManagerTest, IsHMIMessageForPluginFail) { + Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc)); + msg->set_protocol_version(ProtocolVersion::kUnknownProtocol); + EXPECT_FALSE(manager->IsHMIMessageForPlugin(msg)); +} + +TEST_F(PluginManagerTest, IsHMIMessageForPluginPass) { + Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc)); + msg->set_protocol_version(ProtocolVersion::kHMI); + std::string json = "{\"method\": \"HMI-Func-1\"}"; // see MockGenericModule + msg->set_json_message(json); + EXPECT_TRUE(manager->IsHMIMessageForPlugin(msg)); +} + +TEST_F(PluginManagerTest, RemoveAppExtension) { + const uint32_t kAppId = 2; + EXPECT_CALL(*module, RemoveAppExtension(kAppId)).Times(1); + manager->RemoveAppExtension(kAppId); +} + +TEST_F(PluginManagerTest, ProcessMessageFail) { + Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc)); + application_manager::MessagePtr message(msg); + msg->set_protocol_version(ProtocolVersion::kUnknownProtocol); + EXPECT_CALL(*module, ProcessMessage(message)).Times(0); + manager->ProcessMessage(message); +} + +TEST_F(PluginManagerTest, ProcessMessagePass) { + Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc)); + application_manager::MessagePtr message(msg); + msg->set_protocol_version(ProtocolVersion::kV3); + msg->set_function_id(101); // see MockGenericModule + EXPECT_CALL(*module, ProcessMessage(message)) + .Times(1) + .WillOnce(Return(ProcessResult::PROCESSED)); + manager->ProcessMessage(message); +} + +TEST_F(PluginManagerTest, ProcessHMIMessageFail) { + Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc)); + application_manager::MessagePtr message(msg); + message->set_protocol_version(ProtocolVersion::kUnknownProtocol); + EXPECT_CALL(*module, ProcessHMIMessage(message)).Times(0); + manager->ProcessHMIMessage(message); +} + +TEST_F(PluginManagerTest, ProcessHMIMessagePass) { + Message* msg = new Message(protocol_handler::MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc)); + application_manager::MessagePtr message(msg); + message->set_protocol_version(ProtocolVersion::kHMI); + std::string json = "{\"method\": \"HMI-Func-1\"}"; // see MockGenericModule + message->set_json_message(json); + EXPECT_CALL(*module, ProcessHMIMessage(message)) + .Times(1) + .WillOnce(Return(ProcessResult::PROCESSED)); + manager->ProcessHMIMessage(message); +} + +TEST_F(PluginManagerTest, IsAppForPlugins) { + using test::components::application_manager_test::MockApplication; + MockApplication* app = new MockApplication(); + application_manager::ApplicationSharedPtr app_ptr(app); + EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).Times(1); + manager->IsAppForPlugins(app_ptr); +} + +TEST_F(PluginManagerTest, OnAppHMILevelChanged) { + using test::components::application_manager_test::MockApplication; + NiceMock* app = new NiceMock(); + application_manager::ApplicationSharedPtr app_ptr(app); + + const application_manager::custom_str::CustomString name("name"); + ON_CALL(*app, name()).WillByDefault(ReturnRef(name)); + mobile_apis::HMILevel::eType level = mobile_apis::HMILevel::eType::HMI_NONE; + ON_CALL(*app, hmi_level()).WillByDefault(Return(level)); + + Expectation is_for_plugin = + EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(true)); + EXPECT_CALL(*module, OnAppHMILevelChanged(app_ptr, _)) + .Times(1) + .After(is_for_plugin); + manager->OnAppHMILevelChanged(app_ptr, + mobile_apis::HMILevel::eType::HMI_FULL); +} + +TEST_F(PluginManagerTest, CanAppChangeHMILevel) { + using test::components::application_manager_test::MockApplication; + NiceMock* app = new NiceMock(); + application_manager::ApplicationSharedPtr app_ptr(app); + + const application_manager::custom_str::CustomString name("name"); + ON_CALL(*app, name()).WillByDefault(ReturnRef(name)); + + Expectation is_for_plugin = + EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(true)); + EXPECT_CALL(*module, CanAppChangeHMILevel(app_ptr, _)) + .Times(1) + .After(is_for_plugin) + .WillOnce(Return(true)); + ASSERT_TRUE(manager->CanAppChangeHMILevel( + app_ptr, mobile_apis::HMILevel::eType::HMI_FULL)); +} + +TEST_F(PluginManagerTest, CanAppChangeHMILevelNegative) { + using test::components::application_manager_test::MockApplication; + NiceMock* app = new NiceMock(); + application_manager::ApplicationSharedPtr app_ptr(app); + + const application_manager::custom_str::CustomString name("name"); + ON_CALL(*app, name()).WillByDefault(ReturnRef(name)); + + Expectation is_for_plugin = + EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(true)); + EXPECT_CALL(*module, CanAppChangeHMILevel(app_ptr, _)) + .Times(1) + .After(is_for_plugin) + .WillOnce(Return(false)); + ASSERT_FALSE(manager->CanAppChangeHMILevel( + app_ptr, mobile_apis::HMILevel::eType::HMI_BACKGROUND)); +} + +TEST_F(PluginManagerTest, CanAppChangeHMILevelNotForPlugin) { + using test::components::application_manager_test::MockApplication; + NiceMock* app = new NiceMock(); + application_manager::ApplicationSharedPtr app_ptr(app); + + const application_manager::custom_str::CustomString name("name"); + ON_CALL(*app, name()).WillByDefault(ReturnRef(name)); + + Expectation is_for_plugin = + EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(false)); + EXPECT_CALL(*module, CanAppChangeHMILevel(app_ptr, _)) + .Times(0) + .After(is_for_plugin); + ASSERT_TRUE(manager->CanAppChangeHMILevel( + app_ptr, mobile_apis::HMILevel::eType::HMI_BACKGROUND)); +} + +} // namespace functional_modules diff --git a/src/components/functional_module/test/src/settings_test.cc b/src/components/functional_module/test/src/settings_test.cc new file mode 100644 index 0000000000..ad7324c350 --- /dev/null +++ b/src/components/functional_module/test/src/settings_test.cc @@ -0,0 +1,92 @@ +#include "gtest/gtest.h" +#include "functional_module/settings.h" + +namespace functional_modules { + +TEST(Settings, ChangeConfigFile) { + Settings set; + set.ChangeConfigFile("test.ini"); + int port = 0; + bool result = set.ReadParameter("HMI", "ServerPort", &port); + ASSERT_TRUE(result); + ASSERT_EQ(8087, port); + set.ChangeConfigFile("not_existing_file.ini"); + result = set.ReadParameter("HMI", "ServerPort", &port); + ASSERT_FALSE(result); +} + +TEST(Settings, ReadParamIntWithSectionSuccess) { + Settings set; + set.ChangeConfigFile("test.ini"); + int port = 0; + bool result = set.ReadParameter("HMI", "ServerPort", &port); + ASSERT_TRUE(result); + ASSERT_EQ(8087, port); +} + +TEST(Settings, ReadParamIntWithSectionFail) { + Settings set; + set.ChangeConfigFile("test.ini"); + int port = 0; + bool result = set.ReadParameter("HMI", "ServerPo", &port); + ASSERT_FALSE(result); + ASSERT_EQ(0, port); +} + +TEST(Settings, ReadParamBoolWithSectionSuccess) { + Settings set; + set.ChangeConfigFile("test.ini"); + bool launch = true; + bool result = set.ReadParameter("HMI", "LaunchHMI", &launch); + ASSERT_TRUE(result); + ASSERT_FALSE(launch); +} + +TEST(Settings, ReadParamBoolWithSectionFail) { + Settings set; + set.ChangeConfigFile("test.ini"); + bool launch = true; + bool result = set.ReadParameter("HMI", "LaunchH", &launch); + ASSERT_FALSE(result); + ASSERT_TRUE(launch); +} + +TEST(Settings, ReadParamStringWithSectionSuccess) { + Settings set; + set.ChangeConfigFile("test.ini"); + std::string file_path; + bool result = set.ReadParameter( + "Remote Control", "InteriorVDCapabilitiesFile", &file_path); + ASSERT_TRUE(result); + ASSERT_EQ("./plugins/InteriorVehicleDataCapabilities.json", file_path); +} + +TEST(Settings, ReadParamStringWithSectionFail) { + Settings set; + set.ChangeConfigFile("test.ini"); + std::string file_path; + bool result = + set.ReadParameter("Remote Control", "InteriorVDCFile", &file_path); + ASSERT_FALSE(result); + ASSERT_EQ("", file_path); +} + +TEST(Settings, ReadParamStringNoSectionSuccess) { + Settings set; + set.ChangeConfigFile("test.ini"); + std::string caps; + bool result = set.ReadParameter("HMICapabilities", &caps); + ASSERT_TRUE(result); + ASSERT_EQ("hmi_capabilities.json", caps); +} + +TEST(Settings, ReadParamStringNoSectionFail) { + Settings set; + set.ChangeConfigFile("test.ini"); + std::string caps; + bool result = set.ReadParameter("HMICaps", &caps); + ASSERT_FALSE(result); + ASSERT_EQ("", caps); +} + +} // namespace functional_modules diff --git a/src/components/functional_module/test/test.ini b/src/components/functional_module/test/test.ini new file mode 100644 index 0000000000..211b7edc78 --- /dev/null +++ b/src/components/functional_module/test/test.ini @@ -0,0 +1,36 @@ + ; The INI-file consists of different chapters. +; Each chapter begins with the line containing +; the name in square brackets. Syntax: +; [chapter] +; The chapters consists of a set of items with a +; assinged value. The syntax is: +; item=value +; All white spaces an second encounters of chapters +; or items will be ignored. +; Remarks start with semicolon or star as first character. +; It is alowed for names of chapters and items to +; contain semicolon and star. Possible syntax is: +; [ chapter ] ;Remark +; item = value ;Remark + +[HMI] +LaunchHMI = false +ServerAddress = 127.0.0.1 +ServerPort = 8087 + +[MAIN] + +;The value of a variable ThreadStackSize used only if its realy needed, other way stack size will be PTHREAD_STACK_MIN +; +ThreadStackSize = 20480 +MixingAudioSupported = true +HMICapabilities = hmi_capabilities.json +MaxCmdID = 2000000000 +; Default request timeout in milliseconds +DefaultTimeout = 10000 + +SystemFilesPath = /tmp/fs/mp/images/ivsu_cache + + +[Remote Control] +InteriorVDCapabilitiesFile = ./plugins/InteriorVehicleDataCapabilities.json diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h index bd118032d6..1a28c89bda 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h @@ -51,8 +51,15 @@ class HMIMessageAdapterImpl : public HMIMessageAdapter { /** * \brief Destructor */ - virtual ~HMIMessageAdapterImpl(); + ~HMIMessageAdapterImpl(); +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Subscribes to notification from HMI + * @param hmi_notification string with notification name + */ + void SubscribeToHMINotification(const std::string& hmi_notification) OVERRIDE; +#endif // SDL_REMOTE_CONTROL protected: virtual HMIMessageHandler* handler() const { return handler_; diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h index 8b238b4aa8..daba87e738 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h @@ -89,14 +89,21 @@ class HMIMessageHandlerImpl : public HMIMessageHandler, explicit HMIMessageHandlerImpl(const HMIMessageHandlerSettings& settings); ~HMIMessageHandlerImpl(); - void OnMessageReceived(MessageSharedPointer message); - void SendMessageToHMI(MessageSharedPointer message); + void OnMessageReceived(MessageSharedPointer message) OVERRIDE; + void SendMessageToHMI(MessageSharedPointer message) OVERRIDE; void set_message_observer(HMIMessageObserver* observer); - void OnErrorSending(MessageSharedPointer message); - void AddHMIMessageAdapter(HMIMessageAdapter* adapter); - void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter); - - virtual const HMIMessageHandlerSettings& get_settings() const OVERRIDE; + void OnErrorSending(MessageSharedPointer message) OVERRIDE; + void AddHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE; + void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE; + +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Subscribes to notification from HMI + * @param hmi_notification string with notification name + */ + void SubscribeToHMINotification(const std::string& hmi_notification) OVERRIDE; +#endif // SDL_REMOTE_CONTROL + const HMIMessageHandlerSettings& get_settings() const OVERRIDE; #ifdef BUILD_TESTS std::set message_adapters() const { @@ -120,15 +127,16 @@ class HMIMessageHandlerImpl : public HMIMessageHandler, // threads::MessageLoopThread<*>::Handler implementations // CALLED ON messages_from_hmi_ THREAD! - virtual void Handle(const impl::MessageFromHmi message) OVERRIDE; + void Handle(const impl::MessageFromHmi message) OVERRIDE; // CALLED ON messages_to_hmi_ THREAD! - virtual void Handle(const impl::MessageToHmi message) OVERRIDE; + void Handle(const impl::MessageToHmi message) OVERRIDE; private: const HMIMessageHandlerSettings& settings_; HMIMessageObserver* observer_; - mutable sync_primitives::Lock observer_locker_; std::set message_adapters_; + mutable sync_primitives::Lock observer_locker_; + mutable sync_primitives::Lock message_adapters_locker_; // Construct message threads when everything is already created diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h index f582cb2b81..8acc8fb207 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h @@ -76,6 +76,13 @@ class MessageBrokerAdapter : public HMIMessageAdapterImpl, void* SubscribeAndBeginReceiverThread(void* param); +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Subscribes to notification from HMI + * @param hmi_notification string with notification name + */ + void SubscribeToHMINotification(const std::string& hmi_notification) FINAL; +#endif // SDL_REMOTE_CONTROL protected: void ProcessRecievedFromMB(Json::Value& root); diff --git a/src/components/hmi_message_handler/src/hmi_message_adapter_impl.cc b/src/components/hmi_message_handler/src/hmi_message_adapter_impl.cc index 48874618a0..e58c5a8fb6 100644 --- a/src/components/hmi_message_handler/src/hmi_message_adapter_impl.cc +++ b/src/components/hmi_message_handler/src/hmi_message_adapter_impl.cc @@ -40,4 +40,10 @@ HMIMessageAdapterImpl::~HMIMessageAdapterImpl() { handler_ = 0; } +#ifdef SDL_REMOTE_CONTROL +void HMIMessageAdapterImpl::SubscribeToHMINotification( + const std::string& hmi_notification) { + // TODO(SL): Find an immplementation +} +#endif // SDL_REMOTE_CONTROL } // namespace hmi_message_handler diff --git a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc index 1c774b9efe..654b67de7f 100644 --- a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc +++ b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc @@ -94,6 +94,7 @@ void HMIMessageHandlerImpl::AddHMIMessageAdapter(HMIMessageAdapter* adapter) { LOG4CXX_WARN(logger_, "HMIMessageAdapter is not valid!"); return; } + sync_primitives::AutoLock lock(message_adapters_locker_); message_adapters_.insert(adapter); } @@ -104,6 +105,7 @@ void HMIMessageHandlerImpl::RemoveHMIMessageAdapter( LOG4CXX_WARN(logger_, "HMIMessageAdapter is not valid!"); return; } + sync_primitives::AutoLock lock(message_adapters_locker_); message_adapters_.erase(adapter); } @@ -123,11 +125,23 @@ void HMIMessageHandlerImpl::Handle(const impl::MessageFromHmi message) { LOG4CXX_INFO(logger_, "Message from hmi given away."); } void HMIMessageHandlerImpl::Handle(const impl::MessageToHmi message) { + sync_primitives::AutoLock lock(message_adapters_locker_); for (std::set::iterator it = message_adapters_.begin(); it != message_adapters_.end(); ++it) { (*it)->SendMessageToHMI(message); } } +#ifdef SDL_REMOTE_CONTROL +void HMIMessageHandlerImpl::SubscribeToHMINotification( + const std::string& hmi_notification) { + sync_primitives::AutoLock lock(message_adapters_locker_); + for (std::set::iterator it = message_adapters_.begin(); + it != message_adapters_.end(); + ++it) { + (*it)->SubscribeToHMINotification(hmi_notification); + } +} +#endif // SDL_REMOTE_CONTROL } // namespace hmi_message_handler diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 8d1bb756c2..e4500fb602 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -45,6 +45,7 @@ #include "application_manager/hmi_capabilities.h" #include "application_manager/vehicle_info_data.h" #include "application_manager/state_controller.h" +#include "application_manager/message.h" #include "resumption/last_state.h" #include "interfaces/MOBILE_API.h" #include "application_manager/app_launch/app_launch_ctrl.h" @@ -74,6 +75,28 @@ class MockApplicationManager : public application_manager::ApplicationManager { application, application_manager::ApplicationSharedPtr(uint32_t app_id)); MOCK_CONST_METHOD0(active_application, application_manager::ApplicationSharedPtr()); + +#ifdef SDL_REMOTE_CONTROL + MOCK_CONST_METHOD2(application, + application_manager::ApplicationSharedPtr( + const std::string& device_id, + const std::string& policy_app_id)); + MOCK_METHOD1(SubscribeToHMINotification, + void(const std::string& hmi_notification)); + MOCK_METHOD1(GetDeviceHandle, uint32_t(uint32_t connection_key)); + MOCK_CONST_METHOD1(IsAudioStreamingAllowed, bool(uint32_t connection_key)); + MOCK_CONST_METHOD1(IsVideoStreamingAllowed, bool(uint32_t connection_key)); + MOCK_METHOD2(ChangeAppsHMILevel, + void(uint32_t app_id, mobile_apis::HMILevel::eType level)); + MOCK_METHOD0(GetPluginManager, functional_modules::PluginManager&()); + MOCK_CONST_METHOD1( + devices, std::vector(const std::string& policy_app_id)); + MOCK_METHOD1(SendPostMessageToMobile, + void(const application_manager::MessagePtr& message)); + MOCK_METHOD1(SendPostMessageToHMI, + void(const application_manager::MessagePtr& message)); +#endif // SDL_REMOTE_CONTROL + MOCK_CONST_METHOD1( application_by_hmi_app, application_manager::ApplicationSharedPtr(uint32_t hmi_app_id)); @@ -110,6 +133,8 @@ class MockApplicationManager : public application_manager::ApplicationManager { MOCK_METHOD1( SendMessageToHMI, void(const application_manager::commands::MessageSharedPtr message)); + MOCK_METHOD1(RemoveHMIFakeParameters, + void(application_manager::MessagePtr& message)); MOCK_METHOD1( ManageHMICommand, bool(const application_manager::commands::MessageSharedPtr message)); diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h index fd9e2aa8a3..c09e79a52f 100644 --- a/src/components/include/test/application_manager/mock_application_manager_settings.h +++ b/src/components/include/test/application_manager/mock_application_manager_settings.h @@ -101,6 +101,7 @@ class MockApplicationManagerSettings MOCK_CONST_METHOD0(start_stream_retry_amount, const std::pair&()); MOCK_CONST_METHOD0(app_icons_folder, const std::string&()); + MOCK_CONST_METHOD0(plugins_folder, const std::string&()); MOCK_CONST_METHOD0(app_icons_folder_max_size, const uint32_t&()); MOCK_CONST_METHOD0(app_icons_amount_to_remove, const uint32_t&()); MOCK_CONST_METHOD0(list_files_response_size, const uint32_t&()); diff --git a/src/components/include/utils/macro.h b/src/components/include/utils/macro.h index 0e029e4b06..4cf76fe022 100644 --- a/src/components/include/utils/macro.h +++ b/src/components/include/utils/macro.h @@ -113,6 +113,13 @@ return; \ } +#define EXPORT_FUNCTION(TypeName) extern "C" TypeName* Create(); + +#define EXPORT_FUNCTION_IMPL(TypeName) \ + extern "C" TypeName* Create() { \ + return new TypeName(); \ + } + #define NOTREACHED() DCHECK(!"Unreachable code") // Allows to perform static check that virtual function from base class is @@ -134,6 +141,8 @@ #ifdef BUILD_TESTS #define FRIEND_TEST(test_case_name, test_name) \ friend class test_case_name##_##test_name##_Test -#endif +#else // BUILD_TESTS +#define FRIEND_TEST(test_case_name, test_name) +#endif // BUILD_TESTS #endif // SRC_COMPONENTS_INCLUDE_UTILS_MACRO_H_ -- cgit v1.2.1 From 59f437dc8608e1ec54c517416a39860d9a7be3b8 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Thu, 10 Aug 2017 14:07:09 +0300 Subject: Implementation of Remote Control plugin Stype changes after integration Fix policy handler remote unit tests --- src/components/application_manager/CMakeLists.txt | 13 + .../include/application_manager/application.h | 28 +- .../include/application_manager/application_impl.h | 80 +- .../application_manager/application_manager_impl.h | 96 + .../include/application_manager/message.h | 21 +- .../include/application_manager/message_helper.h | 29 + .../application_manager/policies/policy_handler.h | 169 +- .../application_manager/src/application_impl.cc | 101 + .../src/application_manager_impl.cc | 325 ++- .../mobile/register_app_interface_request.cc | 13 + .../src/message_helper/message_helper.cc | 102 + .../src/policies/policy_handler.cc | 350 +++ .../application_manager/src/smart_object_keys.cc | 1 + .../application_manager/test/CMakeLists.txt | 6 +- .../include/application_manager/mock_application.h | 30 + .../application_manager/mock_message_helper.h | 11 +- .../test/mock_message_helper.cc | 28 +- .../test/rc_policy_handler_test.cc | 643 ++++++ .../src/messagebroker_adapter.cc | 12 +- .../application_manager/application_manager.h | 57 +- .../application_manager_settings.h | 1 + .../policies/policy_handler_interface.h | 155 ++ .../hmi_message_handler/hmi_message_adapter.h | 15 + .../hmi_message_handler/hmi_message_handler.h | 9 + .../hmi_message_handler_settings.h | 2 +- .../policy_external/policy/policy_listener.h | 88 +- .../policy/policy_external/policy/policy_manager.h | 132 +- .../policy/policy_regular/policy/policy_listener.h | 171 ++ .../policy/policy_regular/policy/policy_manager.h | 129 ++ .../policy/usage_statistics/app_stopwatch.h | 50 + .../policies/mock_policy_handler_interface.h | 67 + .../mock_hmi_message_handler_settings.h | 2 +- .../policy_external/policy/mock_cache_manager.h | 256 +++ .../policy_external/policy/mock_policy_listener.h | 15 + .../policy_external/policy/mock_policy_manager.h | 45 + .../policy_regular/policy/mock_cache_manager.h | 220 ++ .../policy_regular/policy/mock_policy_listener.h | 109 + .../policy_regular/policy/mock_policy_manager.h | 44 + src/components/media_manager/CMakeLists.txt | 7 +- src/components/media_manager/test/CMakeLists.txt | 7 + .../policy/policy_external/CMakeLists.txt | 4 + .../policy_external/include/policy/access_remote.h | 233 ++ .../include/policy/access_remote_impl.h | 122 + .../policy_external/include/policy/cache_manager.h | 8 + .../policy_external/include/policy/policy_helper.h | 19 +- .../include/policy/policy_manager_impl.h | 75 + .../include/policy/policy_table/enums.h | 3 +- .../include/policy/policy_table/types.h | 18 + .../policy_external/include/policy/policy_types.h | 1 + .../include/policy/sql_pt_queries.h | 4 - .../include/policy/sql_pt_representation.h | 25 + .../policy_external/src/access_remote_impl.cc | 389 ++++ .../policy/policy_external/src/policy_helper.cc | 49 + .../policy_external/src/policy_manager_impl.cc | 399 +++- .../policy_external/src/policy_table/enums.cc | 47 +- .../policy_external/src/policy_table/types.cc | 114 +- .../policy_external/src/policy_table/validation.cc | 38 + .../policy/policy_external/src/sql_pt_queries.cc | 42 +- .../policy_external/src/sql_pt_representation.cc | 379 +++- .../policy/policy_external/test/CMakeLists.txt | 6 + .../test/include/policy/mock_access_remote.h | 97 + .../test/include/policy/mock_app_stopwatch.h | 53 + .../test/sql_pt_ext_representation_test.cc | 2 + .../test/sql_pt_representation_test.cc | 8 +- .../policy/policy_regular/CMakeLists.txt | 9 +- .../policy_regular/include/policy/access_remote.h | 233 ++ .../include/policy/access_remote_impl.h | 123 + .../policy_regular/include/policy/cache_manager.h | 18 +- .../include/policy/cache_manager_interface.h | 14 +- .../policy_regular/include/policy/policy_helper.h | 16 + .../include/policy/policy_manager_impl.h | 70 + .../include/policy/policy_table/types.h | 18 + .../policy_regular/include/policy/policy_types.h | 1 + .../policy_regular/include/policy/sql_pt_queries.h | 21 + .../include/policy/sql_pt_representation.h | 25 + .../policy/usage_statistics/app_stopwatch.h | 50 - .../policy_regular/src/access_remote_impl.cc | 377 ++++ .../policy/policy_regular/src/cache_manager.cc | 15 +- .../policy/policy_regular/src/policy_helper.cc | 49 + .../policy_regular/src/policy_manager_impl.cc | 380 +++- .../policy_regular/src/policy_table/enums.cc | 42 + .../policy_regular/src/policy_table/types.cc | 113 +- .../policy_regular/src/policy_table/validation.cc | 40 +- .../policy/policy_regular/src/sql_pt_queries.cc | 176 +- .../policy_regular/src/sql_pt_representation.cc | 376 +++- .../policy/policy_regular/test/CMakeLists.txt | 6 + .../policy_regular/test/access_remote_impl_test.cc | 265 +++ .../test/include/policy/mock_access_remote.h | 97 + .../test/include/policy/mock_cache_manager.h | 218 -- .../test/include/policy/mock_policy_listener.h | 83 - .../test/include/policy/mock_policy_manager.h | 185 -- .../test/policy_manager_impl_test.cc | 33 +- .../test/sql_pt_representation_test.cc | 38 +- src/components/remote_control/CMakeLists.txt | 86 + .../InteriorVehicleDataCapabilities.json | 6 + .../commands/base_command_notification.h | 112 + .../remote_control/commands/base_command_request.h | 281 +++ .../remote_control/commands/button_press_request.h | 104 + .../include/remote_control/commands/command.h | 84 + .../commands/get_interior_vehicle_data_request.h | 101 + .../on_interior_vehicle_data_notification.h | 75 + .../on_remote_control_settings_notification.h | 79 + .../commands/set_interior_vehicle_data_request.h | 128 ++ .../include/remote_control/event_engine/event.h | 127 ++ .../remote_control/event_engine/event_dispatcher.h | 203 ++ .../remote_control/event_engine/event_observer.h | 96 + .../include/remote_control/message_helper.h | 135 ++ .../include/remote_control/module_helper.h | 62 + .../include/remote_control/policy_helper.h | 64 + .../include/remote_control/rc_app_extension.h | 98 + .../include/remote_control/rc_command_factory.h | 66 + .../include/remote_control/rc_module_constants.h | 306 +++ .../include/remote_control/rc_module_timer.h | 70 + .../include/remote_control/remote_control_event.h | 82 + .../include/remote_control/remote_control_plugin.h | 147 ++ .../remote_control/remote_plugin_interface.h | 135 ++ .../include/remote_control/request_controller.h | 98 + .../remote_control/resource_allocation_manager.h | 111 + .../resource_allocation_manager_impl.h | 80 + src/components/remote_control/remote_sdl_pt.json | 2359 ++++++++++++++++++++ .../src/commands/base_command_notification.cc | 154 ++ .../src/commands/base_command_request.cc | 647 ++++++ .../src/commands/button_press_request.cc | 156 ++ .../commands/get_interior_vehicle_data_request.cc | 191 ++ .../on_interior_vehicle_data_notification.cc | 103 + .../on_remote_control_settings_notification.cc | 113 + .../commands/set_interior_vehicle_data_request.cc | 248 ++ .../remote_control/src/message_helper.cc | 157 ++ src/components/remote_control/src/module_helper.cc | 96 + src/components/remote_control/src/policy_helper.cc | 93 + .../remote_control/src/rc_app_extension.cc | 68 + .../remote_control/src/rc_command_factory.cc | 86 + .../remote_control/src/remote_control_event.cc | 56 + .../remote_control/src/remote_control_plugin.cc | 369 +++ .../remote_control/src/request_controller.cc | 94 + .../src/resource_allocation_manager_impl.cc | 229 ++ src/components/remote_control/test/CMakeLists.txt | 73 + .../remote_control/test/commands/CMakeLists.txt | 62 + .../test/commands/button_press_request_test.cc | 295 +++ .../get_interior_vehicle_data_request_test.cc | 288 +++ .../on_interior_vehicle_data_notification_test.cc | 178 ++ .../commands/on_remote_control_settings_test.cc | 322 +++ .../set_interior_vehicle_data_request_test.cc | 429 ++++ .../remote_control/test/include/mock_application.h | 329 +++ .../test/include/mock_remote_control_plugin.h | 55 + .../include/mock_resource_allocation_manager.h | 47 + src/components/remote_control/test/lc.awk | 170 ++ .../remote_control/test/run_calc_comments.sh | 38 + .../remote_control/test/run_mem_check.sh | 94 + src/components/remote_control/test/setup_rsdl.sh | 160 ++ .../remote_control/test/smartDeviceLink.ini | 5 + .../test/src/rc_app_extension_test.cc | 59 + .../remote_control/test/src/rc_library_test.cc | 92 + .../remote_control/test/src/rc_module_test.cc | 484 ++++ .../src/resource_allocation_manager_impl_test.cc | 282 +++ src/components/telemetry_monitor/CMakeLists.txt | 2 + 156 files changed, 19777 insertions(+), 707 deletions(-) create mode 100644 src/components/application_manager/test/rc_policy_handler_test.cc create mode 100644 src/components/include/policy/policy_regular/policy/policy_listener.h create mode 100644 src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h create mode 100644 src/components/include/test/policy/policy_external/policy/mock_cache_manager.h create mode 100644 src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h create mode 100644 src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h create mode 100644 src/components/policy/policy_external/include/policy/access_remote.h create mode 100644 src/components/policy/policy_external/include/policy/access_remote_impl.h create mode 100644 src/components/policy/policy_external/src/access_remote_impl.cc create mode 100644 src/components/policy/policy_external/test/include/policy/mock_access_remote.h create mode 100644 src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h create mode 100644 src/components/policy/policy_regular/include/policy/access_remote.h create mode 100644 src/components/policy/policy_regular/include/policy/access_remote_impl.h delete mode 100644 src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h create mode 100644 src/components/policy/policy_regular/src/access_remote_impl.cc create mode 100644 src/components/policy/policy_regular/test/access_remote_impl_test.cc create mode 100644 src/components/policy/policy_regular/test/include/policy/mock_access_remote.h delete mode 100644 src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h delete mode 100644 src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h delete mode 100644 src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h create mode 100644 src/components/remote_control/CMakeLists.txt create mode 100644 src/components/remote_control/InteriorVehicleDataCapabilities.json create mode 100644 src/components/remote_control/include/remote_control/commands/base_command_notification.h create mode 100644 src/components/remote_control/include/remote_control/commands/base_command_request.h create mode 100644 src/components/remote_control/include/remote_control/commands/button_press_request.h create mode 100644 src/components/remote_control/include/remote_control/commands/command.h create mode 100644 src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h create mode 100644 src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h create mode 100644 src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h create mode 100644 src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h create mode 100644 src/components/remote_control/include/remote_control/event_engine/event.h create mode 100644 src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h create mode 100644 src/components/remote_control/include/remote_control/event_engine/event_observer.h create mode 100644 src/components/remote_control/include/remote_control/message_helper.h create mode 100644 src/components/remote_control/include/remote_control/module_helper.h create mode 100644 src/components/remote_control/include/remote_control/policy_helper.h create mode 100644 src/components/remote_control/include/remote_control/rc_app_extension.h create mode 100644 src/components/remote_control/include/remote_control/rc_command_factory.h create mode 100644 src/components/remote_control/include/remote_control/rc_module_constants.h create mode 100644 src/components/remote_control/include/remote_control/rc_module_timer.h create mode 100644 src/components/remote_control/include/remote_control/remote_control_event.h create mode 100644 src/components/remote_control/include/remote_control/remote_control_plugin.h create mode 100644 src/components/remote_control/include/remote_control/remote_plugin_interface.h create mode 100644 src/components/remote_control/include/remote_control/request_controller.h create mode 100644 src/components/remote_control/include/remote_control/resource_allocation_manager.h create mode 100644 src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h create mode 100644 src/components/remote_control/remote_sdl_pt.json create mode 100644 src/components/remote_control/src/commands/base_command_notification.cc create mode 100644 src/components/remote_control/src/commands/base_command_request.cc create mode 100644 src/components/remote_control/src/commands/button_press_request.cc create mode 100644 src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc create mode 100644 src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc create mode 100644 src/components/remote_control/src/commands/on_remote_control_settings_notification.cc create mode 100644 src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc create mode 100644 src/components/remote_control/src/message_helper.cc create mode 100644 src/components/remote_control/src/module_helper.cc create mode 100644 src/components/remote_control/src/policy_helper.cc create mode 100644 src/components/remote_control/src/rc_app_extension.cc create mode 100644 src/components/remote_control/src/rc_command_factory.cc create mode 100644 src/components/remote_control/src/remote_control_event.cc create mode 100644 src/components/remote_control/src/remote_control_plugin.cc create mode 100644 src/components/remote_control/src/request_controller.cc create mode 100644 src/components/remote_control/src/resource_allocation_manager_impl.cc create mode 100644 src/components/remote_control/test/CMakeLists.txt create mode 100644 src/components/remote_control/test/commands/CMakeLists.txt create mode 100644 src/components/remote_control/test/commands/button_press_request_test.cc create mode 100644 src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc create mode 100644 src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc create mode 100644 src/components/remote_control/test/commands/on_remote_control_settings_test.cc create mode 100644 src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc create mode 100644 src/components/remote_control/test/include/mock_application.h create mode 100644 src/components/remote_control/test/include/mock_remote_control_plugin.h create mode 100644 src/components/remote_control/test/include/mock_resource_allocation_manager.h create mode 100755 src/components/remote_control/test/lc.awk create mode 100755 src/components/remote_control/test/run_calc_comments.sh create mode 100755 src/components/remote_control/test/run_mem_check.sh create mode 100755 src/components/remote_control/test/setup_rsdl.sh create mode 100644 src/components/remote_control/test/smartDeviceLink.ini create mode 100644 src/components/remote_control/test/src/rc_app_extension_test.cc create mode 100644 src/components/remote_control/test/src/rc_library_test.cc create mode 100644 src/components/remote_control/test/src/rc_module_test.cc create mode 100644 src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index 0d532c9a5c..e61411d063 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -38,6 +38,7 @@ set (AM_MOCK_DIR ${AM_TEST_DIR}/mock) include_directories ( include/ ${COMPONENTS_DIR} + ${COMPONENTS_DIR}/functional_module/include/ ${COMPONENTS_DIR}/utils/include/ ${COMPONENTS_DIR}/formatters/include/ ${COMPONENTS_DIR}/protocol_handler/include/ @@ -389,6 +390,11 @@ set(PATHS ) collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}") +if (NOT REMOTE_CONTROL) + list(REMOVE_ITEM SOURCES + ${COMPONENTS_DIR}/application_manager/src/core_service.cc) +endif() + set(LIBRARIES HMI_API MOBILE_API @@ -404,6 +410,13 @@ set(LIBRARIES emhashmap -L${EMHASHMAP_LIBS_DIRECTORY} ) +if(REMOTE_CONTROL) + SET (LIBRARIES + ${LIBRARIES} + FunctionalModule + ) +endif(REMOTE_CONTROL) + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") list(APPEND LIBRARIES sqlite3) endif () diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index aa0227efda..01b305e876 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -42,6 +42,7 @@ #include "utils/data_accessor.h" #include "interfaces/MOBILE_API.h" #include "connection_handler/device.h" +#include "application_manager/app_extension.h" #include "application_manager/message.h" #include "application_manager/hmi_state.h" #include "application_manager/application_state.h" @@ -384,7 +385,6 @@ class Application : public virtual InitialApplicationData, public: enum ApplicationRegisterState { kRegistered = 0, kWaitingForRegistration }; - public: Application() : is_greyed_out_(false) {} virtual ~Application() {} @@ -786,6 +786,31 @@ class Application : public virtual InitialApplicationData, */ virtual uint32_t GetAvailableDiskSpace() = 0; +#ifdef SDL_REMOTE_CONTROL + virtual void set_system_context( + const mobile_api::SystemContext::eType& system_context) = 0; + virtual void set_audio_streaming_state( + const mobile_api::AudioStreamingState::eType& state) = 0; + virtual bool IsSubscribedToInteriorVehicleData( + smart_objects::SmartObject module) = 0; + virtual bool SubscribeToInteriorVehicleData( + smart_objects::SmartObject module) = 0; + virtual bool UnsubscribeFromInteriorVehicleData( + smart_objects::SmartObject module) = 0; + virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0; + + /** + * @brief Return pointer to extension by uid + * @param uid uid of extension + * @return Pointer to extension, if extension was initialized, otherwise NULL + */ + virtual AppExtensionPtr QueryInterface(AppExtensionUID uid) = 0; + virtual bool AddExtension(AppExtensionPtr extention) = 0; + virtual bool RemoveExtension(AppExtensionUID uid) = 0; + virtual void RemoveExtensions() = 0; + virtual const std::set& SubscribesIVI() const = 0; +#endif // SDL_REMOTE_CONTROL + protected: mutable sync_primitives::Lock hmi_states_lock_; @@ -800,6 +825,7 @@ class Application : public virtual InitialApplicationData, typedef utils::SharedPtr ApplicationSharedPtr; typedef utils::SharedPtr ApplicationConstSharedPtr; +typedef uint32_t ApplicationId; } // namespace application_manager diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 089be323cf..979abe945d 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "utils/date_time.h" @@ -64,7 +65,8 @@ using namespace timer; namespace mobile_api = mobile_apis; namespace custom_str = custom_string; -class ApplicationImpl : public virtual InitialApplicationDataImpl, +class ApplicationImpl : public virtual Application, + public virtual InitialApplicationDataImpl, public virtual DynamicApplicationDataImpl { public: ApplicationImpl( @@ -188,9 +190,18 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, DataAccessor SubscribedIVI() const OVERRIDE; inline bool IsRegistered() const OVERRIDE; - /** - * @brief ResetDataInNone reset data counters in NONE - */ +#ifdef SDL_REMOTE_CONTROL + bool SubscribeToInteriorVehicleData( + smart_objects::SmartObject module) OVERRIDE; + bool IsSubscribedToInteriorVehicleData( + smart_objects::SmartObject module) OVERRIDE; + bool UnsubscribeFromInteriorVehicleData( + smart_objects::SmartObject module) OVERRIDE; + +#endif // SDL_REMOTE_CONTROL + /** + * @brief ResetDataInNone reset data counters in NONE + */ virtual void ResetDataInNone(); virtual DataAccessor SubscribedButtons() const OVERRIDE; @@ -306,6 +317,39 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, */ uint32_t GetAvailableDiskSpace() OVERRIDE; +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Sets current system context + * @param system_context new system context + */ + void set_system_context( + const mobile_api::SystemContext::eType& system_context) OVERRIDE; + /** + * @brief Sets current audio streaming state + * @param state new audio streaming state + */ + void set_audio_streaming_state( + const mobile_api::AudioStreamingState::eType& state) OVERRIDE; + /** + * @brief Sets current HMI level + * @param hmi_level new HMI level + */ + void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) OVERRIDE; + + /** + * @brief Get list of subscriptions to vehicle info notifications + * @return list of subscriptions to vehicle info notifications + */ + const std::set& SubscribesIVI() const OVERRIDE; + + /** + * @brief Return pointer to extension by uid + * @param uid uid of extension + * @return Pointer to extension, if extension was initialized, otherwise NULL + */ + AppExtensionPtr QueryInterface(AppExtensionUID uid) OVERRIDE; +#endif + protected: /** * @brief Clean up application folder. Persistent files will stay @@ -335,6 +379,27 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, */ void OnAudioStreamSuspend(); +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Add extension to application + * @param extension pointer to extension + * @return true if success, false if extension already initialized + */ + bool AddExtension(AppExtensionPtr extention) OVERRIDE; + + /** + * @brief Remove extension from application + * @param uid uid of extension + * @return true if success, false if extension is not present + */ + bool RemoveExtension(AppExtensionUID uid) OVERRIDE; + + /** + * @brief Removes all extensions + */ + void RemoveExtensions() OVERRIDE; +#endif // SDL_REMOTE_CONTROL + std::string hash_val_; uint32_t grammar_id_; @@ -384,6 +449,13 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, Timer video_stream_suspend_timer_; Timer audio_stream_suspend_timer_; +#ifdef SDL_REMOTE_CONTROL + std::list extensions_; + + std::forward_list + subscribed_interior_vehicle_data_; +#endif // SDL_REMOTE_CONTROL + /** * @brief Defines number per time in seconds limits */ diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index c0b7b7bd46..f0afbc78b2 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -59,6 +59,7 @@ #include "protocol_handler/protocol_handler.h" #include "hmi_message_handler/hmi_message_observer.h" #include "hmi_message_handler/hmi_message_sender.h" +#include "application_manager/policies/policy_handler_interface.h" #include "application_manager/policies/policy_handler_observer.h" #include "connection_handler/connection_handler.h" #include "connection_handler/connection_handler_observer.h" @@ -264,6 +265,72 @@ class ApplicationManagerImpl void SendHMIStatusNotification( const utils::SharedPtr app) OVERRIDE; + +#ifdef SDL_REMOTE_CONTROL + ApplicationSharedPtr application( + const std::string& device_id, + const std::string& policy_app_id) const OVERRIDE; + + uint32_t GetDeviceHandle(uint32_t connection_key) OVERRIDE; + /** + * @brief ChangeAppsHMILevel the function that will change application's + * hmi level. + * + * @param app_id id of the application whose hmi level should be changed. + * + * @param level new hmi level for certain application. + */ + void ChangeAppsHMILevel(uint32_t app_id, mobile_apis::HMILevel::eType level); + /** + * @brief MakeAppNotAudible allows to make certain application not audible. + * + * @param app_id applicatin's id whose audible state should be changed. + */ + void MakeAppNotAudible(uint32_t app_id); + + /** + * @brief MakeAppFullScreen allows ti change application's properties + * in order to make it full screen. + * + * @param app_id the id of application which should be in full screen mode. + * + * @return true if operation was success, false otherwise. + */ + bool MakeAppFullScreen(uint32_t app_id); + + /** + * @brief Subscribes to notification from HMI + * @param hmi_notification string with notification name + */ + void SubscribeToHMINotification(const std::string& hmi_notification) OVERRIDE; + + /** + * @brief Checks HMI level and returns true if audio streaming is allowed + */ + bool IsAudioStreamingAllowed(uint32_t connection_key) const OVERRIDE; + + /** + * @brief Checks HMI level and returns true if video streaming is allowed + */ + bool IsVideoStreamingAllowed(uint32_t connection_key) const OVERRIDE; + + void Erase(ApplicationSharedPtr app_to_remove) { + app_to_remove->RemoveExtensions(); + applications_.erase(app_to_remove); + } + + virtual functional_modules::PluginManager& GetPluginManager() OVERRIDE { + return plugin_manager_; + } + + std::vector devices( + const std::string& policy_app_id) const OVERRIDE; + + virtual void SendPostMessageToMobile(const MessagePtr& message) OVERRIDE; + + virtual void SendPostMessageToHMI(const MessagePtr& message) OVERRIDE; +#endif // SDL_REMOTE_CONTROL + /** * @brief Checks if application with the same HMI type * (media, voice communication or navi) exists @@ -763,6 +830,9 @@ class ApplicationManagerImpl void SendMessageToHMI(const commands::MessageSharedPtr message) OVERRIDE; + void RemoveHMIFakeParameters( + application_manager::MessagePtr& message) OVERRIDE; + bool ManageMobileCommand(const commands::MessageSharedPtr message, commands::Command::CommandOrigin origin) OVERRIDE; bool ManageHMICommand(const commands::MessageSharedPtr message) OVERRIDE; @@ -1216,6 +1286,10 @@ class ApplicationManagerImpl smart_objects::SmartObject& output); bool ConvertSOtoMessage(const smart_objects::SmartObject& message, Message& output); + + MessageValidationResult ValidateMessageBySchema( + const Message& message) OVERRIDE; + utils::SharedPtr ConvertRawMsgToMessage( const ::protocol_handler::RawMessagePtr message); @@ -1499,6 +1573,28 @@ class ApplicationManagerImpl protocol_handler::ProtocolHandler* protocol_handler_; request_controller::RequestController request_ctrl_; +#ifdef SDL_REMOTE_CONTROL + functional_modules::PluginManager plugin_manager_; + + /** + * @brief Map contains apps with HMI state before incoming call + * After incoming call ends previous HMI state must restore + * + */ + struct AppState { + AppState(const mobile_apis::HMILevel::eType& level, + const mobile_apis::AudioStreamingState::eType& streaming_state, + const mobile_apis::SystemContext::eType& context) + : hmi_level(level) + , audio_streaming_state(streaming_state) + , system_context(context) {} + + mobile_apis::HMILevel::eType hmi_level; + mobile_apis::AudioStreamingState::eType audio_streaming_state; + mobile_apis::SystemContext::eType system_context; + }; +#endif // SDL_REMOTE_CONTROL + hmi_apis::HMI_API* hmi_so_factory_; mobile_apis::MOBILE_API* mobile_so_factory_; diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index 70d80f44ef..77ef5479ee 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,14 +60,17 @@ MessageType MessageTypeFromRpcType(protocol_handler::RpcType rpc_type); class Message { public: - Message(protocol_handler::MessagePriority priority); + explicit Message(protocol_handler::MessagePriority priority); Message(const Message& message); Message& operator=(const Message& message); - bool operator==(const Message& message); + bool operator==(const Message& message) const; ~Message(); //! -------------------------------------------------------------------------- int32_t function_id() const; +#ifdef SDL_REMOTE_CONTROL + std::string function_name() const; +#endif // SDL_REMOTE_CONTROL int32_t correlation_id() const; int32_t connection_key() const; @@ -81,8 +84,12 @@ class Message { size_t payload_size() const; const smart_objects::SmartObject& smart_object() const; - //! -------------------------------------------------------------------------- + //! + //--------------------------------------------------------------------------. void set_function_id(int32_t id); +#ifdef SDL_REMOTE_CONTROL + void set_function_name(const std::string& name); +#endif // SDL_REMOTE_CONTROL void set_correlation_id(int32_t id); void set_connection_key(int32_t key); void set_message_type(MessageType type); @@ -105,6 +112,9 @@ class Message { int32_t function_id_; // @remark protocol V2. int32_t correlation_id_; // @remark protocol V2. MessageType type_; // @remark protocol V2. +#ifdef SDL_REMOTE_CONTROL + std::string function_name_; +#endif // SDL_REMOTE_CONTROL // Pre-calculated message priority, higher priority messages are // Processed first @@ -120,6 +130,9 @@ class Message { size_t payload_size_; protocol_handler::MajorProtocolVersion version_; }; + +typedef utils::SharedPtr MobileMessage; +typedef utils::SharedPtr MessagePtr; } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_ diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h index 8ec1d4745e..45a1215531 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -129,6 +129,17 @@ class MessageHelper { static hmi_apis::Common_Result::eType HMIResultFromString( const std::string& hmi_result); +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Converts string to device rank, if possible + * @param device_rank Stringified device rank + * @return Appropriate enum from device rank, or INVALID_ENUM, if conversion + * is not possible + */ + static mobile_api::DeviceRank::eType StringToDeviceRank( + const std::string& device_rank); +#endif // SDL_REMOTE_CONTROL + /** * @brief Converts mobile Result enum value to string * @param mobile_result mobile Result enum value @@ -702,6 +713,24 @@ class MessageHelper { int32_t connection_key, mobile_api::AppInterfaceUnregisteredReason::eType reason); +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Sends HMI status notification to mobile + * + * @param application_impl application with changed HMI status + * + **/ + static void SendHMIStatusNotification( + const Application& application_impl, + ApplicationManager& application_manager); + + static void SendActivateAppToHMI( + uint32_t const app_id, + ApplicationManager& application_manager, + hmi_apis::Common_HMILevel::eType level = hmi_apis::Common_HMILevel::FULL, + bool send_policy_priority = true); +#endif // SDL_REMOTE_CONTROL + private: /** * @brief Creates new request object and fill its header diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 0b808b13f5..3dd2bb76e0 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -112,6 +112,159 @@ class PolicyHandler : public PolicyHandlerInterface, uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE; virtual DeviceConsent GetUserConsentForDevice( const std::string& device_id) const OVERRIDE; + +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Sets HMI default type for specified application + * @param application_id ID application + * @param app_types list of HMI types + */ + void SetDefaultHmiTypes(const std::string& application_id, + const smart_objects::SmartObject* app_types) OVERRIDE; + + /** + * Checks if application has HMI type + * @param application_id ID application + * @param hmi HMI type to check + * @param app_types additional list of HMI type to search in it + * @return true if hmi is contained in policy or app_types + */ + bool CheckHMIType(const std::string& application_id, + mobile_apis::AppHMIType::eType hmi, + const smart_objects::SmartObject* app_types) OVERRIDE; + + /** + * Notifies about changing HMI level + * @param device_id unique identifier of device + * @param policy_app_id unique identifier of application in policy + * @param hmi_level default HMI level for this application + */ + void OnUpdateHMILevel(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) OVERRIDE; + + /** + * Checks access to equipment of vehicle for application by RPC + * @param device_id unique identifier of device + * @param app_id policy id application + * @param module type + * @param rpc name of rpc + * @param params parameters list + */ + application_manager::TypeAccess CheckAccess( + const PTString& device_id, + const PTString& app_id, + const PTString& module, + const std::string& rpc, + const std::vector& params) OVERRIDE; + + /** + * Checks access to module for application + * @param app_id policy id application + * @param module + * @return true if module is allowed for application + */ + bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE; + + /** + * Sets access to equipment of vehicle for application by RPC + * @param device_id unique identifier of device + * @param app_id policy id application + * @param module type + * @param allowed true if access is allowed + */ + void SetAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + bool allowed) OVERRIDE; + + /** + * Resets access application to all resources + * @param device_id unique identifier of device + * @param app_id policy id application + */ + void ResetAccess(const PTString& device_id, const PTString& app_id) OVERRIDE; + + /** + * Resets access by group name for all applications + * @param module type + */ + void ResetAccess(const std::string& module) OVERRIDE; + + /** + * Sets device as primary device + * @param dev_id ID device + */ + void SetPrimaryDevice(const PTString& dev_id) OVERRIDE; + + /** + * Resets driver's device + */ + void ResetPrimaryDevice() OVERRIDE; + + /** + * Return id of primary device + */ + uint32_t PrimaryDevice() const OVERRIDE; + + /** + * Sets mode of remote control (on/off) + * @param enabled true if remote control is turned on + */ + void SetRemoteControl(bool enabled) OVERRIDE; + + /** + * @brief If remote control is enabled + * by User and by Policy + */ + bool GetRemoteControl() const OVERRIDE; + + /** + * @brief Notifies passengers' apps about change + * @param new_consent New value of remote permission + */ + void OnRemoteAllowedChanged(bool new_consent) OVERRIDE; + + /** + * @brief Notifies Remote apps about change in permissions + * @param device_id Device on which app is running + * @param application_id ID of app whose permissions are changed + */ + void OnRemoteAppPermissionsChanged( + const std::string& device_id, const std::string& application_id) OVERRIDE; + + /** + * @brief Notifies Remote apps about change in HMI status + * @param device_id Device on which app is running + * @param policy_app_id ID of application + * @param hmi_level new HMI level for this application + */ + void OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) OVERRIDE; + + /** + * @brief Notifies Remote apps about change in HMI status + * @param device_id Device on which app is running + * @param policy_app_id ID of application + * @param hmi_level new HMI level for this application + * @param device_rank new device rank + */ + void OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level, + const std::string& device_rank) OVERRIDE; + + /** + * Gets all allowed module types + * @param app_id unique identifier of application + * @param list of allowed module types + * @return true if application has allowed modules + */ + bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const OVERRIDE; +#endif // SDL_REMOTE_CONTROL + bool GetDefaultHmi(const std::string& policy_app_id, std::string* default_hmi) const OVERRIDE; bool GetInitialAppData(const std::string& application_id, @@ -348,7 +501,8 @@ class PolicyHandler : public PolicyHandlerInterface, * @brief Allows to add new or update existed application during * registration process * @param application_id The policy aplication id. - ** @return function that will notify update manager about new application + * @param hmi_types list of hmi types + * @return function that will notify update manager about new application */ StatusNotifier AddApplication( const std::string& application_id, @@ -506,6 +660,18 @@ class PolicyHandler : public PolicyHandlerInterface, PermissionConsent& out_permissions) OVERRIDE; #endif +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Updates HMI level for specified application and send notification + * @param app application where HMI level was changed + * @param level new HMI level + */ + void UpdateHMILevel(application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level); + std::vector GetDevicesIds( + const std::string& policy_app_id) OVERRIDE; +#endif // SDL_REMOTE_CONTROL + /** * @brief Sets days after epoch on successful policy update */ @@ -644,7 +810,6 @@ class PolicyHandler : public PolicyHandlerInterface, * otherwise FALSE */ bool IsUrlAppIdValid(const uint32_t app_idx, const EndpointUrls& urls) const; - DISALLOW_COPY_AND_ASSIGN(PolicyHandler); }; diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 5764a7c5f7..08672732b7 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -1008,4 +1008,105 @@ void ApplicationImpl::UnsubscribeFromSoftButtons(int32_t cmd_id) { } } +#ifdef SDL_REMOTE_CONTROL + +void ApplicationImpl::set_system_context( + const mobile_api::SystemContext::eType& system_context) { + const HmiStatePtr hmi_state = CurrentHmiState(); + hmi_state->set_system_context(system_context); +} + +void ApplicationImpl::set_audio_streaming_state( + const mobile_api::AudioStreamingState::eType& state) { + if (!(is_media_application() || is_navi()) && + state != mobile_api::AudioStreamingState::NOT_AUDIBLE) { + LOG4CXX_WARN(logger_, + "Trying to set audio streaming state" + " for non-media application to different from NOT_AUDIBLE"); + return; + } + CurrentHmiState()->set_audio_streaming_state(state); +} + +void ApplicationImpl::set_hmi_level( + const mobile_api::HMILevel::eType& new_hmi_level) { + using namespace mobile_apis; + const HMILevel::eType current_hmi_level = hmi_level(); + if (HMILevel::HMI_NONE != current_hmi_level && + HMILevel::HMI_NONE == new_hmi_level) { + put_file_in_none_count_ = 0; + delete_file_in_none_count_ = 0; + list_files_in_none_count_ = 0; + } + ApplicationSharedPtr app = application_manager_.application(app_id()); + DCHECK_OR_RETURN_VOID(app) + application_manager_.state_controller().SetRegularState(app, new_hmi_level); + LOG4CXX_INFO(logger_, "hmi_level = " << new_hmi_level); + usage_report_.RecordHmiStateChanged(new_hmi_level); +} + +bool ApplicationImpl::SubscribeToInteriorVehicleData( + smart_objects::SmartObject module) { + subscribed_interior_vehicle_data_.push_front(module); + return true; +} + +bool ApplicationImpl::IsSubscribedToInteriorVehicleData( + smart_objects::SmartObject module) { + for (auto it = subscribed_interior_vehicle_data_.begin(); + it != subscribed_interior_vehicle_data_.end(); + ++it) { + if (*it == module) { + return true; + } + } + return false; +} + +bool ApplicationImpl::UnsubscribeFromInteriorVehicleData( + smart_objects::SmartObject module) { + subscribed_interior_vehicle_data_.remove(module); + return true; +} + +const std::set& ApplicationImpl::SubscribesIVI() const { + return subscribed_vehicle_info_; +} + +AppExtensionPtr ApplicationImpl::QueryInterface(AppExtensionUID uid) { + std::list::const_iterator it = extensions_.begin(); + for (; it != extensions_.end(); ++it) { + if ((*it)->uid() == uid) { + return (*it); + } + } + + return AppExtensionPtr(); +} + +bool ApplicationImpl::AddExtension(AppExtensionPtr extension) { + if (!QueryInterface(extension->uid())) { + extensions_.push_back(extension); + return true; + } + return false; +} + +bool ApplicationImpl::RemoveExtension(AppExtensionUID uid) { + for (std::list::iterator it = extensions_.begin(); + extensions_.end() != it; + ++it) { + if ((*it)->uid() == uid) { + extensions_.erase(it); + return true; + } + } + return false; +} + +void ApplicationImpl::RemoveExtensions() { + application_manager_.GetPluginManager().RemoveAppExtension(app_id_); +} +#endif // SDL_REMOTE_CONTROL + } // namespace application_manager diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index c141a16515..72896c289e 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -71,6 +71,12 @@ #include "utils/custom_string.h" #include +#ifdef SDL_REMOTE_CONTROL +#include "policy/usage_statistics/counter.h" +#include "functional_module/plugin_manager.h" +#include "application_manager/core_service.h" +#endif // SDL_REMOTE_CONTROL + namespace { int get_rand_from_range(uint32_t from = 0, int to = RAND_MAX) { return std::rand() % to + from; @@ -333,6 +339,20 @@ struct SubscribedToIVIPredicate { } }; +struct IsApplication { + IsApplication(connection_handler::DeviceHandle device_handle, + const std::string& policy_app_id) + : device_handle_(device_handle), policy_app_id_(policy_app_id) {} + bool operator()(const ApplicationSharedPtr app) const { + return app && app->device() == device_handle_ && + app->policy_app_id() == policy_app_id_; + } + + private: + connection_handler::DeviceHandle device_handle_; + const std::string& policy_app_id_; +}; + std::vector ApplicationManagerImpl::IviInfoUpdated( VehicleDataType vehicle_info, int value) { // Notify Policy Manager if available about info it's interested in, @@ -1571,6 +1591,11 @@ void ApplicationManagerImpl::SendMessageToMobile( } smart_objects::SmartObject& msg_to_mobile = *message; +#ifdef SDL_REMOTE_CONTROL + mobile_apis::FunctionID::eType function_id = + static_cast( + (*message)[strings::params][strings::function_id].asUInt()); +#endif // If correlation_id is not present, it is from-HMI message which should be // checked against policy permissions if (msg_to_mobile[strings::params].keyExists(strings::correlation_id)) { @@ -1578,6 +1603,16 @@ void ApplicationManagerImpl::SendMessageToMobile( msg_to_mobile[strings::params][strings::correlation_id].asUInt(), msg_to_mobile[strings::params][strings::connection_key].asUInt(), msg_to_mobile[strings::params][strings::function_id].asInt()); +#ifdef SDL_REMOTE_CONTROL + if (function_id == mobile_apis::FunctionID::RegisterAppInterfaceID && + (*message)[strings::msg_params][strings::success].asBool()) { + bool is_for_plugin = plugin_manager_.IsAppForPlugins(app); + LOG4CXX_INFO(logger_, + "Registered app " << app->app_id() << " is " + << (is_for_plugin ? "" : "not ") + << "for plugins."); + } +#endif } else if (app) { mobile_apis::FunctionID::eType function_id = static_cast( @@ -1810,6 +1845,25 @@ bool ApplicationManagerImpl::ManageMobileCommand( return false; } +void ApplicationManagerImpl::RemoveHMIFakeParameters( + application_manager::MessagePtr& message) { + LOG4CXX_AUTO_TRACE(logger_); + using namespace NsSmartDeviceLink::NsSmartObjects; + using namespace NsSmartDeviceLink::NsJSONHandler; + SmartObject so; + + Formatters::FormatterJsonRpc::FromString( + message->json_message(), so); + + std::string formatted_message; + namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters; + hmi_apis::HMI_API factory; + factory.attachSchema(so, true); + Formatters::FormatterJsonRpc::ToString(so, formatted_message); + message->set_json_message(formatted_message); +} + void ApplicationManagerImpl::SendMessageToHMI( const commands::MessageSharedPtr message) { LOG4CXX_AUTO_TRACE(logger_); @@ -1954,6 +2008,17 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state, app_launch_ctrl_.reset(new app_launch::AppLaunchCtrlImpl( *app_launch_dto_.get(), *this, settings_)); +#ifdef SDL_REMOTE_CONTROL + if (!hmi_handler_) { + LOG4CXX_ERROR(logger_, "HMI message handler was not initialized"); + return false; + } + plugin_manager_.SetServiceHandler(utils::MakeShared(*this)); + plugin_manager_.LoadPlugins(settings_.plugins_folder()); + plugin_manager_.OnServiceStateChanged( + functional_modules::ServiceState::HMI_ADAPTER_INITIALIZED); +#endif // SDL_REMOTE_CONTROL + return true; } @@ -2059,24 +2124,7 @@ bool ApplicationManagerImpl::ConvertMessageToSO( } if (output.validate() != smart_objects::Errors::OK) { LOG4CXX_ERROR(logger_, "Incorrect parameter from HMI"); - - if (application_manager::MessageType::kNotification == - output[strings::params][strings::message_type].asInt()) { - LOG4CXX_ERROR(logger_, "Ignore wrong HMI notification"); - return false; - } - - if (application_manager::MessageType::kRequest == - output[strings::params][strings::message_type].asInt()) { - LOG4CXX_ERROR(logger_, "Ignore wrong HMI request"); - return false; - } - - output.erase(strings::msg_params); - output[strings::params][hmi_response::code] = - hmi_apis::Common_Result::INVALID_DATA; - output[strings::msg_params][strings::info] = - std::string("Received invalid data on HMI response"); + return false; } break; } @@ -2234,6 +2282,58 @@ bool ApplicationManagerImpl::ConvertSOtoMessage( return true; } +MessageValidationResult ApplicationManagerImpl::ValidateMessageBySchema( + const Message& message) { + LOG4CXX_AUTO_TRACE(logger_); + smart_objects::SmartObject so; + switch (message.protocol_version()) { + case ProtocolVersion::kV4: + case ProtocolVersion::kV3: + case ProtocolVersion::kV2: { + const bool conversion_result = + formatters::CFormatterJsonSDLRPCv2::fromString( + message.json_message(), + so, + message.function_id(), + message.type(), + message.correlation_id()); + if (!conversion_result) { + return INVALID_JSON; + } + + if (!mobile_so_factory().attachSchema(so, true)) { + return INVALID_METADATA; + } + + if (so.validate() != smart_objects::Errors::OK) { + return SCHEMA_MISMATCH; + } + break; + } + case ProtocolVersion::kHMI: { + const int32_t conversion_result = formatters::FormatterJsonRpc:: + FromString( + message.json_message(), so); + if (0 != conversion_result) { + LOG4CXX_WARN(logger_, + "Failed to parse json from HMI: " << conversion_result); + return INVALID_JSON; + } + + if (!hmi_so_factory().attachSchema(so, true)) { + return INVALID_METADATA; + } + + if (so.validate() != smart_objects::Errors::OK) { + return SCHEMA_MISMATCH; + } + break; + } + default: { return UNSUPPORTED_PROTOCOL; } + } + return SUCCESS; +} + utils::SharedPtr ApplicationManagerImpl::ConvertRawMsgToMessage( const ::protocol_handler::RawMessagePtr message) { LOG4CXX_AUTO_TRACE(logger_); @@ -2309,8 +2409,17 @@ void ApplicationManagerImpl::ProcessMessageFromHMI( *smart_object = message->smart_object(); #else if (!ConvertMessageToSO(*message, *smart_object)) { - LOG4CXX_ERROR(logger_, "Cannot create smart object from message"); - return; + if (application_manager::MessageType::kResponse == + (*smart_object)[strings::params][strings::message_type].asInt()) { + (*smart_object).erase(strings::msg_params); + (*smart_object)[strings::params][hmi_response::code] = + hmi_apis::Common_Result::INVALID_DATA; + (*smart_object)[strings::msg_params][strings::info] = + std::string("Received invalid data on HMI response"); + } else { + LOG4CXX_ERROR(logger_, "Cannot create smart object from message"); + return; + } } #endif // HMI_DBUS_API @@ -2852,6 +2961,10 @@ void ApplicationManagerImpl::UnregisterApplication( MessageHelper::SendStopAudioPathThru(*this); } +#ifdef SDL_REMOTE_CONTROL + plugin_manager_.OnUnregisterApplication(app_id); +#endif + MessageHelper::SendOnAppUnregNotificationToHMI( app_to_remove, is_unexpected_disconnect, *this); request_ctrl_.terminateAppRequests(app_id); @@ -2875,6 +2988,13 @@ void ApplicationManagerImpl::Handle(const impl::MessageFromMobile message) { LOG4CXX_INFO(logger_, "Application manager is stopping"); return; } +#ifdef SDL_REMOTE_CONTROL + if (plugin_manager_.IsMessageForPlugin(message)) { + LOG4CXX_INFO(logger_, "Message will be processed by plugin."); + plugin_manager_.ProcessMessage(message); + return; + } +#endif ProcessMessageFromMobile(message); } @@ -2920,6 +3040,18 @@ void ApplicationManagerImpl::Handle(const impl::MessageFromHmi message) { return; } +#ifdef SDL_REMOTE_CONTROL + if (plugin_manager_.IsHMIMessageForPlugin(message)) { + LOG4CXX_INFO(logger_, "Message will be processed by plugin."); + functional_modules::ProcessResult result = + plugin_manager_.ProcessHMIMessage(message); + if (functional_modules::ProcessResult::PROCESSED == result || + functional_modules::ProcessResult::FAILED == result) { + return; + } + } +#endif + ProcessMessageFromHMI(message); } @@ -3889,5 +4021,158 @@ void ApplicationManagerImpl::AddMockApplication(ApplicationSharedPtr mock_app) { applications_list_lock_.Release(); } #endif // BUILD_TESTS +#ifdef SDL_REMOTE_CONTROL +struct MobileAppIdPredicate { + std::string policy_app_id_; + MobileAppIdPredicate(const std::string& policy_app_id) + : policy_app_id_(policy_app_id) {} + bool operator()(const ApplicationSharedPtr app) const { + return app ? policy_app_id_ == app->policy_app_id() : false; + } +}; + +struct TakeDeviceHandle { + public: + TakeDeviceHandle(const ApplicationManager& app_mngr) : app_mngr_(app_mngr) {} + std::string operator()(ApplicationSharedPtr& app) { + return MessageHelper::GetDeviceMacAddressForHandle(app->device(), + app_mngr_); + } + + private: + const ApplicationManager& app_mngr_; +}; + +ApplicationSharedPtr ApplicationManagerImpl::application( + const std::string& device_id, const std::string& policy_app_id) const { + connection_handler::DeviceHandle device_handle; + connection_handler().GetDeviceID(device_id, &device_handle); + + DataAccessor accessor = applications(); + ApplicationSharedPtr app = + FindApp(accessor, IsApplication(device_handle, policy_app_id)); + + LOG4CXX_DEBUG(logger_, + " policy_app_id << " << policy_app_id << "Found = " << app); + return app; +} + +std::vector ApplicationManagerImpl::devices( + const std::string& policy_app_id) const { + MobileAppIdPredicate matcher(policy_app_id); + AppSharedPtrs apps = FindAllApps(applications(), matcher); + std::vector devices; + std::transform(apps.begin(), + apps.end(), + std::back_inserter(devices), + TakeDeviceHandle(*this)); + return devices; +} + +bool ApplicationManagerImpl::IsAudioStreamingAllowed( + uint32_t application_key) const { + ApplicationSharedPtr app = application(application_key); + + using namespace mobile_apis::HMILevel; + using namespace helpers; + if (!app) { + LOG4CXX_WARN(logger_, "An application is not registered."); + return false; + } + + return Compare(app->hmi_level(), HMI_FULL, HMI_LIMITED); +} + +bool ApplicationManagerImpl::IsVideoStreamingAllowed( + uint32_t application_key) const { + ApplicationSharedPtr app = application(application_key); + using namespace mobile_apis::HMILevel; + using namespace helpers; + + if (!app) { + LOG4CXX_WARN(logger_, "An application is not registered."); + return false; + } + + LOG4CXX_DEBUG(logger_, "HMILevel: " << app->hmi_level()); + return Compare(app->hmi_level(), HMI_FULL, HMI_LIMITED); +} + +void ApplicationManagerImpl::SubscribeToHMINotification( + const std::string& hmi_notification) { + hmi_handler_->SubscribeToHMINotification(hmi_notification); +} + +void ApplicationManagerImpl::ChangeAppsHMILevel( + uint32_t app_id, mobile_apis::HMILevel::eType level) { + using namespace mobile_apis::HMILevel; + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "AppID to change: " << app_id << " -> " << level); + ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "There is no app with id: " << app_id); + return; + } + eType old_level = app->hmi_level(); + if (old_level != level) { + app->set_hmi_level(level); + OnHMILevelChanged(app_id, old_level, level); + + plugin_manager_.OnAppHMILevelChanged(app, old_level); + } else { + LOG4CXX_WARN(logger_, "Redudant changing HMI level : " << level); + } +} + +void ApplicationManagerImpl::MakeAppNotAudible(uint32_t app_id) { + using namespace mobile_apis; + ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "There is no app with id: " << app_id); + return; + } + ChangeAppsHMILevel(app_id, HMILevel::HMI_BACKGROUND); + app->set_audio_streaming_state(AudioStreamingState::NOT_AUDIBLE); +} + +bool ApplicationManagerImpl::MakeAppFullScreen(uint32_t app_id) { + using namespace mobile_apis; + ApplicationSharedPtr app = application(app_id); + if (!app) { + LOG4CXX_ERROR(logger_, "There is no app with id: " << app_id); + return false; + } + + ChangeAppsHMILevel(app_id, HMILevel::HMI_FULL); + if (app->is_media_application() || app->is_navi()) { + app->set_audio_streaming_state(AudioStreamingState::AUDIBLE); + } + app->set_system_context(SystemContext::SYSCTXT_MAIN); + + if (!app->has_been_activated()) { + app->set_activated(true); + } + + return true; +} + +uint32_t ApplicationManagerImpl::GetDeviceHandle(uint32_t connection_key) { + using namespace connection_handler; + uint32_t device_handle = 0; + connection_handler().GetDataOnSessionKey( + connection_key, 0, NULL, &device_handle); + return device_handle; +} + +void ApplicationManagerImpl::SendPostMessageToMobile( + const MessagePtr& message) { + messages_to_mobile_.PostMessage(impl::MessageToMobile(message, false)); +} + +void ApplicationManagerImpl::SendPostMessageToHMI(const MessagePtr& message) { + messages_to_hmi_.PostMessage(impl::MessageToHmi(message)); +} + +#endif // SDL_REMOTE_CONTROL } // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 63231438f4..74bc0c032e 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -76,6 +76,10 @@ mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) { return mobile_apis::AppHMIType::SYSTEM; } else if ("PROJECTION" == str) { return mobile_apis::AppHMIType::PROJECTION; +#ifdef SDL_REMOTE_CONTROL + } else if ("REMOTE_CONTROL" == str) { + return mobile_apis::AppHMIType::REMOTE_CONTROL; +#endif } else { return mobile_apis::AppHMIType::INVALID_ENUM; } @@ -84,6 +88,9 @@ mobile_apis::AppHMIType::eType StringToAppHMIType(const std::string& str) { std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) { const std::map app_hmi_type_map = {{mobile_apis::AppHMIType::DEFAULT, "DEFAULT"}, +#ifdef SDL_REMOTE_CONTROL + {mobile_apis::AppHMIType::REMOTE_CONTROL, "REMOTE_CONTROL"}, +#endif // SDL_REMOTE_CONTROL {mobile_apis::AppHMIType::COMMUNICATION, "COMMUNICATION"}, {mobile_apis::AppHMIType::MEDIA, "MEDIA"}, {mobile_apis::AppHMIType::MESSAGING, "MESSAGING"}, @@ -673,6 +680,12 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { SendResponse(true, result_code, add_info.c_str(), &response_params); SendOnAppRegisteredNotificationToHMI( *(application.get()), resumption, need_restore_vr); +#ifdef SDL_REMOTE_CONTROL + if (msg_params.keyExists(strings::app_hmi_type)) { + GetPolicyHandler().SetDefaultHmiTypes(application->policy_app_id(), + &(msg_params[strings::app_hmi_type])); + } +#endif // SDL_REMOTE_CONTROL // Default HMI level should be set before any permissions validation, since it // relies on HMI level. diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 7bc676620e..1ceadbdc6e 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -443,6 +443,108 @@ hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult( return HMIResultFromString(result); } +#ifdef SDL_REMOTE_CONTROL +mobile_apis::DeviceRank::eType MessageHelper::StringToDeviceRank( + const std::string& device_rank) { + using namespace NsSmartDeviceLink::NsSmartObjects; + mobile_apis::DeviceRank::eType value; + if (EnumConversionHelper::StringToEnum( + device_rank, &value)) { + return value; + } + return mobile_apis::DeviceRank::INVALID_ENUM; +} + +void MessageHelper::SendHMIStatusNotification( + const Application& application_impl, + ApplicationManager& application_manager) { + LOG4CXX_AUTO_TRACE(logger_); + smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject; + if (!notification) { + LOG4CXX_ERROR(logger_, "Failed to create smart object"); + return; + } + smart_objects::SmartObject& message = *notification; + + message[strings::params][strings::function_id] = + static_cast(mobile_api::FunctionID::OnHMIStatusID); + + message[strings::params][strings::message_type] = + static_cast(application_manager::MessageType::kNotification); + + message[strings::params][strings::connection_key] = + static_cast(application_impl.app_id()); + + message[strings::msg_params][strings::hmi_level] = + static_cast(application_impl.hmi_level()); + + message[strings::msg_params][strings::audio_streaming_state] = + static_cast(application_impl.audio_streaming_state()); + + message[strings::msg_params][strings::system_context] = + static_cast(application_impl.system_context()); + + application_manager.ManageMobileCommand(notification, + commands::Command::ORIGIN_SDL); +} + +void MessageHelper::SendActivateAppToHMI( + uint32_t const app_id, + ApplicationManager& application_manager, + hmi_apis::Common_HMILevel::eType level, + bool send_policy_priority) { + application_manager::ApplicationConstSharedPtr app = + application_manager.application(app_id); + if (!app) { + LOG4CXX_WARN(logger_, "Invalid app_id: " << app_id); + return; + } + + utils::SharedPtr message = + new smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*message)[strings::params][strings::function_id] = + hmi_apis::FunctionID::BasicCommunication_ActivateApp; + (*message)[strings::params][strings::message_type] = MessageType::kRequest; + (*message)[strings::params][strings::correlation_id] = + application_manager.GetNextHMICorrelationID(); + (*message)[strings::msg_params][strings::app_id] = app_id; + + if (send_policy_priority) { + std::string priority; + // TODO(KKolodiy): need remove method policy_manager + + application_manager.GetPolicyHandler().GetPriority(app->policy_app_id(), + &priority); + // According SDLAQ-CRS-2794 + // SDL have to send ActivateApp without "proirity" parameter to HMI. + // in case of unconsented device + std::string mac_adress; + connection_handler::DeviceHandle device_handle = app->device(); + application_manager.connection_handler() + .get_session_observer() + .GetDataOnDeviceID(device_handle, NULL, NULL, &mac_adress, NULL); + + policy::DeviceConsent consent = + application_manager.GetPolicyHandler().GetUserConsentForDevice( + mac_adress); + if (!priority.empty() && + (policy::DeviceConsent::kDeviceAllowed == consent)) { + (*message)[strings::msg_params][strings::priority] = + GetPriorityCode(priority); + } + } + + // We haven't send HMI level to HMI in case it FULL. + if (hmi_apis::Common_HMILevel::INVALID_ENUM != level && + hmi_apis::Common_HMILevel::FULL != level) { + (*message)[strings::msg_params][strings::activate_app_hmi_level] = level; + } + + application_manager.ManageHMICommand(message); +} +#endif // SDL_REMOTE_CONTROL + mobile_apis::HMILevel::eType MessageHelper::StringToHMILevel( const std::string& hmi_level) { using namespace NsSmartDeviceLink::NsSmartObjects; diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index ec8b36477c..49d79dd92e 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -541,6 +541,12 @@ void PolicyHandler::GetAvailableApps(std::queue& apps) { } } +struct SmartObjectToInt { + int operator()(const smart_objects::SmartObject& item) const { + return item.asInt(); + } +}; + StatusNotifier PolicyHandler::AddApplication( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) { @@ -1941,4 +1947,348 @@ bool PolicyHandler::IsUrlAppIdValid(const uint32_t app_idx, return ((is_registered && !is_empty_urls) || is_default); } + +#ifdef SDL_REMOTE_CONTROL + +std::vector PolicyHandler::GetDevicesIds( + const std::string& policy_app_id) { + return application_manager_.devices(policy_app_id); +} + +namespace { +application_manager::TypeAccess ConvertTypeAccess(policy::TypeAccess access) { + application_manager::TypeAccess converted; + switch (access) { + case policy::TypeAccess::kAllowed: + converted = application_manager::TypeAccess::kAllowed; + break; + case policy::TypeAccess::kManual: + converted = application_manager::TypeAccess::kManual; + break; + case policy::TypeAccess::kDisallowed: + converted = application_manager::TypeAccess::kDisallowed; + break; + default: + converted = application_manager::TypeAccess::kNone; + } + return converted; +} +} // namespace + +void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app, + mobile_apis::HMILevel::eType level) { + LOG4CXX_AUTO_TRACE(logger_); + if (app->hmi_level() == mobile_apis::HMILevel::HMI_NONE) { + // If default is FULL, send request to HMI. Notification to mobile will be + // sent on response receiving. + if (mobile_apis::HMILevel::HMI_FULL == level) { + MessageHelper::SendActivateAppToHMI(app->app_id(), application_manager_); + } else { + LOG4CXX_INFO(logger_, + "Changing hmi level of application " + << app->app_id() << " to default hmi level " << level); + // Set application hmi level + application_manager_.ChangeAppsHMILevel(app->app_id(), level); + // If hmi Level is full, it will be seted after ActivateApp response + MessageHelper::SendHMIStatusNotification(*app, application_manager_); + } + } +} + +application_manager::TypeAccess PolicyHandler::CheckAccess( + const PTString& device_id, + const PTString& app_id, + const PTString& module, + const std::string& rpc, + const std::vector& params) { + POLICY_LIB_CHECK(application_manager::TypeAccess::kNone); + policy::TypeAccess access = + policy_manager_->CheckAccess(device_id, app_id, module, rpc, params); + return ConvertTypeAccess(access); +} + +bool PolicyHandler::CheckModule(const PTString& app_id, + const PTString& module) { + POLICY_LIB_CHECK(false); + return policy_manager_->CheckModule(app_id, module); +} + +void PolicyHandler::SetAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + bool allowed) { + POLICY_LIB_CHECK_VOID(); + policy_manager_->SetAccess(device_id, app_id, module, allowed); +} + +void PolicyHandler::ResetAccess(const PTString& device_id, + const PTString& app_id) { + POLICY_LIB_CHECK_VOID(); + policy_manager_->ResetAccess(device_id, app_id); +} + +void PolicyHandler::ResetAccess(const std::string& module) { + POLICY_LIB_CHECK_VOID(); + policy_manager_->ResetAccess(module); +} + +void PolicyHandler::SetPrimaryDevice(const PTString& dev_id) { + using namespace application_manager; + POLICY_LIB_CHECK_VOID(); + PTString old_dev_id = policy_manager_->PrimaryDevice(); + if (dev_id == old_dev_id) { + LOG4CXX_INFO(logger_, "Driver's device has not changed."); + return; + } + policy_manager_->SetPrimaryDevice(dev_id); + + connection_handler::DeviceHandle old_device_handle; + application_manager_.connection_handler().GetDeviceID(old_dev_id, + &old_device_handle); + + connection_handler::DeviceHandle device_handle; + application_manager_.connection_handler().GetDeviceID(dev_id, &device_handle); + + LOG4CXX_DEBUG(logger_, + "Old: " << old_dev_id << "(" << old_device_handle << ")" + << "New: " << dev_id << "(" << device_handle << ")"); + std::map devices; + devices[device_handle] = dev_id; + devices[old_device_handle] = old_dev_id; + DataAccessor accessor = application_manager_.applications(); + for (ApplicationSetConstIt i = accessor.GetData().begin(); + i != accessor.GetData().end(); + ++i) { + const ApplicationSharedPtr app = *i; + LOG4CXX_DEBUG(logger_, + "Item: " << app->device() << " - " << app->policy_app_id()); + if (devices.find(app->device()) != devices.end()) { + LOG4CXX_DEBUG(logger_, + "Send notify " << app->device() << " - " + << app->policy_app_id()); + policy_manager_->OnChangedPrimaryDevice(devices[app->device()], + app->policy_app_id()); + } + } +} + +void PolicyHandler::ResetPrimaryDevice() { + POLICY_LIB_CHECK_VOID(); + PTString old_dev_id = policy_manager_->PrimaryDevice(); + policy_manager_->ResetPrimaryDevice(); + + connection_handler::DeviceHandle old_device_handle; + application_manager_.connection_handler().GetDeviceID(old_dev_id, + &old_device_handle); + + LOG4CXX_DEBUG(logger_, + "Old: " << old_dev_id << "(" << old_device_handle << ")"); + + DataAccessor accessor = application_manager_.applications(); + for (ApplicationSetConstIt i = accessor.GetData().begin(); + i != accessor.GetData().end(); + ++i) { + const ApplicationSharedPtr app = *i; + LOG4CXX_DEBUG(logger_, + "Item: " << app->device() << " - " << app->policy_app_id()); + if (app->device() == old_device_handle) { + LOG4CXX_DEBUG(logger_, + "Send notify " << app->device() << " - " + << app->policy_app_id()); + policy_manager_->OnChangedPrimaryDevice(old_dev_id, app->policy_app_id()); + } + } +} + +uint32_t PolicyHandler::PrimaryDevice() const { + POLICY_LIB_CHECK(0); + PTString device_id = policy_manager_->PrimaryDevice(); + connection_handler::DeviceHandle device_handle; + if (application_manager_.connection_handler().GetDeviceID(device_id, + &device_handle)) { + return device_handle; + } else { + return 0; + } +} + +void PolicyHandler::SetRemoteControl(bool enabled) { + POLICY_LIB_CHECK_VOID(); + policy_manager_->SetRemoteControl(enabled); + + OnRemoteAllowedChanged(enabled); +} + +bool PolicyHandler::GetRemoteControl() const { + POLICY_LIB_CHECK(false); + return policy_manager_->GetRemoteControl(); +} + +void PolicyHandler::OnRemoteAllowedChanged(bool /*new_consent*/) { + POLICY_LIB_CHECK_VOID(); + connection_handler::DeviceHandle device_handle = PrimaryDevice(); + + DataAccessor accessor = application_manager_.applications(); + for (ApplicationSetConstIt i = accessor.GetData().begin(); + i != accessor.GetData().end(); + ++i) { + const ApplicationSharedPtr app = *i; + LOG4CXX_DEBUG(logger_, + "Item: " << app->device() << " - " << app->policy_app_id()); + if (app->device() != device_handle) { + LOG4CXX_DEBUG(logger_, + "Send notify " << app->device() << " - " + << app->policy_app_id()); + std::string mac = MessageHelper::GetDeviceMacAddressForHandle( + app->device(), application_manager_); + policy_manager_->OnChangedRemoteControl(mac, app->policy_app_id()); + } + } +} + +void PolicyHandler::OnRemoteAppPermissionsChanged( + const std::string& device_id, const std::string& application_id) { + POLICY_LIB_CHECK_VOID(); + policy_manager_->SendAppPermissionsChanged(device_id, application_id); +} + +void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) { + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = + application_manager_.application(device_id, policy_app_id); + if (!app) { + LOG4CXX_WARN(logger_, + "Could not find application: " << device_id << " - " + << policy_app_id); + return; + } + mobile_apis::HMILevel::eType level = + MessageHelper::StringToHMILevel(hmi_level); + if (mobile_apis::HMILevel::INVALID_ENUM == level) { + LOG4CXX_WARN(logger_, + "Couldn't convert default hmi level " << hmi_level + << " to enum."); + return; + } + + LOG4CXX_INFO(logger_, + "Changing hmi level of application " + << app->app_id() << " to default hmi level " << level); + // Set application hmi level + application_manager_.ChangeAppsHMILevel(app->app_id(), level); + MessageHelper::SendHMIStatusNotification(*app, application_manager_); +} + +void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level, + const std::string& device_rank) { + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = + application_manager_.application(device_id, policy_app_id); + if (!app) { + LOG4CXX_WARN(logger_, + "Could not find application: " << device_id << " - " + << policy_app_id); + return; + } + mobile_apis::HMILevel::eType level = + MessageHelper::StringToHMILevel(hmi_level); + if (mobile_apis::HMILevel::INVALID_ENUM == level) { + LOG4CXX_WARN(logger_, + "Couldn't convert default hmi level " << hmi_level + << " to enum."); + return; + } + mobile_apis::DeviceRank::eType rank = + MessageHelper::StringToDeviceRank(device_rank); + if (rank == mobile_apis::DeviceRank::INVALID_ENUM) { + LOG4CXX_WARN(logger_, + "Couldn't convert device rank " << device_rank << " to enum."); + return; + } + + if (rank == mobile_apis::DeviceRank::DRIVER) { + MessageHelper::SendHMIStatusNotification(*app, application_manager_); + LOG4CXX_DEBUG(logger_, "Device rank: " << rank); + return; + } + LOG4CXX_INFO(logger_, + "Changing hmi level of application " + << app->app_id() << " to default hmi level " << level); + + // Set application hmi level + application_manager_.ChangeAppsHMILevel(app->app_id(), level); + MessageHelper::SendHMIStatusNotification(*app, application_manager_); +} + +bool PolicyHandler::GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const { + LOG4CXX_AUTO_TRACE(logger_); + POLICY_LIB_CHECK(false); + return policy_manager_->GetModuleTypes(policy_app_id, modules); +} + +void PolicyHandler::SetDefaultHmiTypes( + const std::string& application_id, + const smart_objects::SmartObject* app_types) { + LOG4CXX_AUTO_TRACE(logger_); + POLICY_LIB_CHECK_VOID(); + std::vector hmi_types; + if (app_types && app_types->asArray()) { + smart_objects::SmartArray* hmi_list = app_types->asArray(); + std::transform(hmi_list->begin(), + hmi_list->end(), + std::back_inserter(hmi_types), + SmartObjectToInt()); + } + policy_manager_->SetDefaultHmiTypes(application_id, hmi_types); +} + +bool PolicyHandler::CheckHMIType(const std::string& application_id, + mobile_apis::AppHMIType::eType hmi, + const smart_objects::SmartObject* app_types) { + LOG4CXX_AUTO_TRACE(logger_); + POLICY_LIB_CHECK(false); + std::vector policy_hmi_types; + bool ret = policy_manager_->GetHMITypes(application_id, &policy_hmi_types); + + std::vector additional_hmi_types; + if (app_types && app_types->asArray()) { + smart_objects::SmartArray* hmi_list = app_types->asArray(); + std::transform(hmi_list->begin(), + hmi_list->end(), + std::back_inserter(additional_hmi_types), + SmartObjectToInt()); + } + const std::vector& hmi_types = + ret ? policy_hmi_types : additional_hmi_types; + return std::find(hmi_types.begin(), hmi_types.end(), hmi) != hmi_types.end(); +} + +void PolicyHandler::OnUpdateHMILevel(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) { + LOG4CXX_AUTO_TRACE(logger_); + ApplicationSharedPtr app = + application_manager_.application(device_id, policy_app_id); + if (!app) { + LOG4CXX_WARN(logger_, + "Could not find application: " << device_id << " - " + << policy_app_id); + return; + } + mobile_apis::HMILevel::eType level = + MessageHelper::StringToHMILevel(hmi_level); + if (mobile_apis::HMILevel::INVALID_ENUM == level) { + LOG4CXX_WARN(logger_, + "Couldn't convert default hmi level " << hmi_level + << " to enum."); + return; + } + UpdateHMILevel(app, level); +} +#endif // SDL_REMOTE_CONTROL } // namespace policy diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 75d324699c..7294b4c1a2 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -140,6 +140,7 @@ const char* system_capabilities = "systemCapabilities"; const char* navigation_capability = "navigationCapability"; const char* phone_capability = "phoneCapability"; const char* video_streaming_capability = "videoStreamingCapability"; +const char* device_rank = "deviceRank"; // PutFile const char* sync_file_name = "syncFileName"; diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt index 579fa787b9..089f8fd25e 100644 --- a/src/components/application_manager/test/CMakeLists.txt +++ b/src/components/application_manager/test/CMakeLists.txt @@ -45,11 +45,11 @@ include_directories( ${COMPONENTS_DIR}/resumption/include/ ${COMPONENTS_DIR}/utils/include/ ${POLICY_PATH}/include/ + ${COMPONENTS_DIR}/policy/policy_regular/test/include ${POLICY_PATH}/policy/test/include/ ${POLICY_MOCK_INCLUDE_PATH}/ ${COMPONENTS_DIR}/media_manager/include/ ${COMPONENTS_DIR}/security_manager/include/ - ${COMPONENTS_DIR}/policy/test/include/ ${COMPONENTS_DIR}/application_manager/test/include/ ${BSON_INCLUDE_DIRECTORY} ) @@ -73,6 +73,10 @@ set(testSources ) +if(REMOTE_CONTROL) + list(APPEND testSources ${AM_TEST_DIR}/rc_policy_handler_test.cc) +endif(REMOTE_CONTROL) + set (RequestController_SOURCES ${AM_TEST_DIR}/request_controller/request_controller_test.cc ${AM_TEST_DIR}/mock_message_helper.cc diff --git a/src/components/application_manager/test/include/application_manager/mock_application.h b/src/components/application_manager/test/include/application_manager/mock_application.h index 7702403cbe..c24e4590f5 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application.h +++ b/src/components/application_manager/test/include/application_manager/mock_application.h @@ -34,6 +34,7 @@ #include #include "gmock/gmock.h" #include "application_manager/application.h" +#include "application_manager/app_extension.h" #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "application_manager/usage_statistics.h" @@ -280,12 +281,41 @@ class MockApplication : public ::application_manager::Application { MOCK_CONST_METHOD0(bundle_id, const std::string&()); MOCK_METHOD1(set_bundle_id, void(const std::string& bundle_id)); MOCK_METHOD0(GetAvailableDiskSpace, uint32_t()); + MOCK_METHOD1(set_mobile_app_id, void(const std::string& policy_app_id)); MOCK_CONST_METHOD0(is_foreground, bool()); MOCK_METHOD1(set_foreground, void(bool is_foreground)); MOCK_CONST_METHOD0(IsRegistered, bool()); MOCK_CONST_METHOD0(SchemaUrl, std::string()); MOCK_CONST_METHOD0(PackageName, std::string()); + +#ifdef SDL_REMOTE_CONTROL + MOCK_METHOD1( + set_system_context, + void(const application_manager::mobile_api::SystemContext::eType&)); + MOCK_METHOD1( + set_audio_streaming_state, + void(const application_manager::mobile_api::AudioStreamingState::eType& + state)); + MOCK_METHOD1(IsSubscribedToInteriorVehicleData, + bool(smart_objects::SmartObject module)); + MOCK_METHOD1(SubscribeToInteriorVehicleData, + bool(smart_objects::SmartObject module)); + MOCK_METHOD1(UnsubscribeFromInteriorVehicleData, + bool(smart_objects::SmartObject module)); + MOCK_METHOD1( + set_hmi_level, + void(const application_manager::mobile_api::HMILevel::eType& hmi_level)); + MOCK_METHOD1(QueryInterface, + application_manager::AppExtensionPtr( + application_manager::AppExtensionUID uid)); + MOCK_METHOD1(AddExtension, + bool(application_manager::AppExtensionPtr extention)); + MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid)); + MOCK_METHOD0(RemoveExtensions, void()); + MOCK_CONST_METHOD0(SubscribesIVI, const std::set&()); + +#endif // SDL_REMOTE_CONTROL }; } // namespace application_manager_test diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h index 4499605f5a..04dc7e1df8 100644 --- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h +++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h @@ -113,7 +113,16 @@ class MockMessageHelper { uint32_t correlation_id, ApplicationManager& app_mngr)); MOCK_METHOD1(SendGetSystemInfoRequest, void(ApplicationManager& app_mngr)); - + MOCK_METHOD4(SendActivateAppToHMI, + void(uint32_t const app_id, + ApplicationManager& application_manager, + hmi_apis::Common_HMILevel::eType level, + bool send_policy_priority)); + MOCK_METHOD2(SendHMIStatusNotification, + void(const Application& application_impl, + ApplicationManager& application_manager)); + MOCK_METHOD1(StringToDeviceRank, + mobile_api::DeviceRank::eType(const std::string& device_rank)); MOCK_METHOD4(SendPolicyUpdate, void(const std::string& file_path, const uint32_t timeout, diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc index 3039e1f677..e52a8f53ac 100644 --- a/src/components/application_manager/test/mock_message_helper.cc +++ b/src/components/application_manager/test/mock_message_helper.cc @@ -33,6 +33,8 @@ #include "application_manager/message_helper.h" #include "application_manager/mock_message_helper.h" #include "application_manager/policies/policy_handler_interface.h" +#include "gtest/gtest.h" +#include "gmock/gmock.h" namespace application_manager { @@ -227,6 +229,30 @@ void MessageHelper::SendPolicyUpdate(const std::string& file_path, file_path, timeout, retries, app_mngr); } +#ifdef SDL_REMOTE_CONTROL +void MessageHelper::SendActivateAppToHMI( + uint32_t const app_id, + ApplicationManager& application_manager, + hmi_apis::Common_HMILevel::eType level, + bool send_policy_priority) { + MockMessageHelper::message_helper_mock()->SendActivateAppToHMI( + app_id, application_manager, level, send_policy_priority); +} + +void MessageHelper::SendHMIStatusNotification( + const Application& application_impl, + ApplicationManager& application_manager) { + MockMessageHelper::message_helper_mock()->SendHMIStatusNotification( + application_impl, application_manager); +} + +mobile_api::DeviceRank::eType MessageHelper::StringToDeviceRank( + const std::string& device_rank) { + return MockMessageHelper::message_helper_mock()->StringToDeviceRank( + device_rank); +} +#endif // SDL_REMOTE_CONTROL + void MessageHelper::SendUpdateSDLResponse(const std::string& result, uint32_t correlation_id, ApplicationManager& app_mngr) { @@ -247,7 +273,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO( } MockMessageHelper* MockMessageHelper::message_helper_mock() { - static MockMessageHelper message_helper_mock; + static ::testing::NiceMock message_helper_mock; return &message_helper_mock; } void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp( diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc new file mode 100644 index 0000000000..0a50dd230f --- /dev/null +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -0,0 +1,643 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include +#include +#include +#include "gmock/gmock.h" + +#include "application_manager/policies/policy_handler.h" +#include "application_manager/policies/delegates/app_permission_delegate.h" +#include "policy/mock_cache_manager.h" +#include "application_manager/mock_message_helper.h" +#include "connection_handler/mock_connection_handler_settings.h" +#include "policy/policy_types.h" +#include "policy/access_remote.h" +#include "json/reader.h" +#include "json/writer.h" +#include "json/value.h" +#include "smart_objects/smart_object.h" +#include "utils/make_shared.h" +#include "utils/custom_string.h" +#include "interfaces/MOBILE_API.h" +#include "policy/mock_policy_settings.h" +#include "application_manager/mock_application.h" +#include "policy/usage_statistics/mock_statistics_manager.h" +#include "protocol_handler/mock_session_observer.h" +#include "connection_handler/mock_connection_handler.h" +#include "application_manager/mock_application_manager.h" +#include "application_manager/policies/mock_policy_handler_observer.h" +#include "application_manager/mock_event_dispatcher.h" +#include "policy/mock_policy_manager.h" + +namespace test { +namespace components { +namespace rc_policy_handler_test { + +using namespace application_manager; +using namespace policy; +using namespace utils::custom_string; +using testing::_; +using ::testing::Mock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::NiceMock; +using ::testing::DoAll; +using ::testing::SetArgPointee; + +class RCPolicyHandlerTest : public ::testing::Test { + public: + RCPolicyHandlerTest() + : policy_handler_(policy_settings_, app_manager_) + , kPolicyAppId_("fake_app_id") + , kMacAddr_("kMacAddr_ess") + , kDeviceId_("fake_device_id") + , kHmiLevel_("NONE") + , default_hmi_("fake_hmi") + , app_set(test_app, app_lock) + , kAppId1_(10u) + , kAppId2_(11u) + , kConnectionKey_(1u) + , kCorrelationKey_(2u) + , kUrl_("test_url") + , mock_message_helper_(*MockMessageHelper::message_helper_mock()) {} + + protected: + NiceMock policy_settings_; + utils::SharedPtr mock_app_; + connection_handler_test::MockConnectionHandler conn_handler; + protocol_handler_test::MockSessionObserver mock_session_observer; + components::usage_statistics_test::MockStatisticsManager + mock_statistics_manager_; + PolicyHandler policy_handler_; + utils::SharedPtr mock_policy_manager_; + application_manager_test::MockApplicationManager app_manager_; + const std::string kPolicyAppId_; + const std::string kMacAddr_; + const std::string kDeviceId_; + const std::string kHmiLevel_; + std::string default_hmi_; + ApplicationSet test_app; + sync_primitives::Lock app_lock; + DataAccessor app_set; + const uint32_t kAppId1_; + const uint32_t kAppId2_; + const uint32_t kConnectionKey_; + const uint32_t kCorrelationKey_; + const std::string kUrl_; + application_manager::MockMessageHelper& mock_message_helper_; + + virtual void SetUp() OVERRIDE { + Mock::VerifyAndClearExpectations(&mock_message_helper_); + ON_CALL(app_manager_, applications()).WillByDefault(Return(app_set)); + ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true)); + mock_policy_manager_ = + utils::MakeShared(); + ASSERT_TRUE(mock_policy_manager_.valid()); + + ON_CALL(app_manager_, connection_handler()) + .WillByDefault(ReturnRef(conn_handler)); + ON_CALL(conn_handler, get_session_observer()) + .WillByDefault(ReturnRef(mock_session_observer)); + + mock_app_ = utils::MakeShared(); + } + + virtual void TearDown() OVERRIDE { + Mock::VerifyAndClearExpectations(&mock_message_helper_); + } + + void ChangePolicyManagerToMock() { + policy_handler_.SetPolicyManager(mock_policy_manager_); + } + + void EnablePolicy() { + ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true)); + } + + void EnablePolicyAndPolicyManagerMock() { + EnablePolicy(); + ChangePolicyManagerToMock(); + } +}; + +TEST_F(RCPolicyHandlerTest, + SendMessageToSDK_RemoteControlInvalidMobileAppId_UNSUCCESS) { + // Precondition + BinaryMessage msg; + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set)); + test_app.insert(mock_app_); + + ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId1_)); + ON_CALL(*mock_app_, hmi_level()) + .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL)); + EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true)); + + EXPECT_CALL(app_manager_, application(kAppId1_)) + .WillRepeatedly(Return(mock_app_)); + const std::string empty_mobile_app_id(""); + EXPECT_CALL(*mock_app_, policy_app_id()) + .WillOnce(Return(empty_mobile_app_id)); + + EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_)) + .WillOnce(Return(kDeviceAllowed)); + + EXPECT_CALL(mock_message_helper_, SendPolicySnapshotNotification(_, _, _, _)) + .Times(0); + EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, kUrl_)); +} + +TEST_F(RCPolicyHandlerTest, SendMessageToSDK_RemoteControl_SUCCESS) { + BinaryMessage msg; + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set)); + test_app.insert(mock_app_); + + ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId1_)); + ON_CALL(*mock_app_, hmi_level()) + .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL)); + EXPECT_CALL(*mock_app_, IsRegistered()).WillOnce(Return(true)); + + EXPECT_CALL(app_manager_, application(kAppId1_)) + .WillRepeatedly(Return(mock_app_)); + + EXPECT_CALL(*mock_app_, policy_app_id()).WillOnce(Return(kPolicyAppId_)); + + EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_)) + .WillOnce(Return(kDeviceAllowed)); + + EXPECT_CALL(mock_message_helper_, + SendPolicySnapshotNotification(kAppId1_, _, kUrl_, _)); + EXPECT_TRUE(policy_handler_.SendMessageToSDK(msg, kUrl_)); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidApp_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + utils::SharedPtr invalid_app; + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(invalid_app)); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(_)).Times(0); + + const std::string hmi_level("HMI_FULL"); + policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidHmiLevel_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("INVALID_ENUM"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM)); + + policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_HmiLevelFull_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("HMI_FULL"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL)); + + EXPECT_CALL(*mock_app_, hmi_level()) + .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId1_)); + EXPECT_CALL(mock_message_helper_, SendActivateAppToHMI(kAppId1_, _, _, _)); + + policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_HmiLevelChanged_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("HMI_LIMITED"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::HMI_LIMITED)); + + EXPECT_CALL(*mock_app_, hmi_level()) + .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_)); + + EXPECT_CALL(app_manager_, + ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_LIMITED)); + + EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _)); + + policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level); +} + +TEST_F(RCPolicyHandlerTest, CheckAccess_ValidParams_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + const PTString module("module"); + const PTString pt_rpc("rpc"); + const std::vector params; + + EXPECT_CALL(*mock_policy_manager_, + CheckAccess(kDeviceId_, kPolicyAppId_, module, pt_rpc, _)) + .WillOnce(Return(policy::TypeAccess::kDisallowed)); + EXPECT_EQ(application_manager::TypeAccess::kDisallowed, + policy_handler_.CheckAccess( + kDeviceId_, kPolicyAppId_, module, pt_rpc, params)); + + EXPECT_CALL(*mock_policy_manager_, + CheckAccess(kDeviceId_, kPolicyAppId_, module, pt_rpc, _)) + .WillOnce(Return(policy::TypeAccess::kAllowed)); + + EXPECT_EQ(application_manager::TypeAccess::kAllowed, + policy_handler_.CheckAccess( + kDeviceId_, kPolicyAppId_, module, pt_rpc, params)); + + EXPECT_CALL(*mock_policy_manager_, + CheckAccess(kDeviceId_, kPolicyAppId_, module, pt_rpc, _)) + .WillOnce(Return(policy::TypeAccess::kManual)); + EXPECT_EQ(application_manager::TypeAccess::kManual, + policy_handler_.CheckAccess( + kDeviceId_, kPolicyAppId_, module, pt_rpc, params)); +} + +TEST_F(RCPolicyHandlerTest, SetAccess_ValidParams_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + const PTString module("module"); + const bool allowed(true); + EXPECT_CALL(*mock_policy_manager_, + SetAccess(kDeviceId_, kPolicyAppId_, module, allowed)); + + policy_handler_.SetAccess(kDeviceId_, kPolicyAppId_, module, allowed); +} + +TEST_F(RCPolicyHandlerTest, ResetAccess_ValidParams_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(*mock_policy_manager_, ResetAccess(kDeviceId_, kPolicyAppId_)); + + policy_handler_.ResetAccess(kDeviceId_, kPolicyAppId_); +} + +TEST_F(RCPolicyHandlerTest, ResetAccess_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + const PTString module("module"); + EXPECT_CALL(*mock_policy_manager_, ResetAccess(module)); + + policy_handler_.ResetAccess(module); +} + +TEST_F(RCPolicyHandlerTest, CheckModule_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + const PTString module("module"); + EXPECT_CALL(*mock_policy_manager_, CheckModule(kPolicyAppId_, module)) + .WillOnce(Return(true)); + + EXPECT_TRUE(policy_handler_.CheckModule(kPolicyAppId_, module)); +} + +TEST_F(RCPolicyHandlerTest, SetPrimaryDevice_EqualDeviceId_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) + .WillOnce(Return(kDeviceId_)); + + policy_handler_.SetPrimaryDevice(kDeviceId_); +} + +ACTION_P(SetDeviceHandle, handle) { + *arg1 = handle; +} + +TEST_F(RCPolicyHandlerTest, SetPrimaryDevice_DifferentSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + const PTString old_device_id("00:00:00:00:00:01"); + + EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) + .WillOnce(Return(old_device_id)); + EXPECT_CALL(*mock_policy_manager_, SetPrimaryDevice(kDeviceId_)); + + connection_handler::DeviceHandle old_device_handle(1u); + EXPECT_CALL(conn_handler, GetDeviceID(old_device_id, _)) + .WillOnce(DoAll(SetDeviceHandle(old_device_handle), Return(true))); + + connection_handler::DeviceHandle device_handle(2u); + EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) + .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(true))); + + test_app.insert(mock_app_); + EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set)); + + EXPECT_CALL(*mock_app_, device()) + .WillOnce(Return(device_handle)) + .WillOnce(Return(device_handle)); + EXPECT_CALL(*mock_app_, policy_app_id()) + .WillRepeatedly(Return(kPolicyAppId_)); + + EXPECT_CALL(*mock_policy_manager_, + OnChangedPrimaryDevice(kDeviceId_, kPolicyAppId_)); + + policy_handler_.SetPrimaryDevice(kDeviceId_); +} + +TEST_F(RCPolicyHandlerTest, ResetPrimaryDevice_DifferenrDevIds_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) + .WillOnce(Return(kMacAddr_)); + EXPECT_CALL(*mock_policy_manager_, ResetPrimaryDevice()); + + connection_handler::DeviceHandle old_device_handle(1u); + EXPECT_CALL(conn_handler, GetDeviceID(kMacAddr_, _)) + .WillOnce(DoAll(SetDeviceHandle(old_device_handle), Return(true))); + + test_app.insert(mock_app_); + EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set)); + + EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(old_device_handle)); + EXPECT_CALL(*mock_app_, policy_app_id()) + .WillRepeatedly(Return(kPolicyAppId_)); + + EXPECT_CALL(*mock_policy_manager_, + OnChangedPrimaryDevice(kMacAddr_, kPolicyAppId_)); + + policy_handler_.ResetPrimaryDevice(); +} + +TEST_F(RCPolicyHandlerTest, PrimaryDevice_ValidDeviceHandle_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) + .WillOnce(Return(kDeviceId_)); + + connection_handler::DeviceHandle device_handle(1u); + EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) + .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(true))); + + EXPECT_EQ(device_handle, policy_handler_.PrimaryDevice()); +} + +TEST_F(RCPolicyHandlerTest, PrimaryDevice_GetDeviceIdFalse_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + + EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) + .WillOnce(Return(kDeviceId_)); + + connection_handler::DeviceHandle device_handle(1u); + EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) + .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(false))); + + EXPECT_EQ(0u, policy_handler_.PrimaryDevice()); +} + +TEST_F(RCPolicyHandlerTest, GetRemoteControl_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(*mock_policy_manager_, GetRemoteControl()).WillOnce(Return(true)); + + EXPECT_TRUE(policy_handler_.GetRemoteControl()); +} + +TEST_F(RCPolicyHandlerTest, SetRemoteControl_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + const bool enabled(true); + EXPECT_CALL(*mock_policy_manager_, SetRemoteControl(enabled)); + + EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) + .WillOnce(Return(kDeviceId_)); + + connection_handler::DeviceHandle device_handle(1u); + EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) + .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(true))); + + test_app.insert(mock_app_); + EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set)); + + connection_handler::DeviceHandle app_device_handle(2u); + EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(app_device_handle)); + EXPECT_CALL(*mock_app_, policy_app_id()) + .WillRepeatedly(Return(kPolicyAppId_)); + + EXPECT_CALL(mock_message_helper_, + GetDeviceMacAddressForHandle(app_device_handle, _)) + .WillOnce(Return(kMacAddr_)); + + EXPECT_CALL(*mock_policy_manager_, + OnChangedRemoteControl(kMacAddr_, kPolicyAppId_)); + + policy_handler_.SetRemoteControl(enabled); +} + +TEST_F(RCPolicyHandlerTest, + OnRemoteAppPermissionsChanged_DifferentDeviceHandle_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(*mock_policy_manager_, + SendAppPermissionsChanged(kDeviceId_, kPolicyAppId_)); + + policy_handler_.OnRemoteAppPermissionsChanged(kDeviceId_, kPolicyAppId_); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_InvalidApp_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + utils::SharedPtr invalid_app; + EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(invalid_app)); + EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); + + const std::string hmi_level("HMI_NONE"); + policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_HmiLevelInvalidEnum_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("INVALID_ENUM"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM)); + + EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); + + policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_ValidAppAndHmiLevel_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("HMI_NONE"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + + EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_)); + + EXPECT_CALL(app_manager_, + ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_NONE)); + EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _)); + + policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatusFourParams_InvalidApp_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + utils::SharedPtr invalid_app; + EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(invalid_app)); + EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); + + const std::string hmi_level("HMI_NONE"); + const std::string device_rank("INVALID_ENUM"); + policy_handler_.OnUpdateHMIStatus( + kDeviceId_, kPolicyAppId_, hmi_level, device_rank); +} + +TEST_F(RCPolicyHandlerTest, + OnUpdateHMIStatusFourParams_HmiLevelInvalidEnum_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("INVALID_ENUM"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM)); + + EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); + const std::string device_rank("INVALID_ENUM"); + policy_handler_.OnUpdateHMIStatus( + kDeviceId_, kPolicyAppId_, hmi_level, device_rank); +} + +TEST_F(RCPolicyHandlerTest, + OnUpdateHMIStatusFourParams_DeviceRankInvalidEnum_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("HMI_NONE"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + + const std::string device_rank("INVALID_ENUM"); + EXPECT_CALL(mock_message_helper_, StringToDeviceRank(device_rank)) + .WillOnce(Return(mobile_apis::DeviceRank::INVALID_ENUM)); + + EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); + policy_handler_.OnUpdateHMIStatus( + kDeviceId_, kPolicyAppId_, hmi_level, device_rank); +} + +TEST_F(RCPolicyHandlerTest, + OnUpdateHMIStatusFourParams_DeviceRankDriver_UNSUCCESS) { + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("HMI_NONE"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + + const std::string device_rank("DRIVER"); + EXPECT_CALL(mock_message_helper_, StringToDeviceRank(device_rank)) + .WillOnce(Return(mobile_apis::DeviceRank::DRIVER)); + EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _)); + + EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); + policy_handler_.OnUpdateHMIStatus( + kDeviceId_, kPolicyAppId_, hmi_level, device_rank); +} + +TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatusFourParams_ValidParams_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) + .WillOnce(Return(mock_app_)); + + const std::string hmi_level("HMI_NONE"); + EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) + .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); + + const std::string device_rank("PASSENGER"); + EXPECT_CALL(mock_message_helper_, StringToDeviceRank(device_rank)) + .WillOnce(Return(mobile_apis::DeviceRank::PASSENGER)); + + EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_)); + EXPECT_CALL(app_manager_, + ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_NONE)); + EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _)); + + policy_handler_.OnUpdateHMIStatus( + kDeviceId_, kPolicyAppId_, hmi_level, device_rank); +} + +TEST_F(RCPolicyHandlerTest, GetModuleTypes_GetModuleTypes_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + std::vector modules; + + EXPECT_CALL(*mock_policy_manager_, GetModuleTypes(kPolicyAppId_, &modules)) + .WillOnce(Return(true)); + + EXPECT_TRUE(policy_handler_.GetModuleTypes(kPolicyAppId_, &modules)); +} + +TEST_F(RCPolicyHandlerTest, CheckHMIType_ValidTypes_SUCCESS) { + EnablePolicyAndPolicyManagerMock(); + mobile_apis::AppHMIType::eType hmi = mobile_apis::AppHMIType::MEDIA; + + const smart_objects::SmartObjectSPtr app_types = + utils::MakeShared( + smart_objects::SmartType_Array); + (*app_types)[strings::app_hmi_type][0] = mobile_apis::AppHMIType::MEDIA; + (*app_types)[strings::app_hmi_type][1] = + mobile_apis::AppHMIType::BACKGROUND_PROCESS; + + std::vector policy_hmi_types; + policy_hmi_types.push_back(mobile_apis::AppHMIType::MEDIA); + policy_hmi_types.push_back(mobile_apis::AppHMIType::BACKGROUND_PROCESS); + + EXPECT_CALL(*mock_policy_manager_, GetHMITypes(kPolicyAppId_, _)) + .WillOnce(DoAll(SetArgPointee<1>(policy_hmi_types), Return(true))); + + EXPECT_TRUE(policy_handler_.CheckHMIType( + kPolicyAppId_, hmi, &(*app_types.get())[strings::app_hmi_type])); +} + +} // namespace rc_policy_handler_test +} // namespace components +} // namespace test diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc index 39cae7ea76..853b5992c6 100644 --- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc +++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -116,6 +116,7 @@ void MessageBrokerAdapter::SubscribeTo() { MessageBrokerController::subscribeTo("VR.OnLanguageChange"); MessageBrokerController::subscribeTo("TTS.OnLanguageChange"); MessageBrokerController::subscribeTo("VehicleInfo.OnVehicleData"); + MessageBrokerController::subscribeTo("VehicleInfo.OnReverseAppsAllowing"); MessageBrokerController::subscribeTo("Navigation.OnTBTClientState"); MessageBrokerController::subscribeTo("Navigation.OnWayPointChange"); MessageBrokerController::subscribeTo("TTS.Started"); @@ -135,9 +136,18 @@ void MessageBrokerAdapter::SubscribeTo() { MessageBrokerController::subscribeTo("SDL.OnDeviceStateChanged"); MessageBrokerController::subscribeTo("SDL.OnPolicyUpdate"); MessageBrokerController::subscribeTo("BasicCommunication.OnEventChanged"); + MessageBrokerController::subscribeTo("RC.OnDeviceRankChanged"); + MessageBrokerController::subscribeTo("RC.OnInteriorVehicleData"); + MessageBrokerController::subscribeTo("RC.OnRemoteControlSettings"); LOG4CXX_INFO(logger_, "Subscribed to notifications."); } +#ifdef SDL_REMOTE_CONTROL +void MessageBrokerAdapter::SubscribeToHMINotification( + const std::string& hmi_notification) { + MessageBrokerController::subscribeTo(hmi_notification); +} +#endif void* MessageBrokerAdapter::SubscribeAndBeginReceiverThread(void* param) { PassToThread(threads::Thread::CurrentId()); diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index 7875c12ff5..e275d67f74 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -49,6 +49,9 @@ #include "application_manager/state_controller.h" #include "application_manager/hmi_interfaces.h" #include "policy/policy_types.h" +#ifdef SDL_REMOTE_CONTROL +#include "functional_module/plugin_manager.h" +#endif namespace resumption { class LastState; @@ -85,6 +88,7 @@ class Application; class StateControllerImpl; struct CommandParametersPermissions; using policy::RPCParams; +typedef std::vector AppSharedPtrs; struct ApplicationsAppIdSorter { bool operator()(const ApplicationSharedPtr lhs, const ApplicationSharedPtr rhs) const { @@ -153,9 +157,40 @@ class ApplicationManager { virtual ApplicationSharedPtr application_by_policy_id( const std::string& policy_app_id) const = 0; - virtual std::vector applications_by_button( - uint32_t button) = 0; - virtual std::vector applications_with_navi() = 0; + virtual AppSharedPtrs applications_by_button(uint32_t button) = 0; + virtual AppSharedPtrs applications_with_navi() = 0; + +#ifdef SDL_REMOTE_CONTROL + virtual ApplicationSharedPtr application( + const std::string& device_id, const std::string& policy_app_id) const = 0; + + virtual void SubscribeToHMINotification( + const std::string& hmi_notification) = 0; + + virtual uint32_t GetDeviceHandle(uint32_t connection_key) = 0; + + /** + * @brief Checks HMI level and returns true if audio streaming is allowed + */ + virtual bool IsAudioStreamingAllowed(uint32_t connection_key) const = 0; + + /** + * @brief Checks HMI level and returns true if video streaming is allowed + */ + virtual bool IsVideoStreamingAllowed(uint32_t connection_key) const = 0; + + virtual void ChangeAppsHMILevel(uint32_t app_id, + mobile_apis::HMILevel::eType level) = 0; + + virtual std::vector devices( + const std::string& policy_app_id) const = 0; + + virtual void SendPostMessageToMobile(const MessagePtr& message) = 0; + + virtual void SendPostMessageToHMI(const MessagePtr& message) = 0; + + virtual functional_modules::PluginManager& GetPluginManager() = 0; +#endif // SDL_REMOTE_CONTROL virtual std::vector applications_with_mobile_projection() = 0; @@ -264,9 +299,16 @@ class ApplicationManager { virtual void SendMessageToHMI(const commands::MessageSharedPtr message) = 0; + virtual void RemoveHMIFakeParameters( + application_manager::MessagePtr& message) = 0; + virtual bool ManageHMICommand(const commands::MessageSharedPtr message) = 0; virtual bool ManageMobileCommand(const commands::MessageSharedPtr message, commands::Command::CommandOrigin origin) = 0; + + virtual MessageValidationResult ValidateMessageBySchema( + const Message& message) = 0; + virtual mobile_api::HMILevel::eType GetDefaultHmiLevel( ApplicationConstSharedPtr application) const = 0; /** @@ -340,8 +382,8 @@ class ApplicationManager { * @param vehicle_info Enum value of type of vehicle data * @param new value (for integer values currently) of vehicle data */ - virtual std::vector IviInfoUpdated( - VehicleDataType vehicle_info, int value) = 0; + virtual AppSharedPtrs IviInfoUpdated(VehicleDataType vehicle_info, + int value) = 0; virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr< smart_objects::SmartObject>& request_for_registration) = 0; @@ -609,6 +651,11 @@ class ApplicationManager { virtual const ApplicationManagerSettings& get_settings() const = 0; virtual event_engine::EventDispatcher& event_dispatcher() = 0; + + virtual uint32_t GetAvailableSpaceForApp(const std::string& folder_name) = 0; + virtual void OnTimerSendTTSGlobalProperties() = 0; + virtual void OnLowVoltage() = 0; + virtual void OnWakeUp() = 0; }; } // namespace application_manager diff --git a/src/components/include/application_manager/application_manager_settings.h b/src/components/include/application_manager/application_manager_settings.h index fa01b34783..415cc57d17 100644 --- a/src/components/include/application_manager/application_manager_settings.h +++ b/src/components/include/application_manager/application_manager_settings.h @@ -93,6 +93,7 @@ class ApplicationManagerSettings : public RequestControlerSettings, virtual const uint32_t& app_icons_folder_max_size() const = 0; virtual const uint32_t& app_icons_amount_to_remove() const = 0; virtual const uint32_t& list_files_response_size() const = 0; + virtual const std::string& plugins_folder() const = 0; }; } // namespace application_manager diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index a1c45c0bd6..5f7b6c5833 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -40,6 +40,7 @@ #include #include "interfaces/MOBILE_API.h" #include "application_manager/policies/policy_handler_observer.h" +#include "application_manager/core_service.h" #include "application_manager/application.h" #include "policy/usage_statistics/statistics_manager.h" #include "utils/custom_string.h" @@ -416,6 +417,160 @@ class PolicyHandlerInterface { virtual const PolicySettings& get_settings() const = 0; virtual const std::string RemoteAppsUrl() const = 0; +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Sets HMI default type for specified application + * @param application_id ID application + * @param app_types list of HMI types + */ + virtual void SetDefaultHmiTypes( + const std::string& application_id, + const smart_objects::SmartObject* app_types) = 0; + + /** + * Checks if application has HMI type + * @param application_id ID application + * @param hmi HMI type to check + * @param app_types additional list of HMI type to search in it + * @return true if hmi is contained in policy or app_types + */ + virtual bool CheckHMIType(const std::string& application_id, + mobile_apis::AppHMIType::eType hmi, + const smart_objects::SmartObject* app_types) = 0; + + /** + * Notifies about changing HMI level + * @param device_id unique identifier of device + * @param policy_app_id unique identifier of application in policy + * @param hmi_level default HMI level for this application + */ + virtual void OnUpdateHMILevel(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) = 0; + + /** + * Checks access to equipment of vehicle for application by RPC + * @param device_id unique identifier of device + * @param app_id policy id application + * @param module type + * @param rpc name of rpc + * @param params parameters list + */ + virtual application_manager::TypeAccess CheckAccess( + const PTString& device_id, + const PTString& app_id, + const PTString& module, + const std::string& rpc, + const std::vector& params) = 0; + + /** + * Checks access to module for application + * @param app_id policy id application + * @param module + * @return true if module is allowed for application + */ + virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; + + /** + * Sets access to equipment of vehicle for application by RPC + * @param device_id unique identifier of device + * @param app_id policy id application + * @param module type + * @param allowed true if access is allowed + */ + virtual void SetAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + bool allowed) = 0; + + /** + * Resets access application to all resources + * @param device_id unique identifier of device + * @param app_id policy id application + */ + virtual void ResetAccess(const PTString& device_id, + const PTString& app_id) = 0; + + /** + * Resets access by group name for all applications + * @param module type + */ + virtual void ResetAccess(const std::string& module) = 0; + + /** + * Sets device as primary device + * @param dev_id ID device + */ + virtual void SetPrimaryDevice(const PTString& dev_id) = 0; + + /** + * Resets driver's device + */ + virtual void ResetPrimaryDevice() = 0; + + /** + * Return id of primary device + */ + virtual uint32_t PrimaryDevice() const = 0; + + /** + * Sets mode of remote control (on/off) + * @param enabled true if remote control is turned on + */ + virtual void SetRemoteControl(bool enabled) = 0; + + /** + * @brief If remote control is enabled + * by User and by Policy + */ + virtual bool GetRemoteControl() const = 0; + + /** + * @brief Notifies passengers' apps about change + * @param new_consent New value of remote permission + */ + virtual void OnRemoteAllowedChanged(bool new_consent) = 0; + + /** + * @brief Notifies Remote apps about change in permissions + * @param device_id Device on which app is running + * @param application_id ID of app whose permissions are changed + */ + virtual void OnRemoteAppPermissionsChanged( + const std::string& device_id, const std::string& application_id) = 0; + + /** + * @brief Notifies Remote apps about change in HMI status + * @param device_id Device on which app is running + * @param policy_app_id ID of application + * @param hmi_level new HMI level for this application + */ + virtual void OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) = 0; + + /** + * @brief Notifies Remote apps about change in HMI status + * @param device_id Device on which app is running + * @param policy_app_id ID of application + * @param hmi_level new HMI level for this application + * @param device_rank new device rank + */ + virtual void OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level, + const std::string& device_rank) = 0; + + /** + * Gets all allowed module types + * @param app_id unique identifier of application + * @param list of allowed module types + * @return true if application has allowed modules + */ + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const = 0; +#endif // SDL_REMOTE_CONTROL + private: /** * @brief Processes data received via OnAppPermissionChanged notification diff --git a/src/components/include/hmi_message_handler/hmi_message_adapter.h b/src/components/include/hmi_message_handler/hmi_message_adapter.h index 10e4231528..9423f74394 100644 --- a/src/components/include/hmi_message_handler/hmi_message_adapter.h +++ b/src/components/include/hmi_message_handler/hmi_message_adapter.h @@ -43,6 +43,21 @@ namespace hmi_message_handler { * SDL with HMI has to implement this interface. */ class HMIMessageAdapter : public HMIMessageSender { + public: + /** + * \brief Destructor + */ + virtual ~HMIMessageAdapter() {} + +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Subscribes to notification from HMI + * @param hmi_notification string with notification name + */ + virtual void SubscribeToHMINotification( + const std::string& hmi_notification) = 0; +#endif // SDL_REMOTE_CONTROL + protected: /** * \brief Interface for subscriptions. diff --git a/src/components/include/hmi_message_handler/hmi_message_handler.h b/src/components/include/hmi_message_handler/hmi_message_handler.h index 411d19fb75..5c4a443407 100644 --- a/src/components/include/hmi_message_handler/hmi_message_handler.h +++ b/src/components/include/hmi_message_handler/hmi_message_handler.h @@ -51,6 +51,15 @@ class HMIMessageHandler : public HMIMessageObserver, public HMIMessageSender { virtual void AddHMIMessageAdapter(HMIMessageAdapter* adapter) = 0; virtual void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) = 0; +#ifdef SDL_REMOTE_CONTROL + /** + * @brief Subscribes to notification from HMI + * @param hmi_notification string with notification name + */ + virtual void SubscribeToHMINotification( + const std::string& hmi_notification) = 0; +#endif // SDL_REMOTE_CONTROL + /** * \brief Hmi message handler settings getter * \return pointer to hmi message handler settings class diff --git a/src/components/include/hmi_message_handler/hmi_message_handler_settings.h b/src/components/include/hmi_message_handler/hmi_message_handler_settings.h index 5386869555..8b24f2cf7d 100644 --- a/src/components/include/hmi_message_handler/hmi_message_handler_settings.h +++ b/src/components/include/hmi_message_handler/hmi_message_handler_settings.h @@ -44,7 +44,7 @@ class HMIMessageHandlerSettings { public: virtual ~HMIMessageHandlerSettings() {} - virtual const uint64_t& thread_min_stack_size() const = 0; + virtual const uint64_t thread_min_stack_size() const = 0; }; } // namespace hmi_message_handler #endif // SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_HANDLER_SETTINGS_H_ diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h index f3388beb95..4331ae4847 100644 --- a/src/components/include/policy/policy_external/policy/policy_listener.h +++ b/src/components/include/policy/policy_external/policy/policy_listener.h @@ -52,12 +52,13 @@ class PolicyListener { const Permissions& permissions) = 0; virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0; virtual void OnUpdateStatusChanged(const std::string&) = 0; + /** - * Gets device ID - * @param policy_app_id - * @return device ID - * @deprecated see std::vector GetDevicesIds(const std::string&) - */ + * Gets device ID + * @param policy_app_id + * @return device ID + * @deprecated see std::vector GetDevicesIds(const std::string&) + */ virtual std::string OnCurrentDeviceIdUpdateRequired( const std::string& policy_app_id) = 0; virtual void OnSystemInfoUpdateRequired() = 0; @@ -67,12 +68,12 @@ class PolicyListener { std::map app_hmi_types) = 0; /** - * @brief CanUpdate allows to find active application - * and check whether related device consented. - * - * @return true if there are at least one application has been registered - * with consented device. - */ + * @brief CanUpdate allows to find active application + * and check whether related device consented. + * + * @return true if there are at least one application has been registered + * with consented device. + */ virtual bool CanUpdate() = 0; /** @@ -129,12 +130,67 @@ class PolicyListener { virtual void OnPTUFinished(const bool ptu_result) = 0; /** - * @brief Collects currently registered applications ids linked to their - * device id - * @return Collection of device_id-to-app_id links - */ + * @brief Collects currently registered applications ids linked to their + * device id + * @return Collection of device_id-to-app_id links + */ virtual void GetRegisteredLinks( std::map& out_links) const = 0; + +#ifdef SDL_REMOTE_CONTROL + /** + * Gets devices ids by policy application id + * @param policy_app_id + * @return list devices ids + */ + virtual std::vector GetDevicesIds( + const std::string& policy_app_id) = 0; + + /** + * Notifies about changing HMI level + * @param device_id unique identifier of device + * @param policy_app_id unique identifier of application in policy + * @param hmi_level default HMI level for this application + */ + virtual void OnUpdateHMILevel(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) = 0; + /** + * @brief Signal that country_consent field was updated during PTU + * @param new_consent New value of country_consent + */ + virtual void OnRemoteAllowedChanged(bool new_consent) = 0; + + /** + * @brief Notifies Remote apps about change in permissions + * @param device_id Device on which app is running + * @param application_id ID of app whose permissions are changed + */ + virtual void OnRemoteAppPermissionsChanged( + const std::string& device_id, const std::string& application_id) = 0; + + /** + * Notifies about changing HMI status + * @param device_id unique identifier of device + * @param policy_app_id unique identifier of application in policy + * @param hmi_level default HMI level for this application + */ + virtual void OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) = 0; + + /** + * Notifies about changing HMI status + * @param device_id unique identifier of device + * @param policy_app_id unique identifier of application in policy + * @param hmi_level default HMI level for this application + * @param device_rank device rank + */ + virtual void OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level, + const std::string& device_rank) = 0; +#endif // SDL_REMOTE_CONTROL }; -} // namespace policy +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_LISTENER_H_ diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 9201956e2a..fd3371bd06 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -40,7 +40,11 @@ #include "policy/policy_types.h" #include "policy/policy_table/types.h" #include "policy/policy_listener.h" -#include "usage_statistics/statistics_manager.h" +#include "policy/usage_statistics/statistics_manager.h" + +#ifdef SDL_REMOTE_CONTROL +#include "policy/access_remote.h" +#endif // SDL_REMOTE_CONTROL namespace policy { class PolicySettings; @@ -505,6 +509,132 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0; +#ifdef SDL_REMOTE_CONTROL + virtual void SetDefaultHmiTypes(const std::string& application_id, + const std::vector& hmi_types) = 0; + /** + * Gets HMI types + * @param application_id ID application + * @param app_types list to save HMI types + * @return true if policy has specific policy for this application + */ + virtual bool GetHMITypes(const std::string& application_id, + std::vector* app_types) = 0; + + /** + * Checks access to equipment of vehicle for application by RPC + * @param device_id unique identifier of device + * @param app_id policy id application + * @param module + * @param rpc name of rpc + * @param params parameters list + */ + virtual TypeAccess CheckAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + const PTString& rpc, + const RemoteControlParams& params) = 0; + + /** + * Checks access to module for application + * @param app_id policy id application + * @param module + * @return true if module is allowed for application + */ + virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; + + /** + * Sets access to equipment of vehicle for application by RPC + * @param dev_id unique identifier of device + * @param app_id policy id application + * @param module type + * @param allowed true if access is allowed + */ + virtual void SetAccess(const PTString& dev_id, + const PTString& app_id, + const PTString& module, + bool allowed) = 0; + + /** + * Resets access application to all resources + * @param dev_id unique identifier of device + * @param app_id policy id application + */ + virtual void ResetAccess(const PTString& dev_id, const PTString& app_id) = 0; + + /** + * Resets access by functional group for all applications + * @param module type + */ + virtual void ResetAccess(const PTString& module) = 0; + + /** + * Sets driver as primary device + * @param dev_id ID device + */ + virtual void SetPrimaryDevice(const PTString& dev_id) = 0; + + /** + * Resets driver's device + */ + virtual void ResetPrimaryDevice() = 0; + + /** + * Gets current primary device + * @return ID device + */ + virtual PTString PrimaryDevice() const = 0; + + /** + * Sets mode of remote control (on/off) + * @param enabled true if remote control is turned on + */ + virtual void SetRemoteControl(bool enabled) = 0; + + /* + * @brief If remote control is enabled + * by User and by Policy + */ + virtual bool GetRemoteControl() const = 0; + + /** + * Handles changed primary device event for a application + * @param device_id Device on which app is running + * @param application_id ID application + */ + virtual void OnChangedPrimaryDevice(const std::string& device_id, + const std::string& application_id) = 0; + + /** + * Handles changed remote control event for a application + * @param device_id Device on which app is running + * @param application_id ID application + */ + virtual void OnChangedRemoteControl(const std::string& device_id, + const std::string& application_id) = 0; + + /* + * Send OnPermissionsChange notification to mobile app + * when it's permissions are changed. + * @param device_id Device on which app is running + * @param application_id ID of app whose permissions are changed + */ + virtual void SendAppPermissionsChanged(const std::string& device_id, + const std::string& application_id) = 0; + + /** + * Gets all allowed module types + * @param app_id unique identifier of application + * @param list of allowed module types + * @return true if application has allowed modules + */ + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const = 0; + + virtual void set_access_remote( + utils::SharedPtr access_remote) = 0; +#endif // SDL_REMOTE_CONTROL + /** * @brief Checks if there is existing URL in the EndpointUrls vector with * index saved in the policy manager and if not, it moves to the next diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h new file mode 100644 index 0000000000..c7fc0de442 --- /dev/null +++ b/src/components/include/policy/policy_regular/policy/policy_listener.h @@ -0,0 +1,171 @@ +/* + Copyright (c) 2016, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_LISTENER_H_ +#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_LISTENER_H_ + +#include + +#include "policy/policy_types.h" +#include "utils/custom_string.h" + +namespace policy { + +namespace custom_str = utils::custom_string; + +class PolicyListener { + public: + virtual ~PolicyListener() {} + virtual void OnPermissionsUpdated(const std::string& policy_app_id, + const Permissions& permissions, + const policy::HMILevel& default_hmi) = 0; + virtual void OnPermissionsUpdated(const std::string& policy_app_id, + const Permissions& permissions) = 0; + virtual void OnPendingPermissionChange(const std::string& policy_app_id) = 0; + virtual void OnUpdateStatusChanged(const std::string&) = 0; + virtual std::string OnCurrentDeviceIdUpdateRequired( + const std::string& policy_app_id) = 0; + virtual void OnSystemInfoUpdateRequired() = 0; + virtual custom_str::CustomString GetAppName( + const std::string& policy_app_id) = 0; + virtual void OnUpdateHMIAppType( + std::map app_hmi_types) = 0; + + /** + * @brief CanUpdate allows to find active application + * and check whether related device consented. + * + * @return true if there are at least one application has been registered + * with consented device. + */ + virtual bool CanUpdate() = 0; + + /** + * @brief OnSnapshotCreated the notification which will be sent + * when snapshot for PTU has been created. + * + * @param pt_string the snapshot + * + * @param retry_seconds retry sequence timeouts. + * + * @param timeout_exceed timeout. + */ + virtual void OnSnapshotCreated(const BinaryMessage& pt_string) = 0; + + /** + * @brief Make appropriate changes for related applications permissions and + * notify them, if it possible + * @param device_id Unique device id, which consent had been changed + * @param device_consent Device consent, which is done by user + */ + virtual void OnDeviceConsentChanged(const std::string& device_id, + bool is_allowed) = 0; + + /** + * @brief Sends OnAppPermissionsChanged notification to HMI + * @param permissions contains parameter for OnAppPermisionChanged + * @param policy_app_id contains policy application id + */ + virtual void SendOnAppPermissionsChanged( + const AppPermissions& permissions, + const std::string& policy_app_id) const = 0; + + /** + * @brief GetAvailableApps allows to obtain list of registered applications. + */ + virtual void GetAvailableApps(std::queue&) = 0; + + /** + * @brief OnCertificateUpdated the callback which signals if certificate field + * has been updated during PTU + * + * @param certificate_data the value of the updated field. + */ + virtual void OnCertificateUpdated(const std::string& certificate_data) = 0; + +#ifdef SDL_REMOTE_CONTROL + /** + * Gets devices ids by policy application id + * @param policy_app_id + * @return list devices ids + */ + virtual std::vector GetDevicesIds( + const std::string& policy_app_id) = 0; + + /** + * Notifies about changing HMI level + * @param device_id unique identifier of device + * @param policy_app_id unique identifier of application in policy + * @param hmi_level default HMI level for this application + */ + virtual void OnUpdateHMILevel(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) = 0; + /** + * @brief Signal that country_consent field was updated during PTU + * @param new_consent New value of country_consent + */ + virtual void OnRemoteAllowedChanged(bool new_consent) = 0; + + /** + * @brief Notifies Remote apps about change in permissions + * @param device_id Device on which app is running + * @param application_id ID of app whose permissions are changed + */ + virtual void OnRemoteAppPermissionsChanged( + const std::string& device_id, const std::string& application_id) = 0; + + /** + * Notifies about changing HMI status + * @param device_id unique identifier of device + * @param policy_app_id unique identifier of application in policy + * @param hmi_level default HMI level for this application + */ + virtual void OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level) = 0; + + /** + * Notifies about changing HMI status + * @param device_id unique identifier of device + * @param policy_app_id unique identifier of application in policy + * @param hmi_level default HMI level for this application + * @param device_rank device rank + */ + virtual void OnUpdateHMIStatus(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level, + const std::string& device_rank) = 0; +#endif // SDL_REMOTE_CONTROL +}; +} // namespace policy +#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_LISTENER_H_ diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index c8074b3528..900f076395 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -41,6 +41,9 @@ #include "policy/policy_table/types.h" #include "policy/policy_listener.h" #include "policy/usage_statistics/statistics_manager.h" +#ifdef SDL_REMOTE_CONTROL +#include "policy/access_remote.h" +#endif // SDL_REMOTE_CONTROL namespace policy { class PolicySettings; @@ -479,6 +482,132 @@ class PolicyManager : public usage_statistics::StatisticsManager { * urls vector */ virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0; +#ifdef SDL_REMOTE_CONTROL + virtual void SetDefaultHmiTypes(const std::string& application_id, + const std::vector& hmi_types) = 0; + + /** + * Gets HMI types + * @param application_id ID application + * @param app_types list to save HMI types + * @return true if policy has specific policy for this application + */ + virtual bool GetHMITypes(const std::string& application_id, + std::vector* app_types) = 0; + + /** + * Checks access to equipment of vehicle for application by RPC + * @param device_id unique identifier of device + * @param app_id policy id application + * @param module + * @param rpc name of rpc + * @param params parameters list + */ + virtual TypeAccess CheckAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + const PTString& rpc, + const RemoteControlParams& params) = 0; + + /** + * Checks access to module for application + * @param app_id policy id application + * @param module + * @return true if module is allowed for application + */ + virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; + + /** + * Sets access to equipment of vehicle for application by RPC + * @param dev_id unique identifier of device + * @param app_id policy id application + * @param module type + * @param allowed true if access is allowed + */ + virtual void SetAccess(const PTString& dev_id, + const PTString& app_id, + const PTString& module, + bool allowed) = 0; + + /** + * Resets access application to all resources + * @param dev_id unique identifier of device + * @param app_id policy id application + */ + virtual void ResetAccess(const PTString& dev_id, const PTString& app_id) = 0; + + /** + * Resets access by functional group for all applications + * @param module type + */ + virtual void ResetAccess(const PTString& module) = 0; + + /** + * Sets driver as primary device + * @param dev_id ID device + */ + virtual void SetPrimaryDevice(const PTString& dev_id) = 0; + + /** + * Resets driver's device + */ + virtual void ResetPrimaryDevice() = 0; + + /** + * Gets current primary device + * @return ID device + */ + virtual PTString PrimaryDevice() const = 0; + + /** + * Sets mode of remote control (on/off) + * @param enabled true if remote control is turned on + */ + virtual void SetRemoteControl(bool enabled) = 0; + + /* + * @brief If remote control is enabled + * by User and by Policy + */ + virtual bool GetRemoteControl() const = 0; + + /** + * Handles changed primary device event for a application + * @param device_id Device on which app is running + * @param application_id ID application + */ + virtual void OnChangedPrimaryDevice(const std::string& device_id, + const std::string& application_id) = 0; + + /** + * Handles changed remote control event for a application + * @param device_id Device on which app is running + * @param application_id ID application + */ + virtual void OnChangedRemoteControl(const std::string& device_id, + const std::string& application_id) = 0; + + /* + * Send OnPermissionsChange notification to mobile app + * when it's permissions are changed. + * @param device_id Device on which app is running + * @param application_id ID of app whose permissions are changed + */ + virtual void SendAppPermissionsChanged(const std::string& device_id, + const std::string& application_id) = 0; + + /** + * Gets all allowed module types + * @param app_id unique identifier of application + * @param list of allowed module types + * @return true if application has allowed modules + */ + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const = 0; + + virtual void set_access_remote( + utils::SharedPtr access_remote) = 0; +#endif // SDL_REMOTE_CONTROL /** * @brief Checks if there is existing URL in the EndpointUrls vector with diff --git a/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h b/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h new file mode 100644 index 0000000000..8093c11467 --- /dev/null +++ b/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_ +#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_ + +#include "policy/usage_statistics/statistics_manager.h" + +namespace usage_statistics { + +class AppStopwatch { + public: + virtual ~AppStopwatch() {} + virtual void Start(AppStopwatchId stopwatch_type) = 0; + virtual void Switch(AppStopwatchId stopwatch_type) = 0; + virtual void WriteTime() = 0; +}; + +} // namespace usage_statistics + +#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_ diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index 2fad7b757e..56c7ff9b91 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -227,6 +227,73 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { void(const std::string& service_type, policy::EndpointUrls& end_points)); +#ifdef SDL_REMOTE_CONTROL + MOCK_METHOD3(OnUpdateHMILevel, + void(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level)); + MOCK_METHOD3(CheckHMIType, + bool(const std::string& application_id, + mobile_apis::AppHMIType::eType hmi, + const smart_objects::SmartObject* app_types)); + MOCK_METHOD5(CheckAccess, + application_manager::TypeAccess( + const policy::PTString& device_id, + const policy::PTString& app_id, + const policy::PTString& module, + const std::string& rpc, + const std::vector& params)); + + MOCK_METHOD2(CheckModule, + bool(const policy::PTString& app_id, + const policy::PTString& module)); + + MOCK_METHOD4(SetAccess, + void(const policy::PTString& device_id, + const policy::PTString& app_id, + const policy::PTString& module, + bool allowed)); + + MOCK_METHOD2(ResetAccess, + void(const policy::PTString& device_id, + const policy::PTString& app_id)); + + MOCK_METHOD1(ResetAccess, void(const std::string& module)); + + MOCK_METHOD1(SetPrimaryDevice, void(const policy::PTString& dev_id)); + + MOCK_METHOD0(ResetPrimaryDevice, void()); + + MOCK_CONST_METHOD0(PrimaryDevice, uint32_t()); + + MOCK_METHOD1(SetRemoteControl, void(bool enabled)); + + MOCK_CONST_METHOD0(GetRemoteControl, bool()); + + MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent)); + + MOCK_METHOD2(OnRemoteAppPermissionsChanged, + void(const std::string& device_id, + const std::string& application_id)); + + MOCK_METHOD3(OnUpdateHMIStatus, + void(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level)); + + MOCK_METHOD4(OnUpdateHMIStatus, + void(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level, + const std::string& device_rank)); + MOCK_CONST_METHOD2(GetModuleTypes, + bool(const std::string& policy_app_id, + std::vector* modules)); + MOCK_METHOD2(SetDefaultHmiTypes, + void(const std::string& application_id, + const smart_objects::SmartObject* app_types)); +#endif // SDL_REMOTE_CONTROL + private: #ifdef EXTERNAL_PROPRIETARY_MODE MOCK_METHOD3(OnAppPermissionConsentInternal, diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h index fcbae93a70..a7e93ec25c 100644 --- a/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h +++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h @@ -44,7 +44,7 @@ namespace hmi_message_handler_test { class MockHMIMessageHandlerSettings : public ::hmi_message_handler::HMIMessageHandlerSettings { public: - MOCK_CONST_METHOD0(thread_min_stack_size, const uint64_t&()); + MOCK_CONST_METHOD0(thread_min_stack_size, const uint64_t()); }; } // namespace hmi_message_handler_test } // namespace components diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h new file mode 100644 index 0000000000..617e99358e --- /dev/null +++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h @@ -0,0 +1,256 @@ +/* + * Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_CACHE_MANAGER_H_ +#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_CACHE_MANAGER_H_ + +#include +#include + +#include "gmock/gmock.h" + +#include "policy/cache_manager_interface.h" + +namespace policy_table = rpc::policy_table_interface_base; + +using namespace ::policy; + +namespace test { +namespace components { +namespace policy_test { + +class MockCacheManagerInterface : public ::policy::CacheManagerInterface { + public: + MOCK_CONST_METHOD2(GetConsentsPriority, + ConsentPriorityType(const std::string& device_id, + const std::string& application_id)); + MOCK_METHOD4(CheckPermissions, + void(const PTString& app_id, + const PTString& hmi_level, + const PTString& rpc, + CheckPermissionResult& result)); + MOCK_METHOD0(IsPTPreloaded, bool()); + MOCK_METHOD0(IgnitionCyclesBeforeExchange, int()); + MOCK_METHOD1(KilometersBeforeExchange, int(int current)); + MOCK_CONST_METHOD1(GetPermissionsList, bool(StringArray& perm_list)); + MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate, + bool(Counters counter, int value)); + MOCK_METHOD1(DaysBeforeExchange, int(uint16_t current)); + MOCK_METHOD0(IncrementIgnitionCycles, void()); + + MOCK_METHOD2(SaveDeviceConsentToCache, + void(const std::string& device_id, const bool is_allowed)); + + MOCK_METHOD1(ResetCalculatedPermissionsForDevice, + void(const std::string& device_id)); + MOCK_METHOD0(ResetIgnitionCycles, void()); + MOCK_METHOD0(TimeoutResponse, int()); + MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector& seconds)); + MOCK_CONST_METHOD1(IsDeviceConsentCached, bool(const std::string& device_id)); + MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); + MOCK_CONST_METHOD1(GetDeviceConsent, + DeviceConsent(const std::string& device_id)); + MOCK_METHOD2(SetDeviceConsent, + void(const std::string& device_id, bool is_allowed)); + + MOCK_CONST_METHOD2(HasDeviceSpecifiedConsent, + bool(const std::string& device_id, const bool is_allowed)); + MOCK_CONST_METHOD1(GetCachedDeviceConsent, + DeviceConsent(const std::string& device_id)); + MOCK_METHOD1(SetVINValue, bool(const std::string& value)); + MOCK_METHOD3(GetUserFriendlyMsg, + std::vector( + const std::vector& msg_codes, + const std::string& language, + const std::string& active_hmi_language)); + MOCK_METHOD2(GetUpdateUrls, + void(const std::string& service_type, + EndpointUrls& out_end_points)); + MOCK_METHOD2(GetUpdateUrls, + void(const uint32_t service_type, EndpointUrls& out_end_points)); + MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string()); + MOCK_METHOD1( + GetNotificationsNumber, + policy_table::NumberOfNotificationsType(const std::string& priority)); + MOCK_CONST_METHOD2(GetPriority, + bool(const std::string& policy_app_id, + std::string& priority)); + MOCK_METHOD2(Init, + bool(const std::string& file_name, + const PolicySettings* settings)); + MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt)); + MOCK_METHOD1(Save, bool(const policy_table::Table& table)); + MOCK_CONST_METHOD0(UpdateRequired, bool()); + MOCK_METHOD1(SaveUpdateRequired, void(bool status)); + MOCK_METHOD3(GetInitialAppData, + bool(const std::string& app_id, + StringArray& nicknames, + StringArray& app_hmi_types)); + MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id)); + MOCK_METHOD1(GetFunctionalGroupings, + bool(policy_table::FunctionalGroupings& groups)); + MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id)); + MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id)); + MOCK_METHOD1(SetIsDefault, bool(const std::string& app_id)); + MOCK_METHOD1(SetIsPredata, bool(const std::string& app_id)); + MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id)); + MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id)); + MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); + MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); + MOCK_CONST_METHOD2(GetDefaultHMI, + bool(const std::string& app_id, std::string& default_hmi)); + MOCK_METHOD0(ResetUserConsent, bool()); + MOCK_CONST_METHOD3(GetUserPermissionsForDevice, + bool(const std::string& device_id, + StringArray& consented_groups, + StringArray& disallowed_groups)); + MOCK_METHOD3(GetPermissionsForApp, + bool(const std::string& device_id, + const std::string& app_id, + FunctionalIdType& group_types)); + MOCK_CONST_METHOD2( + GetDeviceGroupsFromPolicies, + bool(rpc::policy_table_interface_base::Strings& groups, + rpc::policy_table_interface_base::Strings& preconsented_groups)); + MOCK_METHOD2(AddDevice, + bool(const std::string& device_id, + const std::string& connection_type)); + MOCK_METHOD8(SetDeviceData, + bool(const std::string& device_id, + const std::string& hardware, + const std::string& firmware, + const std::string& os, + const std::string& os_version, + const std::string& carrier, + const uint32_t number_of_ports, + const std::string& connection_type)); + MOCK_METHOD3(SetUserPermissionsForDevice, + bool(const std::string& device_id, + const StringArray& consented_groups, + const StringArray& disallowed_groups)); + MOCK_METHOD2(ReactOnUserDevConsentForApp, + bool(const std::string& app_id, bool is_device_allowed)); + MOCK_METHOD2(SetUserPermissionsForApp, + bool(const PermissionConsent& permissions, + bool* out_app_permissions_changed)); + MOCK_METHOD3(SetMetaInfo, + bool(const std::string& ccpu_version, + const std::string& wers_country_code, + const std::string& language)); + MOCK_CONST_METHOD0(IsMetaInfoPresent, bool()); + MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language)); + MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type)); + MOCK_METHOD2(Increment, + void(const std::string& app_id, + usage_statistics::AppCounterId type)); + MOCK_METHOD3(Set, + void(const std::string& app_id, + usage_statistics::AppInfoId type, + const std::string& value)); + MOCK_METHOD3(Add, + void(const std::string& app_id, + usage_statistics::AppStopwatchId type, + int seconds)); + MOCK_METHOD2(CountUnconsentedGroups, + int(const std::string& policy_app_id, + const std::string& device_id)); + MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names)); + MOCK_METHOD2(GetAllAppGroups, + void(const std::string& app_id, + FunctionalGroupIDs& all_group_ids)); + MOCK_METHOD2(GetPreConsentedGroups, + void(const std::string& app_id, + FunctionalGroupIDs& preconsented_groups)); + MOCK_METHOD4(GetConsentedGroups, + void(const std::string& device_id, + const std::string& app_id, + FunctionalGroupIDs& allowed_groups, + FunctionalGroupIDs& disallowed_groups)); + MOCK_METHOD3(GetUnconsentedGroups, + void(const std::string& device_id, + const std::string& policy_app_id, + FunctionalGroupIDs& unconsented_groups)); + MOCK_METHOD2(RemoveAppConsentForGroup, + void(const std::string& app_id, const std::string& group_name)); + MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id)); + MOCK_METHOD0(CleanupUnpairedDevices, bool()); + MOCK_METHOD2(SetUnpairedDevice, + bool(const std::string& device_id, bool unpaired)); + MOCK_METHOD1(UnpairedDevicesList, bool(DeviceIds& device_ids)); + MOCK_METHOD1(ResetPT, bool(const std::string& file_name)); + MOCK_METHOD0(LoadFromBackup, bool()); + MOCK_METHOD2(LoadFromFile, + bool(const std::string& file_name, policy_table::Table&)); + MOCK_METHOD0(Backup, void()); + MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id)); + MOCK_CONST_METHOD2(GetAppRequestTypes, + void(const std::string& policy_app_id, + std::vector& request_types)); + MOCK_METHOD1(GetHMIAppTypeAfterUpdate, + void(std::map& app_hmi_types)); + + MOCK_CONST_METHOD2(AppHasHMIType, + bool(const std::string& application_id, + policy_table::AppHMIType hmi_type)); + + MOCK_METHOD0(ResetCalculatedPermissions, void()); + MOCK_METHOD3(AddCalculatedPermissions, + void(const std::string& device_id, + const std::string& policy_app_id, + const policy::Permissions& permissions)); + MOCK_METHOD3(IsPermissionsCalculated, + bool(const std::string& device_id, + const std::string& policy_app_id, + policy::Permissions& permission)); + MOCK_CONST_METHOD0(GetPT, utils::SharedPtr()); + MOCK_CONST_METHOD0(GetMetaInfo, const MetaInfo()); + MOCK_CONST_METHOD0(GetCertificate, std::string()); + MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); + MOCK_METHOD1(set_settings, void(const PolicySettings* settings)); + MOCK_METHOD1(GetHMITypes, + const policy_table::AppHMITypes*(const std::string& app_id)); + MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id)); + + MOCK_METHOD1(SetExternalConsentStatus, bool(const ExternalConsentStatus&)); + MOCK_METHOD0(GetExternalConsentStatus, ExternalConsentStatus()); + MOCK_METHOD0(GetExternalConsentEntities, ExternalConsentStatus()); + MOCK_METHOD1(GetGroupsWithSameEntities, + GroupsByExternalConsentStatus(const ExternalConsentStatus&)); + MOCK_METHOD0(GetKnownLinksFromPT, std::map()); + MOCK_METHOD1(SetExternalConsentForApp, void(const PermissionConsent&)); +}; + +} // namespace policy_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_CACHE_MANAGER_H_ diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h index 893d5a334f..eba2bc45c0 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h @@ -92,6 +92,21 @@ class MockPolicyListener : public ::policy::PolicyListener { const std::string& hmi_level)); MOCK_CONST_METHOD1(GetRegisteredLinks, void(std::map&)); +#ifdef SDL_REMOTE_CONTROL + MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent)); + MOCK_METHOD2(OnRemoteAppPermissionsChanged, + void(const std::string& device_id, + const std::string& application_id)); + MOCK_METHOD3(OnUpdateHMIStatus, + void(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level)); + MOCK_METHOD4(OnUpdateHMIStatus, + void(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level, + const std::string& device_rank)); +#endif // SDL_REMOTE_CONTROL }; } // namespace policy_test diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 0332b94a89..399ae51169 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -148,6 +148,51 @@ class MockPolicyManager : public PolicyManager { StatusNotifier( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types)); +#ifdef SDL_REMOTE_CONTROL + MOCK_METHOD2(SetDefaultHmiTypes, + void(const std::string& application_id, + const std::vector& hmi_types)); + MOCK_METHOD2(GetHMITypes, + bool(const std::string& application_id, + std::vector* app_types)); + MOCK_METHOD5(CheckAccess, + TypeAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + const PTString& rpc, + const RemoteControlParams& params)); + MOCK_METHOD2(CheckModule, + bool(const PTString& app_id, const PTString& module)); + MOCK_METHOD4(SetAccess, + void(const PTString& dev_id, + const PTString& app_id, + const PTString& module, + bool allowed)); + MOCK_METHOD2(ResetAccess, + void(const PTString& dev_id, const PTString& app_id)); + MOCK_METHOD1(ResetAccess, void(const PTString& module)); + MOCK_METHOD1(SetPrimaryDevice, void(const PTString& dev_id)); + MOCK_METHOD0(ResetPrimaryDevice, void()); + MOCK_CONST_METHOD0(PrimaryDevice, PTString()); + + MOCK_METHOD1(SetRemoteControl, void(bool enabled)); + MOCK_CONST_METHOD0(GetRemoteControl, bool()); + MOCK_METHOD2(OnChangedPrimaryDevice, + void(const std::string& device_id, + const std::string& application_id)); + MOCK_METHOD2(OnChangedRemoteControl, + void(const std::string& device_id, + const std::string& application_id)); + MOCK_METHOD2(SendAppPermissionsChanged, + void(const std::string& device_id, + const std::string& application_id)); + MOCK_CONST_METHOD2(GetModuleTypes, + bool(const std::string& policy_app_id, + std::vector* modules)); + MOCK_METHOD1(set_access_remote, + void(utils::SharedPtr access_remote)); +#endif // SDL_REMOTE_CONTROL + MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h new file mode 100644 index 0000000000..058ea73d51 --- /dev/null +++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_ +#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_ + +#include +#include + +#include "gmock/gmock.h" + +#include "policy/cache_manager_interface.h" + +namespace test { +namespace components { +namespace policy_test { +namespace policy_table = rpc::policy_table_interface_base; +using namespace ::policy; + +class MockCacheManagerInterface : public CacheManagerInterface { + public: + MOCK_METHOD4(CheckPermissions, + void(const policy_table::Strings& groups, + const PTString& hmi_level, + const PTString& rpc, + CheckPermissionResult& result)); + MOCK_METHOD0(IsPTPreloaded, bool()); + MOCK_METHOD0(IgnitionCyclesBeforeExchange, int()); + MOCK_METHOD1(KilometersBeforeExchange, int(int current)); + MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate, + bool(Counters counter, int value)); + MOCK_METHOD1(DaysBeforeExchange, int(int current)); + MOCK_METHOD0(IncrementIgnitionCycles, void()); + MOCK_METHOD0(ResetIgnitionCycles, void()); + MOCK_METHOD0(TimeoutResponse, int()); + MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector& seconds)); + MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); + MOCK_METHOD1(SetVINValue, bool(const std::string& value)); + MOCK_METHOD2(GetUserFriendlyMsg, + std::vector( + const std::vector& msg_codes, + const std::string& language)); + + MOCK_METHOD1( + GetNotificationsNumber, + policy_table::NumberOfNotificationsType(const std::string& priority)); + MOCK_CONST_METHOD2(GetPriority, + bool(const std::string& policy_app_id, + std::string& priority)); + MOCK_METHOD2(GetUpdateUrls, + void(const std::string& service_type, + EndpointUrls& out_end_points)); + MOCK_METHOD2(GetUpdateUrls, + void(const uint32_t service_type, EndpointUrls& out_end_points)); + MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string()); + MOCK_METHOD2(Init, + bool(const std::string& file_name, + const PolicySettings* settings)); + MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt)); + MOCK_METHOD1(Save, bool(const policy_table::Table& table)); + MOCK_CONST_METHOD0(UpdateRequired, bool()); + MOCK_METHOD1(SaveUpdateRequired, void(bool status)); + MOCK_METHOD3(GetInitialAppData, + bool(const std::string& app_id, + StringArray& nicknames, + StringArray& app_hmi_types)); + MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id)); + MOCK_METHOD1(GetFunctionalGroupings, + bool(policy_table::FunctionalGroupings& groups)); + MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id)); + MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id)); + MOCK_METHOD1(SetIsDefault, bool(const std::string& app_id)); + MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id)); + MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id)); + MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); + MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); + MOCK_CONST_METHOD2(GetDefaultHMI, + bool(const std::string& app_id, std::string& default_hmi)); + MOCK_METHOD0(ResetUserConsent, bool()); + MOCK_CONST_METHOD3(GetUserPermissionsForDevice, + bool(const std::string& device_id, + StringArray& consented_groups, + StringArray& disallowed_groups)); + MOCK_METHOD3(GetPermissionsForApp, + bool(const std::string& device_id, + const std::string& app_id, + FunctionalIdType& group_types)); + MOCK_CONST_METHOD2( + GetDeviceGroupsFromPolicies, + bool(rpc::policy_table_interface_base::Strings& groups, + rpc::policy_table_interface_base::Strings& preconsented_groups)); + MOCK_METHOD2(AddDevice, + bool(const std::string& device_id, + const std::string& connection_type)); + MOCK_METHOD8(SetDeviceData, + bool(const std::string& device_id, + const std::string& hardware, + const std::string& firmware, + const std::string& os, + const std::string& os_version, + const std::string& carrier, + const uint32_t number_of_ports, + const std::string& connection_type)); + MOCK_METHOD3(SetUserPermissionsForDevice, + bool(const std::string& device_id, + const StringArray& consented_groups, + const StringArray& disallowed_groups)); + MOCK_METHOD2(ReactOnUserDevConsentForApp, + bool(const std::string& app_id, bool is_device_allowed)); + MOCK_METHOD1(SetUserPermissionsForApp, + bool(const PermissionConsent& permissions)); + MOCK_METHOD3(SetMetaInfo, + bool(const std::string& ccpu_version, + const std::string& wers_country_code, + const std::string& language)); + MOCK_CONST_METHOD0(IsMetaInfoPresent, bool()); + MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language)); + MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type)); + MOCK_METHOD2(Increment, + void(const std::string& app_id, + usage_statistics::AppCounterId type)); + MOCK_METHOD3(Set, + void(const std::string& app_id, + usage_statistics::AppInfoId type, + const std::string& value)); + MOCK_METHOD3(Add, + void(const std::string& app_id, + usage_statistics::AppStopwatchId type, + int seconds)); + MOCK_METHOD2(CountUnconsentedGroups, + int(const std::string& policy_app_id, + const std::string& device_id)); + MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names)); + MOCK_METHOD2(GetAllAppGroups, + void(const std::string& app_id, + FunctionalGroupIDs& all_group_ids)); + MOCK_METHOD2(GetPreConsentedGroups, + void(const std::string& app_id, + FunctionalGroupIDs& preconsented_groups)); + MOCK_METHOD4(GetConsentedGroups, + void(const std::string& device_id, + const std::string& app_id, + FunctionalGroupIDs& allowed_groups, + FunctionalGroupIDs& disallowed_groups)); + MOCK_METHOD3(GetUnconsentedGroups, + void(const std::string& device_id, + const std::string& policy_app_id, + FunctionalGroupIDs& unconsented_groups)); + MOCK_METHOD2(RemoveAppConsentForGroup, + void(const std::string& app_id, const std::string& group_name)); + MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id)); + MOCK_METHOD0(CleanupUnpairedDevices, bool()); + MOCK_METHOD2(SetUnpairedDevice, + bool(const std::string& device_id, bool unpaired)); + MOCK_METHOD1(UnpairedDevicesList, bool(DeviceIds& device_ids)); + MOCK_METHOD1(ResetPT, bool(const std::string& file_name)); + MOCK_METHOD0(LoadFromBackup, bool()); + MOCK_METHOD2(LoadFromFile, + bool(const std::string& file_name, policy_table::Table&)); + MOCK_METHOD0(Backup, void()); + MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id)); + MOCK_CONST_METHOD2(GetAppRequestTypes, + void(const std::string& policy_app_id, + std::vector& request_types)); + MOCK_METHOD1(GetHMIAppTypeAfterUpdate, + void(std::map& app_hmi_types)); + MOCK_METHOD0(ResetCalculatedPermissions, void()); + MOCK_METHOD3(AddCalculatedPermissions, + void(const std::string& device_id, + const std::string& policy_app_id, + const policy::Permissions& permissions)); + MOCK_METHOD3(IsPermissionsCalculated, + bool(const std::string& device_id, + const std::string& policy_app_id, + policy::Permissions& permission)); + MOCK_CONST_METHOD0(pt, utils::SharedPtr()); + MOCK_METHOD1(GetHMITypes, + const policy_table::AppHMITypes*(const std::string& app_id)); + MOCK_CONST_METHOD0(GetCertificate, std::string()); + MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); + MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id)); + MOCK_CONST_METHOD2(AppHasHMIType, + bool(const std::string& application_id, + policy_table::AppHMIType hmi_type)); +}; + +} // namespace policy_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_ diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h new file mode 100644 index 0000000000..91d93908a2 --- /dev/null +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h @@ -0,0 +1,109 @@ +/* Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_ +#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_ + +#include + +#include "gmock/gmock.h" + +#include "policy/policy_listener.h" +#include "rpc_base/rpc_base.h" +#include "policy/policy_table/types.h" +#include "utils/custom_string.h" + +namespace policy_table = ::rpc::policy_table_interface_base; + +namespace test { +namespace components { +namespace policy_test { + +namespace custom_str = utils::custom_string; + +class MockPolicyListener : public ::policy::PolicyListener { + public: + MOCK_METHOD3(OnPermissionsUpdated, + void(const std::string& policy_app_id, + const policy::Permissions& permissions, + const policy::HMILevel& default_hmi)); + MOCK_METHOD2(OnPermissionsUpdated, + void(const std::string& policy_app_id, + const policy::Permissions& permissions)); + MOCK_METHOD1(OnPendingPermissionChange, + void(const std::string& policy_app_id)); + MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status)); + MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired, + std::string(const std::string& policy_app_id)); + MOCK_METHOD0(OnSystemInfoUpdateRequired, void()); + MOCK_METHOD1(GetAppName, + custom_str::CustomString(const std::string& policy_app_id)); + MOCK_METHOD0(OnUserRequestedUpdateCheckRequired, void()); + MOCK_METHOD2(OnDeviceConsentChanged, + void(const std::string& device_id, bool is_allowed)); + MOCK_METHOD1(OnUpdateHMIAppType, + void(std::map)); + MOCK_METHOD1(GetAvailableApps, void(std::queue&)); + MOCK_METHOD1(OnSnapshotCreated, void(const policy::BinaryMessage& pt_string)); + MOCK_METHOD0(CanUpdate, bool()); + MOCK_METHOD1(OnCertificateUpdated, void(const std::string&)); + MOCK_CONST_METHOD2(SendOnAppPermissionsChanged, + void(const policy::AppPermissions&, const std::string&)); + MOCK_METHOD3(OnUpdateHMILevel, + void(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level)); + MOCK_METHOD1(GetDevicesIds, + std::vector(const std::string& policy_app_id)); + MOCK_CONST_METHOD1(GetRegisteredLinks, + void(std::map&)); +#ifdef SDL_REMOTE_CONTROL + MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent)); + MOCK_METHOD2(OnRemoteAppPermissionsChanged, + void(const std::string& device_id, + const std::string& application_id)); + MOCK_METHOD3(OnUpdateHMIStatus, + void(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level)); + MOCK_METHOD4(OnUpdateHMIStatus, + void(const std::string& device_id, + const std::string& policy_app_id, + const std::string& hmi_level, + const std::string& device_rank)); +#endif // SDL_REMOTE_CONTROL +}; + +} // namespace policy_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_ diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index 1ccca81d79..a155a0b07f 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -147,6 +147,50 @@ class MockPolicyManager : public PolicyManager { StatusNotifier( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types)); +#ifdef SDL_REMOTE_CONTROL + MOCK_METHOD2(SetDefaultHmiTypes, + void(const std::string& application_id, + const std::vector& hmi_types)); + MOCK_METHOD2(GetHMITypes, + bool(const std::string& application_id, + std::vector* app_types)); + MOCK_METHOD5(CheckAccess, + TypeAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + const PTString& rpc, + const RemoteControlParams& params)); + MOCK_METHOD2(CheckModule, + bool(const PTString& app_id, const PTString& module)); + MOCK_METHOD4(SetAccess, + void(const PTString& dev_id, + const PTString& app_id, + const PTString& module, + bool allowed)); + MOCK_METHOD2(ResetAccess, + void(const PTString& dev_id, const PTString& app_id)); + MOCK_METHOD1(ResetAccess, void(const PTString& module)); + MOCK_METHOD1(SetPrimaryDevice, void(const PTString& dev_id)); + MOCK_METHOD0(ResetPrimaryDevice, void()); + MOCK_CONST_METHOD0(PrimaryDevice, PTString()); + + MOCK_METHOD1(SetRemoteControl, void(bool enabled)); + MOCK_CONST_METHOD0(GetRemoteControl, bool()); + MOCK_METHOD2(OnChangedPrimaryDevice, + void(const std::string& device_id, + const std::string& application_id)); + MOCK_METHOD2(OnChangedRemoteControl, + void(const std::string& device_id, + const std::string& application_id)); + MOCK_METHOD2(SendAppPermissionsChanged, + void(const std::string& device_id, + const std::string& application_id)); + MOCK_CONST_METHOD2(GetModuleTypes, + bool(const std::string& policy_app_id, + std::vector* modules)); + MOCK_METHOD1(set_access_remote, + void(utils::SharedPtr access_remote)); +#endif // SDL_REMOTE_CONTROL MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt index c5b94ea7e1..4913102c9c 100644 --- a/src/components/media_manager/CMakeLists.txt +++ b/src/components/media_manager/CMakeLists.txt @@ -32,17 +32,20 @@ include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/platform.cmake) include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) include_directories( - include + ${COMPONENTS_DIR}/media_manager/include/ ${COMPONENTS_DIR}/media_manager/include/audio/ ${COMPONENTS_DIR}/media_manager/include/video/ + ${COMPONENTS_DIR}/remote_control/include/ ${COMPONENTS_DIR}/utils/include/ ${COMPONENTS_DIR}/protocol_handler/include/ ${COMPONENTS_DIR}/connection_handler/include/ ${COMPONENTS_DIR}/application_manager/include/ ${COMPONENTS_DIR}/smart_objects/include/ + ${COMPONENTS_DIR}/policy/include/ + ${COMPONENTS_DIR}/rpc_base/include/ + ${COMPONENTS_DIR}/functional_module/include/ ${COMPONENTS_DIR}/hmi_message_handler/include/ ${COMPONENTS_DIR}/formatters/include/ - ${COMPONENTS_DIR}/rpc_base/include/ ${COMPONENTS_DIR}/config_profile/include/ ${JSONCPP_INCLUDE_DIRECTORY} ${CMAKE_BINARY_DIR}/src/components/ diff --git a/src/components/media_manager/test/CMakeLists.txt b/src/components/media_manager/test/CMakeLists.txt index f5d596f681..d2cbced369 100644 --- a/src/components/media_manager/test/CMakeLists.txt +++ b/src/components/media_manager/test/CMakeLists.txt @@ -62,6 +62,13 @@ set(LIBRARIES ${SecurityManagerLibrary} ) +if(REMOTE_CONTROL) + SET (LIBRARIES + ${LIBRARIES} + FunctionalModule + ) +endif(REMOTE_CONTROL) + if(EXTENDED_MEDIA_MODE) list(APPEND LIBRARIES ${GSTREAMER_gstreamer_LIBRARY}) diff --git a/src/components/policy/policy_external/CMakeLists.txt b/src/components/policy/policy_external/CMakeLists.txt index 2cbdbd7f64..8d04f20470 100644 --- a/src/components/policy/policy_external/CMakeLists.txt +++ b/src/components/policy/policy_external/CMakeLists.txt @@ -58,6 +58,10 @@ set(SOURCES ${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc ) +if (REMOTE_CONTROL) + list(APPEND SOURCES ${POLICY_PATH}/src/access_remote_impl.cc) +endif() + list(APPEND SOURCES ${POLICY_PATH}/src/sql_pt_ext_queries.cc ${POLICY_PATH}/src/sql_pt_ext_representation.cc diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h new file mode 100644 index 0000000000..07efe25682 --- /dev/null +++ b/src/components/policy/policy_external/include/policy/access_remote.h @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_ +#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_ + +#include +#include +#include +#include "policy/policy_table/types.h" +#include "policy/policy_types.h" + +namespace policy_table = ::rpc::policy_table_interface_base; + +namespace policy { + +enum TypeAccess { kDisallowed, kAllowed, kManual }; +inline std::ostream& operator<<(std::ostream& output, TypeAccess x) { + output << "Access: "; + switch (x) { + case kDisallowed: + output << "DISALLOWED"; + break; + case kAllowed: + output << "ALLOWED"; + break; + case kManual: + output << "MANUAL"; + break; + default: + output << "Error: Unknown type"; + } + return output; +} + +struct Subject { + PTString dev_id; + PTString app_id; +}; +inline bool operator<(const Subject& x, const Subject& y) { + return x.dev_id < y.dev_id || (x.dev_id == y.dev_id && x.app_id < y.app_id); +} +inline bool operator==(const Subject& x, const Subject& y) { + return x.dev_id == y.dev_id && x.app_id == y.app_id; +} +inline std::ostream& operator<<(std::ostream& output, const Subject& who) { + output << "Subject(dev:" << who.dev_id << ", app:" << who.app_id << ")"; + return output; +} + +struct Object { + policy_table::ModuleType module; +}; +inline bool operator<(const Object& x, const Object& y) { + return x.module < y.module; +} +inline bool operator==(const Object& x, const Object& y) { + return x.module == y.module; +} +inline std::ostream& operator<<(std::ostream& output, const Object& what) { + output << "Object(module:" << EnumToJsonString(what.module) << ")"; + return output; +} + +typedef std::vector RemoteControlParams; + +class AccessRemote { + public: + virtual ~AccessRemote() {} + + /** + * Initializes oneself + */ + virtual void Init() = 0; + + /** + * Enables remote control + */ + virtual void Enable() = 0; + + /** + * Disables remote control + */ + virtual void Disable() = 0; + + /** + * Checks if remote control is enabled + * @return true if enabled + */ + virtual bool IsEnabled() const = 0; + + /** + * Checks whether device is driver's device + * @param dev_id unique device id + * @return true if device is have driver + */ + virtual bool IsPrimaryDevice(const PTString& dev_id) const = 0; + + /** + * Sets device as driver's device + * @param dev_id ID device + */ + virtual void SetPrimaryDevice(const PTString& dev_id) = 0; + + /** + * Gets current primary device + * @return ID device + */ + virtual PTString PrimaryDevice() const = 0; + + /** + * Allows access subject to object + * @param who subject is dev_id and app_id + * @param what object is group_id + */ + virtual void Allow(const Subject& who, const Object& what) = 0; + + /** + * Denies access subject to object + * @param who subject is dev_id and app_id + * @param what object is group_id + */ + virtual void Deny(const Subject& who, const Object& what) = 0; + + /** + * Resets access subject to all object + * @param who subject is dev_id and app_id + */ + virtual void Reset(const Subject& who) = 0; + + /** + * Resets access to object for all subjects + * @param what object is group + */ + virtual void Reset(const Object& what) = 0; + + /* + * Resets all stored consents + */ + virtual void Reset() = 0; + + /** + * Checks access subject to object + * @param who subject is dev_id and app_id + * @param what object is group_id + * @return allowed if access was given, disallowed if access was denied + * manual if need to ask driver + */ + virtual TypeAccess Check(const Subject& who, const Object& what) const = 0; + + /** + * Checks permissions for module + * @param app_id application ID + * @param module type + * @return true if allowed + */ + virtual bool CheckModuleType(const PTString& app_id, + policy_table::ModuleType module) const = 0; + + /** + * Sets HMI types if application has default policy permissions + * @param who subject + * @param hmi_types list of HMI types + */ + virtual void SetDefaultHmiTypes(const Subject& who, + const std::vector& hmi_types) = 0; + + /** + * Gets groups + * @param who subject + * @return list of groups + */ + virtual const policy_table::Strings& GetGroups(const Subject& who) = 0; + + /** + * Gets permissions for application + * @param device_id + * @param app_id + * @param group_types + * @return true if success + */ + virtual bool GetPermissionsForApp(const std::string& device_id, + const std::string& app_id, + FunctionalIdType& group_types) = 0; + + /** + * Checks if application has remote functionality + * @param who subject + * @return true if application uses remote control + */ + virtual bool IsAppRemoteControl(const Subject& who) = 0; + + /** + * Gets all allowed module types + * @param app_id unique identifier of application + * @param list of allowed module types + * @return true if application has allowed modules + */ + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) = 0; +}; + +} // namespace policy + +#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_H_ diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h new file mode 100644 index 0000000000..72223dccab --- /dev/null +++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_ +#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_ + +#include +#include "policy/policy_table/types.h" +#include "utils/macro.h" +#include "utils/shared_ptr.h" +#include "policy/access_remote.h" +#include "policy/cache_manager.h" + +using policy_table::FunctionalGroupings; + +namespace policy { + +class AccessRemoteImpl : public AccessRemote { + public: + AccessRemoteImpl(); + explicit AccessRemoteImpl(utils::SharedPtr cache); + + virtual void Init(); + virtual void Enable(); + virtual void Disable(); + virtual bool IsEnabled() const; + + virtual bool IsPrimaryDevice(const PTString& dev_id) const; + virtual void SetPrimaryDevice(const PTString& dev_id); + virtual PTString PrimaryDevice() const; + + virtual void Allow(const Subject& who, const Object& what); + virtual void Deny(const Subject& who, const Object& what); + virtual void Reset(const Subject& who); + virtual void Reset(const Object& what); + virtual void Reset(); + virtual TypeAccess Check(const Subject& who, const Object& what) const; + virtual bool CheckModuleType(const PTString& app_id, + policy_table::ModuleType module) const; + virtual void SetDefaultHmiTypes(const Subject& who, + const std::vector& hmi_types); + virtual const policy_table::Strings& GetGroups(const Subject& who); + virtual bool GetPermissionsForApp(const std::string& device_id, + const std::string& app_id, + FunctionalIdType& group_types); + virtual bool IsAppRemoteControl(const Subject& who); + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules); + + private: + typedef std::map AccessControlRow; + typedef std::map AccessControlList; + typedef std::map HMIList; + inline void set_enabled(bool value); + inline bool country_consent() const; + const policy_table::AppHMITypes& HmiTypes(const Subject& who); + void GetGroupsIds(const std::string& device_id, + const std::string& app_id, + FunctionalGroupIDs& grops_ids); + bool IsAllowed(const policy_table::AccessModules& modules, + const std::string& module_name, + const std::string& rpc_name, + RemoteControlParams* input) const; + bool CompareParameters(const policy_table::Strings& parameters, + RemoteControlParams* input) const; + utils::SharedPtr cache_; + PTString primary_device_; + bool enabled_; + AccessControlList acl_; + HMIList hmi_types_; + + friend struct Erase; + friend struct IsTypeAccess; + +#ifdef BUILD_TESTS + FRIEND_TEST(AccessRemoteImplTest, KeyMapTest); + FRIEND_TEST(AccessRemoteImplTest, Allow); + FRIEND_TEST(AccessRemoteImplTest, Deny); + FRIEND_TEST(AccessRemoteImplTest, ChangeAccess); + FRIEND_TEST(AccessRemoteImplTest, ResetBySubject); + FRIEND_TEST(AccessRemoteImplTest, ResetByObject); + FRIEND_TEST(AccessRemoteImplTest, CheckAllowed); + FRIEND_TEST(AccessRemoteImplTest, CheckDisallowed); + FRIEND_TEST(AccessRemoteImplTest, CheckManual); + FRIEND_TEST(AccessRemoteImplTest, CheckModuleType); + FRIEND_TEST(AccessRemoteImplTest, EnableDisable); + FRIEND_TEST(AccessRemoteImplTest, SetDefaultHmiTypes); + FRIEND_TEST(AccessRemoteImplTest, GetGroups); +#endif // BUILD_TESTS +}; + +} // namespace policy + +#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_ diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index 95aed36f89..428a9bd2f6 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -914,6 +914,14 @@ class CacheManager : public CacheManagerInterface { sync_primitives::Lock backuper_locker_; BackgroundBackuper* backuper_; const PolicySettings* settings_; + + friend class AccessRemoteImpl; + +#ifdef BUILD_TESTS + FRIEND_TEST(AccessRemoteImplTest, CheckModuleType); + FRIEND_TEST(AccessRemoteImplTest, EnableDisable); + FRIEND_TEST(AccessRemoteImplTest, GetGroups); +#endif // BUILD_TESTS }; } // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_CACHE_MANAGER_H_ diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h index 10d6908b14..ece033c23c 100644 --- a/src/components/policy/policy_external/include/policy/policy_helper.h +++ b/src/components/policy/policy_external/include/policy/policy_helper.h @@ -323,6 +323,23 @@ FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first, * @return true, if succeded, otherwise - false */ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies); -} + +#ifdef SDL_REMOTE_CONTROL + +struct ProccessAppGroups { + ProccessAppGroups(const policy_table::ApplicationPolicies& apps, + PolicyManagerImpl* pm) + : new_apps_(apps), pm_(pm), default_(new_apps_.find(kDefaultId)) {} + void operator()(const policy_table::ApplicationPolicies::value_type& app); + + private: + const policy_table::ApplicationPolicies& new_apps_; + PolicyManagerImpl* pm_; + policy_table::ApplicationPolicies::const_iterator default_; +}; + +#endif // SDL_REMOTE_CONTROL + +} // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_ diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index a37d0d66b9..952aa5d32e 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -43,6 +43,11 @@ #include "policy/policy_table/functions.h" #include "policy/usage_statistics/statistics_manager.h" +#ifdef SDL_REMOTE_CONTROL +#include "policy/access_remote.h" +#include "policy/access_remote_impl.h" +#endif // SDL_REMOTE_CONTROL + namespace policy_table = rpc::policy_table_interface_base; namespace policy { @@ -174,6 +179,41 @@ class PolicyManagerImpl : public PolicyManager { const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types); +#ifdef SDL_REMOTE_CONTROL + void SetDefaultHmiTypes(const std::string& application_id, + const std::vector& hmi_types); + + /** + * Gets HMI types + * @param application_id ID application + * @param app_types list to save HMI types + * @return true if policy has specific policy for this application + */ + virtual bool GetHMITypes(const std::string& application_id, + std::vector* app_types) OVERRIDE; + virtual void set_access_remote(utils::SharedPtr access_remote); + TypeAccess CheckDriverConsent(const Subject& who, + const Object& what, + const std::string& rpc, + const RemoteControlParams& params); + void CheckPTUUpdatesChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot); + bool CheckPTURemoteCtrlChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot); + + void CheckRemoteGroupsChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot); + + void SendHMILevelChanged(const Subject& who); + void UpdateDeviceRank(const Subject& who, const std::string& rank); + + void OnPrimaryGroupsChanged(const std::string& application_id); + void OnNonPrimaryGroupsChanged(const std::string& application_id); +#endif // SDL_REMOTE_CONTROL + virtual void RemoveAppConsentForGroup(const std::string& app_id, const std::string& group_name); @@ -345,6 +385,37 @@ class PolicyManagerImpl : public PolicyManager { bool IsPTValid(utils::SharedPtr policy_table, policy_table::PolicyTableType type) const; +#ifdef SDL_REMOTE_CONTROL + void GetPermissions(const std::string device_id, + const std::string application_id, + Permissions* data); + virtual TypeAccess CheckAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + const PTString& rpc, + const RemoteControlParams& params); + virtual bool CheckModule(const PTString& app_id, const PTString& module); + virtual void SetAccess(const PTString& dev_id, + const PTString& app_id, + const PTString& module, + bool allowed); + virtual void ResetAccess(const PTString& dev_id, const PTString& app_id); + virtual void ResetAccess(const PTString& module); + virtual void SetPrimaryDevice(const PTString& dev_id); + virtual void ResetPrimaryDevice(); + virtual PTString PrimaryDevice() const; + virtual void SetRemoteControl(bool enabled); + virtual bool GetRemoteControl() const; + virtual void OnChangedPrimaryDevice(const std::string& device_id, + const std::string& application_id); + virtual void OnChangedRemoteControl(const std::string& device_id, + const std::string& application_id); + virtual void SendAppPermissionsChanged(const std::string& device_id, + const std::string& application_id); + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const; +#endif // SDL_REMOTE_CONTROL + /** * @brief Notify application about its permissions changes by preparing and * sending OnPermissionsChanged notification @@ -449,6 +520,10 @@ class PolicyManagerImpl : public PolicyManager { UpdateStatusManager update_status_manager_; CacheManagerInterfaceSPtr cache_; +#ifdef SDL_REMOTE_CONTROL + utils::SharedPtr access_remote_; +#endif + sync_primitives::Lock apps_registration_lock_; sync_primitives::Lock app_permissions_diff_lock_; diff --git a/src/components/policy/policy_external/include/policy/policy_table/enums.h b/src/components/policy/policy_external/include/policy/policy_table/enums.h index 4b0a7d74bc..4f8ae5c98d 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_external/include/policy/policy_table/enums.h @@ -120,7 +120,8 @@ enum AppHMIType { AHT_BACKGROUND_PROCESS, AHT_TESTING, AHT_SYSTEM, - AHT_PROJECTION + AHT_PROJECTION, + AHT_REMOTE_CONTROL, }; bool IsValidEnum(AppHMIType val); const char* EnumToJsonString(AppHMIType val); diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index 9606788bae..a5121ec021 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -102,6 +102,12 @@ typedef Map DeviceData; typedef Array, 0, 255> RequestsTypeArray; +#ifdef SDL_REMOTE_CONTROL +typedef Map RemoteRpcs; +typedef Map AccessModules; +typedef Array, 0, 255> ModuleTypes; +#endif // SDL_REMOTE_CONTROL + typedef AppHMIType AppHmiType; typedef std::vector AppHmiTypes; @@ -169,6 +175,11 @@ struct ApplicationParams : PolicyBase { Optional RequestType; Optional > memory_kb; Optional > heart_beat_timeout_ms; +#ifdef SDL_REMOTE_CONTROL + Optional groups_primaryRC; + Optional groups_nonPrimaryRC; + mutable Optional moduleType; +#endif // SDL_REMOTE_CONTROL public: ApplicationParams(); @@ -188,6 +199,9 @@ struct ApplicationParams : PolicyBase { private: bool Validate() const; +#ifdef SDL_REMOTE_CONTROL + bool ValidateModuleTypes() const; +#endif // SDL_REMOTE_CONTROL }; struct ApplicationPoliciesSection : CompositeType { @@ -294,6 +308,10 @@ struct ModuleConfig : CompositeType { Optional > preloaded_date; Optional > certificate; Optional preloaded_pt; +#ifdef SDL_REMOTE_CONTROL + Optional user_consent_passengersRC; + Optional country_consent_passengersRC; +#endif // SDL_REMOTE_CONTROL public: ModuleConfig(); diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h index ab95659917..375d4b4b59 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -56,6 +56,7 @@ const std::string kDefaultDeviceConnectionType = "UNKNOWN"; */ const std::string kPreDataConsentId = "pre_DataConsent"; const std::string kDefaultId = "default"; +const std::string kPreConsentPassengersRC = "pre_consent_passengersRC"; const std::string kDeviceId = "device"; const std::string kPrimary = "rc_primaryDevice"; diff --git a/src/components/policy/policy_external/include/policy/sql_pt_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_queries.h index 685c84742f..a4832aab26 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_queries.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_queries.h @@ -126,10 +126,6 @@ extern const std::string kSelectModuleTypes; extern const std::string kInsertAppGroupPrimary; extern const std::string kInsertAppGroupNonPrimary; extern const std::string kInsertModuleType; -extern const std::string kInsertInteriorZone; -extern const std::string kCountInteriorZones; -extern const std::string kSelectInteriorZones; -extern const std::string kDeleteInteriorZones; extern const std::string kInsertAccessModule; extern const std::string kSelectAccessModules; extern const std::string kDeleteAccessModules; diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h index b3ce0a69be..424769fb41 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h @@ -98,6 +98,31 @@ class SQLPTRepresentation : public virtual PTRepresentation { } #endif // BUILD_TESTS protected: +#ifdef SDL_REMOTE_CONTROL + enum TypeAccess { kAllowed, kManual }; + bool GatherAppGroupPrimary(const std::string& app_id, + policy_table::Strings* app_groups) const; + bool GatherAppGroupNonPrimary(const std::string& app_id, + policy_table::Strings* app_groups) const; + bool GatherModuleType(const std::string& app_id, + policy_table::ModuleTypes* module_types) const; + bool GatherRemoteControlDenied(const std::string& app_id, bool* denied) const; + bool GatherAccessModule(TypeAccess access, + policy_table::AccessModules* modules) const; + bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const; + bool SaveAppGroupPrimary(const std::string& app_id, + const policy_table::Strings& app_groups); + bool SaveAppGroupNonPrimary(const std::string& app_id, + const policy_table::Strings& app_groups); + bool SaveModuleType(const std::string& app_id, + const policy_table::ModuleTypes& types); + bool SaveRemoteControlDenied(const std::string& app_id, bool deny); + + bool SaveAccessModule(TypeAccess access, + const policy_table::AccessModules& modules); + bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs); +#endif // SDL_REMOTE_CONTROL + virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const; virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const; virtual bool GatherUsageAndErrorCounts( diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc new file mode 100644 index 0000000000..929d9eb1d8 --- /dev/null +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -0,0 +1,389 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#include "policy/access_remote_impl.h" + +#include +#include +#include "policy/cache_manager.h" +#include "utils/logger.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl") + +using policy_table::DeviceData; +using policy_table::FunctionalGroupings; +using rpc::policy_table_interface_base::EnumFromJsonString; + +namespace policy { + +struct Erase { + private: + const Subject& who_; + + public: + explicit Erase(const Subject& who) : who_(who) {} + void operator()(AccessRemoteImpl::AccessControlList::value_type& row) const { + row.second.erase(who_); + } +}; + +struct IsTypeAccess { + private: + const TypeAccess& type_; + + public: + explicit IsTypeAccess(const TypeAccess& type) : type_(type) {} + bool operator()( + const AccessRemoteImpl::AccessControlRow::value_type& item) const { + return item.second == type_; + } +}; + +struct ToHMIType { + policy_table::AppHMITypes::value_type operator()(int item) const { + policy_table::AppHMIType type = static_cast(item); + if (!IsValidEnum(type)) { + LOG4CXX_WARN(logger_, "HMI type isn't known " << item); + type = policy_table::AHT_DEFAULT; + } + LOG4CXX_DEBUG(logger_, + "HMI type: " << item << " - " << EnumToJsonString(type)); + return policy_table::AppHMITypes::value_type(type); + } +}; + +struct Contained { + private: + const policy_table::Strings& params_; + + public: + explicit Contained(const policy_table::Strings& params) : params_(params) {} + bool operator()(const RemoteControlParams::value_type& item) const { + return std::find_if(params_.begin(), params_.end(), CompareString(item)) != + params_.end(); + } + struct CompareString { + private: + const RemoteControlParams::value_type& value_; + + public: + explicit CompareString(const RemoteControlParams::value_type& value) + : value_(value) {} + bool operator()(const policy_table::Strings::value_type& item) const { + return value_ == static_cast(item); + } + }; +}; + +struct ToModuleType { + std::string operator()(policy_table::ModuleTypes::value_type item) const { + policy_table::ModuleType type = static_cast(item); + return EnumToJsonString(type); + } +}; + +AccessRemoteImpl::AccessRemoteImpl() + : cache_(new CacheManager()), primary_device_(), enabled_(true), acl_() {} + +AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) + : cache_(cache), primary_device_(), enabled_(true), acl_() {} + +void AccessRemoteImpl::Init() { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK(cache_->pt_); + + policy_table::ModuleConfig& config = cache_->pt_->policy_table.module_config; + enabled_ = country_consent() && + (!config.user_consent_passengersRC.is_initialized() || + *config.user_consent_passengersRC); +} + +bool AccessRemoteImpl::IsPrimaryDevice(const PTString& dev_id) const { + LOG4CXX_AUTO_TRACE(logger_); + return primary_device_ == dev_id; +} + +TypeAccess AccessRemoteImpl::Check(const Subject& who, + const Object& what) const { + LOG4CXX_AUTO_TRACE(logger_); + AccessControlList::const_iterator i = acl_.find(what); + if (i != acl_.end()) { + const AccessControlRow& row = i->second; + AccessControlRow::const_iterator j = row.find(who); + if (j != row.end()) { + // who has permissions + TypeAccess ret = j->second; + LOG4CXX_TRACE(logger_, + "Subject " << who << " has permissions " << ret + << " to object " << what); + return ret; + } + } + return TypeAccess::kManual; +} + +bool AccessRemoteImpl::CheckModuleType(const PTString& app_id, + policy_table::ModuleType module) const { + LOG4CXX_AUTO_TRACE(logger_); + if (!cache_->IsApplicationRepresented(app_id)) { + return false; + } + + const policy_table::ApplicationParams& app = + cache_->pt_->policy_table.app_policies_section.apps[app_id]; + if (!app.moduleType.is_initialized()) { + return false; + } + + const policy_table::ModuleTypes& modules = *app.moduleType; + if (modules.empty()) { + return true; + } + + return std::find(modules.begin(), modules.end(), module) != modules.end(); +} + +bool AccessRemoteImpl::IsAllowed(const policy_table::AccessModules& modules, + const std::string& module_name, + const std::string& rpc_name, + RemoteControlParams* input) const { + LOG4CXX_AUTO_TRACE(logger_); + policy_table::AccessModules::const_iterator i = modules.find(module_name); + if (i == modules.end()) { + LOG4CXX_DEBUG(logger_, "Module " << module_name << " wasn't found"); + return false; + } + + const policy_table::RemoteRpcs& rpcs = i->second; + if (rpcs.empty()) { + return true; + } + policy_table::RemoteRpcs::const_iterator j = rpcs.find(rpc_name); + if (j != rpcs.end()) { + const policy_table::Strings& parameters = j->second; + return CompareParameters(parameters, input); + } + LOG4CXX_DEBUG(logger_, "RPC " << rpc_name << " wasn't found"); + return false; +} + +bool AccessRemoteImpl::CompareParameters( + const policy_table::Strings& parameters, RemoteControlParams* input) const { + LOG4CXX_AUTO_TRACE(logger_); + if (parameters.empty()) { + return true; + } + + if (input->empty()) { + LOG4CXX_DEBUG(logger_, "Input is empty"); + return false; + } + + input->erase( + std::remove_if(input->begin(), input->end(), Contained(parameters)), + input->end()); + return input->empty(); +} + +void AccessRemoteImpl::Allow(const Subject& who, const Object& what) { + LOG4CXX_AUTO_TRACE(logger_); + acl_[what][who] = TypeAccess::kAllowed; +} + +void AccessRemoteImpl::Deny(const Subject& who, const Object& what) { + LOG4CXX_AUTO_TRACE(logger_); + acl_[what][who] = TypeAccess::kDisallowed; +} + +void AccessRemoteImpl::Reset(const Subject& who) { + LOG4CXX_AUTO_TRACE(logger_); + std::for_each(acl_.begin(), acl_.end(), Erase(who)); +} + +void AccessRemoteImpl::Reset(const Object& what) { + LOG4CXX_AUTO_TRACE(logger_); + acl_.erase(what); +} + +void AccessRemoteImpl::Reset() { + acl_.clear(); +} + +void AccessRemoteImpl::SetPrimaryDevice(const PTString& dev_id) { + LOG4CXX_AUTO_TRACE(logger_); + primary_device_ = dev_id; +} + +PTString AccessRemoteImpl::PrimaryDevice() const { + return primary_device_; +} + +void AccessRemoteImpl::Enable() { + LOG4CXX_AUTO_TRACE(logger_); + set_enabled(true); +} + +void AccessRemoteImpl::Disable() { + LOG4CXX_AUTO_TRACE(logger_); + set_enabled(false); +} + +void AccessRemoteImpl::set_enabled(bool value) { + enabled_ = country_consent() && value; + *cache_->pt_->policy_table.module_config.user_consent_passengersRC = value; + cache_->Backup(); +} + +bool AccessRemoteImpl::country_consent() const { + policy_table::ModuleConfig& config = cache_->pt_->policy_table.module_config; + return !config.country_consent_passengersRC.is_initialized() || + *config.country_consent_passengersRC; +} + +bool AccessRemoteImpl::IsEnabled() const { + LOG4CXX_AUTO_TRACE(logger_); + return enabled_; +} + +void AccessRemoteImpl::SetDefaultHmiTypes(const Subject& who, + const std::vector& hmi_types) { + LOG4CXX_AUTO_TRACE(logger_); + HMIList::mapped_type types; + std::transform(hmi_types.begin(), + hmi_types.end(), + std::back_inserter(types), + ToHMIType()); + hmi_types_[who] = types; +} + +const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes( + const Subject& who) { + LOG4CXX_AUTO_TRACE(logger_); + if (cache_->IsDefaultPolicy(who.app_id)) { + return hmi_types_[who]; + } else { + return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] + .AppHMIType; + } +} + +const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { + LOG4CXX_AUTO_TRACE(logger_); + if (IsAppRemoteControl(who)) { + if (IsPrimaryDevice(who.dev_id)) { + return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] + .groups_primaryRC; + } else if (IsEnabled()) { + return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] + .groups_nonPrimaryRC; + } else { + return cache_->GetGroups(kPreConsentPassengersRC); + } + } + return cache_->GetGroups(who.app_id); +} + +bool AccessRemoteImpl::IsAppRemoteControl(const Subject& who) { + const policy_table::AppHMITypes& hmi_types = HmiTypes(who); + return std::find(hmi_types.begin(), + hmi_types.end(), + policy_table::AHT_REMOTE_CONTROL) != hmi_types.end(); +} + +bool AccessRemoteImpl::GetPermissionsForApp(const std::string& device_id, + const std::string& app_id, + FunctionalIdType& group_types) { + LOG4CXX_AUTO_TRACE(logger_); + GetGroupsIds(device_id, app_id, group_types[kTypeGeneral]); + GetGroupsIds(device_id, kDefaultId, group_types[kTypeDefault]); + GetGroupsIds( + device_id, kPreDataConsentId, group_types[kTypePreDataConsented]); + + cache_->GetPreConsentedGroups(app_id, group_types[kTypePreconsented]); + + cache_->GetConsentedGroups(device_id, + app_id, + group_types[kTypeAllowed], + group_types[kTypeDisallowed]); + + cache_->GetUnconsentedGroups( + device_id, app_id, group_types[kTypeUnconsented]); + + cache_->GetAllAppGroups(kDeviceId, group_types[kTypeDevice]); + return true; +} + +std::ostream& operator<<(std::ostream& output, + const FunctionalGroupIDs& types) { + std::copy(types.begin(), + types.end(), + std::ostream_iterator(output, " ")); + return output; +} + +extern std::ostream& operator<<(std::ostream& output, + const policy_table::Strings& groups); + +void AccessRemoteImpl::GetGroupsIds(const std::string& device_id, + const std::string& app_id, + FunctionalGroupIDs& groups_ids) { + Subject who = {device_id, app_id}; + const policy_table::Strings& groups = GetGroups(who); + LOG4CXX_DEBUG(logger_, "Groups Names: " << groups); + groups_ids.resize(groups.size()); + std::transform(groups.begin(), + groups.end(), + groups_ids.begin(), + &CacheManager::GenerateHash); + LOG4CXX_DEBUG(logger_, "Groups Ids: " << groups_ids); +} + +bool AccessRemoteImpl::GetModuleTypes(const std::string& application_id, + std::vector* modules) { + DCHECK(modules); + policy_table::ApplicationPolicies& apps = + cache_->pt_->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::iterator i = apps.find(application_id); + if (i == apps.end()) { + return false; + } + rpc::Optional moduleTypes = i->second.moduleType; + if (!moduleTypes.is_initialized()) { + return false; + } + std::transform(moduleTypes->begin(), + moduleTypes->end(), + std::back_inserter(*modules), + ToModuleType()); + return true; +} + +} // namespace policy diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index cb27e7f0b3..f9c69f58d3 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -865,4 +865,53 @@ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) { return true; } + +#ifdef SDL_REMOTE_CONTROL +bool HaveGroupsChanged(const rpc::Optional& old_groups, + const rpc::Optional& new_groups) { + if (!old_groups.is_initialized() && !new_groups.is_initialized()) { + return false; + } + if (!old_groups.is_initialized() || !new_groups.is_initialized()) { + return true; + } + policy_table::Strings old_groups_abs = *old_groups; + policy_table::Strings new_groups_abs = *new_groups; + if (old_groups_abs.size() != new_groups_abs.size()) { + return true; + } + std::sort(new_groups_abs.begin(), new_groups_abs.end(), Compare); + std::sort(old_groups_abs.begin(), old_groups_abs.end(), Compare); + + return std::equal(new_groups_abs.begin(), + new_groups_abs.end(), + old_groups_abs.begin(), + Compare); } + +void ProccessAppGroups::operator()( + const policy_table::ApplicationPolicies::value_type& app) { + policy_table::ApplicationPolicies::const_iterator i = + new_apps_.find(app.first); + if (i == new_apps_.end() && default_ != new_apps_.end()) { + i = default_; + } + if (i != new_apps_.end()) { + if (HaveGroupsChanged(i->second.groups_primaryRC, + app.second.groups_primaryRC)) { + LOG4CXX_DEBUG(logger_, + "Primary groups for " << app.first << " have changed"); + + pm_->OnPrimaryGroupsChanged(app.first); + } + if (HaveGroupsChanged(i->second.groups_nonPrimaryRC, + app.second.groups_nonPrimaryRC)) { + LOG4CXX_DEBUG(logger_, + "Non-primary groups for " << app.first << " have changed"); + pm_->OnNonPrimaryGroupsChanged(app.first); + } + } +} + +#endif // SDL_REMOTE_CONTROL +} // namespace policy diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 0a774f6b79..d968912725 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -51,6 +51,11 @@ #include "config_profile/profile.h" #include "utils/make_shared.h" +#ifdef SDL_REMOTE_CONTROL +#include "policy/access_remote.h" +#include "policy/access_remote_impl.h" +#endif // SDL_REMOTE_CONTROL + policy::PolicyManager* CreateManager() { return new policy::PolicyManagerImpl(); } @@ -211,22 +216,32 @@ PolicyManagerImpl::PolicyManagerImpl() : PolicyManager() , listener_(NULL) , cache_(new CacheManager) +#ifdef SDL_REMOTE_CONTROL + , access_remote_(new AccessRemoteImpl( + CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) +#endif // SDL_REMOTE_CONTROL , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) - , retry_sequence_url_(0, 0, "") {} + , retry_sequence_url_(0, 0, "") { +} PolicyManagerImpl::PolicyManagerImpl(bool in_memory) : PolicyManager() , listener_(NULL) , cache_(new CacheManager(in_memory)) +#ifdef SDL_REMOTE_CONTROL + , access_remote_(new AccessRemoteImpl( + CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) +#endif // SDL_REMOTE_CONTROL , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) , retry_sequence_url_(0, 0, "") , wrong_ptu_update_received_(false) , send_on_update_sent_out_(false) - , trigger_ptu_(false) {} + , trigger_ptu_(false) { +} void PolicyManagerImpl::set_listener(PolicyListener* listener) { listener_ = listener; @@ -325,6 +340,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, listener_->OnCertificateUpdated( *(pt_update->policy_table.module_config.certificate)); +#ifdef SDL_REMOTE_CONTROL + access_remote_->Init(); + CheckPTUUpdatesChange(pt_update, policy_table_snapshot); +#endif // SDL_REMOTE_CONTROL std::map app_hmi_types; cache_->GetHMIAppTypeAfterUpdate(app_hmi_types); @@ -578,7 +597,13 @@ void PolicyManagerImpl::CheckPermissions(const PTString& app_id, policy_table::FunctionalGroupings functional_groupings; cache_->GetFunctionalGroupings(functional_groupings); - policy_table::Strings app_groups = GetGroupsNames(app_group_permissions); +#ifdef SDL_REMOTE_CONTROL + Subject who = {device_id, app_id}; + const policy_table::Strings app_groups = access_remote_->GetGroups(who); +#else // SDL_REMOTE_CONTROL + const policy_table::Strings app_groups = + GetGroupsNames(app_group_permissions); +#endif // SDL_REMOTE_CONTROL // Undefined groups (without user consent) disallowed by default, since // OnPermissionsChange notification has no "undefined" section @@ -757,6 +782,17 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( LOG4CXX_INFO(logger_, "Send notification for application_id:" << application_id); +#ifdef SDL_REMOTE_CONTROL + const Subject who = {device_id, application_id}; + if (access_remote_->IsAppRemoteControl(who)) { + const std::string rank = + access_remote_->IsPrimaryDevice(who.dev_id) ? "DRIVER" : "PASSENGER"; + UpdateDeviceRank(who, rank); + listener()->OnPermissionsUpdated(application_id, notification_data); + return; + } +#endif // SDL_REMOTE_CONTROL + std::string default_hmi; GetDefaultHmi(application_id, &default_hmi); @@ -1135,7 +1171,17 @@ void PolicyManagerImpl::GetPermissionsForApp( } FunctionalIdType group_types; - if (!cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types)) { + +#ifdef SDL_REMOTE_CONTROL + allowed_by_default = false; + const bool ret = access_remote_->GetPermissionsForApp( + device_id, app_id_to_check, group_types); +#else + const bool ret = + cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types); +#endif // REMOTE_CONTROL + + if (!ret) { LOG4CXX_WARN(logger_, "Can't get user permissions for app " << policy_app_id); return; @@ -1863,6 +1909,9 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name, if (ret) { RefreshRetrySequence(); update_status_manager_.OnPolicyInit(cache_->UpdateRequired()); +#ifdef SDL_REMOTE_CONTROL + access_remote_->Init(); +#endif // SDL_REMOTE_CONTROL } return ret; } @@ -1880,4 +1929,346 @@ void PolicyManagerImpl::set_cache_manager( cache_ = cache_manager; } +std::ostream& operator<<(std::ostream& output, + const policy_table::Strings& groups) { + for (policy_table::Strings::const_iterator i = groups.begin(); + i != groups.end(); + ++i) { + output << static_cast(*i) << " "; + } + return output; +} + +#ifdef SDL_REMOTE_CONTROL +void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id, + const std::vector& hmi_types) { + LOG4CXX_INFO(logger_, "SetDefaultHmiTypes"); + const std::string device_id = GetCurrentDeviceId(application_id); + Subject who = {device_id, application_id}; + access_remote_->SetDefaultHmiTypes(who, hmi_types); +} + +struct HMITypeToInt { + int operator()(const policy_table::AppHMITypes::value_type item) { + return policy_table::AppHMIType(item); + } +}; + +bool PolicyManagerImpl::GetHMITypes(const std::string& application_id, + std::vector* app_types) { + LOG4CXX_AUTO_TRACE(logger_); + if (cache_->IsDefaultPolicy(application_id)) { + return false; + } + const policy_table::AppHMITypes* hmi_types = + cache_->GetHMITypes(application_id); + if (hmi_types) { + std::transform(hmi_types->begin(), + hmi_types->end(), + std::back_inserter(*app_types), + HMITypeToInt()); + } + return hmi_types; +} + +TypeAccess PolicyManagerImpl::CheckAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + const PTString& rpc, + const RemoteControlParams& params) { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Module type: " << module); + + policy_table::ModuleType module_type; + bool is_valid = EnumFromJsonString(module, &module_type); + if (is_valid && access_remote_->CheckModuleType(app_id, module_type)) { + if (access_remote_->IsPrimaryDevice(device_id)) { + return TypeAccess::kAllowed; + } else { + Subject who = {device_id, app_id}; + Object what = {module_type}; + return CheckDriverConsent(who, what, rpc, params); + } + } + LOG4CXX_DEBUG(logger_, TypeAccess::kDisallowed); + return TypeAccess::kDisallowed; +} + +bool PolicyManagerImpl::CheckModule(const PTString& app_id, + const PTString& module) { + LOG4CXX_AUTO_TRACE(logger_); + policy_table::ModuleType module_type; + return EnumFromJsonString(module, &module_type) && + access_remote_->CheckModuleType(app_id, module_type); +} + +TypeAccess PolicyManagerImpl::CheckDriverConsent( + const Subject& who, + const Object& what, + const std::string& rpc, + const RemoteControlParams& params) { + LOG4CXX_AUTO_TRACE(logger_); + if (!access_remote_->IsEnabled()) { + return TypeAccess::kDisallowed; + } + + return access_remote_->Check(who, what); +} + +void PolicyManagerImpl::SetAccess(const PTString& dev_id, + const PTString& app_id, + const PTString& module, + bool allowed) { + LOG4CXX_AUTO_TRACE(logger_); + policy_table::ModuleType module_type; + bool is_valid = EnumFromJsonString(module, &module_type); + if (!is_valid) { + return; + } + + Subject who = {dev_id, app_id}; + Object what = {module_type}; + LOG4CXX_DEBUG(logger_, + "Driver's consent: " << who << ", " << what << " is " + << std::boolalpha << allowed); + if (allowed) { + access_remote_->Allow(who, what); + } else { + access_remote_->Deny(who, what); + } +} + +void PolicyManagerImpl::ResetAccess(const PTString& dev_id, + const PTString& app_id) { + LOG4CXX_AUTO_TRACE(logger_); + Subject who = {dev_id, app_id}; + access_remote_->Reset(who); +} + +void PolicyManagerImpl::ResetAccess(const PTString& module) { + LOG4CXX_AUTO_TRACE(logger_); + policy_table::ModuleType module_type; + bool is_valid = EnumFromJsonString(module, &module_type); + if (!is_valid) { + return; + } + + Object what = {module_type}; + access_remote_->Reset(what); +} + +void PolicyManagerImpl::SetPrimaryDevice(const PTString& dev_id) { + LOG4CXX_AUTO_TRACE(logger_); + access_remote_->SetPrimaryDevice(dev_id); +} + +void PolicyManagerImpl::ResetPrimaryDevice() { + LOG4CXX_AUTO_TRACE(logger_); + access_remote_->SetPrimaryDevice(""); +} + +PTString PolicyManagerImpl::PrimaryDevice() const { + LOG4CXX_AUTO_TRACE(logger_); + return access_remote_->PrimaryDevice(); +} + +void PolicyManagerImpl::SetRemoteControl(bool enabled) { + LOG4CXX_AUTO_TRACE(logger_); + if (enabled) { + access_remote_->Enable(); + } else { + access_remote_->Disable(); + } +} + +bool PolicyManagerImpl::GetRemoteControl() const { + return access_remote_->IsEnabled(); +} + +void PolicyManagerImpl::OnChangedPrimaryDevice( + const std::string& device_id, const std::string& application_id) { + LOG4CXX_AUTO_TRACE(logger_); + Subject who = {device_id, application_id}; + if (!access_remote_->IsAppRemoteControl(who)) { + LOG4CXX_INFO(logger_, "Application " << who << " isn't remote"); + return; + } + + const std::string rank = + access_remote_->IsPrimaryDevice(who.dev_id) ? "DRIVER" : "PASSENGER"; + UpdateDeviceRank(who, rank); + SendAppPermissionsChanged(who.dev_id, who.app_id); +} + +void PolicyManagerImpl::OnChangedRemoteControl( + const std::string& device_id, const std::string& application_id) { + LOG4CXX_AUTO_TRACE(logger_); + Subject who = {device_id, application_id}; + if (!access_remote_->IsAppRemoteControl(who)) { + LOG4CXX_INFO(logger_, "Application " << who << " isn't remote"); + return; + } + + if (access_remote_->IsPrimaryDevice(who.dev_id)) { + LOG4CXX_INFO(logger_, "Device " << who.dev_id << " is primary"); + return; + } + + if (!access_remote_->IsEnabled()) { + SendHMILevelChanged(who); + } + + SendAppPermissionsChanged(who.dev_id, who.app_id); +} + +void PolicyManagerImpl::UpdateDeviceRank(const Subject& who, + const std::string& rank) { + std::string default_hmi("NONE"); + if (GetDefaultHmi(who.app_id, &default_hmi)) { + access_remote_->Reset(who); + listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi, rank); + } else { + LOG4CXX_WARN(logger_, + "Couldn't get default HMI level for application " + << who.app_id); + } +} + +void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { + std::string default_hmi("NONE"); + if (GetDefaultHmi(who.app_id, &default_hmi)) { + access_remote_->Reset(who); + listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi); + } else { + LOG4CXX_WARN(logger_, + "Couldn't get default HMI level for application " + << who.app_id); + } +} + +void PolicyManagerImpl::GetPermissions(const std::string device_id, + const std::string application_id, + Permissions* data) { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK(data); + std::vector app_group_permissions; + GetPermissionsForApp(device_id, application_id, app_group_permissions); + + policy_table::FunctionalGroupings functional_groupings; + cache_->GetFunctionalGroupings(functional_groupings); + + policy_table::Strings app_groups; + std::vector::const_iterator it = + app_group_permissions.begin(); + std::vector::const_iterator it_end = + app_group_permissions.end(); + for (; it != it_end; ++it) { + app_groups.push_back((*it).group_name); + } + + PrepareNotificationData( + functional_groupings, app_groups, app_group_permissions, *data); +} + +void PolicyManagerImpl::SendAppPermissionsChanged( + const std::string& device_id, const std::string& application_id) { + Permissions notification_data; + GetPermissions(device_id, application_id, ¬ification_data); + listener()->OnPermissionsUpdated(application_id, notification_data); +} + +void PolicyManagerImpl::CheckPTUUpdatesChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot) { + CheckPTURemoteCtrlChange(pt_update, snapshot); + CheckRemoteGroupsChange(pt_update, snapshot); +} + +bool PolicyManagerImpl::CheckPTURemoteCtrlChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot) { + LOG4CXX_AUTO_TRACE(logger_); + + rpc::Optional& new_consent = + pt_update->policy_table.module_config.country_consent_passengersRC; + rpc::Optional& old_consent = + snapshot->policy_table.module_config.country_consent_passengersRC; + + if (!new_consent.is_initialized() && !old_consent.is_initialized()) { + return false; + } + + bool result = false; + if (new_consent.is_initialized() && old_consent.is_initialized()) { + result = (*new_consent != *old_consent); + } else { + bool not_changed_consent1 = !new_consent.is_initialized() && *old_consent; + bool not_changed_consent2 = !old_consent.is_initialized() && *new_consent; + + result = !(not_changed_consent1 || not_changed_consent2); + } + + if (result) { + listener()->OnRemoteAllowedChanged(result); + } + + return result; +} + +void PolicyManagerImpl::CheckRemoteGroupsChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot) { + LOG4CXX_AUTO_TRACE(logger_); + + policy_table::ApplicationPolicies& new_apps = + pt_update->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies& old_apps = + snapshot->policy_table.app_policies_section.apps; + std::for_each( + old_apps.begin(), old_apps.end(), ProccessAppGroups(new_apps, this)); +} + +void PolicyManagerImpl::OnPrimaryGroupsChanged( + const std::string& application_id) { + const std::vector devices = + listener()->GetDevicesIds(application_id); + for (std::vector::const_iterator i = devices.begin(); + i != devices.end(); + ++i) { + const Subject who = {*i, application_id}; + if (access_remote_->IsAppRemoteControl(who) && + access_remote_->IsPrimaryDevice(who.dev_id)) { + SendAppPermissionsChanged(who.dev_id, who.app_id); + } + } +} + +void PolicyManagerImpl::OnNonPrimaryGroupsChanged( + const std::string& application_id) { + const std::vector devices = + listener()->GetDevicesIds(application_id); + for (std::vector::const_iterator i = devices.begin(); + i != devices.end(); + ++i) { + const Subject who = {*i, application_id}; + if (access_remote_->IsAppRemoteControl(who) && + !access_remote_->IsPrimaryDevice(who.dev_id) && + access_remote_->IsEnabled()) { + SendAppPermissionsChanged(who.dev_id, who.app_id); + } + } +} + +bool PolicyManagerImpl::GetModuleTypes( + const std::string& application_id, + std::vector* modules) const { + return access_remote_->GetModuleTypes(application_id, modules); +} + +void PolicyManagerImpl::set_access_remote( + utils::SharedPtr access_remote) { + access_remote_ = access_remote; +} +#endif // SDL_REMOTE_CONTROL + } // namespace policy diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc index 45db2cb469..fc108217c4 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -1,4 +1,3 @@ -// This file is generated, do not edit #include "policy/policy_table/enums.h" namespace rpc { @@ -440,6 +439,8 @@ bool IsValidEnum(AppHMIType val) { return true; case AHT_PROJECTION: return true; + case AHT_REMOTE_CONTROL: + return true; default: return false; } @@ -466,8 +467,6 @@ const char* EnumToJsonString(AppHMIType val) { return "TESTING"; case AHT_SYSTEM: return "SYSTEM"; - case AHT_PROJECTION: - return "PROJECTION"; default: return ""; } @@ -506,6 +505,9 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) { } else if ("PROJECTION" == literal) { *result = AHT_PROJECTION; return true; + } else if ("REMOTE_CONTROL" == literal) { + *result = AHT_REMOTE_CONTROL; + return true; } else { return false; } @@ -682,6 +684,10 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) { *result = RT_DRIVER_PROFILE; return true; } +} +else if ("REMOTE_CONTROL" == literal) { + *result = AHT_REMOTE_CONTROL; + return true; if ("VOICE_SEARCH" == literal) { *result = RT_VOICE_SEARCH; return true; @@ -722,6 +728,41 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) { } } +#ifdef SDL_REMOTE_CONTROL +bool IsValidEnum(ModuleType val) { + switch (val) { + case MT_CLIMATE: + return true; + case MT_RADIO: + return true; + default: + return false; + } +} +const char* EnumToJsonString(ModuleType val) { + switch (val) { + case MT_CLIMATE: + return "CLIMATE"; + case MT_RADIO: + return "RADIO"; + default: + return ""; + } +} + +bool EnumFromJsonString(const std::string& literal, ModuleType* result) { + if ("CLIMATE" == literal) { + *result = MT_CLIMATE; + return true; + } else if ("RADIO" == literal) { + *result = MT_RADIO; + return true; + } else { + return false; + } +} +#endif // SDL_REMOTE_CONTROL + const std::string kDefaultApp = "default"; const std::string kPreDataConsentApp = "pre_DataConsent"; const std::string kDeviceApp = "device"; diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index 528d70a426..5c962cc4da 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -239,8 +239,14 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , AppHMIType(impl::ValueMember(value__, "AppHMIType")) , RequestType(impl::ValueMember(value__, "RequestType")) , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) - , heart_beat_timeout_ms( - impl::ValueMember(value__, "heart_beat_timeout_ms")) {} + , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) +#ifdef SDL_REMOTE_CONTROL + , groups_primaryRC(impl::ValueMember(value__, "groups_primaryRC")) + , groups_nonPrimaryRC(impl::ValueMember(value__, "groups_nonPrimaryRC")) + , moduleType(impl::ValueMember(value__, "moduleType")) +#endif // SDL_REMOTE_CONTROL +{ +} Json::Value ApplicationParams::ToJsonValue() const { Json::Value result__(PolicyBase::ToJsonValue()); @@ -250,6 +256,11 @@ Json::Value ApplicationParams::ToJsonValue() const { impl::WriteJsonField("memory_kb", memory_kb, &result__); impl::WriteJsonField( "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); +#ifdef SDL_REMOTE_CONTROL + impl::WriteJsonField("groups_primaryRC", groups_primaryRC, &result__); + impl::WriteJsonField("groups_nonPrimaryRC", groups_nonPrimaryRC, &result__); + impl::WriteJsonField("moduleType", moduleType, &result__); +#endif // SDL_REMOTE_CONTROL return result__; } @@ -271,6 +282,17 @@ bool ApplicationParams::is_valid() const { if (!heart_beat_timeout_ms.is_valid()) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (!groups_primaryRC.is_valid()) { + return false; + } + if (!groups_nonPrimaryRC.is_valid()) { + return false; + } + if (!moduleType.is_valid()) { + return false; + } +#endif // SDL_REMOTE_CONTROL return Validate(); } @@ -297,6 +319,17 @@ bool ApplicationParams::struct_empty() const { if (heart_beat_timeout_ms.is_initialized()) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (groups_primaryRC.is_initialized()) { + return false; + } + if (groups_nonPrimaryRC.is_initialized()) { + return false; + } + if (moduleType.is_initialized()) { + return false; + } +#endif // SDL_REMOTE_CONTROL return true; } @@ -339,6 +372,20 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { heart_beat_timeout_ms.ReportErrors( &report__->ReportSubobject("heart_beat_timeout_ms")); } + +#ifdef SDL_REMOTE_CONTROL + if (!groups_primaryRC.is_valid()) { + groups_primaryRC.ReportErrors( + &report__->ReportSubobject("groups_primaryRC")); + } + if (!groups_nonPrimaryRC.is_valid()) { + groups_nonPrimaryRC.ReportErrors( + &report__->ReportSubobject("groups_nonPrimaryRC")); + } + if (!moduleType.is_valid()) { + moduleType.ReportErrors(&report__->ReportSubobject("moduleType")); + } +#endif // SDL_REMOTE_CONTROL } void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { @@ -347,6 +394,11 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { RequestType.SetPolicyTableType(pt_type); memory_kb.SetPolicyTableType(pt_type); heart_beat_timeout_ms.SetPolicyTableType(pt_type); +#ifdef SDL_REMOTE_CONTROL + groups_primaryRC.SetPolicyTableType(pt_type); + groups_nonPrimaryRC.SetPolicyTableType(pt_type); + moduleType.SetPolicyTableType(pt_type); +#endif // SDL_REMOTE_CONTROL } // RpcParameters methods @@ -549,7 +601,15 @@ ModuleConfig::ModuleConfig(const Json::Value* value__) , vehicle_year(impl::ValueMember(value__, "vehicle_year")) , preloaded_date(impl::ValueMember(value__, "preloaded_date")) , certificate(impl::ValueMember(value__, "certificate")) - , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) {} + , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) +#ifdef SDL_REMOTE_CONTROL + , user_consent_passengersRC( + impl::ValueMember(value__, "user_consent_passengersRC")) + , country_consent_passengersRC( + impl::ValueMember(value__, "country_consent_passengersRC")) +#endif // SDL_REMOTE_CONTROL +{ +} void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { exchange_after_x_days = from.exchange_after_x_days; @@ -566,6 +626,11 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { vehicle_make.assign_if_valid(from.vehicle_make); vehicle_model.assign_if_valid(from.vehicle_model); vehicle_year.assign_if_valid(from.vehicle_year); +#ifdef SDL_REMOTE_CONTROL + user_consent_passengersRC.assign_if_valid(from.user_consent_passengersRC); + country_consent_passengersRC.assign_if_valid( + from.country_consent_passengersRC); +#endif // SDL_REMOTE_CONTROL } Json::Value ModuleConfig::ToJsonValue() const { @@ -592,6 +657,12 @@ Json::Value ModuleConfig::ToJsonValue() const { impl::WriteJsonField("vehicle_year", vehicle_year, &result__); impl::WriteJsonField("certificate", certificate, &result__); impl::WriteJsonField("preloaded_date", preloaded_date, &result__); +#ifdef SDL_REMOTE_CONTROL + impl::WriteJsonField( + "user_consent_passengersRC", user_consent_passengersRC, &result__); + impl::WriteJsonField( + "country_consent_passengersRC", country_consent_passengersRC, &result__); +#endif // SDL_REMOTE_CONTROL return result__; } @@ -638,6 +709,14 @@ bool ModuleConfig::is_valid() const { if (!preloaded_date.is_valid()) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (!user_consent_passengersRC.is_valid()) { + return false; + } + if (!country_consent_passengersRC.is_valid()) { + return false; + } +#endif // SDL_REMOTE_CONTROL return Validate(); } @@ -687,6 +766,14 @@ bool ModuleConfig::struct_empty() const { if (vehicle_year.is_initialized()) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (user_consent_passengersRC.is_initialized()) { + return false; + } + if (country_consent_passengersRC.is_initialized()) { + return false; + } +#endif // SDL_REMOTE_CONTROL return true; } @@ -736,6 +823,16 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { if (!vehicle_year.is_valid()) { vehicle_year.ReportErrors(&report__->ReportSubobject("vehicle_year")); } +#ifdef SDL_REMOTE_CONTROL + if (!user_consent_passengersRC.is_valid()) { + user_consent_passengersRC.ReportErrors( + &report__->ReportSubobject("user_consent_passengersRC")); + } + if (!country_consent_passengersRC.is_valid()) { + country_consent_passengersRC.ReportErrors( + &report__->ReportSubobject("country_consent_passengersRC")); + } +#endif // SDL_REMOTE_CONTROL const std::string validation_info = omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType()); @@ -754,6 +851,13 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { omitted_field_report = &report__->ReportSubobject("vehicle_model"); omitted_field_report->set_validation_info(validation_info); } +#ifdef SDL_REMOTE_CONTROL + if (user_consent_passengersRC.is_initialized()) { + omitted_field_report = + &report__->ReportSubobject("user_consent_passengersRC"); + omitted_field_report->set_validation_info(validation_info); + } +#endif // SDL_REMOTE_CONTROL break; } case PT_UPDATE: { @@ -787,6 +891,10 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) { vehicle_make.SetPolicyTableType(pt_type); vehicle_model.SetPolicyTableType(pt_type); vehicle_year.SetPolicyTableType(pt_type); +#ifdef SDL_REMOTE_CONTROL + user_consent_passengersRC.SetPolicyTableType(pt_type); + country_consent_passengersRC.SetPolicyTableType(pt_type); +#endif // SDL_REMOTE_CONTROL } // MessageString methods diff --git a/src/components/policy/policy_external/src/policy_table/validation.cc b/src/components/policy/policy_external/src/policy_table/validation.cc index b7e6dcc337..48a8578855 100644 --- a/src/components/policy/policy_external/src/policy_table/validation.cc +++ b/src/components/policy/policy_external/src/policy_table/validation.cc @@ -135,6 +135,39 @@ bool ApplicationPoliciesSection::Validate() const { return true; } + +#ifdef SDL_REMOTE_CONTROL +bool ApplicationParams::ValidateModuleTypes() const { + // moduleType is optional so see Optional::is_valid() + bool is_initialized = moduleType->is_initialized(); + if (!is_initialized) { + // valid if not initialized + return true; + } + bool is_valid = moduleType->is_valid(); + if (is_valid) { + return true; + } + + struct IsInvalid { + bool operator()(Enum item) const { + return !item.is_valid(); + } + }; + // cut invalid items + moduleType->erase( + std::remove_if(moduleType->begin(), moduleType->end(), IsInvalid()), + moduleType->end()); + bool empty = moduleType->empty(); + if (empty) { + // set non initialized value + ModuleTypes non_initialized; + moduleType = Optional(non_initialized); + } + return true; +} +#endif // SDL_REMOTE_CONTROL + bool ApplicationParams::Validate() const { if (is_initialized()) { if (preconsented_groups.is_initialized()) { @@ -145,8 +178,13 @@ bool ApplicationParams::Validate() const { } } } +#ifdef SDL_REMOTE_CONTROL + return ValidateModuleTypes(); +#else // SDL_REMOTE_CONTROL return true; +#endif // SDL_REMOTE_CONTROL } + bool RpcParameters::Validate() const { return true; } diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc index 1cd789f00d..6b3acd44ec 100644 --- a/src/components/policy/policy_external/src/sql_pt_queries.cc +++ b/src/components/policy/policy_external/src/sql_pt_queries.cc @@ -77,7 +77,7 @@ const std::string kCreateSchema = " `vehicle_year` VARCHAR(4), " " `preloaded_date` VARCHAR (10), " " `certificate` VARCHAR (45), " - " `user_consent_passengersRC` BOOL," + " `user_consent_passengersRC` BOOL, " " `country_consent_passengersRC` BOOL " "); " "CREATE TABLE IF NOT EXISTS `functional_group`( " @@ -392,31 +392,12 @@ const std::string kCreateSchema = "idx` " " ON `app_group_non_primary`(`application_id`); " - /* interior_zone */ - "CREATE TABLE `interior_zone`( " - " `id` INTEGER PRIMARY KEY NOT NULL, " - " `name` VARCHAR(100) NOT NULL, " - " `col` INTEGER NOT NULL, " - " `row` INTEGER NOT NULL, " - " `level` INTEGER NOT NULL " - "); " - "CREATE UNIQUE INDEX `interior_zone.room` ON " - "`interior_zone`(`col`,`row`,`level`); " - /* access_module */ "CREATE TABLE `access_module`( " " `id` INTEGER PRIMARY KEY NOT NULL, " " `name` VARCHAR(45) NOT NULL, " - " `zone_id` INTEGER NOT NULL, " - " `user_consent_needed` INTEGER NOT NULL, " - "CONSTRAINT `fk_module_1` " - " FOREIGN KEY(`zone_id`) " - " REFERENCES `interior_zone`(`id`) " + " `user_consent_needed` INTEGER NOT NULL " "); " - "CREATE INDEX `access_module.zone_module` ON " - "`access_module`(`name`,`zone_id`); " - "CREATE INDEX `access_module.fk_module_1_idx` ON " - "`access_module`(`zone_id`); " /* remote_rpc */ "CREATE TABLE `remote_rpc`( " @@ -522,24 +503,12 @@ const std::string kInsertAppGroupNonPrimary = const std::string kUpdateRemoteControlDenied = "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?"; -const std::string kCountInteriorZones = - "SELECT COUNT(`id`) FROM `interior_zone`"; - -const std::string kDeleteInteriorZones = "DELETE FROM `interior_zone`"; - const std::string kDeleteAccessModules = "DELETE FROM `access_module`"; const std::string kDeleteRemoteRpc = "DELETE FROM `remote_rpc`"; -const std::string kInsertInteriorZone = - "INSERT INTO `interior_zone` (`name`, `col`, `row`, `level`) " - " VALUES(?, ?, ?, ?)"; - -const std::string kSelectInteriorZones = - "SELECT `id`, `name`, `col`, `row`, `level` FROM `interior_zone`"; - const std::string kInsertAccessModule = - "INSERT INTO `access_module` (`name`, `zone_id`, `user_consent_needed`) " + "INSERT INTO `access_module` (`name`, `user_consent_needed`) " " VALUES(?, ?, ?)"; const std::string kDeleteAppGroupPrimaryByApplicationId = @@ -550,7 +519,7 @@ const std::string kDeleteAppGroupNonPrimaryByApplicationId = const std::string kSelectAccessModules = "SELECT `id`, `name` FROM `access_module` " - " WHERE `zone_id` = ? AND `user_consent_needed` = ?"; + " WHERE `user_consent_needed` = ?"; const std::string kInsertRemoteRpc = "INSERT INTO `remote_rpc` (`module_id`, `name`, `parameter`) " @@ -619,9 +588,7 @@ const std::string kDropSchema = "`app_group_non_primary.fk_application_has_functional_group_functional_" "group1_idx`; " "DROP TABLE IF EXISTS `app_group_non_primary`; " - "DROP TABLE IF EXISTS `interior_zone`; " "DROP TABLE IF EXISTS `access_module`; " - "DROP INDEX IF EXISTS `access_module.zone_module`; " "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; " "DROP INDEX IF EXISTS " "`app_group.fk_application_has_functional_group_application1_idx`; " @@ -674,7 +641,6 @@ const std::string kDeleteData = "DELETE FROM `rpc`; " "DELETE FROM `app_group_primary`; " "DELETE FROM `app_group_non_primary`; " - "DELETE FROM `interior_zone`; " "DELETE FROM `access_module`; " "DELETE FROM `version`; " "DELETE FROM `message_type`; " diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 1732f3c774..1960fb6e03 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -552,6 +552,12 @@ void SQLPTRepresentation::GatherModuleConfig( *config->vehicle_year = query.GetString(7); *config->preloaded_date = query.GetString(8); *config->certificate = query.GetString(9); +#ifdef SDL_REMOTE_CONTROL + *config->user_consent_passengersRC = + query.IsNull(8) ? true : query.GetBoolean(10); + *config->country_consent_passengersRC = + query.IsNull(9) ? true : query.GetBoolean(11); +#endif // SDL_REMOTE_CONTROL } utils::dbms::SQLQuery endpoints(db()); @@ -764,6 +770,25 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( if (!GatherAppGroup(app_id, ¶ms.groups)) { return false; } + +#ifdef SDL_REMOTE_CONTROL + if (!GatherAppGroupPrimary(app_id, &*params.groups_primaryRC)) { + return false; + } + if (!GatherAppGroupNonPrimary(app_id, &*params.groups_nonPrimaryRC)) { + return false; + } + bool denied = false; + if (!GatherRemoteControlDenied(app_id, &denied)) { + return false; + } + if (!denied) { + if (!GatherModuleType(app_id, &*params.moduleType)) { + return false; + } + } +#endif // SDL_REMOTE_CONTROL + if (!GatherNickName(app_id, &*params.nicknames)) { return false; } @@ -953,6 +978,22 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection( LOG4CXX_WARN(logger_, "Incorrect delete from app_group."); return false; } + +#ifdef SDL_REMOTE_CONTROL + if (!query_delete.Exec(sql_pt::kDeleteAppGroupPrimary)) { + LOG4CXX_WARN(logger_, "Incorrect delete from app_group_primary."); + return false; + } + if (!query_delete.Exec(sql_pt::kDeleteAppGroupNonPrimary)) { + LOG4CXX_WARN(logger_, "Incorrect delete from app_group_non_primary."); + return false; + } + if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) { + LOG4CXX_WARN(logger_, "Incorrect delete from module_type."); + return false; + } +#endif // SDL_REMOTE_CONTROL + if (!query_delete.Exec(sql_pt::kDeleteApplication)) { LOG4CXX_WARN(logger_, "Incorrect delete from application."); return false; @@ -1033,6 +1074,22 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( if (!SaveAppGroup(app.first, app.second.groups)) { return false; } + +#ifdef SDL_REMOTE_CONTROL + if (!SaveAppGroupPrimary(app.first, *app.second.groups_primaryRC)) { + return false; + } + if (!SaveAppGroupNonPrimary(app.first, *app.second.groups_nonPrimaryRC)) { + return false; + } + + bool denied = !app.second.moduleType->is_initialized(); + if (!SaveRemoteControlDenied(app.first, denied) || + !SaveModuleType(app.first, *app.second.moduleType)) { + return false; + } +#endif // SDL_REMOTE_CONTROL + if (!SaveNickname(app.first, *app.second.nicknames)) { return false; } @@ -1195,6 +1252,14 @@ bool SQLPTRepresentation::SaveModuleConfig( : query.Bind(8); config.certificate.is_initialized() ? query.Bind(9, *(config.certificate)) : query.Bind(9); +#ifdef SDL_REMOTE_CONTROL + config.user_consent_passengersRC.is_initialized() + ? query.Bind(10, *(config.user_consent_passengersRC)) + : query.Bind(10); + config.country_consent_passengersRC.is_initialized() + ? query.Bind(11, *(config.country_consent_passengersRC)) + : query.Bind(11); +#endif // SDL_REMOTE_CONTROL if (!query.Exec()) { LOG4CXX_WARN(logger_, "Incorrect update module config"); @@ -1596,6 +1661,280 @@ bool SQLPTRepresentation::GatherAppGroup( return true; } +#ifdef SDL_REMOTE_CONTROL +bool SQLPTRepresentation::GatherAppGroupPrimary( + const std::string& app_id, policy_table::Strings* app_groups) const { + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectAppGroupsPrimary)) { + LOG4CXX_WARN(logger_, "Incorrect select from app groups for primary RC"); + return false; + } + + query.Bind(0, app_id); + while (query.Next()) { + app_groups->push_back(query.GetString(0)); + } + return true; +} + +bool SQLPTRepresentation::GatherAppGroupNonPrimary( + const std::string& app_id, policy_table::Strings* app_groups) const { + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectAppGroupsNonPrimary)) { + LOG4CXX_WARN(logger_, + "Incorrect select from app groups for non primary RC"); + return false; + } + + query.Bind(0, app_id); + while (query.Next()) { + app_groups->push_back(query.GetString(0)); + } + return true; +} + +bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id, + bool* denied) const { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectRemoteControlDenied)) { + LOG4CXX_WARN(logger_, "Incorrect select remote control flag"); + return false; + } + query.Bind(0, app_id); + if (query.Next()) { + *denied = query.GetBoolean(0); + } else { + return false; + } + return true; +} + +bool SQLPTRepresentation::GatherModuleType( + const std::string& app_id, policy_table::ModuleTypes* app_types) const { + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectModuleTypes)) { + LOG4CXX_WARN(logger_, "Incorrect select from app types"); + return false; + } + + query.Bind(0, app_id); + while (query.Next()) { + policy_table::ModuleType type; + if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) { + return false; + } + app_types->push_back(type); + } + return true; +} + +bool SQLPTRepresentation::SaveAppGroupPrimary( + const std::string& app_id, const policy_table::Strings& app_groups) { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertAppGroupPrimary)) { + LOG4CXX_WARN(logger_, "Incorrect insert statement for app group primary"); + return false; + } + policy_table::Strings::const_iterator it; + for (it = app_groups.begin(); it != app_groups.end(); ++it) { + std::string ssss = *it; + LOG4CXX_INFO(logger_, "Group: " << ssss); + query.Bind(0, app_id); + query.Bind(1, *it); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, + "Incorrect insert into app group primary." + << query.LastError().text()); + return false; + } + } + + return true; +} + +bool SQLPTRepresentation::SaveAppGroupNonPrimary( + const std::string& app_id, const policy_table::Strings& app_groups) { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertAppGroupNonPrimary)) { + LOG4CXX_WARN(logger_, + "Incorrect insert statement for app group non primary"); + return false; + } + policy_table::Strings::const_iterator it; + for (it = app_groups.begin(); it != app_groups.end(); ++it) { + std::string ssss = *it; + LOG4CXX_INFO(logger_, "Group: " << ssss); + query.Bind(0, app_id); + query.Bind(1, *it); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, + "Incorrect insert into app group non primary." + << query.LastError().text()); + return false; + } + } + + return true; +} + +bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id, + bool deny) { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kUpdateRemoteControlDenied)) { + LOG4CXX_WARN(logger_, "Incorrect update statement for remote control flag"); + return false; + } + LOG4CXX_DEBUG(logger_, "App: " << app_id << std::boolalpha << " - " << deny); + query.Bind(0, deny); + query.Bind(1, app_id); + if (!query.Exec()) { + LOG4CXX_WARN(logger_, "Incorrect update remote control flag."); + return false; + } + return true; +} + +bool SQLPTRepresentation::SaveModuleType( + const std::string& app_id, const policy_table::ModuleTypes& types) { + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertModuleType)) { + LOG4CXX_WARN(logger_, "Incorrect insert statement for module type"); + return false; + } + + policy_table::ModuleTypes::const_iterator it; + for (it = types.begin(); it != types.end(); ++it) { + query.Bind(0, app_id); + std::string module(policy_table::EnumToJsonString(*it)); + query.Bind(1, module); + LOG4CXX_DEBUG(logger_, + "Module(app: " << app_id << ", type: " << module << ")"); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, "Incorrect insert into module type."); + return false; + } + } + + return true; +} + +bool SQLPTRepresentation::SaveAccessModule( + TypeAccess access, const policy_table::AccessModules& modules) { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertAccessModule)) { + LOG4CXX_WARN(logger_, "Incorrect insert statement for access module"); + return false; + } + + policy_table::AccessModules::const_iterator i; + for (i = modules.begin(); i != modules.end(); ++i) { + const std::string& name = i->first; + const policy_table::RemoteRpcs& rpcs = i->second; + query.Bind(0, name); + query.Bind(1, access); + if (!query.Exec()) { + LOG4CXX_WARN(logger_, "Incorrect insert into access module."); + return false; + } + int id = query.LastInsertId(); + if (!query.Reset()) { + LOG4CXX_WARN(logger_, "Couldn't reset query access module."); + return false; + } + if (!SaveRemoteRpc(id, rpcs)) { + return false; + } + } + return true; +} + +bool SQLPTRepresentation::GatherAccessModule( + TypeAccess access, policy_table::AccessModules* modules) const { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectAccessModules)) { + LOG4CXX_WARN(logger_, "Incorrect select from access module"); + return false; + } + + query.Bind(0, access); + while (query.Next()) { + int id = query.GetInteger(0); + std::string name = query.GetString(1); + policy_table::RemoteRpcs rpcs; + if (!GatherRemoteRpc(id, &rpcs)) { + return false; + } + modules->insert(std::make_pair(name, rpcs)); + } + return true; +} + +bool SQLPTRepresentation::SaveRemoteRpc(int module_id, + const policy_table::RemoteRpcs& rpcs) { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertRemoteRpc)) { + LOG4CXX_WARN(logger_, "Incorrect insert statement for remote rpc"); + return false; + } + policy_table::RemoteRpcs::const_iterator i; + for (i = rpcs.begin(); i != rpcs.end(); ++i) { + const std::string& name = i->first; + const policy_table::Strings& params = i->second; + policy_table::Strings::const_iterator j; + if (params.empty()) { + query.Bind(0, module_id); + query.Bind(1, name); + query.Bind(2); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc."); + return false; + } + } else { + for (j = params.begin(); j != params.end(); ++j) { + const std::string& param = *j; + query.Bind(0, module_id); + query.Bind(1, name); + query.Bind(2, param); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc."); + return false; + } + } + } + } + return true; +} + +bool SQLPTRepresentation::GatherRemoteRpc( + int module_id, policy_table::RemoteRpcs* rpcs) const { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectRemoteRpcs)) { + LOG4CXX_WARN(logger_, "Incorrect select from remote rpc"); + return false; + } + + query.Bind(0, module_id); + while (query.Next()) { + std::string name = query.GetString(0); + if (!query.IsNull(1)) { + std::string parameter = query.GetString(1); + (*rpcs)[name].push_back(parameter); + } else { + rpcs->insert(std::make_pair(name, policy_table::Strings())); + } + } + return true; +} +#endif // SDL_REMOTE_CONTROL + bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id, bool is_revoked, bool is_default, @@ -1681,6 +2020,32 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { return false; } +#ifdef SDL_REMOTE_CONTROL + dbms::SQLQuery query_p(db()); + if (!query_p.Prepare(sql_pt::kDeleteAppGroupPrimaryByApplicationId)) { + LOG4CXX_ERROR(logger_, + "Incorrect statement to delete from app_group_primary."); + return false; + } + query_p.Bind(0, app_id); + if (!query_p.Exec()) { + LOG4CXX_ERROR(logger_, "Failed deleting from app_group_primary."); + return false; + } + + dbms::SQLQuery query_np(db()); + if (!query_np.Prepare(sql_pt::kDeleteAppGroupNonPrimaryByApplicationId)) { + LOG4CXX_ERROR(logger_, + "Incorrect statement to delete from app_group_non_primary."); + return false; + } + query_np.Bind(0, app_id); + if (!query_np.Exec()) { + LOG4CXX_ERROR(logger_, "Failed deleting from app_group_non_primary."); + return false; + } +#endif // SDL_REMOTE_CONTROL + if (!CopyApplication(kDefaultId, app_id)) { return false; } @@ -1699,8 +2064,18 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { } policy_table::Strings default_groups; - if (GatherAppGroup(kDefaultId, &default_groups) && - SaveAppGroup(app_id, default_groups)) { + bool ret = (GatherAppGroup(kDefaultId, &default_groups) && + SaveAppGroup(app_id, default_groups)); +#ifdef SDL_REMOTE_CONTROL + policy_table::Strings groups_primary; + ret = ret && (GatherAppGroupPrimary(kDefaultId, &groups_primary) && + SaveAppGroupPrimary(app_id, groups_primary)); + policy_table::Strings groups_non_primary; + ret = ret && (GatherAppGroupNonPrimary(kDefaultId, &groups_non_primary) && + SaveAppGroupNonPrimary(app_id, groups_non_primary)); +#endif // SDL_REMOTE_CONTROL + + if (ret) { return SetIsDefault(app_id, true); } return false; diff --git a/src/components/policy/policy_external/test/CMakeLists.txt b/src/components/policy/policy_external/test/CMakeLists.txt index 8b77c90dd2..a455d43b91 100644 --- a/src/components/policy/policy_external/test/CMakeLists.txt +++ b/src/components/policy/policy_external/test/CMakeLists.txt @@ -55,6 +55,12 @@ file (GLOB POLICY_TEST_SOURCES list (REMOVE_ITEM POLICY_TEST_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/policy_manager_impl_stress_test.cc) +if (REMOTE_CONTROL) + list (APPEND testSources + access_remote_impl_test.cc + ) +endif () + create_test("policy_test" "${POLICY_TEST_SOURCES}" "${testLibraries}") #Additional test files (json) diff --git a/src/components/policy/policy_external/test/include/policy/mock_access_remote.h b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h new file mode 100644 index 0000000000..01e48805b6 --- /dev/null +++ b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_ +#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_ + +#include "gmock/gmock.h" +#include "policy/access_remote.h" + +namespace test { +namespace components { +namespace access_remote_test { + +class MockSubject : public policy::Subject { + public: +}; + +class MockObject : public policy::Object { + public: +}; + +class MockAccessRemote : public policy::AccessRemote { + public: + MOCK_METHOD0(Init, void()); + MOCK_METHOD0(Enable, void()); + MOCK_METHOD0(Disable, void()); + MOCK_CONST_METHOD0(IsEnabled, bool()); + MOCK_CONST_METHOD1(IsPrimaryDevice, bool(const policy::PTString& dev_id)); + MOCK_METHOD1(SetPrimaryDevice, void(const policy::PTString& dev_id)); + MOCK_CONST_METHOD0(PrimaryDevice, policy::PTString()); + + MOCK_METHOD2(Allow, + void(const policy::Subject& who, const policy::Object& what)); + MOCK_METHOD2(Deny, + void(const policy::Subject& who, const policy::Object& what)); + MOCK_METHOD1(Reset, void(const policy::Subject& who)); + MOCK_METHOD1(Reset, void(const policy::Object& what)); + MOCK_CONST_METHOD2(Check, + policy::TypeAccess(const policy::Subject& who, + const policy::Object& what)); + MOCK_CONST_METHOD3( + FindGroup, + policy::PTString(const policy::Subject& who, + const policy::PTString& rpc, + const policy::RemoteControlParams& params)); + MOCK_METHOD2(SetDefaultHmiTypes, + void(const policy::Subject& who, + const std::vector& hmi_types)); + MOCK_METHOD1(GetGroups, + const policy_table::Strings&(const policy::Subject& who)); + MOCK_METHOD3(GetPermissionsForApp, + bool(const std::string& device_id, + const std::string& app_id, + policy::FunctionalIdType& group_types)); + MOCK_CONST_METHOD2(CheckModuleType, + bool(const policy::PTString& app_id, + policy_table::ModuleType module)); + MOCK_METHOD1(IsAppRemoteControl, bool(const policy::Subject& who)); + MOCK_METHOD0(Reset, void()); + MOCK_METHOD2(GetModuleTypes, + bool(const std::string& application_id, + std::vector* modules)); +}; + +} // namespace access_remote_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_ diff --git a/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h b/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h new file mode 100644 index 0000000000..397201ce40 --- /dev/null +++ b/src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2016, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_ +#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_ + +#include "gmock/gmock.h" +#include "policy/usage_statistics/app_stopwatch.h" + +namespace test { +namespace components { +namespace usage_statistics_test { + +class MockAppStopwatch : public usage_statistics::AppStopwatch { + public: + MOCK_METHOD1(Start, void(usage_statistics::AppStopwatchId stopwatch_type)); + MOCK_METHOD1(Switch, void(usage_statistics::AppStopwatchId stopwatch_type)); + MOCK_METHOD0(WriteTime, void()); +}; + +} // namespace usage_statistics_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_APP_STOPWATCH_H_ diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc index 92525c646d..1ece673711 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc @@ -323,6 +323,8 @@ TEST_F(SQLPTExtRepresentationTest, module_config["vehicle_model"] = Json::Value("ModelT"); module_config["vehicle_year"] = Json::Value("2014"); module_config["certificate"] = Json::Value("my_cert"); + module_config["country_consent_passengersRC"] = Json::Value(false); + module_config["user_consent_passengersRC"] = Json::Value(false); Json::Value& functional_groupings = policy_table["functional_groupings"]; functional_groupings["default"] = Json::Value(Json::objectValue); diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index a0a544deeb..d835a5c389 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -85,7 +85,7 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, policy_settings_; static void SetUpTestCase() { - const std::string kAppStorageFolder = "storage1"; + const std::string kAppStorageFolder = "storage_SQLPTRepresentationTest"; reps = new SQLPTRepresentation(in_memory_); ASSERT_TRUE(reps != NULL); policy_settings_ = std::auto_ptr( @@ -407,7 +407,7 @@ TEST_F(SQLPTRepresentationTest, query.Prepare(query_select); query.Next(); - const int policy_tables_number = 35; + const int policy_tables_number = 34; ASSERT_EQ(policy_tables_number, query.GetInteger(0)); const std::string query_select_count_of_iap_buffer_full = @@ -1607,6 +1607,10 @@ TEST_F(SQLPTRepresentationTest, table["policy_table"]["device_data"] = Json::Value(Json::objectValue); table["policy_table"]["module_meta"] = Json::Value(Json::objectValue); table["policy_table"]["module_config"]["preloaded_pt"] = Json::Value(false); + table["policy_table"]["module_config"]["country_consent_passengersRC"] = + Json::Value(false); + table["policy_table"]["module_config"]["user_consent_passengersRC"] = + Json::Value(false); policy_table::Table expected(&table); Json::StyledWriter writer; // Checks diff --git a/src/components/policy/policy_regular/CMakeLists.txt b/src/components/policy/policy_regular/CMakeLists.txt index 76e10a58b0..c7b9c068b9 100644 --- a/src/components/policy/policy_regular/CMakeLists.txt +++ b/src/components/policy/policy_regular/CMakeLists.txt @@ -65,12 +65,17 @@ set(EXCLUDE_PATHS ) set(PATHS - ${CMAKE_CURRENT_SOURCE_DIR}/include/ - ${CMAKE_CURRENT_SOURCE_DIR}/src/ + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/src ${COMPONENTS_DIR}/rpc_base/src/rpc_base/rpc_base.cc ) collect_sources(SOURCES "${PATHS}" "${EXCLUDE_PATHS}") +if (NOT REMOTE_CONTROL) + list(REMOVE_ITEM SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/src/access_remote_impl.cc) +endif() + set(LIBRARIES ConfigProfile policy_struct diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h new file mode 100644 index 0000000000..b9fd8862e9 --- /dev/null +++ b/src/components/policy/policy_regular/include/policy/access_remote.h @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_ACCESS_REMOTE_H_ +#define SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_ACCESS_REMOTE_H_ + +#include +#include +#include +#include "policy/policy_table/types.h" +#include "policy/policy_types.h" + +namespace policy_table = ::rpc::policy_table_interface_base; + +namespace policy { + +enum TypeAccess { kDisallowed, kAllowed, kManual }; +inline std::ostream& operator<<(std::ostream& output, TypeAccess x) { + output << "Access: "; + switch (x) { + case kDisallowed: + output << "DISALLOWED"; + break; + case kAllowed: + output << "ALLOWED"; + break; + case kManual: + output << "MANUAL"; + break; + default: + output << "Error: Unknown type"; + } + return output; +} + +struct Subject { + PTString dev_id; + PTString app_id; +}; +inline bool operator<(const Subject& x, const Subject& y) { + return x.dev_id < y.dev_id || (x.dev_id == y.dev_id && x.app_id < y.app_id); +} +inline bool operator==(const Subject& x, const Subject& y) { + return x.dev_id == y.dev_id && x.app_id == y.app_id; +} +inline std::ostream& operator<<(std::ostream& output, const Subject& who) { + output << "Subject(dev:" << who.dev_id << ", app:" << who.app_id << ")"; + return output; +} + +struct Object { + policy_table::ModuleType module; +}; +inline bool operator<(const Object& x, const Object& y) { + return x.module < y.module; +} +inline bool operator==(const Object& x, const Object& y) { + return x.module == y.module; +} +inline std::ostream& operator<<(std::ostream& output, const Object& what) { + output << "Object(module:" << EnumToJsonString(what.module) << ")"; + return output; +} + +typedef std::vector RemoteControlParams; + +class AccessRemote { + public: + virtual ~AccessRemote() {} + + /** + * Initializes oneself + */ + virtual void Init() = 0; + + /** + * Enables remote control + */ + virtual void Enable() = 0; + + /** + * Disables remote control + */ + virtual void Disable() = 0; + + /** + * Checks if remote control is enabled + * @return true if enabled + */ + virtual bool IsEnabled() const = 0; + + /** + * Checks whether device is driver's device + * @param dev_id unique device id + * @return true if device is have driver + */ + virtual bool IsPrimaryDevice(const PTString& dev_id) const = 0; + + /** + * Sets device as driver's device + * @param dev_id ID device + */ + virtual void SetPrimaryDevice(const PTString& dev_id) = 0; + + /** + * Gets current primary device + * @return ID device + */ + virtual PTString PrimaryDevice() const = 0; + + /** + * Allows access subject to object + * @param who subject is dev_id and app_id + * @param what object is group_id + */ + virtual void Allow(const Subject& who, const Object& what) = 0; + + /** + * Denies access subject to object + * @param who subject is dev_id and app_id + * @param what object is group_id + */ + virtual void Deny(const Subject& who, const Object& what) = 0; + + /** + * Resets access subject to all object + * @param who subject is dev_id and app_id + */ + virtual void Reset(const Subject& who) = 0; + + /** + * Resets access to object for all subjects + * @param what object is group + */ + virtual void Reset(const Object& what) = 0; + + /* + * Resets all stored consents + */ + virtual void Reset() = 0; + + /** + * Checks access subject to object + * @param who subject is dev_id and app_id + * @param what object is group_id + * @return allowed if access was given, disallowed if access was denied + * manual if need to ask driver + */ + virtual TypeAccess Check(const Subject& who, const Object& what) const = 0; + + /** + * Checks permissions for module + * @param app_id application ID + * @param module type + * @return true if allowed + */ + virtual bool CheckModuleType(const PTString& app_id, + policy_table::ModuleType module) const = 0; + + /** + * Sets HMI types if application has default policy permissions + * @param who subject + * @param hmi_types list of HMI types + */ + virtual void SetDefaultHmiTypes(const Subject& who, + const std::vector& hmi_types) = 0; + + /** + * Gets groups + * @param who subject + * @return list of groups + */ + virtual const policy_table::Strings& GetGroups(const Subject& who) = 0; + + /** + * Gets permissions for application + * @param device_id + * @param app_id + * @param group_types + * @return true if success + */ + virtual bool GetPermissionsForApp(const std::string& device_id, + const std::string& app_id, + FunctionalIdType& group_types) = 0; + + /** + * Checks if application has remote functionality + * @param who subject + * @return true if application uses remote control + */ + virtual bool IsAppRemoteControl(const Subject& who) = 0; + + /** + * Gets all allowed module types + * @param app_id unique identifier of application + * @param list of allowed module types + * @return true if application has allowed modules + */ + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) = 0; +}; + +} // namespace policy + +#endif // SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_ACCESS_REMOTE_H_ diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h new file mode 100644 index 0000000000..03427d2501 --- /dev/null +++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_ +#define SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_ + +#include +#include "policy/policy_table/types.h" +#include "utils/macro.h" +#include "utils/shared_ptr.h" +#include "policy/access_remote.h" +#include "policy/cache_manager.h" + +using policy_table::FunctionalGroupings; + +namespace policy { + +class AccessRemoteImpl : public AccessRemote { + public: + typedef std::map AccessControlRow; + typedef std::map AccessControlList; + typedef std::map HMIList; + + AccessRemoteImpl(); + explicit AccessRemoteImpl(utils::SharedPtr cache); + + virtual void Init(); + virtual void Enable(); + virtual void Disable(); + virtual bool IsEnabled() const; + + virtual bool IsPrimaryDevice(const PTString& dev_id) const; + virtual void SetPrimaryDevice(const PTString& dev_id); + virtual PTString PrimaryDevice() const; + + virtual void Allow(const Subject& who, const Object& what); + virtual void Deny(const Subject& who, const Object& what); + virtual void Reset(const Subject& who); + virtual void Reset(const Object& what); + virtual void Reset(); + virtual TypeAccess Check(const Subject& who, const Object& what) const; + virtual bool CheckModuleType(const PTString& app_id, + policy_table::ModuleType module) const; + virtual void SetDefaultHmiTypes(const Subject& who, + const std::vector& hmi_types); + virtual const policy_table::Strings& GetGroups(const Subject& who); + virtual bool GetPermissionsForApp(const std::string& device_id, + const std::string& app_id, + FunctionalIdType& group_types); + virtual bool IsAppRemoteControl(const Subject& who); + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules); + + private: + inline void set_enabled(bool value); + inline bool country_consent() const; + const policy_table::AppHMITypes& HmiTypes(const Subject& who); + void GetGroupsIds(const std::string& device_id, + const std::string& app_id, + FunctionalGroupIDs& grops_ids); + bool IsAllowed(const policy_table::AccessModules& modules, + const std::string& module_name, + const std::string& rpc_name, + RemoteControlParams* input) const; + bool CompareParameters(const policy_table::Strings& parameters, + RemoteControlParams* input) const; + utils::SharedPtr cache_; + PTString primary_device_; + bool enabled_; + AccessControlList acl_; + HMIList hmi_types_; + +#ifdef BUILD_TESTS + friend struct Erase; + friend struct IsTypeAccess; + + FRIEND_TEST(AccessRemoteImplTest, KeyMapTest); + FRIEND_TEST(AccessRemoteImplTest, Allow); + FRIEND_TEST(AccessRemoteImplTest, Deny); + FRIEND_TEST(AccessRemoteImplTest, ChangeAccess); + FRIEND_TEST(AccessRemoteImplTest, ResetBySubject); + FRIEND_TEST(AccessRemoteImplTest, ResetByObject); + FRIEND_TEST(AccessRemoteImplTest, CheckAllowed); + FRIEND_TEST(AccessRemoteImplTest, CheckDisallowed); + FRIEND_TEST(AccessRemoteImplTest, CheckManual); + FRIEND_TEST(AccessRemoteImplTest, CheckModuleType); + FRIEND_TEST(AccessRemoteImplTest, EnableDisable); + FRIEND_TEST(AccessRemoteImplTest, SetDefaultHmiTypes); + FRIEND_TEST(AccessRemoteImplTest, GetGroups); +#endif // BUILD_TESTS +}; + +} // namespace policy + +#endif // SRC_COMPONENTS_POLICY_SRC_POLICY_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_ diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index 73c010ce33..c5d4c848f4 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -324,6 +324,13 @@ class CacheManager : public CacheManagerInterface { */ bool GetDefaultHMI(const std::string& app_id, std::string& default_hmi) const; + /** + * Gets HMI types from specific policy + * @param app_id ID application + * @return list of HMI types + */ + const policy_table::AppHMITypes* GetHMITypes(const std::string& app_id); + /** * @brief Reset user consent for device data and applications permissions * @return @@ -690,11 +697,9 @@ class CacheManager : public CacheManagerInterface { const PolicySettings& get_settings() const; -#ifdef BUILD_TESTS - utils::SharedPtr GetPT() const { + utils::SharedPtr pt() const { return pt_; } -#endif private: std::string currentDateTime(); @@ -767,6 +772,13 @@ class CacheManager : public CacheManagerInterface { sync_primitives::Lock backuper_locker_; BackgroundBackuper* backuper_; const PolicySettings* settings_; + +#ifdef BUILD_TESTS + friend class AccessRemoteImpl; + FRIEND_TEST(AccessRemoteImplTest, CheckModuleType); + FRIEND_TEST(AccessRemoteImplTest, EnableDisable); + FRIEND_TEST(AccessRemoteImplTest, GetGroups); +#endif // BUILD_TESTS }; } // namespace policy #endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_CACHE_MANAGER_H_ diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index 50896bb8f1..9712b799dc 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -322,6 +322,14 @@ class CacheManagerInterface { virtual bool GetDefaultHMI(const std::string& app_id, std::string& default_hmi) const = 0; + /** + * Gets HMI types from specific policy + * @param app_id ID application + * @return list of HMI types + */ + virtual const policy_table::AppHMITypes* GetHMITypes( + const std::string& app_id) = 0; + /** * @brief Reset user consent for device data and applications permissions * @return @@ -626,15 +634,13 @@ class CacheManagerInterface { */ virtual std::string GetCertificate() const = 0; -#ifdef BUILD_TESTS /** - * @brief GetPT allows to obtain SharedPtr to PT. + * @brief pt allows to obtain SharedPtr to PT. * Used ONLY in Unit tests * @return SharedPTR to PT * */ - virtual utils::SharedPtr GetPT() const = 0; -#endif + virtual utils::SharedPtr pt() const = 0; }; typedef utils::SharedPtr CacheManagerInterfaceSPtr; diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h index 996c2917d0..ce1288fa1b 100644 --- a/src/components/policy/policy_regular/include/policy/policy_helper.h +++ b/src/components/policy/policy_regular/include/policy/policy_helper.h @@ -243,6 +243,22 @@ FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first, * @return true, if succeded, otherwise - false */ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies); + +#ifdef SDL_REMOTE_CONTROL + +struct ProccessAppGroups { + ProccessAppGroups(const policy_table::ApplicationPolicies& apps, + PolicyManagerImpl* pm) + : new_apps_(apps), pm_(pm), default_(new_apps_.find(kDefaultId)) {} + void operator()(const policy_table::ApplicationPolicies::value_type& app); + + private: + const policy_table::ApplicationPolicies& new_apps_; + PolicyManagerImpl* pm_; + policy_table::ApplicationPolicies::const_iterator default_; +}; + +#endif // SDL_REMOTE_CONTROL } #endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_ diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 3ca9994a8a..868328bcb4 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -47,6 +47,10 @@ #include "policy/usage_statistics/statistics_manager.h" #include "policy/policy_helper.h" #include "utils/timer.h" +#ifdef SDL_REMOTE_CONTROL +#include "policy/access_remote.h" +#include "policy/access_remote_impl.h" +#endif // SDL_REMOTE_CONTROL namespace policy_table = rpc::policy_table_interface_base; @@ -176,6 +180,39 @@ class PolicyManagerImpl : public PolicyManager { StatusNotifier AddApplication( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types); +#ifdef SDL_REMOTE_CONTROL + void SetDefaultHmiTypes(const std::string& application_id, + const std::vector& hmi_types); + /** + * Gets HMI types + * @param application_id ID application + * @param app_types list to save HMI types + * @return true if policy has specific policy for this application + */ + virtual bool GetHMITypes(const std::string& application_id, + std::vector* app_types) OVERRIDE; + virtual void set_access_remote(utils::SharedPtr access_remote); + TypeAccess CheckDriverConsent(const Subject& who, + const Object& what, + const std::string& rpc, + const RemoteControlParams& params); + void CheckPTUUpdatesChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot); + bool CheckPTURemoteCtrlChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot); + + void CheckRemoteGroupsChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot); + + void SendHMILevelChanged(const Subject& who); + void UpdateDeviceRank(const Subject& who, const std::string& rank); + + void OnPrimaryGroupsChanged(const std::string& application_id); + void OnNonPrimaryGroupsChanged(const std::string& application_id); +#endif // SDL_REMOTE_CONTROL virtual void RemoveAppConsentForGroup(const std::string& app_id, const std::string& group_name); @@ -319,10 +356,43 @@ class PolicyManagerImpl : public PolicyManager { void RetrySequence(); private: +#ifdef SDL_REMOTE_CONTROL + void GetPermissions(const std::string device_id, + const std::string application_id, + Permissions* data); + virtual TypeAccess CheckAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + const PTString& rpc, + const RemoteControlParams& params); + virtual bool CheckModule(const PTString& app_id, const PTString& module); + virtual void SetAccess(const PTString& dev_id, + const PTString& app_id, + const PTString& module, + bool allowed); + virtual void ResetAccess(const PTString& dev_id, const PTString& app_id); + virtual void ResetAccess(const PTString& module); + virtual void SetPrimaryDevice(const PTString& dev_id); + virtual void ResetPrimaryDevice(); + virtual PTString PrimaryDevice() const; + virtual void SetRemoteControl(bool enabled); + virtual bool GetRemoteControl() const; + virtual void OnChangedPrimaryDevice(const std::string& device_id, + const std::string& application_id); + virtual void OnChangedRemoteControl(const std::string& device_id, + const std::string& application_id); + virtual void SendAppPermissionsChanged(const std::string& device_id, + const std::string& application_id); + virtual bool GetModuleTypes(const std::string& policy_app_id, + std::vector* modules) const; +#endif // SDL_REMOTE_CONTROL PolicyListener* listener_; UpdateStatusManager update_status_manager_; CacheManagerInterfaceSPtr cache_; +#ifdef SDL_REMOTE_CONTROL + utils::SharedPtr access_remote_; +#endif sync_primitives::Lock apps_registration_lock_; sync_primitives::Lock app_permissions_diff_lock_; std::map app_permissions_diff_; diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 8b9a872a5b..d9d2ad34eb 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -96,6 +96,12 @@ typedef Map DeviceData; typedef Array, 0, 255> RequestTypes; +#ifdef SDL_REMOTE_CONTROL +typedef Map RemoteRpcs; +typedef Map AccessModules; +typedef Array, 0, 255> ModuleTypes; +#endif // SDL_REMOTE_CONTROL + typedef AppHMIType AppHmiType; typedef std::vector AppHmiTypes; @@ -136,6 +142,11 @@ struct ApplicationParams : PolicyBase { Optional > memory_kb; Optional > heart_beat_timeout_ms; Optional > certificate; +#ifdef SDL_REMOTE_CONTROL + Optional groups_primaryRC; + Optional groups_nonPrimaryRC; + mutable Optional moduleType; +#endif // SDL_REMOTE_CONTROL public: ApplicationParams(); @@ -151,6 +162,9 @@ struct ApplicationParams : PolicyBase { private: bool Validate() const; +#ifdef SDL_REMOTE_CONTROL + bool ValidateModuleTypes() const; +#endif // SDL_REMOTE_CONTROL }; struct ApplicationPoliciesSection : CompositeType { @@ -233,6 +247,10 @@ struct ModuleConfig : CompositeType { Optional > vehicle_year; Optional > preloaded_date; Optional > certificate; +#ifdef SDL_REMOTE_CONTROL + Optional user_consent_passengersRC; + Optional country_consent_passengersRC; +#endif // SDL_REMOTE_CONTROL public: ModuleConfig(); diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h index 25aa126a03..09df043197 100644 --- a/src/components/policy/policy_regular/include/policy/policy_types.h +++ b/src/components/policy/policy_regular/include/policy/policy_types.h @@ -56,6 +56,7 @@ const std::string kDefaultDeviceConnectionType = "UNKNOWN"; */ const std::string kPreDataConsentId = "pre_DataConsent"; const std::string kDefaultId = "default"; +const std::string kPreConsentPassengersRC = "pre_consent_passengersRC"; const std::string kDeviceId = "device"; /* diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h index 79a66ba41a..20f5d5aed4 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h @@ -114,6 +114,27 @@ extern const std::string kInsertApplicationFull; extern const std::string kDeletePreconsentedGroupsByApplicationId; extern const std::string kSelectApplicationFull; extern const std::string kUpdatePreloaded; +extern const std::string kUpdateRemoteControlDenied; +extern const std::string kSelectRemoteControlDenied; +extern const std::string kDeleteAppGroupPrimaryByApplicationId; +extern const std::string kDeleteAppGroupNonPrimaryByApplicationId; +extern const std::string kCollectFriendlyMsg; +extern const std::string kSelectAppGroupsPrimary; +extern const std::string kSelectAppGroupsNonPrimary; +extern const std::string kSelectModuleTypes; +extern const std::string kInsertAppGroupPrimary; +extern const std::string kInsertAppGroupNonPrimary; +extern const std::string kInsertModuleType; +extern const std::string kInsertAccessModule; +extern const std::string kSelectAccessModules; +extern const std::string kDeleteAccessModules; +extern const std::string kInsertRemoteRpc; +extern const std::string kSelectRemoteRpcs; +extern const std::string kDeleteRemoteRpc; +extern const std::string kDeleteAppGroupPrimary; +extern const std::string kDeleteAppGroupNonPrimary; +extern const std::string kDeleteModuleTypes; +extern const std::string kDeleteAllDevices; extern const std::string kSelectDBVersion; extern const std::string kUpdateDBVersion; extern const std::string kSaveModuleMeta; diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h index bd867389ab..e152c040b1 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h @@ -97,6 +97,31 @@ class SQLPTRepresentation : public virtual PTRepresentation { } #endif // BUILD_TESTS protected: +#ifdef SDL_REMOTE_CONTROL + enum TypeAccess { kAllowed, kManual }; + bool GatherAppGroupPrimary(const std::string& app_id, + policy_table::Strings* app_groups) const; + bool GatherAppGroupNonPrimary(const std::string& app_id, + policy_table::Strings* app_groups) const; + bool GatherModuleType(const std::string& app_id, + policy_table::ModuleTypes* module_types) const; + bool GatherRemoteControlDenied(const std::string& app_id, bool* denied) const; + bool GatherAccessModule(TypeAccess access, + policy_table::AccessModules* modules) const; + bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const; + bool SaveAppGroupPrimary(const std::string& app_id, + const policy_table::Strings& app_groups); + bool SaveAppGroupNonPrimary(const std::string& app_id, + const policy_table::Strings& app_groups); + bool SaveModuleType(const std::string& app_id, + const policy_table::ModuleTypes& types); + bool SaveRemoteControlDenied(const std::string& app_id, bool deny); + + bool SaveAccessModule(TypeAccess access, + const policy_table::AccessModules& modules); + bool SaveRemoteRpc(int module_id, const policy_table::RemoteRpcs& rpcs); +#endif // SDL_REMOTE_CONTROL + virtual void GatherModuleMeta(policy_table::ModuleMeta* meta) const; virtual void GatherModuleConfig(policy_table::ModuleConfig* config) const; virtual bool GatherUsageAndErrorCounts( diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h b/src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h deleted file mode 100644 index 8093c11467..0000000000 --- a/src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2016, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - */ - -#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_ -#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_ - -#include "policy/usage_statistics/statistics_manager.h" - -namespace usage_statistics { - -class AppStopwatch { - public: - virtual ~AppStopwatch() {} - virtual void Start(AppStopwatchId stopwatch_type) = 0; - virtual void Switch(AppStopwatchId stopwatch_type) = 0; - virtual void WriteTime() = 0; -}; - -} // namespace usage_statistics - -#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_ diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc new file mode 100644 index 0000000000..9ae76fc19a --- /dev/null +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -0,0 +1,377 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#include "policy/access_remote_impl.h" + +#include +#include +#include "policy/cache_manager.h" +#include "utils/logger.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyManagerImpl") + +using policy_table::DeviceData; +using policy_table::FunctionalGroupings; +using rpc::policy_table_interface_base::EnumFromJsonString; + +namespace policy { + +struct Erase { + private: + const Subject& who_; + + public: + explicit Erase(const Subject& who) : who_(who) {} + void operator()(AccessRemoteImpl::AccessControlList::value_type& row) const { + row.second.erase(who_); + } +}; + +struct IsTypeAccess { + private: + const TypeAccess& type_; + + public: + explicit IsTypeAccess(const TypeAccess& type) : type_(type) {} + bool operator()( + const AccessRemoteImpl::AccessControlRow::value_type& item) const { + return item.second == type_; + } +}; + +struct ToHMIType { + policy_table::AppHMITypes::value_type operator()(int item) const { + policy_table::AppHMIType type = static_cast(item); + if (!IsValidEnum(type)) { + LOG4CXX_WARN(logger_, "HMI type isn't known " << item); + type = policy_table::AHT_DEFAULT; + } + LOG4CXX_DEBUG(logger_, + "HMI type: " << item << " - " << EnumToJsonString(type)); + return policy_table::AppHMITypes::value_type(type); + } +}; + +struct Contained { + private: + const policy_table::Strings& params_; + + public: + explicit Contained(const policy_table::Strings& params) : params_(params) {} + bool operator()(const RemoteControlParams::value_type& item) const { + return std::find_if(params_.begin(), params_.end(), CompareString(item)) != + params_.end(); + } + struct CompareString { + private: + const RemoteControlParams::value_type& value_; + + public: + explicit CompareString(const RemoteControlParams::value_type& value) + : value_(value) {} + bool operator()(const policy_table::Strings::value_type& item) const { + return value_ == static_cast(item); + } + }; +}; + +struct ToModuleType { + std::string operator()(policy_table::ModuleTypes::value_type item) const { + policy_table::ModuleType type = static_cast(item); + return EnumToJsonString(type); + } +}; + +AccessRemoteImpl::AccessRemoteImpl() + : cache_(new CacheManager()), primary_device_(), enabled_(true), acl_() {} + +AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) + : cache_(cache), primary_device_(), enabled_(true), acl_() {} + +void AccessRemoteImpl::Init() { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK(cache_->pt()); + + policy_table::ModuleConfig& config = cache_->pt()->policy_table.module_config; + enabled_ = country_consent() && + (!config.user_consent_passengersRC.is_initialized() || + *config.user_consent_passengersRC); +} + +bool AccessRemoteImpl::IsPrimaryDevice(const PTString& dev_id) const { + LOG4CXX_AUTO_TRACE(logger_); + return primary_device_ == dev_id; +} + +TypeAccess AccessRemoteImpl::Check(const Subject& who, + const Object& what) const { + LOG4CXX_AUTO_TRACE(logger_); + AccessControlList::const_iterator i = acl_.find(what); + if (i != acl_.end()) { + const AccessControlRow& row = i->second; + AccessControlRow::const_iterator j = row.find(who); + if (j != row.end()) { + // who has permissions + TypeAccess ret = j->second; + LOG4CXX_TRACE(logger_, + "Subject " << who << " has permissions " << ret + << " to object " << what); + return ret; + } + } + return TypeAccess::kManual; +} + +bool AccessRemoteImpl::CheckModuleType(const PTString& app_id, + policy_table::ModuleType module) const { + LOG4CXX_AUTO_TRACE(logger_); + if (!cache_->IsApplicationRepresented(app_id)) { + return false; + } + + const policy_table::ApplicationParams& app = + cache_->pt()->policy_table.app_policies_section.apps[app_id]; + if (!app.moduleType.is_initialized()) { + return false; + } + + const policy_table::ModuleTypes& modules = *app.moduleType; + if (modules.empty()) { + return true; + } + + return std::find(modules.begin(), modules.end(), module) != modules.end(); +} + +bool AccessRemoteImpl::IsAllowed(const policy_table::AccessModules& modules, + const std::string& module_name, + const std::string& rpc_name, + RemoteControlParams* input) const { + LOG4CXX_AUTO_TRACE(logger_); + policy_table::AccessModules::const_iterator i = modules.find(module_name); + if (i == modules.end()) { + LOG4CXX_DEBUG(logger_, "Module " << module_name << " wasn't found"); + return false; + } + + const policy_table::RemoteRpcs& rpcs = i->second; + if (rpcs.empty()) { + return true; + } + policy_table::RemoteRpcs::const_iterator j = rpcs.find(rpc_name); + if (j != rpcs.end()) { + const policy_table::Strings& parameters = j->second; + return CompareParameters(parameters, input); + } + LOG4CXX_DEBUG(logger_, "RPC " << rpc_name << " wasn't found"); + return false; +} + +bool AccessRemoteImpl::CompareParameters( + const policy_table::Strings& parameters, RemoteControlParams* input) const { + LOG4CXX_AUTO_TRACE(logger_); + if (parameters.empty()) { + return true; + } + + if (input->empty()) { + LOG4CXX_DEBUG(logger_, "Input is empty"); + return false; + } + + input->erase( + std::remove_if(input->begin(), input->end(), Contained(parameters)), + input->end()); + return input->empty(); +} + +void AccessRemoteImpl::Allow(const Subject& who, const Object& what) { + LOG4CXX_AUTO_TRACE(logger_); + acl_[what][who] = TypeAccess::kAllowed; +} + +void AccessRemoteImpl::Deny(const Subject& who, const Object& what) { + LOG4CXX_AUTO_TRACE(logger_); + acl_[what][who] = TypeAccess::kDisallowed; +} + +void AccessRemoteImpl::Reset(const Subject& who) { + LOG4CXX_AUTO_TRACE(logger_); + std::for_each(acl_.begin(), acl_.end(), Erase(who)); +} + +void AccessRemoteImpl::Reset(const Object& what) { + LOG4CXX_AUTO_TRACE(logger_); + acl_.erase(what); +} + +void AccessRemoteImpl::Reset() { + acl_.clear(); +} + +void AccessRemoteImpl::SetPrimaryDevice(const PTString& dev_id) { + LOG4CXX_AUTO_TRACE(logger_); + primary_device_ = dev_id; +} + +PTString AccessRemoteImpl::PrimaryDevice() const { + return primary_device_; +} + +void AccessRemoteImpl::Enable() { + LOG4CXX_AUTO_TRACE(logger_); + set_enabled(true); +} + +void AccessRemoteImpl::Disable() { + LOG4CXX_AUTO_TRACE(logger_); + set_enabled(false); +} + +void AccessRemoteImpl::set_enabled(bool value) { + enabled_ = country_consent() && value; + *cache_->pt()->policy_table.module_config.user_consent_passengersRC = value; + cache_->Backup(); +} + +bool AccessRemoteImpl::country_consent() const { + policy_table::ModuleConfig& config = cache_->pt()->policy_table.module_config; + return !config.country_consent_passengersRC.is_initialized() || + *config.country_consent_passengersRC; +} + +bool AccessRemoteImpl::IsEnabled() const { + LOG4CXX_AUTO_TRACE(logger_); + return enabled_; +} + +void AccessRemoteImpl::SetDefaultHmiTypes(const Subject& who, + const std::vector& hmi_types) { + LOG4CXX_AUTO_TRACE(logger_); + HMIList::mapped_type types; + std::transform(hmi_types.begin(), + hmi_types.end(), + std::back_inserter(types), + ToHMIType()); + hmi_types_[who] = types; +} + +const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes( + const Subject& who) { + LOG4CXX_AUTO_TRACE(logger_); + if (cache_->IsDefaultPolicy(who.app_id)) { + return hmi_types_[who]; + } else { + return *cache_->pt() + ->policy_table.app_policies_section.apps[who.app_id] + .AppHMIType; + } +} + +const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { + LOG4CXX_AUTO_TRACE(logger_); + if (IsAppRemoteControl(who)) { + if (IsPrimaryDevice(who.dev_id)) { + return *cache_->pt() + ->policy_table.app_policies_section.apps[who.app_id] + .groups_primaryRC; + } else if (IsEnabled()) { + return *cache_->pt() + ->policy_table.app_policies_section.apps[who.app_id] + .groups_nonPrimaryRC; + } else { + return cache_->GetGroups(kPreConsentPassengersRC); + } + } + return cache_->GetGroups(who.app_id); +} + +bool AccessRemoteImpl::IsAppRemoteControl(const Subject& who) { + LOG4CXX_AUTO_TRACE(logger_); + const policy_table::AppHMITypes& hmi_types = HmiTypes(who); + return std::find(hmi_types.begin(), + hmi_types.end(), + policy_table::AHT_REMOTE_CONTROL) != hmi_types.end(); +} + +bool AccessRemoteImpl::GetPermissionsForApp(const std::string& device_id, + const std::string& app_id, + FunctionalIdType& group_types) { + LOG4CXX_AUTO_TRACE(logger_); + GetGroupsIds(device_id, app_id, group_types[kTypeGeneral]); + GetGroupsIds(device_id, kDefaultId, group_types[kTypeDefault]); + GetGroupsIds( + device_id, kPreDataConsentId, group_types[kTypePreDataConsented]); + return true; +} + +std::ostream& operator<<(std::ostream& output, + const FunctionalGroupIDs& types) { + std::copy(types.begin(), + types.end(), + std::ostream_iterator(output, " ")); + return output; +} + +void AccessRemoteImpl::GetGroupsIds(const std::string& device_id, + const std::string& app_id, + FunctionalGroupIDs& groups_ids) { + Subject who = {device_id, app_id}; + const policy_table::Strings& groups = GetGroups(who); + groups_ids.resize(groups.size()); + std::transform(groups.begin(), + groups.end(), + groups_ids.begin(), + &CacheManager::GenerateHash); + LOG4CXX_DEBUG(logger_, "Groups Ids: " << groups_ids); +} + +bool AccessRemoteImpl::GetModuleTypes(const std::string& application_id, + std::vector* modules) { + DCHECK(modules); + policy_table::ApplicationPolicies& apps = + cache_->pt()->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::iterator i = apps.find(application_id); + if (i == apps.end()) { + return false; + } + rpc::Optional moduleTypes = i->second.moduleType; + if (!moduleTypes.is_initialized()) { + return false; + } + std::transform(moduleTypes->begin(), + moduleTypes->end(), + std::back_inserter(*modules), + ToModuleType()); + return true; +} + +} // namespace policy diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 6184320306..decf526677 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -127,6 +127,17 @@ uint32_t CacheManager::HeartBeatTimeout(const std::string& app_id) const { return result; } +const policy_table::AppHMITypes* CacheManager::GetHMITypes( + const std::string& app_id) { + const policy_table::ApplicationPolicies& apps = + pt_->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies::const_iterator i = apps.find(app_id); + if (i != apps.end()) { + return &(*i->second.AppHMIType); + } + return NULL; +} + bool CacheManager::CanAppStealFocus(const std::string& app_id) const { CACHE_MANAGER_CHECK(false); bool result = true; @@ -136,8 +147,8 @@ bool CacheManager::CanAppStealFocus(const std::string& app_id) const { bool CacheManager::GetDefaultHMI(const std::string& app_id, std::string& default_hmi) const { CACHE_MANAGER_CHECK(false); - bool result = true; - return result; + default_hmi = "NONE"; + return true; } bool CacheManager::ResetUserConsent() { diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc index b72a041a83..7ee8153e8b 100644 --- a/src/components/policy/policy_regular/src/policy_helper.cc +++ b/src/components/policy/policy_regular/src/policy_helper.cc @@ -802,4 +802,53 @@ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) { return true; } + +#ifdef SDL_REMOTE_CONTROL +bool HaveGroupsChanged(const rpc::Optional& old_groups, + const rpc::Optional& new_groups) { + if (!old_groups.is_initialized() && !new_groups.is_initialized()) { + return false; + } + if (!old_groups.is_initialized() || !new_groups.is_initialized()) { + return true; + } + policy_table::Strings old_groups_abs = *old_groups; + policy_table::Strings new_groups_abs = *new_groups; + if (old_groups_abs.size() != new_groups_abs.size()) { + return true; + } + std::sort(new_groups_abs.begin(), new_groups_abs.end(), Compare); + std::sort(old_groups_abs.begin(), old_groups_abs.end(), Compare); + + return std::equal(new_groups_abs.begin(), + new_groups_abs.end(), + old_groups_abs.begin(), + Compare); +} + +void ProccessAppGroups::operator()( + const policy_table::ApplicationPolicies::value_type& app) { + policy_table::ApplicationPolicies::const_iterator i = + new_apps_.find(app.first); + if (i == new_apps_.end() && default_ != new_apps_.end()) { + i = default_; + } + if (i != new_apps_.end()) { + if (HaveGroupsChanged(i->second.groups_primaryRC, + app.second.groups_primaryRC)) { + LOG4CXX_DEBUG(logger_, + "Primary groups for " << app.first << " have changed"); + + pm_->OnPrimaryGroupsChanged(app.first); + } + if (HaveGroupsChanged(i->second.groups_nonPrimaryRC, + app.second.groups_nonPrimaryRC)) { + LOG4CXX_DEBUG(logger_, + "Non-primary groups for " << app.first << " have changed"); + pm_->OnNonPrimaryGroupsChanged(app.first); + } + } +} + +#endif // SDL_REMOTE_CONTROL } diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index f05ac9cb67..562539eb0c 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -51,6 +51,11 @@ #include "utils/timer_task_impl.h" #include "utils/make_shared.h" +#ifdef SDL_REMOTE_CONTROL +#include "policy/access_remote.h" +#include "policy/access_remote_impl.h" +#endif // SDL_REMOTE_CONTROL + policy::PolicyManager* CreateManager() { return new policy::PolicyManagerImpl(); } @@ -71,6 +76,10 @@ PolicyManagerImpl::PolicyManagerImpl() : PolicyManager() , listener_(NULL) , cache_(new CacheManager) +#ifdef SDL_REMOTE_CONTROL + , access_remote_(new AccessRemoteImpl( + CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) +#endif // SDL_REMOTE_CONTROL , retry_sequence_timeout_(kDefaultRetryTimeoutInMSec) , retry_sequence_index_(0) , timer_retry_sequence_("Retry sequence timer", @@ -80,7 +89,8 @@ PolicyManagerImpl::PolicyManagerImpl() , retry_sequence_url_(0, 0, "") , wrong_ptu_update_received_(false) , send_on_update_sent_out_(false) - , trigger_ptu_(false) {} + , trigger_ptu_(false) { +} void PolicyManagerImpl::set_listener(PolicyListener* listener) { listener_ = listener; @@ -204,6 +214,10 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, listener_->OnCertificateUpdated( *(pt_update->policy_table.module_config.certificate)); } +#ifdef SDL_REMOTE_CONTROL + access_remote_->Init(); + CheckPTUUpdatesChange(pt_update, policy_table_snapshot); +#endif // SDL_REMOTE_CONTROL std::map app_hmi_types; cache_->GetHMIAppTypeAfterUpdate(app_hmi_types); @@ -381,7 +395,13 @@ void PolicyManagerImpl::CheckPermissions(const PTString& device_id, "CheckPermissions for " << app_id << " and rpc " << rpc << " for " << hmi_level << " level."); +#ifdef SDL_REMOTE_CONTROL + Subject who = {device_id, app_id}; + const policy_table::Strings& groups = access_remote_->GetGroups(who); +#else // SDL_REMOTE_CONTROL const policy_table::Strings& groups = cache_->GetGroups(app_id); +#endif // SDL_REMOTE_CONTROL + cache_->CheckPermissions(groups, hmi_level, rpc, result); if (cache_->IsApplicationRevoked(app_id)) { // SDL must be able to notify mobile side with its status after app has @@ -438,6 +458,17 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( std::string default_hmi; default_hmi = "NONE"; +#ifdef SDL_REMOTE_CONTROL + const Subject who = {device_id, application_id}; + if (access_remote_->IsAppRemoteControl(who)) { + const std::string rank = + access_remote_->IsPrimaryDevice(who.dev_id) ? "DRIVER" : "PASSENGER"; + UpdateDeviceRank(who, rank); + listener()->OnPermissionsUpdated(application_id, notification_data); + return; + } +#endif // SDL_REMOTE_CONTROL + listener()->OnPermissionsUpdated( application_id, notification_data, default_hmi); } @@ -674,7 +705,16 @@ void PolicyManagerImpl::GetPermissionsForApp( } FunctionalIdType group_types; - if (!cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types)) { +#ifdef SDL_REMOTE_CONTROL + allowed_by_default = false; + bool ret = access_remote_->GetPermissionsForApp( + device_id, policy_app_id, group_types); +#else + bool ret = + cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types); +#endif // REMOTE_CONTROL + + if (!ret) { LOG4CXX_WARN(logger_, "Can't get user permissions for app " << policy_app_id); return; @@ -1020,6 +1060,7 @@ StatusNotifier PolicyManagerImpl::AddApplication( return utils::MakeShared(); } } + void PolicyManagerImpl::RemoveAppConsentForGroup( const std::string& app_id, const std::string& group_name) { cache_->RemoveAppConsentForGroup(app_id, group_name); @@ -1093,6 +1134,9 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name, if (ret) { RefreshRetrySequence(); update_status_manager_.OnPolicyInit(cache_->UpdateRequired()); +#ifdef SDL_REMOTE_CONTROL + access_remote_->Init(); +#endif // SDL_REMOTE_CONTROL } return ret; } @@ -1127,4 +1171,336 @@ void PolicyManagerImpl::RetrySequence() { timer_retry_sequence_.Start(timeout_msec, timer::kPeriodic); } +#ifdef SDL_REMOTE_CONTROL +void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id, + const std::vector& hmi_types) { + LOG4CXX_INFO(logger_, "SetDefaultHmiTypes"); + const std::string device_id = GetCurrentDeviceId(application_id); + Subject who = {device_id, application_id}; + access_remote_->SetDefaultHmiTypes(who, hmi_types); +} + +struct HMITypeToInt { + int operator()(const policy_table::AppHMITypes::value_type item) { + return policy_table::AppHMIType(item); + } +}; + +bool PolicyManagerImpl::GetHMITypes(const std::string& application_id, + std::vector* app_types) { + LOG4CXX_AUTO_TRACE(logger_); + if (cache_->IsDefaultPolicy(application_id)) { + return false; + } + const policy_table::AppHMITypes* hmi_types = + cache_->GetHMITypes(application_id); + if (hmi_types) { + std::transform(hmi_types->begin(), + hmi_types->end(), + std::back_inserter(*app_types), + HMITypeToInt()); + } + return hmi_types; +} + +TypeAccess PolicyManagerImpl::CheckAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module, + const PTString& rpc, + const RemoteControlParams& params) { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, "Module type: " << module); + + policy_table::ModuleType module_type; + bool is_valid = EnumFromJsonString(module, &module_type); + if (is_valid && access_remote_->CheckModuleType(app_id, module_type)) { + if (access_remote_->IsPrimaryDevice(device_id)) { + return TypeAccess::kAllowed; + } else { + Subject who = {device_id, app_id}; + Object what = {module_type}; + return CheckDriverConsent(who, what, rpc, params); + } + } + LOG4CXX_DEBUG(logger_, TypeAccess::kDisallowed); + return TypeAccess::kDisallowed; +} + +bool PolicyManagerImpl::CheckModule(const PTString& app_id, + const PTString& module) { + LOG4CXX_AUTO_TRACE(logger_); + policy_table::ModuleType module_type; + return EnumFromJsonString(module, &module_type) && + access_remote_->CheckModuleType(app_id, module_type); +} + +TypeAccess PolicyManagerImpl::CheckDriverConsent( + const Subject& who, + const Object& what, + const std::string& rpc, + const RemoteControlParams& params) { + LOG4CXX_AUTO_TRACE(logger_); + if (!access_remote_->IsEnabled()) { + return TypeAccess::kDisallowed; + } + + return access_remote_->Check(who, what); +} + +void PolicyManagerImpl::SetAccess(const PTString& dev_id, + const PTString& app_id, + const PTString& module, + bool allowed) { + LOG4CXX_AUTO_TRACE(logger_); + policy_table::ModuleType module_type; + bool is_valid = EnumFromJsonString(module, &module_type); + if (!is_valid) { + return; + } + + Subject who = {dev_id, app_id}; + Object what = {module_type}; + LOG4CXX_DEBUG(logger_, + "Driver's consent: " << who << ", " << what << " is " + << std::boolalpha << allowed); + if (allowed) { + access_remote_->Allow(who, what); + } else { + access_remote_->Deny(who, what); + } +} + +void PolicyManagerImpl::ResetAccess(const PTString& dev_id, + const PTString& app_id) { + LOG4CXX_AUTO_TRACE(logger_); + Subject who = {dev_id, app_id}; + access_remote_->Reset(who); +} + +void PolicyManagerImpl::ResetAccess(const PTString& module) { + LOG4CXX_AUTO_TRACE(logger_); + policy_table::ModuleType module_type; + bool is_valid = EnumFromJsonString(module, &module_type); + if (!is_valid) { + return; + } + + Object what = {module_type}; + access_remote_->Reset(what); +} + +void PolicyManagerImpl::SetPrimaryDevice(const PTString& dev_id) { + LOG4CXX_AUTO_TRACE(logger_); + access_remote_->SetPrimaryDevice(dev_id); +} + +void PolicyManagerImpl::ResetPrimaryDevice() { + LOG4CXX_AUTO_TRACE(logger_); + access_remote_->SetPrimaryDevice(""); +} + +PTString PolicyManagerImpl::PrimaryDevice() const { + LOG4CXX_AUTO_TRACE(logger_); + return access_remote_->PrimaryDevice(); +} + +void PolicyManagerImpl::SetRemoteControl(bool enabled) { + LOG4CXX_AUTO_TRACE(logger_); + if (enabled) { + access_remote_->Enable(); + } else { + access_remote_->Disable(); + } +} + +bool PolicyManagerImpl::GetRemoteControl() const { + return access_remote_->IsEnabled(); +} + +void PolicyManagerImpl::OnChangedPrimaryDevice( + const std::string& device_id, const std::string& application_id) { + LOG4CXX_AUTO_TRACE(logger_); + Subject who = {device_id, application_id}; + if (!access_remote_->IsAppRemoteControl(who)) { + LOG4CXX_INFO(logger_, "Application " << who << " isn't remote"); + return; + } + + const std::string rank = + access_remote_->IsPrimaryDevice(who.dev_id) ? "DRIVER" : "PASSENGER"; + UpdateDeviceRank(who, rank); + SendAppPermissionsChanged(who.dev_id, who.app_id); +} + +void PolicyManagerImpl::OnChangedRemoteControl( + const std::string& device_id, const std::string& application_id) { + LOG4CXX_AUTO_TRACE(logger_); + Subject who = {device_id, application_id}; + if (!access_remote_->IsAppRemoteControl(who)) { + LOG4CXX_INFO(logger_, "Application " << who << " isn't remote"); + return; + } + + if (access_remote_->IsPrimaryDevice(who.dev_id)) { + LOG4CXX_INFO(logger_, "Device " << who.dev_id << " is primary"); + return; + } + + if (!access_remote_->IsEnabled()) { + SendHMILevelChanged(who); + } + + SendAppPermissionsChanged(who.dev_id, who.app_id); +} + +void PolicyManagerImpl::UpdateDeviceRank(const Subject& who, + const std::string& rank) { + std::string default_hmi("NONE"); + if (GetDefaultHmi(who.app_id, &default_hmi)) { + access_remote_->Reset(who); + listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi, rank); + } else { + LOG4CXX_WARN(logger_, + "Couldn't get default HMI level for application " + << who.app_id); + } +} + +void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { + std::string default_hmi("NONE"); + if (GetDefaultHmi(who.app_id, &default_hmi)) { + access_remote_->Reset(who); + listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi); + } else { + LOG4CXX_WARN(logger_, + "Couldn't get default HMI level for application " + << who.app_id); + } +} + +void PolicyManagerImpl::GetPermissions(const std::string device_id, + const std::string application_id, + Permissions* data) { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK(data); + std::vector app_group_permissions; + GetPermissionsForApp(device_id, application_id, app_group_permissions); + + policy_table::FunctionalGroupings functional_groupings; + cache_->GetFunctionalGroupings(functional_groupings); + + policy_table::Strings app_groups; + std::vector::const_iterator it = + app_group_permissions.begin(); + std::vector::const_iterator it_end = + app_group_permissions.end(); + for (; it != it_end; ++it) { + app_groups.push_back((*it).group_name); + } + + PrepareNotificationData( + functional_groupings, app_groups, app_group_permissions, *data); +} + +void PolicyManagerImpl::SendAppPermissionsChanged( + const std::string& device_id, const std::string& application_id) { + Permissions notification_data; + GetPermissions(device_id, application_id, ¬ification_data); + listener()->OnPermissionsUpdated(application_id, notification_data); +} + +void PolicyManagerImpl::CheckPTUUpdatesChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot) { + CheckPTURemoteCtrlChange(pt_update, snapshot); + CheckRemoteGroupsChange(pt_update, snapshot); +} + +bool PolicyManagerImpl::CheckPTURemoteCtrlChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot) { + LOG4CXX_AUTO_TRACE(logger_); + + rpc::Optional& new_consent = + pt_update->policy_table.module_config.country_consent_passengersRC; + rpc::Optional& old_consent = + snapshot->policy_table.module_config.country_consent_passengersRC; + + if (!new_consent.is_initialized() && !old_consent.is_initialized()) { + return false; + } + + bool result = false; + if (new_consent.is_initialized() && old_consent.is_initialized()) { + result = (*new_consent != *old_consent); + } else { + bool not_changed_consent1 = !new_consent.is_initialized() && *old_consent; + bool not_changed_consent2 = !old_consent.is_initialized() && *new_consent; + + result = !(not_changed_consent1 || not_changed_consent2); + } + + if (result) { + listener()->OnRemoteAllowedChanged(result); + } + + return result; +} + +void PolicyManagerImpl::CheckRemoteGroupsChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot) { + LOG4CXX_AUTO_TRACE(logger_); + + policy_table::ApplicationPolicies& new_apps = + pt_update->policy_table.app_policies_section.apps; + policy_table::ApplicationPolicies& old_apps = + snapshot->policy_table.app_policies_section.apps; + std::for_each( + old_apps.begin(), old_apps.end(), ProccessAppGroups(new_apps, this)); +} + +void PolicyManagerImpl::OnPrimaryGroupsChanged( + const std::string& application_id) { + const std::vector devices = + listener()->GetDevicesIds(application_id); + for (std::vector::const_iterator i = devices.begin(); + i != devices.end(); + ++i) { + const Subject who = {*i, application_id}; + if (access_remote_->IsAppRemoteControl(who) && + access_remote_->IsPrimaryDevice(who.dev_id)) { + SendAppPermissionsChanged(who.dev_id, who.app_id); + } + } +} + +void PolicyManagerImpl::OnNonPrimaryGroupsChanged( + const std::string& application_id) { + const std::vector devices = + listener()->GetDevicesIds(application_id); + for (std::vector::const_iterator i = devices.begin(); + i != devices.end(); + ++i) { + const Subject who = {*i, application_id}; + if (access_remote_->IsAppRemoteControl(who) && + !access_remote_->IsPrimaryDevice(who.dev_id) && + access_remote_->IsEnabled()) { + SendAppPermissionsChanged(who.dev_id, who.app_id); + } + } +} + +bool PolicyManagerImpl::GetModuleTypes( + const std::string& application_id, + std::vector* modules) const { + return access_remote_->GetModuleTypes(application_id, modules); +} + +void PolicyManagerImpl::set_access_remote( + utils::SharedPtr access_remote) { + access_remote_ = access_remote; +} +#endif // SDL_REMOTE_CONTROL + } // namespace policy diff --git a/src/components/policy/policy_regular/src/policy_table/enums.cc b/src/components/policy/policy_regular/src/policy_table/enums.cc index 6de065148a..e0f77be989 100644 --- a/src/components/policy/policy_regular/src/policy_table/enums.cc +++ b/src/components/policy/policy_regular/src/policy_table/enums.cc @@ -326,6 +326,8 @@ bool IsValidEnum(AppHMIType val) { return true; case AHT_PROJECTION: return true; + case AHT_REMOTE_CONTROL: + return true; default: return false; } @@ -354,6 +356,8 @@ const char* EnumToJsonString(AppHMIType val) { return "SYSTEM"; case AHT_PROJECTION: return "PROJECTION"; + case AHT_REMOTE_CONTROL: + return "REMOTE_CONTROL"; default: return ""; } @@ -392,6 +396,9 @@ bool EnumFromJsonString(const std::string& literal, AppHMIType* result) { } else if ("PROJECTION" == literal) { *result = AHT_PROJECTION; return true; + } else if ("REMOTE_CONTROL" == literal) { + *result = AHT_REMOTE_CONTROL; + return true; } else { return false; } @@ -576,6 +583,41 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) { } } +#ifdef SDL_REMOTE_CONTROL +bool IsValidEnum(ModuleType val) { + switch (val) { + case MT_CLIMATE: + return true; + case MT_RADIO: + return true; + default: + return false; + } +} +const char* EnumToJsonString(ModuleType val) { + switch (val) { + case MT_CLIMATE: + return "CLIMATE"; + case MT_RADIO: + return "RADIO"; + default: + return ""; + } +} + +bool EnumFromJsonString(const std::string& literal, ModuleType* result) { + if ("CLIMATE" == literal) { + *result = MT_CLIMATE; + return true; + } else if ("RADIO" == literal) { + *result = MT_RADIO; + return true; + } else { + return false; + } +} +#endif // SDL_REMOTE_CONTROL + const std::string kDefaultApp = "default"; const std::string kPreDataConsentApp = "pre_DataConsent"; const std::string kDeviceApp = "device"; diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index 7928973919..2c445d4bff 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -166,7 +166,14 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , RequestType(impl::ValueMember(value__, "RequestType")) , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) - , certificate(impl::ValueMember(value__, "certificate"), "not_specified") {} + , certificate(impl::ValueMember(value__, "certificate"), "not_specified") +#ifdef SDL_REMOTE_CONTROL + , groups_primaryRC(impl::ValueMember(value__, "groups_primaryRC")) + , groups_nonPrimaryRC(impl::ValueMember(value__, "groups_nonPrimaryRC")) + , moduleType(impl::ValueMember(value__, "moduleType")) +#endif // SDL_REMOTE_CONTROL +{ +} Json::Value ApplicationParams::ToJsonValue() const { Json::Value result__(PolicyBase::ToJsonValue()); @@ -177,6 +184,11 @@ Json::Value ApplicationParams::ToJsonValue() const { impl::WriteJsonField("memory_kb", memory_kb, &result__); impl::WriteJsonField( "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); +#ifdef SDL_REMOTE_CONTROL + impl::WriteJsonField("groups_primaryRC", groups_primaryRC, &result__); + impl::WriteJsonField("groups_nonPrimaryRC", groups_nonPrimaryRC, &result__); + impl::WriteJsonField("moduleType", moduleType, &result__); +#endif // SDL_REMOTE_CONTROL return result__; } @@ -204,6 +216,17 @@ bool ApplicationParams::is_valid() const { if (!certificate.is_valid()) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (!groups_primaryRC.is_valid()) { + return false; + } + if (!groups_nonPrimaryRC.is_valid()) { + return false; + } + if (!moduleType.is_valid()) { + return false; + } +#endif // SDL_REMOTE_CONTROL return Validate(); } @@ -236,6 +259,17 @@ bool ApplicationParams::struct_empty() const { if (certificate.is_initialized()) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (groups_primaryRC.is_initialized()) { + return false; + } + if (groups_nonPrimaryRC.is_initialized()) { + return false; + } + if (moduleType.is_initialized()) { + return false; + } +#endif // SDL_REMOTE_CONTROL return true; } @@ -268,6 +302,19 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { if (!certificate.is_valid()) { certificate.ReportErrors(&report__->ReportSubobject("certificate")); } +#ifdef SDL_REMOTE_CONTROL + if (!groups_primaryRC.is_valid()) { + groups_primaryRC.ReportErrors( + &report__->ReportSubobject("groups_primaryRC")); + } + if (!groups_nonPrimaryRC.is_valid()) { + groups_nonPrimaryRC.ReportErrors( + &report__->ReportSubobject("groups_nonPrimaryRC")); + } + if (!moduleType.is_valid()) { + moduleType.ReportErrors(&report__->ReportSubobject("moduleType")); + } +#endif // SDL_REMOTE_CONTROL } void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { @@ -278,6 +325,11 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { memory_kb.SetPolicyTableType(pt_type); heart_beat_timeout_ms.SetPolicyTableType(pt_type); certificate.SetPolicyTableType(pt_type); +#ifdef SDL_REMOTE_CONTROL + groups_primaryRC.SetPolicyTableType(pt_type); + groups_nonPrimaryRC.SetPolicyTableType(pt_type); + moduleType.SetPolicyTableType(pt_type); +#endif // SDL_REMOTE_CONTROL } // RpcParameters methods @@ -430,7 +482,15 @@ ModuleConfig::ModuleConfig(const Json::Value* value__) , vehicle_model(impl::ValueMember(value__, "vehicle_model")) , vehicle_year(impl::ValueMember(value__, "vehicle_year")) , preloaded_date(impl::ValueMember(value__, "preloaded_date")) - , certificate(impl::ValueMember(value__, "certificate")) {} + , certificate(impl::ValueMember(value__, "certificate")) +#ifdef SDL_REMOTE_CONTROL + , user_consent_passengersRC( + impl::ValueMember(value__, "user_consent_passengersRC")) + , country_consent_passengersRC( + impl::ValueMember(value__, "country_consent_passengersRC")) +#endif // SDL_REMOTE_CONTROL +{ +} void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { // device_certificates = from.device_certificates; // According to the @@ -448,6 +508,11 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { vehicle_model.assign_if_valid(from.vehicle_model); vehicle_year.assign_if_valid(from.vehicle_year); certificate.assign_if_valid(from.certificate); +#ifdef SDL_REMOTE_CONTROL + user_consent_passengersRC.assign_if_valid(from.user_consent_passengersRC); + country_consent_passengersRC.assign_if_valid( + from.country_consent_passengersRC); +#endif // SDL_REMOTE_CONTROL } Json::Value ModuleConfig::ToJsonValue() const { @@ -473,6 +538,12 @@ Json::Value ModuleConfig::ToJsonValue() const { impl::WriteJsonField("vehicle_year", vehicle_year, &result__); impl::WriteJsonField("certificate", certificate, &result__); impl::WriteJsonField("preloaded_date", preloaded_date, &result__); +#ifdef SDL_REMOTE_CONTROL + impl::WriteJsonField( + "user_consent_passengersRC", user_consent_passengersRC, &result__); + impl::WriteJsonField( + "country_consent_passengersRC", country_consent_passengersRC, &result__); +#endif // SDL_REMOTE_CONTROL return result__; } bool ModuleConfig::is_valid() const { @@ -515,6 +586,14 @@ bool ModuleConfig::is_valid() const { if (!preloaded_date.is_valid()) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (!user_consent_passengersRC.is_valid()) { + return false; + } + if (!country_consent_passengersRC.is_valid()) { + return false; + } +#endif // SDL_REMOTE_CONTROL return Validate(); } bool ModuleConfig::is_initialized() const { @@ -559,7 +638,14 @@ bool ModuleConfig::struct_empty() const { if (vehicle_year.is_initialized()) { return false; } - +#ifdef SDL_REMOTE_CONTROL + if (user_consent_passengersRC.is_initialized()) { + return false; + } + if (country_consent_passengersRC.is_initialized()) { + return false; + } +#endif // SDL_REMOTE_CONTROL return true; } void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { @@ -609,6 +695,16 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { if (!vehicle_year.is_valid()) { vehicle_year.ReportErrors(&report__->ReportSubobject("vehicle_year")); } +#ifdef SDL_REMOTE_CONTROL + if (!user_consent_passengersRC.is_valid()) { + user_consent_passengersRC.ReportErrors( + &report__->ReportSubobject("user_consent_passengersRC")); + } + if (!country_consent_passengersRC.is_valid()) { + country_consent_passengersRC.ReportErrors( + &report__->ReportSubobject("country_consent_passengersRC")); + } +#endif // SDL_REMOTE_CONTROL if (PT_PRELOADED == GetPolicyTableType()) { std::string validation_info = omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType()); @@ -625,6 +721,13 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { omitted_field_report = &report__->ReportSubobject("vehicle_model"); omitted_field_report->set_validation_info(validation_info); } +#ifdef SDL_REMOTE_CONTROL + if (user_consent_passengersRC.is_initialized()) { + omitted_field_report = + &report__->ReportSubobject("user_consent_passengersRC"); + omitted_field_report->set_validation_info(validation_info); + } +#endif // SDL_REMOTE_CONTROL } } @@ -641,6 +744,10 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) { vehicle_make.SetPolicyTableType(pt_type); vehicle_model.SetPolicyTableType(pt_type); vehicle_year.SetPolicyTableType(pt_type); +#ifdef SDL_REMOTE_CONTROL + user_consent_passengersRC.SetPolicyTableType(pt_type); + country_consent_passengersRC.SetPolicyTableType(pt_type); +#endif // SDL_REMOTE_CONTROL } // MessageString methods diff --git a/src/components/policy/policy_regular/src/policy_table/validation.cc b/src/components/policy/policy_regular/src/policy_table/validation.cc index 18a30d9f77..10b8e4bf7c 100644 --- a/src/components/policy/policy_regular/src/policy_table/validation.cc +++ b/src/components/policy/policy_regular/src/policy_table/validation.cc @@ -114,14 +114,46 @@ bool ApplicationPoliciesSection::Validate() const { return true; } -bool ApplicationParams::Validate() const { - // Check for empty "groups" sub-sections - if (groups.empty()) { - return false; +#ifdef SDL_REMOTE_CONTROL +bool ApplicationParams::ValidateModuleTypes() const { + // moduleType is optional so see Optional::is_valid() + bool is_initialized = moduleType->is_initialized(); + if (!is_initialized) { + // valid if not initialized + return true; + } + bool is_valid = moduleType->is_valid(); + if (is_valid) { + return true; + } + + struct IsInvalid { + bool operator()(Enum item) const { + return !item.is_valid(); + } + }; + // cut invalid items + moduleType->erase( + std::remove_if(moduleType->begin(), moduleType->end(), IsInvalid()), + moduleType->end()); + bool empty = moduleType->empty(); + if (empty) { + // set non initialized value + ModuleTypes non_initialized; + moduleType = Optional(non_initialized); } return true; } +bool ApplicationParams::Validate() const { + return ValidateModuleTypes(); +} +#else // SDL_REMOTE_CONTROL +bool ApplicationParams::Validate() const { + return true; +} +#endif // SDL_REMOTE_CONTROL + bool RpcParameters::Validate() const { return true; } diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc index df4bc74cc2..d573e79816 100644 --- a/src/components/policy/policy_regular/src/sql_pt_queries.cc +++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc @@ -71,7 +71,9 @@ const std::string kCreateSchema = " `certificate` TEXT, " " `vehicle_make` VARCHAR(45), " " `vehicle_model` VARCHAR(45), " - " `vehicle_year` VARCHAR(4) " + " `vehicle_year` VARCHAR(4), " + " `user_consent_passengersRC` BOOL, " + " `country_consent_passengersRC` BOOL " "); " "CREATE TABLE IF NOT EXISTS `functional_group`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -134,6 +136,7 @@ const std::string kCreateSchema = " `memory_kb` INTEGER NOT NULL, " " `heart_beat_timeout_ms` INTEGER NOT NULL, " " `certificate` VARCHAR(45), " + " `remote_control_denied` BOOLEAN NOT NULL DEFAULT 0, " " CONSTRAINT `fk_application_hmi_level1` " " FOREIGN KEY(`default_hmi`) " " REFERENCES `hmi_level`(`value`), " @@ -316,6 +319,78 @@ const std::string kCreateSchema = " FOREIGN KEY(`message_type_name`) " " REFERENCES `message_type`(`name`) " "); " + + "CREATE TABLE IF NOT EXISTS `app_group_primary`( " + " `application_id` VARCHAR(45) NOT NULL, " + " `functional_group_id` INTEGER NOT NULL, " + " PRIMARY KEY(`application_id`,`functional_group_id`), " + " CONSTRAINT `fk_application_has_functional_group_application1` " + " FOREIGN KEY(`application_id`) " + " REFERENCES `application`(`id`), " + " CONSTRAINT `fk_application_has_functional_group_functional_group1` " + " FOREIGN KEY(`functional_group_id`) " + " REFERENCES `functional_group`(`id`) " + "); " + "CREATE INDEX IF NOT EXISTS " + "`app_group_primary.fk_application_has_functional_group_functional_group1_" + "idx` " + " ON `app_group_primary`(`functional_group_id`); " + "CREATE INDEX IF NOT EXISTS " + "`app_group_primary.fk_application_has_functional_group_application1_idx` " + " ON `app_group_primary`(`application_id`); " + + "CREATE TABLE IF NOT EXISTS `app_group_non_primary`( " + " `application_id` VARCHAR(45) NOT NULL, " + " `functional_group_id` INTEGER NOT NULL, " + " PRIMARY KEY(`application_id`,`functional_group_id`), " + " CONSTRAINT `fk_application_has_functional_group_application1` " + " FOREIGN KEY(`application_id`) " + " REFERENCES `application`(`id`), " + " CONSTRAINT `fk_application_has_functional_group_functional_group1` " + " FOREIGN KEY(`functional_group_id`) " + " REFERENCES `functional_group`(`id`) " + "); " + "CREATE INDEX IF NOT EXISTS " + "`app_group_non_primary.fk_application_has_functional_group_functional_" + "group1_idx` " + " ON `app_group_non_primary`(`functional_group_id`); " + "CREATE INDEX IF NOT EXISTS " + "`app_group_non_primary.fk_application_has_functional_group_application1_" + "idx` " + " ON `app_group_non_primary`(`application_id`); " + + /* access_module */ + "CREATE TABLE `access_module`( " + " `id` INTEGER PRIMARY KEY NOT NULL, " + " `name` VARCHAR(45) NOT NULL, " + " `user_consent_needed` INTEGER NOT NULL " + "); " + + /* remote_rpc */ + "CREATE TABLE `remote_rpc`( " + " `id` INTEGER PRIMARY KEY NOT NULL, " + " `name` VARCHAR(255) NOT NULL, " + " `parameter` VARCHAR(45), " + " `module_id` INTEGER NOT NULL, " + "CONSTRAINT `fk_remote_rpc_1` " + " FOREIGN KEY(`module_id`) " + " REFERENCES `access_module`(`id`) " + "); " + "CREATE INDEX `remote_rpc.fk_remote_rpc_1_idx` ON " + "`remote_rpc`(`module_id`); " + + /* module type */ + "CREATE TABLE IF NOT EXISTS `module_type`( " + " `name` VARCHAR(50) NOT NULL, " + " `application_id` VARCHAR(45) NOT NULL, " + " PRIMARY KEY(`name`,`application_id`), " + " CONSTRAINT `fk_module_type_application1` " + " FOREIGN KEY(`application_id`) " + " REFERENCES `application`(`id`) " + "); " + "CREATE INDEX IF NOT EXISTS `module_type.fk_module_type_application1_idx` " + " ON `module_type`(`application_id`); " + "CREATE INDEX IF NOT EXISTS `message.fk_messages_languages1_idx` " " ON `message`(`language_code`);" "CREATE INDEX IF NOT EXISTS " @@ -353,8 +428,79 @@ const std::string kInsertInitData = "INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); " ""; +const std::string kDeleteAppGroupPrimary = "DELETE FROM `app_group_primary`"; + +const std::string kDeleteAppGroupNonPrimary = + "DELETE FROM `app_group_non_primary`"; + +const std::string kDeleteModuleTypes = "DELETE FROM `module_type`"; + +const std::string kDeleteAllDevices = "DELETE FROM `device`;"; + +const std::string kSelectAppGroupsPrimary = + "SELECT `f`.`name` FROM `app_group_primary` AS `a`" + " LEFT JOIN `functional_group` AS `f` " + " ON (`f`.`id` = `a`.`functional_group_id`)" + " WHERE `a`.`application_id` = ?"; + +const std::string kSelectAppGroupsNonPrimary = + "SELECT `f`.`name` FROM `app_group_non_primary` AS `a`" + " LEFT JOIN `functional_group` AS `f` " + " ON (`f`.`id` = `a`.`functional_group_id`)" + " WHERE `a`.`application_id` = ?"; + +const std::string kSelectRemoteControlDenied = + "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1"; + +const std::string kInsertAppGroupPrimary = + "INSERT INTO `app_group_primary` (`application_id`, `functional_group_id`)" + " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1"; + +const std::string kInsertAppGroupNonPrimary = + "INSERT INTO `app_group_non_primary` (`application_id`, " + "`functional_group_id`)" + " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1"; + +const std::string kUpdateRemoteControlDenied = + "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?"; + +const std::string kDeleteAccessModules = "DELETE FROM `access_module`"; + +const std::string kDeleteRemoteRpc = "DELETE FROM `remote_rpc`"; + +const std::string kInsertAccessModule = + "INSERT INTO `access_module` (`name`, `user_consent_needed`) " + " VALUES(?, ?, ?)"; + +const std::string kDeleteAppGroupPrimaryByApplicationId = + "DELETE FROM `app_group_primary` WHERE `application_id` = ?"; + +const std::string kDeleteAppGroupNonPrimaryByApplicationId = + "DELETE FROM `app_group_non_primary` WHERE `application_id` = ?"; + +const std::string kSelectAccessModules = + "SELECT `id`, `name` FROM `access_module` " + " WHERE `user_consent_needed` = ?"; + +const std::string kInsertRemoteRpc = + "INSERT INTO `remote_rpc` (`module_id`, `name`, `parameter`) " + " VALUES(?, ?, ?)"; + +const std::string kSelectRemoteRpcs = + "SELECT `name`, `parameter` FROM `remote_rpc` " + " WHERE `module_id` = ?"; + +const std::string kInsertModuleType = + "INSERT OR IGNORE INTO `module_type` (`application_id`, `name`) VALUES (?, " + "?)"; + +const std::string kSelectModuleTypes = + "SELECT DISTINCT `name` FROM `module_type` WHERE `application_id` = ?"; + const std::string kDropSchema = "BEGIN; " + "DROP INDEX IF EXISTS `module_type.fk_module_type_application1_idx`; " + "DROP TABLE IF EXISTS `module_type`; " "DROP INDEX IF EXISTS `message.fk_messages_languages1_idx`; " "DROP INDEX IF EXISTS " "`message.fk_message_consumer_friendly_messages1_idx`; " @@ -388,6 +534,21 @@ const std::string kDropSchema = "idx`; " "DROP TABLE IF EXISTS `preconsented_group`; " "DROP INDEX IF EXISTS " + "`app_group_primary.fk_application_has_functional_group_application1_idx`; " + "DROP INDEX IF EXISTS " + "`app_group_primary.fk_application_has_functional_group_functional_group1_" + "idx`; " + "DROP TABLE IF EXISTS `app_group_primary`; " + "DROP INDEX IF EXISTS " + "`app_group_non_primary.fk_application_has_functional_group_application1_" + "idx`; " + "DROP INDEX IF EXISTS " + "`app_group_non_primary.fk_application_has_functional_group_functional_" + "group1_idx`; " + "DROP TABLE IF EXISTS `app_group_non_primary`; " + "DROP TABLE IF EXISTS `access_module`; " + "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; " + "DROP INDEX IF EXISTS " "`app_group.fk_application_has_functional_group_application1_idx`; " "DROP INDEX IF EXISTS " "`app_group.fk_application_has_functional_group_functional_group1_idx`; " @@ -409,6 +570,8 @@ const std::string kDropSchema = "DROP TABLE IF EXISTS `priority`; " "DROP TABLE IF EXISTS `functional_group`; " "DROP TABLE IF EXISTS `module_config`; " + "DROP TABLE IF EXISTS `remote_rpc`; " + "DROP INDEX IF EXISTS `remote_rpc.fk_remote_rpc_1_idx`; " "DROP TABLE IF EXISTS `module_meta`; " "DROP TABLE IF EXISTS `usage_and_error_count`; " "DROP TABLE IF EXISTS `device`; " @@ -419,6 +582,7 @@ const std::string kDropSchema = const std::string kDeleteData = "BEGIN; " "DELETE FROM `message`; " + "DELETE FROM `module_type`; " "DELETE FROM `endpoint`; " "DELETE FROM `consent_group`; " "DELETE FROM `app_type`; " @@ -430,6 +594,9 @@ const std::string kDeleteData = "DELETE FROM `app_group`; " "DELETE FROM `application`; " "DELETE FROM `rpc`; " + "DELETE FROM `app_group_primary`; " + "DELETE FROM `app_group_non_primary`; " + "DELETE FROM `access_module`; " "DELETE FROM `version`; " "DELETE FROM `message_type`; " "DELETE FROM `language`; " @@ -439,6 +606,7 @@ const std::string kDeleteData = "DELETE FROM `functional_group`; " "DELETE FROM `module_config`; " "DELETE FROM `module_meta`; " + "DELETE FROM `remote_rpc`; " "DELETE FROM `usage_and_error_count`; " "DELETE FROM `device`; " "COMMIT; " @@ -522,7 +690,8 @@ const std::string kUpdateModuleConfig = " `exchange_after_x_ignition_cycles` = ?," " `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, " " `timeout_after_x_seconds` = ?, `certificate` = ?, `vehicle_make` = ?, " - " `vehicle_model` = ?, `vehicle_year` = ?"; + " `vehicle_model` = ?, `vehicle_year` = ?, " + " `user_consent_passengersRC` = ?, `country_consent_passengersRC` = ?"; const std::string kInsertEndpoint = "INSERT INTO `endpoint` (`service`, `url`, `application_id`) " @@ -562,7 +731,8 @@ const std::string kSelectModuleConfig = "SELECT `preloaded_pt`, `exchange_after_x_ignition_cycles`, " " `exchange_after_x_kilometers`, `exchange_after_x_days`, " " `timeout_after_x_seconds`, `certificate`, `vehicle_make`," - " `vehicle_model`, `vehicle_year` " + " `vehicle_model`, `vehicle_year`, " + " `user_consent_passengersRC` , `country_consent_passengersRC` " " FROM `module_config`"; const std::string kSelectEndpoints = diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index e94c853414..854b6e4804 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -526,6 +526,12 @@ void SQLPTRepresentation::GatherModuleConfig( *config->vehicle_model = query.GetString(7); *config->vehicle_year = query.GetString(8); *config->preloaded_date = query.GetString(9); +#ifdef SDL_REMOTE_CONTROL + *config->user_consent_passengersRC = + query.IsNull(8) ? true : query.GetBoolean(8); + *config->country_consent_passengersRC = + query.IsNull(9) ? true : query.GetBoolean(9); +#endif // SDL_REMOTE_CONTROL } utils::dbms::SQLQuery endpoints(db()); @@ -705,6 +711,23 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( if (!GatherAppGroup(app_id, ¶ms.groups)) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (!GatherAppGroupPrimary(app_id, &*params.groups_primaryRC)) { + return false; + } + if (!GatherAppGroupNonPrimary(app_id, &*params.groups_nonPrimaryRC)) { + return false; + } + bool denied = false; + if (!GatherRemoteControlDenied(app_id, &denied)) { + return false; + } + if (!denied) { + if (!GatherModuleType(app_id, &*params.moduleType)) { + return false; + } + } +#endif // SDL_REMOTE_CONTROL if (!GatherNickName(app_id, &*params.nicknames)) { return false; } @@ -859,6 +882,20 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection( LOG4CXX_WARN(logger_, "Incorrect delete from app_group."); return false; } +#ifdef SDL_REMOTE_CONTROL + if (!query_delete.Exec(sql_pt::kDeleteAppGroupPrimary)) { + LOG4CXX_WARN(logger_, "Incorrect delete from app_group_primary."); + return false; + } + if (!query_delete.Exec(sql_pt::kDeleteAppGroupNonPrimary)) { + LOG4CXX_WARN(logger_, "Incorrect delete from app_group_non_primary."); + return false; + } + if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) { + LOG4CXX_WARN(logger_, "Incorrect delete from module_type."); + return false; + } +#endif // SDL_REMOTE_CONTROL if (!query_delete.Exec(sql_pt::kDeleteApplication)) { LOG4CXX_WARN(logger_, "Incorrect delete from application."); return false; @@ -941,6 +978,20 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( if (!SaveAppGroup(app.first, app.second.groups)) { return false; } +#ifdef SDL_REMOTE_CONTROL + if (!SaveAppGroupPrimary(app.first, *app.second.groups_primaryRC)) { + return false; + } + if (!SaveAppGroupNonPrimary(app.first, *app.second.groups_nonPrimaryRC)) { + return false; + } + + bool denied = !app.second.moduleType->is_initialized(); + if (!SaveRemoteControlDenied(app.first, denied) || + !SaveModuleType(app.first, *app.second.moduleType)) { + return false; + } +#endif // SDL_REMOTE_CONTROL if (!SaveNickname(app.first, *app.second.nicknames)) { return false; } @@ -1111,7 +1162,14 @@ bool SQLPTRepresentation::SaveModuleConfig( : query.Bind(7); config.vehicle_year.is_initialized() ? query.Bind(8, *(config.vehicle_year)) : query.Bind(8); - +#ifdef SDL_REMOTE_CONTROL + config.user_consent_passengersRC.is_initialized() + ? query.Bind(9, *(config.user_consent_passengersRC)) + : query.Bind(9); + config.country_consent_passengersRC.is_initialized() + ? query.Bind(10, *(config.country_consent_passengersRC)) + : query.Bind(10); +#endif // SDL_REMOTE_CONTROL if (!query.Exec()) { LOG4CXX_WARN(logger_, "Incorrect update module config"); return false; @@ -1506,6 +1564,280 @@ bool SQLPTRepresentation::GatherAppGroup( return true; } +#ifdef SDL_REMOTE_CONTROL +bool SQLPTRepresentation::GatherAppGroupPrimary( + const std::string& app_id, policy_table::Strings* app_groups) const { + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectAppGroupsPrimary)) { + LOG4CXX_WARN(logger_, "Incorrect select from app groups for primary RC"); + return false; + } + + query.Bind(0, app_id); + while (query.Next()) { + app_groups->push_back(query.GetString(0)); + } + return true; +} + +bool SQLPTRepresentation::GatherAppGroupNonPrimary( + const std::string& app_id, policy_table::Strings* app_groups) const { + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectAppGroupsNonPrimary)) { + LOG4CXX_WARN(logger_, + "Incorrect select from app groups for non primary RC"); + return false; + } + + query.Bind(0, app_id); + while (query.Next()) { + app_groups->push_back(query.GetString(0)); + } + return true; +} + +bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id, + bool* denied) const { + LOG4CXX_AUTO_TRACE(logger_); + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectRemoteControlDenied)) { + LOG4CXX_WARN(logger_, "Incorrect select remote control flag"); + return false; + } + query.Bind(0, app_id); + if (query.Next()) { + *denied = query.GetBoolean(0); + } else { + return false; + } + return true; +} + +bool SQLPTRepresentation::GatherModuleType( + const std::string& app_id, policy_table::ModuleTypes* app_types) const { + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectModuleTypes)) { + LOG4CXX_WARN(logger_, "Incorrect select from app types"); + return false; + } + + query.Bind(0, app_id); + while (query.Next()) { + policy_table::ModuleType type; + if (!policy_table::EnumFromJsonString(query.GetString(0), &type)) { + return false; + } + app_types->push_back(type); + } + return true; +} + +bool SQLPTRepresentation::SaveAppGroupPrimary( + const std::string& app_id, const policy_table::Strings& app_groups) { + LOG4CXX_AUTO_TRACE(logger_); + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertAppGroupPrimary)) { + LOG4CXX_WARN(logger_, "Incorrect insert statement for app group primary"); + return false; + } + policy_table::Strings::const_iterator it; + for (it = app_groups.begin(); it != app_groups.end(); ++it) { + std::string ssss = *it; + LOG4CXX_INFO(logger_, "Group: " << ssss); + query.Bind(0, app_id); + query.Bind(1, *it); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, + "Incorrect insert into app group primary." + << query.LastError().text()); + return false; + } + } + + return true; +} + +bool SQLPTRepresentation::SaveAppGroupNonPrimary( + const std::string& app_id, const policy_table::Strings& app_groups) { + LOG4CXX_AUTO_TRACE(logger_); + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertAppGroupNonPrimary)) { + LOG4CXX_WARN(logger_, + "Incorrect insert statement for app group non primary"); + return false; + } + policy_table::Strings::const_iterator it; + for (it = app_groups.begin(); it != app_groups.end(); ++it) { + std::string ssss = *it; + LOG4CXX_INFO(logger_, "Group: " << ssss); + query.Bind(0, app_id); + query.Bind(1, *it); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, + "Incorrect insert into app group non primary." + << query.LastError().text()); + return false; + } + } + + return true; +} + +bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id, + bool deny) { + LOG4CXX_AUTO_TRACE(logger_); + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kUpdateRemoteControlDenied)) { + LOG4CXX_WARN(logger_, "Incorrect update statement for remote control flag"); + return false; + } + LOG4CXX_DEBUG(logger_, "App: " << app_id << std::boolalpha << " - " << deny); + query.Bind(0, deny); + query.Bind(1, app_id); + if (!query.Exec()) { + LOG4CXX_WARN(logger_, "Incorrect update remote control flag."); + return false; + } + return true; +} + +bool SQLPTRepresentation::SaveModuleType( + const std::string& app_id, const policy_table::ModuleTypes& types) { + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertModuleType)) { + LOG4CXX_WARN(logger_, "Incorrect insert statement for module type"); + return false; + } + + policy_table::ModuleTypes::const_iterator it; + for (it = types.begin(); it != types.end(); ++it) { + query.Bind(0, app_id); + std::string module(policy_table::EnumToJsonString(*it)); + query.Bind(1, module); + LOG4CXX_DEBUG(logger_, + "Module(app: " << app_id << ", type: " << module << ")"); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, "Incorrect insert into module type."); + return false; + } + } + + return true; +} + +bool SQLPTRepresentation::SaveAccessModule( + TypeAccess access, const policy_table::AccessModules& modules) { + LOG4CXX_AUTO_TRACE(logger_); + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertAccessModule)) { + LOG4CXX_WARN(logger_, "Incorrect insert statement for access module"); + return false; + } + + policy_table::AccessModules::const_iterator i; + for (i = modules.begin(); i != modules.end(); ++i) { + const std::string& name = i->first; + const policy_table::RemoteRpcs& rpcs = i->second; + query.Bind(0, name); + query.Bind(1, access); + if (!query.Exec()) { + LOG4CXX_WARN(logger_, "Incorrect insert into access module."); + return false; + } + int id = query.LastInsertId(); + if (!query.Reset()) { + LOG4CXX_WARN(logger_, "Couldn't reset query access module."); + return false; + } + if (!SaveRemoteRpc(id, rpcs)) { + return false; + } + } + return true; +} + +bool SQLPTRepresentation::GatherAccessModule( + TypeAccess access, policy_table::AccessModules* modules) const { + LOG4CXX_AUTO_TRACE(logger_); + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectAccessModules)) { + LOG4CXX_WARN(logger_, "Incorrect select from access module"); + return false; + } + + query.Bind(0, access); + while (query.Next()) { + int id = query.GetInteger(0); + std::string name = query.GetString(1); + policy_table::RemoteRpcs rpcs; + if (!GatherRemoteRpc(id, &rpcs)) { + return false; + } + modules->insert(std::make_pair(name, rpcs)); + } + return true; +} + +bool SQLPTRepresentation::SaveRemoteRpc(int module_id, + const policy_table::RemoteRpcs& rpcs) { + LOG4CXX_AUTO_TRACE(logger_); + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kInsertRemoteRpc)) { + LOG4CXX_WARN(logger_, "Incorrect insert statement for remote rpc"); + return false; + } + policy_table::RemoteRpcs::const_iterator i; + for (i = rpcs.begin(); i != rpcs.end(); ++i) { + const std::string& name = i->first; + const policy_table::Strings& params = i->second; + policy_table::Strings::const_iterator j; + if (params.empty()) { + query.Bind(0, module_id); + query.Bind(1, name); + query.Bind(2); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc."); + return false; + } + } else { + for (j = params.begin(); j != params.end(); ++j) { + const std::string& param = *j; + query.Bind(0, module_id); + query.Bind(1, name); + query.Bind(2, param); + if (!query.Exec() || !query.Reset()) { + LOG4CXX_WARN(logger_, "Incorrect insert into remote rpc."); + return false; + } + } + } + } + return true; +} + +bool SQLPTRepresentation::GatherRemoteRpc( + int module_id, policy_table::RemoteRpcs* rpcs) const { + LOG4CXX_AUTO_TRACE(logger_); + utils::dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kSelectRemoteRpcs)) { + LOG4CXX_WARN(logger_, "Incorrect select from remote rpc"); + return false; + } + + query.Bind(0, module_id); + while (query.Next()) { + std::string name = query.GetString(0); + if (!query.IsNull(1)) { + std::string parameter = query.GetString(1); + (*rpcs)[name].push_back(parameter); + } else { + rpcs->insert(std::make_pair(name, policy_table::Strings())); + } + } + return true; +} +#endif // SDL_REMOTE_CONTROL + bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id, bool is_revoked, bool is_default, @@ -1590,6 +1922,31 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { LOG4CXX_ERROR(logger_, "Failed deleting from app_group."); return false; } +#ifdef SDL_REMOTE_CONTROL + utils::dbms::SQLQuery query_p(db()); + if (!query_p.Prepare(sql_pt::kDeleteAppGroupPrimaryByApplicationId)) { + LOG4CXX_ERROR(logger_, + "Incorrect statement to delete from app_group_primary."); + return false; + } + query_p.Bind(0, app_id); + if (!query_p.Exec()) { + LOG4CXX_ERROR(logger_, "Failed deleting from app_group_primary."); + return false; + } + + utils::dbms::SQLQuery query_np(db()); + if (!query_np.Prepare(sql_pt::kDeleteAppGroupNonPrimaryByApplicationId)) { + LOG4CXX_ERROR(logger_, + "Incorrect statement to delete from app_group_non_primary."); + return false; + } + query_np.Bind(0, app_id); + if (!query_np.Exec()) { + LOG4CXX_ERROR(logger_, "Failed deleting from app_group_non_primary."); + return false; + } +#endif // SDL_REMOTE_CONTROL if (!CopyApplication(kDefaultId, app_id)) { return false; @@ -1612,7 +1969,22 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { !SaveAppType(app_id, app_types)) { return false; } - return SetIsDefault(app_id, true); + + bool ret = (GatherAppGroup(kDefaultId, &default_groups) && + SaveAppGroup(app_id, default_groups)); +#ifdef SDL_REMOTE_CONTROL + policy_table::Strings groups_primary; + ret = ret && (GatherAppGroupPrimary(kDefaultId, &groups_primary) && + SaveAppGroupPrimary(app_id, groups_primary)); + policy_table::Strings groups_non_primary; + ret = ret && (GatherAppGroupNonPrimary(kDefaultId, &groups_non_primary) && + SaveAppGroupNonPrimary(app_id, groups_non_primary)); +#endif // SDL_REMOTE_CONTROL + + if (ret) { + return SetIsDefault(app_id, true); + } + return false; } bool SQLPTRepresentation::SetIsDefault(const std::string& app_id, diff --git a/src/components/policy/policy_regular/test/CMakeLists.txt b/src/components/policy/policy_regular/test/CMakeLists.txt index 997c3637e8..62ff691f83 100644 --- a/src/components/policy/policy_regular/test/CMakeLists.txt +++ b/src/components/policy/policy_regular/test/CMakeLists.txt @@ -39,11 +39,17 @@ include_directories( ${COMPONENTS_DIR}/rpc_base/include ${COMPONENTS_DIR}/config_profile/include ${COMPONENTS_DIR}/utils/include/ + ${COMPONENTS_DIR}/include/test/policy/policy_regular/ ${POLICY_PATH}/test/include/ ${POLICY_MOCK_INCLUDE_PATH}/ ) collect_sources(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}") +if (NOT REMOTE_CONTROL) + list (REMOVE_ITEM SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/access_remote_impl_test.cc + ) +endif () set(LIBRARIES gmock diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc new file mode 100644 index 0000000000..4b2a9b02eb --- /dev/null +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -0,0 +1,265 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "gtest/gtest.h" +#include "policy/access_remote_impl.h" + +namespace policy { + +TEST(AccessRemoteImplTest, Allow) { + AccessRemoteImpl access_remote; + Subject who = {"dev1", "12345"}; + Object what = {policy_table::MT_RADIO}; + access_remote.Allow(who, what); + AccessRemoteImpl::AccessControlList::const_iterator i = + access_remote.acl_.find(what); + ASSERT_NE(access_remote.acl_.end(), i); + AccessRemoteImpl::AccessControlRow::const_iterator j = i->second.find(who); + ASSERT_NE(i->second.end(), j); + EXPECT_EQ(TypeAccess::kAllowed, j->second); +} + +TEST(AccessRemoteImplTest, KeyMapTest) { + // Testing operator < to use as key of map + AccessRemoteImpl access_remote; + Subject who = {"dev1", "12345"}; + Object what1 = {policy_table::MT_RADIO}; + Object what2 = {policy_table::MT_CLIMATE}; + access_remote.Allow(who, what1); + access_remote.Allow(who, what2); + ASSERT_EQ(2u, access_remote.acl_.size()); +} + +TEST(AccessRemoteImplTest, Deny) { + AccessRemoteImpl access_remote; + Subject who = {"dev1", "12345"}; + Object what = {policy_table::MT_RADIO}; + access_remote.Deny(who, what); + AccessRemoteImpl::AccessControlList::const_iterator i = + access_remote.acl_.find(what); + ASSERT_NE(access_remote.acl_.end(), i); + AccessRemoteImpl::AccessControlRow::const_iterator j = i->second.find(who); + ASSERT_NE(i->second.end(), j); + EXPECT_EQ(TypeAccess::kDisallowed, j->second); +} + +TEST(AccessRemoteImplTest, ChangeAccess) { + AccessRemoteImpl access_remote; + Subject who = {"dev1", "12345"}; + Object what = {policy_table::MT_RADIO}; + access_remote.Allow(who, what); + ASSERT_EQ(TypeAccess::kAllowed, access_remote.acl_[what][who]); + access_remote.Deny(who, what); + ASSERT_EQ(TypeAccess::kDisallowed, access_remote.acl_[what][who]); + access_remote.Allow(who, what); + EXPECT_EQ(TypeAccess::kAllowed, access_remote.acl_[what][who]); +} + +TEST(AccessRemoteImplTest, ResetBySubject) { + AccessRemoteImpl access_remote; + Subject who = {"dev1", "12345"}; + Object what1 = {policy_table::MT_RADIO}; + Object what2 = {policy_table::MT_CLIMATE}; + access_remote.Allow(who, what1); + access_remote.Deny(who, what2); + ASSERT_EQ(2u, access_remote.acl_.size()); + ASSERT_EQ(1u, access_remote.acl_[what1].size()); + ASSERT_EQ(1u, access_remote.acl_[what2].size()); + + access_remote.Reset(who); + ASSERT_EQ(2u, access_remote.acl_.size()); + EXPECT_TRUE(access_remote.acl_[what1].empty()); + EXPECT_TRUE(access_remote.acl_[what2].empty()); +} + +TEST(AccessRemoteImplTest, ResetByObject) { + AccessRemoteImpl access_remote; + Subject who1 = {"dev1", "12345"}; + Subject who2 = {"dev2", "123456"}; + Object what = {policy_table::MT_RADIO}; + access_remote.Allow(who1, what); + access_remote.Deny(who2, what); + ASSERT_EQ(1u, access_remote.acl_.size()); + ASSERT_EQ(2u, access_remote.acl_[what].size()); + + access_remote.Reset(what); + EXPECT_TRUE(access_remote.acl_.empty()); +} + +TEST(AccessRemoteImplTest, CheckAllowed) { + AccessRemoteImpl access_remote; + Subject who = {"dev1", "12345"}; + Object what = {policy_table::MT_RADIO}; + access_remote.Allow(who, what); + + EXPECT_EQ(TypeAccess::kAllowed, access_remote.Check(who, what)); +} + +TEST(AccessRemoteImplTest, CheckDisallowed) { + AccessRemoteImpl access_remote; + Subject who = {"dev1", "12345"}; + Subject who1 = {"dev1", "123456"}; + Object what = {policy_table::MT_RADIO}; + + access_remote.Allow(who, what); + EXPECT_EQ(TypeAccess::kManual, access_remote.Check(who1, what)); + + access_remote.Reset(who); + access_remote.Deny(who1, what); + EXPECT_EQ(TypeAccess::kDisallowed, access_remote.Check(who1, what)); +} + +TEST(AccessRemoteImplTest, CheckManual) { + AccessRemoteImpl access_remote; + Subject who = {"dev1", "12345"}; + Subject who1 = {"dev1", "123456"}; + Object what = {policy_table::MT_RADIO}; + + EXPECT_EQ(TypeAccess::kManual, access_remote.Check(who, what)); + + access_remote.Deny(who1, what); + EXPECT_EQ(TypeAccess::kManual, access_remote.Check(who, what)); +} + +TEST(AccessRemoteImplTest, CheckModuleType) { + AccessRemoteImpl access_remote; + access_remote.cache_->pt_ = new policy_table::Table(); + + // No application + EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO)); + + // No modules + policy_table::ApplicationPolicies& apps = + access_remote.cache_->pt_->policy_table.app_policies_section.apps; + apps["1234"]; + EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO)); + + // Empty modules + policy_table::ModuleTypes& modules = *apps["1234"].moduleType; + modules.mark_initialized(); + EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO)); + EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_CLIMATE)); + + // Specific modules + modules.push_back(policy_table::MT_RADIO); + EXPECT_TRUE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO)); + EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_CLIMATE)); +} + +TEST(AccessRemoteImplTest, EnableDisable) { + AccessRemoteImpl access_remote; + access_remote.cache_->pt_ = new policy_table::Table(); + policy_table::ModuleConfig& config = + access_remote.cache_->pt_->policy_table.module_config; + + // Country is enabled + access_remote.enabled_ = true; + *config.country_consent_passengersRC = true; + access_remote.Enable(); + EXPECT_TRUE(*config.user_consent_passengersRC); + EXPECT_TRUE(*config.country_consent_passengersRC); + EXPECT_TRUE(access_remote.IsEnabled()); + + access_remote.Disable(); + EXPECT_FALSE(*config.user_consent_passengersRC); + EXPECT_TRUE(*config.country_consent_passengersRC); + EXPECT_FALSE(access_remote.IsEnabled()); + + // Country is disabled + access_remote.enabled_ = false; + *config.country_consent_passengersRC = false; + access_remote.Enable(); + EXPECT_TRUE(*config.user_consent_passengersRC); + EXPECT_FALSE(*config.country_consent_passengersRC); + EXPECT_FALSE(access_remote.IsEnabled()); + + access_remote.Disable(); + EXPECT_FALSE(*config.user_consent_passengersRC); + EXPECT_FALSE(*config.country_consent_passengersRC); + EXPECT_FALSE(access_remote.IsEnabled()); +} + +TEST(AccessRemoteImplTest, SetDefaultHmiTypes) { + AccessRemoteImpl access_remote; + + std::vector hmi_expected; + hmi_expected.push_back(2); + hmi_expected.push_back(6); + Subject who = {"dev1", "1234"}; + access_remote.SetDefaultHmiTypes(who, hmi_expected); + + EXPECT_NE(access_remote.hmi_types_.end(), access_remote.hmi_types_.find(who)); + policy_table::AppHMITypes& hmi_output = access_remote.hmi_types_[who]; + EXPECT_EQ(2u, hmi_output.size()); + EXPECT_EQ(policy_table::AHT_MEDIA, hmi_output[0]); + EXPECT_EQ(policy_table::AHT_SOCIAL, hmi_output[1]); +} + +TEST(AccessRemoteImplTest, GetGroups) { + AccessRemoteImpl access_remote; + access_remote.primary_device_ = "dev1"; + access_remote.enabled_ = true; + Subject who = {"dev1", "1234"}; + access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL); + + access_remote.cache_->pt_ = new policy_table::Table(); + policy_table::ApplicationPolicies& apps = + access_remote.cache_->pt_->policy_table.app_policies_section.apps; + apps["1234"].groups.push_back("group_default"); + apps["1234"].groups_nonPrimaryRC->push_back("group_non_primary"); + apps["1234"].groups_primaryRC->push_back("group_primary"); + apps["1234"].AppHMIType->push_back(policy_table::AHT_MEDIA); + + // Default groups + const policy_table::Strings& groups1 = access_remote.GetGroups(who); + EXPECT_EQ(std::string("group_default"), std::string(groups1[0])); + + // Primary groups + apps["1234"].set_to_string(policy::kDefaultId); + const policy_table::Strings& groups2 = access_remote.GetGroups(who); + EXPECT_EQ(std::string("group_primary"), std::string(groups2[0])); + + // Non primary groups + apps["1234"].set_to_string(policy::kDefaultId); + Subject who2 = {"dev2", "1234"}; + access_remote.hmi_types_[who2].push_back(policy_table::AHT_REMOTE_CONTROL); + const policy_table::Strings& groups3 = access_remote.GetGroups(who2); + EXPECT_EQ(std::string("group_non_primary"), std::string(groups3[0])); + + // Empty groups + access_remote.enabled_ = false; + apps["1234"].set_to_string(policy::kDefaultId); + const policy_table::Strings& groups4 = access_remote.GetGroups(who2); + EXPECT_TRUE(groups4.empty()); +} + +} // namespace policy diff --git a/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h new file mode 100644 index 0000000000..8c5bf75ba5 --- /dev/null +++ b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#ifndef SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_ACCESS_REMOTE_H_ +#define SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_ACCESS_REMOTE_H_ + +#include "gmock/gmock.h" +#include "policy/access_remote.h" + +namespace test { +namespace components { +namespace access_remote_test { + +class MockSubject : public policy::Subject { + public: +}; + +class MockObject : public policy::Object { + public: +}; + +class MockAccessRemote : public policy::AccessRemote { + public: + MOCK_METHOD0(Init, void()); + MOCK_METHOD0(Enable, void()); + MOCK_METHOD0(Disable, void()); + MOCK_CONST_METHOD0(IsEnabled, bool()); + MOCK_CONST_METHOD1(IsPrimaryDevice, bool(const policy::PTString& dev_id)); + MOCK_METHOD1(SetPrimaryDevice, void(const policy::PTString& dev_id)); + MOCK_CONST_METHOD0(PrimaryDevice, policy::PTString()); + + MOCK_METHOD2(Allow, + void(const policy::Subject& who, const policy::Object& what)); + MOCK_METHOD2(Deny, + void(const policy::Subject& who, const policy::Object& what)); + MOCK_METHOD1(Reset, void(const policy::Subject& who)); + MOCK_METHOD1(Reset, void(const policy::Object& what)); + MOCK_CONST_METHOD2(Check, + policy::TypeAccess(const policy::Subject& who, + const policy::Object& what)); + MOCK_CONST_METHOD3( + FindGroup, + policy::PTString(const policy::Subject& who, + const policy::PTString& rpc, + const policy::RemoteControlParams& params)); + MOCK_METHOD2(SetDefaultHmiTypes, + void(const policy::Subject& who, + const std::vector& hmi_types)); + MOCK_METHOD1(GetGroups, + const policy_table::Strings&(const policy::Subject& who)); + MOCK_METHOD3(GetPermissionsForApp, + bool(const std::string& device_id, + const std::string& app_id, + policy::FunctionalIdType& group_types)); + MOCK_CONST_METHOD2(CheckModuleType, + bool(const policy::PTString& app_id, + policy_table::ModuleType module)); + MOCK_METHOD1(IsAppRemoteControl, bool(const policy::Subject& who)); + MOCK_METHOD0(Reset, void()); + MOCK_METHOD2(GetModuleTypes, + bool(const std::string& application_id, + std::vector* modules)); +}; + +} // namespace access_remote_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_POLICY_TEST_INCLUDE_MOCK_ACCESS_REMOTE_H_ diff --git a/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h deleted file mode 100644 index 7569e2195d..0000000000 --- a/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2014, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - */ -#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_ -#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_ - -#include -#include - -#include "gmock/gmock.h" - -#include "policy/cache_manager_interface.h" - -namespace test { -namespace components { -namespace policy_test { -namespace policy_table = rpc::policy_table_interface_base; -using namespace ::policy; - -class MockCacheManagerInterface : public CacheManagerInterface { - public: - MOCK_METHOD4(CheckPermissions, - void(const policy_table::Strings& groups, - const PTString& hmi_level, - const PTString& rpc, - CheckPermissionResult& result)); - MOCK_METHOD0(IsPTPreloaded, bool()); - MOCK_METHOD0(IgnitionCyclesBeforeExchange, int()); - MOCK_METHOD1(KilometersBeforeExchange, int(int current)); - MOCK_METHOD2(SetCountersPassedForSuccessfulUpdate, - bool(Counters counter, int value)); - MOCK_METHOD1(DaysBeforeExchange, int(int current)); - MOCK_METHOD0(IncrementIgnitionCycles, void()); - MOCK_METHOD0(ResetIgnitionCycles, void()); - MOCK_METHOD0(TimeoutResponse, int()); - MOCK_METHOD1(SecondsBetweenRetries, bool(std::vector& seconds)); - MOCK_CONST_METHOD0(GetVehicleInfo, const VehicleInfo()); - MOCK_METHOD1(SetVINValue, bool(const std::string& value)); - MOCK_METHOD2(GetUserFriendlyMsg, - std::vector( - const std::vector& msg_codes, - const std::string& language)); - - MOCK_METHOD1( - GetNotificationsNumber, - policy_table::NumberOfNotificationsType(const std::string& priority)); - MOCK_CONST_METHOD2(GetPriority, - bool(const std::string& policy_app_id, - std::string& priority)); - MOCK_METHOD2(GetUpdateUrls, - void(const std::string& service_type, - EndpointUrls& out_end_points)); - MOCK_METHOD2(GetUpdateUrls, - void(const uint32_t service_type, EndpointUrls& out_end_points)); - MOCK_CONST_METHOD0(GetLockScreenIconUrl, std::string()); - MOCK_METHOD2(Init, - bool(const std::string& file_name, - const PolicySettings* settings)); - MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr()); - MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt)); - MOCK_METHOD1(Save, bool(const policy_table::Table& table)); - MOCK_CONST_METHOD0(UpdateRequired, bool()); - MOCK_METHOD1(SaveUpdateRequired, void(bool status)); - MOCK_METHOD3(GetInitialAppData, - bool(const std::string& app_id, - StringArray& nicknames, - StringArray& app_hmi_types)); - MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id)); - MOCK_METHOD1(GetFunctionalGroupings, - bool(policy_table::FunctionalGroupings& groups)); - MOCK_CONST_METHOD1(IsApplicationRepresented, bool(const std::string& app_id)); - MOCK_CONST_METHOD1(IsDefaultPolicy, bool(const std::string& app_id)); - MOCK_METHOD1(SetIsDefault, bool(const std::string& app_id)); - MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& app_id)); - MOCK_METHOD1(SetDefaultPolicy, bool(const std::string& app_id)); - MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); - MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); - MOCK_CONST_METHOD2(GetDefaultHMI, - bool(const std::string& app_id, std::string& default_hmi)); - MOCK_METHOD0(ResetUserConsent, bool()); - MOCK_CONST_METHOD3(GetUserPermissionsForDevice, - bool(const std::string& device_id, - StringArray& consented_groups, - StringArray& disallowed_groups)); - MOCK_METHOD3(GetPermissionsForApp, - bool(const std::string& device_id, - const std::string& app_id, - FunctionalIdType& group_types)); - MOCK_CONST_METHOD2( - GetDeviceGroupsFromPolicies, - bool(rpc::policy_table_interface_base::Strings& groups, - rpc::policy_table_interface_base::Strings& preconsented_groups)); - MOCK_METHOD2(AddDevice, - bool(const std::string& device_id, - const std::string& connection_type)); - MOCK_METHOD8(SetDeviceData, - bool(const std::string& device_id, - const std::string& hardware, - const std::string& firmware, - const std::string& os, - const std::string& os_version, - const std::string& carrier, - const uint32_t number_of_ports, - const std::string& connection_type)); - MOCK_METHOD3(SetUserPermissionsForDevice, - bool(const std::string& device_id, - const StringArray& consented_groups, - const StringArray& disallowed_groups)); - MOCK_METHOD2(ReactOnUserDevConsentForApp, - bool(const std::string& app_id, bool is_device_allowed)); - MOCK_METHOD1(SetUserPermissionsForApp, - bool(const PermissionConsent& permissions)); - MOCK_METHOD3(SetMetaInfo, - bool(const std::string& ccpu_version, - const std::string& wers_country_code, - const std::string& language)); - MOCK_CONST_METHOD0(IsMetaInfoPresent, bool()); - MOCK_METHOD1(SetSystemLanguage, bool(const std::string& language)); - MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type)); - MOCK_METHOD2(Increment, - void(const std::string& app_id, - usage_statistics::AppCounterId type)); - MOCK_METHOD3(Set, - void(const std::string& app_id, - usage_statistics::AppInfoId type, - const std::string& value)); - MOCK_METHOD3(Add, - void(const std::string& app_id, - usage_statistics::AppStopwatchId type, - int seconds)); - MOCK_METHOD2(CountUnconsentedGroups, - int(const std::string& policy_app_id, - const std::string& device_id)); - MOCK_METHOD1(GetFunctionalGroupNames, bool(FunctionalGroupNames& names)); - MOCK_METHOD2(GetAllAppGroups, - void(const std::string& app_id, - FunctionalGroupIDs& all_group_ids)); - MOCK_METHOD2(GetPreConsentedGroups, - void(const std::string& app_id, - FunctionalGroupIDs& preconsented_groups)); - MOCK_METHOD4(GetConsentedGroups, - void(const std::string& device_id, - const std::string& app_id, - FunctionalGroupIDs& allowed_groups, - FunctionalGroupIDs& disallowed_groups)); - MOCK_METHOD3(GetUnconsentedGroups, - void(const std::string& device_id, - const std::string& policy_app_id, - FunctionalGroupIDs& unconsented_groups)); - MOCK_METHOD2(RemoveAppConsentForGroup, - void(const std::string& app_id, const std::string& group_name)); - MOCK_METHOD1(SetPredataPolicy, bool(const std::string& app_id)); - MOCK_METHOD0(CleanupUnpairedDevices, bool()); - MOCK_METHOD2(SetUnpairedDevice, - bool(const std::string& device_id, bool unpaired)); - MOCK_METHOD1(UnpairedDevicesList, bool(DeviceIds& device_ids)); - MOCK_METHOD1(ResetPT, bool(const std::string& file_name)); - MOCK_METHOD0(LoadFromBackup, bool()); - MOCK_METHOD2(LoadFromFile, - bool(const std::string& file_name, policy_table::Table&)); - MOCK_METHOD0(Backup, void()); - MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id)); - MOCK_CONST_METHOD2(GetAppRequestTypes, - void(const std::string& policy_app_id, - std::vector& request_types)); - MOCK_METHOD1(GetHMIAppTypeAfterUpdate, - void(std::map& app_hmi_types)); - MOCK_METHOD0(ResetCalculatedPermissions, void()); - MOCK_METHOD3(AddCalculatedPermissions, - void(const std::string& device_id, - const std::string& policy_app_id, - const policy::Permissions& permissions)); - MOCK_METHOD3(IsPermissionsCalculated, - bool(const std::string& device_id, - const std::string& policy_app_id, - policy::Permissions& permission)); - MOCK_CONST_METHOD0(GetPT, utils::SharedPtr()); - MOCK_CONST_METHOD0(GetCertificate, std::string()); - MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); - MOCK_METHOD1(GetGroups, const policy_table::Strings&(const PTString& app_id)); - MOCK_CONST_METHOD2(AppHasHMIType, - bool(const std::string& application_id, - policy_table::AppHMIType hmi_type)); -}; - -} // namespace policy_test -} // namespace components -} // namespace test - -#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_ diff --git a/src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h b/src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h deleted file mode 100644 index 2e4073aae9..0000000000 --- a/src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) 2016, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - */ - -#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_ -#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_ - -#include - -#include "gmock/gmock.h" - -#include "policy/policy_listener.h" -#include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" -#include "utils/custom_string.h" - -namespace policy_table = ::rpc::policy_table_interface_base; - -namespace policy { - -namespace custom_str = utils::custom_string; - -class MockPolicyListener : public PolicyListener { - public: - MOCK_METHOD3(OnPermissionsUpdated, - void(const std::string& policy_app_id, - const Permissions& permissions, - const policy::HMILevel& default_hmi)); - MOCK_METHOD2(OnPermissionsUpdated, - void(const std::string& policy_app_id, - const Permissions& permissions)); - MOCK_METHOD1(OnPendingPermissionChange, - void(const std::string& policy_app_id)); - MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status)); - MOCK_METHOD1(OnCurrentDeviceIdUpdateRequired, - std::string(const std::string& policy_app_id)); - MOCK_METHOD0(OnSystemInfoUpdateRequired, void()); - MOCK_METHOD1(GetAppName, - custom_str::CustomString(const std::string& policy_app_id)); - MOCK_METHOD0(OnUserRequestedUpdateCheckRequired, void()); - MOCK_METHOD2(OnDeviceConsentChanged, - void(const std::string& device_id, bool is_allowed)); - MOCK_METHOD1(OnUpdateHMIAppType, void(std::map)); - MOCK_METHOD1(GetAvailableApps, void(std::queue&)); - MOCK_METHOD1(OnSnapshotCreated, void(const BinaryMessage& pt_string)); - MOCK_METHOD0(CanUpdate, bool()); - MOCK_METHOD1(OnCertificateUpdated, void(const std::string&)); - MOCK_CONST_METHOD2(SendOnAppPermissionsChanged, - void(const AppPermissions&, const std::string&)); - MOCK_CONST_METHOD1(GetRegisteredLinks, - void(std::map&)); -}; - -} // namespace policy - -#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_ diff --git a/src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h b/src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h deleted file mode 100644 index 7ab4b518cd..0000000000 --- a/src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2016, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - */ - -#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_MANAGER_H_ -#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_MANAGER_H_ - -#include -#include -#include "gmock/gmock.h" -#include "policy/policy_listener.h" -#include "policy/policy_types.h" -#include "policy/usage_statistics/statistics_manager.h" - -#include "rpc_base/rpc_base.h" -#include "policy/policy_table/types.h" -#include "policy/policy_manager.h" - -namespace policy_table = ::rpc::policy_table_interface_base; - -namespace policy_manager { - -using namespace policy; - -class MockPolicyManager : public PolicyManager { - public: - MOCK_METHOD1(set_listener, void(PolicyListener* listener)); - MOCK_METHOD2(InitPT, - bool(const std::string& file_name, - const PolicySettings* settings)); - MOCK_METHOD2(LoadPT, - bool(const std::string& file, const BinaryMessage& pt_content)); - MOCK_METHOD1(ResetPT, bool(const std::string& file_name)); - MOCK_METHOD2(GetUpdateUrls, - void(const uint32_t service_type, EndpointUrls& out_end_points)); - MOCK_METHOD2(GetUpdateUrls, - void(const std::string& service_type, - EndpointUrls& out_end_points)); - MOCK_METHOD0(RequestPTUpdate, bool()); - - MOCK_METHOD6(CheckPermissions, - void(const PTString& device_id, - const PTString& app_id, - const PTString& hmi_level, - const PTString& rpc, - const RPCParams& rpc_params, - CheckPermissionResult& result)); - MOCK_METHOD0(ResetUserConsent, bool()); - MOCK_CONST_METHOD0(GetPolicyTableStatus, std::string()); - MOCK_METHOD1(KmsChanged, void(int kilometers)); - MOCK_METHOD0(IncrementIgnitionCycles, void()); - MOCK_METHOD0(ForcePTExchange, std::string()); - MOCK_METHOD0(ResetRetrySequence, void()); - MOCK_METHOD0(NextRetryTimeout, int()); - MOCK_METHOD0(TimeoutExchangeMSec, uint32_t()); - MOCK_METHOD0(RetrySequenceDelaysSeconds, const std::vector()); - MOCK_METHOD0(OnExceededTimeout, void()); - MOCK_METHOD0(OnUpdateStarted, void()); - MOCK_CONST_METHOD1(GetUserConsentForDevice, - DeviceConsent(const std::string& device_id)); - MOCK_METHOD3( - GetUserConsentForApp, - void(const std::string& device_id, - const std::string& policy_app_id, - std::vector& permissions)); - MOCK_METHOD2(SetUserConsentForDevice, - void(const std::string& device_id, bool is_allowed)); - MOCK_METHOD2(ReactOnUserDevConsentForApp, - bool(const std::string app_id, bool is_device_allowed)); - MOCK_METHOD2(PTUpdatedAt, void(policy::Counters counter, int value)); - - MOCK_METHOD3(GetInitialAppData, - bool(const std::string&, - policy::StringArray*, - policy::StringArray*)); - - MOCK_METHOD2(AddDevice, - void(const std::string& device_id, - const std::string& connection_type)); - MOCK_METHOD2(SetDeviceInfo, - void(const std::string& device_id, - const policy::DeviceInfo& device_info)); - MOCK_METHOD1(SetUserConsentForApp, - void(const policy::PermissionConsent& permissions)); - MOCK_CONST_METHOD2(GetDefaultHmi, - bool(const std::string& policy_app_id, - std::string* default_hmi)); - MOCK_CONST_METHOD2(GetPriority, - bool(const std::string& policy_app_id, - std::string* priority)); - MOCK_METHOD2(GetUserFriendlyMessages, - std::vector( - const std::vector& message_code, - const std::string& language)); - MOCK_CONST_METHOD1(IsApplicationRevoked, bool(const std::string& app_id)); - MOCK_METHOD3( - GetPermissionsForApp, - void(const std::string& device_id, - const std::string& policy_app_id, - std::vector& permissions)); - MOCK_METHOD1(GetAppPermissionsChanges, - policy::AppPermissions(const std::string& policy_app_id)); - MOCK_METHOD1(RemovePendingPermissionChanges, void(const std::string& app_id)); - MOCK_CONST_METHOD1(GetCurrentDeviceId, - std::string&(const std::string& policy_app_id)); - MOCK_METHOD1(SetSystemLanguage, void(const std::string& language)); - MOCK_METHOD3(SetSystemInfo, - void(const std::string& ccpu_version, - const std::string& wers_country_code, - const std::string& language)); - MOCK_METHOD1(SendNotificationOnPermissionsUpdated, - void(const std::string& application_id)); - MOCK_METHOD1(MarkUnpairedDevice, void(const std::string& device_id)); - MOCK_METHOD1(AddApplication, - StatusNotifier(const std::string& application_id)); - MOCK_METHOD0(CleanupUnpairedDevices, bool()); - MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); - MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); - MOCK_METHOD0(OnSystemReady, void()); - MOCK_CONST_METHOD1(GetNotificationsNumber, - uint32_t(const std::string& priority)); - MOCK_METHOD1(SetVINValue, void(const std::string& value)); - MOCK_CONST_METHOD1(IsPredataPolicy, bool(const std::string& policy_app_id)); - MOCK_CONST_METHOD1(HeartBeatTimeout, uint32_t(const std::string& app_id)); - MOCK_METHOD1(SaveUpdateStatusRequired, void(bool is_update_needed)); - MOCK_METHOD0(OnAppsSearchStarted, void()); - MOCK_METHOD0(OnAppsSearchCompleted, void()); - MOCK_METHOD1(OnAppRegisteredOnMobile, - void(const std::string& application_id)); - MOCK_CONST_METHOD1( - GetAppRequestTypes, - const std::vector(const std::string policy_app_id)); - MOCK_CONST_METHOD0(GetVehicleInfo, const policy::VehicleInfo()); - MOCK_CONST_METHOD0(RetrieveCertificate, std::string()); - MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); - MOCK_METHOD0(ExceededIgnitionCycles, bool()); - MOCK_METHOD0(ExceededDays, bool()); - MOCK_METHOD0(StartPTExchange, void()); - MOCK_METHOD1(Increment, void(usage_statistics::GlobalCounterId type)); - MOCK_METHOD2(Increment, - void(const std::string& app_id, - usage_statistics::AppCounterId type)); - MOCK_METHOD3(Set, - void(const std::string& app_id, - usage_statistics::AppInfoId type, - const std::string& value)); - MOCK_METHOD3(Add, - void(const std::string& app_id, - usage_statistics::AppStopwatchId type, - int32_t timespan_seconds)); - MOCK_CONST_METHOD0(get_settings, const PolicySettings&()); - MOCK_METHOD1(set_settings, void(const PolicySettings* get_settings)); -}; - -} // namespace policy_manager - -#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_MANAGER_H_ diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc index e8bca3061f..799b6c2999 100644 --- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc @@ -53,7 +53,9 @@ #include "utils/date_time.h" #include "utils/make_shared.h" #include "utils/gen_hash.h" - +#ifdef SDL_REMOTE_CONTROL +#include "policy/mock_access_remote.h" +#endif // SDL_REMOTE_CONTROL using ::testing::ReturnRef; using ::testing::DoAll; using ::testing::SetArgReferee; @@ -144,12 +146,20 @@ class PolicyManagerImplTest : public ::testing::Test { MockCacheManagerInterface* cache_manager; NiceMock listener; const std::string device_id; +#ifdef SDL_REMOTE_CONTROL + utils::SharedPtr access_remote; +#endif // SDL_REMOTE_CONTROL void SetUp() OVERRIDE { manager = new PolicyManagerImpl(); manager->set_listener(&listener); cache_manager = new MockCacheManagerInterface(); manager->set_cache_manager(cache_manager); + +#ifdef SDL_REMOTE_CONTROL + access_remote = new access_remote_test::MockAccessRemote(); + manager->set_access_remote(access_remote); +#endif // SDL_REMOTE_CONTROL } void TearDown() OVERRIDE { @@ -165,6 +175,15 @@ class PolicyManagerImplTest : public ::testing::Test { return ::testing::AssertionFailure() << ::rpc::PrettyFormat(report); } } + +#ifdef SDL_REMOTE_CONTROL + public: + bool CheckPTURemoteCtrlChange( + const utils::SharedPtr pt_update, + const utils::SharedPtr snapshot) { + return manager->CheckPTURemoteCtrlChange(pt_update, snapshot); + } +#endif // SDL_REMOTE_CONTROL }; class PolicyManagerImplTest2 : public ::testing::Test { @@ -189,10 +208,10 @@ class PolicyManagerImplTest2 : public ::testing::Test { const std::string dev_id2; Json::Value PTU_request_types; NiceMock policy_settings_; - const std::string kAppStorageFolder = "storage1"; + const std::string kAppStorageFolder = "storage_PolicyManagerImplTest2"; void SetUp() OVERRIDE { - file_system::CreateDirectory("storage1"); + file_system::CreateDirectory(kAppStorageFolder); file_system::DeleteFile("policy.sqlite"); manager = new PolicyManagerImpl(); @@ -231,7 +250,7 @@ class PolicyManagerImplTest2 : public ::testing::Test { } void CreateLocalPT(const std::string& file_name) { - file_system::remove_directory_content("storage1"); + file_system::remove_directory_content(kAppStorageFolder); ON_CALL(policy_settings_, app_storage_folder()) .WillByDefault(ReturnRef(kAppStorageFolder)); ASSERT_TRUE(manager->InitPT(file_name, &policy_settings_)); @@ -355,6 +374,8 @@ class PolicyManagerImplTest2 : public ::testing::Test { void TearDown() OVERRIDE { delete manager; + file_system::remove_directory_content(kAppStorageFolder); + file_system::RemoveDirectory(kAppStorageFolder, true); } }; @@ -1247,7 +1268,7 @@ TEST_F(PolicyManagerImplTest2, // Arrange CreateLocalPT("sdl_preloaded_pt.json"); GetPTU("valid_sdl_pt_update.json"); - utils::SharedPtr pt = (manager->GetCache())->GetPT(); + utils::SharedPtr pt = (manager->GetCache())->pt(); policy_table::ModuleConfig& module_config = pt->policy_table.module_config; ::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo(); @@ -1328,7 +1349,7 @@ TEST_F( HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) { // Arrange CreateLocalPT("sdl_preloaded_pt.json"); - utils::SharedPtr pt = (manager->GetCache())->GetPT(); + utils::SharedPtr pt = (manager->GetCache())->pt(); ::policy_table::PolicyTableType type1 = ::policy_table::PolicyTableType::PT_PRELOADED; pt->SetPolicyTableType(type1); diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index a313ce6d7f..cef5cdeb38 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -68,22 +68,23 @@ namespace test { namespace components { namespace policy_test { +using policy_handler_test::MockPolicySettings; + class SQLPTRepresentationTest : public SQLPTRepresentation, public ::testing::Test { protected: - static DBMS* dbms; - static SQLPTRepresentation* reps; + DBMS* dbms; + SQLPTRepresentation* reps; static const std::string kDatabaseName; static const std::string kAppStorageFolder; // Gtest can show message that this object doesn't destroyed - static std::auto_ptr - policy_settings_; + std::auto_ptr > policy_settings_; - static void SetUpTestCase() { - file_system::DeleteFile(kAppStorageFolder + "/policy.sqlite"); + void SetUp() OVERRIDE { + file_system::CreateDirectory(kAppStorageFolder); reps = new SQLPTRepresentation; - policy_settings_ = std::auto_ptr( - new policy_handler_test::MockPolicySettings()); + policy_settings_ = std::auto_ptr >( + new NiceMock()); ON_CALL(*policy_settings_, app_storage_folder()) .WillByDefault(ReturnRef(kAppStorageFolder)); EXPECT_EQ(::policy::SUCCESS, reps->Init(policy_settings_.get())); @@ -93,15 +94,13 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, void TearDown() OVERRIDE { EXPECT_TRUE(reps->Clear()); - } - - static void TearDownTestCase() { EXPECT_TRUE(reps->Drop()); EXPECT_TRUE(reps->Close()); reps->RemoveDB(); delete reps; dbms->Close(); - file_system::RemoveDirectory(kAppStorageFolder); + file_system::remove_directory_content(kAppStorageFolder); + file_system::RemoveDirectory(kAppStorageFolder, true); policy_settings_.reset(); } @@ -346,12 +345,9 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, } }; -DBMS* SQLPTRepresentationTest::dbms = 0; -SQLPTRepresentation* SQLPTRepresentationTest::reps = 0; const std::string SQLPTRepresentationTest::kDatabaseName = "policy.sqlite"; -const std::string SQLPTRepresentationTest::kAppStorageFolder = "storage1"; -std::auto_ptr - SQLPTRepresentationTest::policy_settings_; +const std::string SQLPTRepresentationTest::kAppStorageFolder = + "storage_SQLPTRepresentationTest"; class SQLPTRepresentationTest2 : public ::testing::Test { protected: @@ -378,7 +374,7 @@ class SQLPTRepresentationTest2 : public ::testing::Test { } SQLPTRepresentation* reps; - NiceMock policy_settings_; + NiceMock policy_settings_; const std::string kAppStorageFolder; const uint16_t kOpenAttemptTimeoutMs; const uint16_t kAttemptsToOpenPolicyDB; @@ -399,7 +395,7 @@ class SQLPTRepresentationTest3 : public ::testing::Test { } SQLPTRepresentation* reps; - NiceMock policy_settings_; + NiceMock policy_settings_; const std::string kAppStorageFolder; }; @@ -424,7 +420,7 @@ TEST_F(SQLPTRepresentationTest, ASSERT_EQ(0, dbms->FetchOneInt(query_select)); ASSERT_TRUE(reps->RefreshDB()); // Check PT structure destroyed and tables number is 0 - ASSERT_EQ(25, dbms->FetchOneInt(query_select)); + ASSERT_EQ(30, dbms->FetchOneInt(query_select)); const char* query_select_count_of_iap_buffer_full = "SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`"; const char* query_select_count_sync_out_of_memory = @@ -1102,7 +1098,7 @@ TEST_F(SQLPTRepresentationTest, GetInitialAppData_SetData_ExpectCorrectValuesReceived) { // Arrange const char* query_insert = - "INSERT INTO `nickname` (`application_id`, `name`)" + "INSERT INTO `nickname` (`application_id`, `name`) " "VALUES ('1111', 'first_app') , " "('2222', 'second_app'), ('3333', 'third_app')"; ASSERT_TRUE(dbms->Exec(query_insert)); diff --git a/src/components/remote_control/CMakeLists.txt b/src/components/remote_control/CMakeLists.txt new file mode 100644 index 0000000000..366a8be351 --- /dev/null +++ b/src/components/remote_control/CMakeLists.txt @@ -0,0 +1,86 @@ +set(target "RemoteControlModule") +set(install_destination ${CMAKE_BINARY_DIR}/bin/plugins) +if (ENABLE_GCOV) + set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs") +else() + set(GCOV_FLAGS "") +endif() + +if (CMAKE_BUILD_TYPE) + if (${CMAKE_BUILD_TYPE} STREQUAL "Release") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") + set(CMAKE_CXX_FLAGS_DEBUG "") + else () + set(CMAKE_CXX_FLAGS_RELEASE "") + set(CMAKE_CXX_FLAGS_DEBUG "-g3 -ggdb3 -DDEBUG") + endif() +endif() + +include_directories ( + ${COMPONENTS_DIR}/include/ + ${COMPONENTS_DIR}/application_manager/include + ${COMPONENTS_DIR}/remote_control/include/ + ${COMPONENTS_DIR}/connection_handler/include/ + ${COMPONENTS_DIR}/functional_module/include/ + ${COMPONENTS_DIR}/config_profile/include/ + + ${COMPONENTS_DIR}/hmi_message_handler/include/ + ${COMPONENTS_DIR}/formatters/include/ + ${POLICY_PATH}/include/ + ${POLICY_GLOBAL_INCLUDE_PATH}/ + ${COMPONENTS_DIR}/rpc_base/include/ + ${COMPONENTS_DIR}/application_manager/test/include/ + + ${COMPONENTS_DIR}/smart_objects/include/ + ${COMPONENTS_DIR}/utils/include/ + ${JSONCPP_INCLUDE_DIRECTORY} + ${LOG4CXX_INCLUDE_DIRECTORY} + ${CMAKE_BINARY_DIR}/src/components/ +) + +set (RC_SOURCE_DIR ${COMPONENTS_DIR}/remote_control/src) +set (RC_TEST_DIR ${COMPONENTS_DIR}/remote_control/test) +set (RC_COMMANDS_DIR ${RC_SOURCE_DIR}/commands) + +collect_sources(RC_SOURCES "${RC_SOURCE_DIR}") +collect_sources(RC_COMMANDS_SOURCES "${RC_COMMANDS_DIR}") + +set (SOURCES + ${RC_SOURCES} + ${RC_COMMANDS_SOURCES} +) + +set (LIBRARIES + jsoncpp + FunctionalModule + Utils + ConfigProfile +) + +add_library(${target} SHARED ${SOURCES}) +target_link_libraries(${target} ${LIBRARIES} ) + +if(ENABLE_LOG) + target_link_libraries(${target} log4cxx -L${LOG4CXX_LIBS_DIRECTORY}) +endif() + + +install(TARGETS ${target} + DESTINATION ${install_destination} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE +) + +set(FILES_FOR_COPY +${CMAKE_CURRENT_SOURCE_DIR}/InteriorVehicleDataCapabilities.json +) + +install( + FILES ${FILES_FOR_COPY} + DESTINATION ${install_destination} +) + +if(BUILD_TESTS) + add_subdirectory(test) +endif() diff --git a/src/components/remote_control/InteriorVehicleDataCapabilities.json b/src/components/remote_control/InteriorVehicleDataCapabilities.json new file mode 100644 index 0000000000..7121425606 --- /dev/null +++ b/src/components/remote_control/InteriorVehicleDataCapabilities.json @@ -0,0 +1,6 @@ +{ + "interiorVehicleDataCapabilities": [ + {"moduleType": "CLIMATE"}, + {"moduleType": "RADIO"} + ] +} diff --git a/src/components/remote_control/include/remote_control/commands/base_command_notification.h b/src/components/remote_control/include/remote_control/commands/base_command_notification.h new file mode 100644 index 0000000000..7e695d68c7 --- /dev/null +++ b/src/components/remote_control/include/remote_control/commands/base_command_notification.h @@ -0,0 +1,112 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_ + +#include "remote_control/commands/command.h" +#include "application_manager/message.h" +#include "application_manager/service.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/remote_plugin_interface.h" +#include "utils/logger.h" + +namespace Json { +class Value; +} + +namespace remote_control { + +namespace commands { + +/** + * @brief Base command class for notifications + */ +class BaseCommandNotification : public Command { + public: + /** + * @brief BaseCommandNotification class constructor + * + * @param message Message from mobile + **/ + BaseCommandNotification(const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module); + + /** + * @brief BaseCommandNotification class destructor + */ + virtual ~BaseCommandNotification(); + + /** + * \brief BaseCommandNotification on timeout reaction + */ + virtual void OnTimeout() {} + + // TODO(KKolodiy): need rename to Execute + void Run(); + + protected: + application_manager::MessagePtr message() { + return message_; + } + application_manager::ServicePtr service_; + + RCAppExtensionPtr GetAppExtension( + application_manager::ApplicationSharedPtr app) const; + + /** + * @brief executes specific logic of children classes + */ + // TODO(KKolodiy): need rename to Run + virtual void Execute() = 0; + + /** + * @brief Validates notification by xml schema + */ + virtual bool Validate(); + + virtual std::string ModuleType(const Json::Value& message); + virtual std::vector ControlData(const Json::Value& message); + + void NotifyOneApplication(application_manager::MessagePtr message); + + private: + void NotifyApplications(); + bool CheckPolicy(application_manager::MessagePtr message); + application_manager::MessagePtr message_; +}; + +} // namespace commands + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_NOTIFICATION_H_ diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h new file mode 100644 index 0000000000..fd58f50722 --- /dev/null +++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h @@ -0,0 +1,281 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_ + +#include "remote_control/commands/command.h" +#include "remote_control/event_engine/event_observer.h" +#include "application_manager/message.h" +#include "application_manager/service.h" +#include "utils/logger.h" +#include "interfaces/HMI_API.h" +#include "remote_control/rc_app_extension.h" +#include "json/json.h" +#include "remote_control/remote_plugin_interface.h" + +namespace remote_control { + +namespace commands { + +// Forward declaration to make this struct friend to BaseCommandRequest +struct OnDriverAnswerCallback; + +/** + * @brief Base command class for requests + */ +class BaseCommandRequest + : public Command, + public rc_event_engine::EventObserver { + public: + /** + * @brief BaseCommandRequest class constructor + * + * @param message Message from mobile + **/ + BaseCommandRequest(const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module); + + /** + * @brief BaseCommandRequest class destructor + */ + virtual ~BaseCommandRequest(); + + /** + * @brief BaseCommandRequest on timeout reaction + */ + virtual void OnTimeout(); + + // TODO(KKolodiy): need rename to Execute + void Run(); + void on_event(const rc_event_engine::Event& event); + + /** + * @brief Generates correct request to HMI + * @param function_id request ID + * @param msg_params json with message params + * @return generated request shared ptr + */ + application_manager::MessagePtr CreateHmiRequest( + const char* function_id, const Json::Value& message_params); + + /** + * @brief Prepares response for sending to mobile + * Adds necessary fields to message + * @param success true if successful; false, if failed + * @param result_code Mobile result code in string ("SUCCESS", "INVALID_DATA", + * e.t.c) + * @param info Provides additional human readable info regarding the + *result(may be empty) + */ + void PrepareResponse(const bool success, + const char* result_code, + const std::string& info); + + protected: + application_manager::MessagePtr message_; + Json::Value response_params_; + + /** + * @brief AcquireResource try to allocate resource for application + * In case if allocation of resource is not required, return ALLOWED by + * default. + * This method should be overrided in RPCs that requires resource allocation + * @return result of resource allocation, in case if allocation os not + * required, return ALLOWED + */ + virtual AcquireResult::eType AcquireResource(const Json::Value&) { + return AcquireResult::ALLOWED; + } + + /** + * @brief IsResourceFree check resource state + * This is default implementation which has to be redefined for RPCs which + * need to manage the resources + * @param module_type Resource name + * @return True if free, otherwise - false + */ + virtual bool IsResourceFree(const std::string& module_type) const { + UNUSED(module_type); + return true; + } + + /** + * @brief SetResourceState changes state of resource + * This is default implementation which has to be redefined for RPCs which + * need to manage the resources + * @param Message containing type of module to extract + * @param State to set for resource + */ + virtual void SetResourceState(const Json::Value&, + const ResourceState::eType) {} + + /** + * @brief Get extension for specified application. If extension doesn't exist, + * it will be created + * @param app pointer to application + * @return pointer to extension + */ + RCAppExtensionPtr GetAppExtension( + application_manager::ApplicationSharedPtr app) const; + + /** + * @brief Converts HMI result code to string with mobile result code + * + * @param hmi_code HMI result code + * @return String with mobile result code + */ + const char* GetMobileResultCode( + const hmi_apis::Common_Result::eType& hmi_code) const; + + /** + * @brief Sends Mobile response + * @param success true if successful; false, if failed + * @param result_code Mobile result code in string ("SUCCESS", "INVALID_DATA", + *e.t.c) + * @param info Provides additional human readable info regarding the + *result(may be empty) + */ + void SendResponse(const bool success, + const char* result_code, + const std::string& info); + + /** + * @brief Parse result code from response + * + * @param message Response from HMI or Can + * @param result_code Outgoing param with mobile result code in string + *("SUCCESS", "INVALID_DATA", e.t.c) + * @param info Outgoing param with additional human readable info regarding + *the result(may be empty) + * @return true if it is success response? otherwise false + */ + bool ParseResultCode(const Json::Value& value, + std::string& result_code, + std::string& info); + + /** + * @brief Sends request to HMI + * @param message_to_send to send + */ + void SendMessageToHMI(const application_manager::MessagePtr& message_to_send); + + /** + * @brief Sends request to CAN or HMI + * @param function_id request ID + * @param msg_params json with message params + */ + void SendRequest(const char* function_id, const Json::Value& message_params); + + application_manager::ApplicationSharedPtr app() { + DCHECK(app_); + return app_; + } + + /** + * @brief executes specific logic of children classes + */ + // TODO(KKolodiy): need rename to Run + void virtual Execute() = 0; + + /** + * @brief Validates request by xml schema + */ + bool Validate(); + + /* + * @brief Parses incoming string into Json + * @param parsed_mgs Resulting json object (must be valid pointer) + * @returns True if json string was valid false otherwise. + */ + virtual bool ParseJsonString(Json::Value* parsed_msg); + + /** + * @brief Interface method that is called whenever new event received + * @param event The received event + */ + void virtual OnEvent( + const rc_event_engine::Event& event) = 0; + + virtual std::string ModuleType(const Json::Value& message); + virtual std::vector ControlData(const Json::Value& message); + virtual application_manager::TypeAccess CheckAccess( + const Json::Value& message); + + bool auto_allowed() const { + return auto_allowed_; + } + + void set_auto_allowed(bool value) { + auto_allowed_ = value; + } + + application_manager::ServicePtr service() { + return service_; + } + + void set_disallowed_info(const std::string& info) { + disallowed_info_ = info; + } + + private: + void CheckHMILevel(application_manager::TypeAccess access, + bool hmi_consented = false); + void UpdateHMILevel( + const rc_event_engine::Event& event); + bool CheckPolicyPermissions(); + bool CheckDriverConsent(); + inline bool IsAutoAllowed(application_manager::TypeAccess access) const; + inline bool IsNeededDriverConsent( + application_manager::TypeAccess access) const; + void SendDisallowed(application_manager::TypeAccess access); + void SendGetUserConsent(const Json::Value& value); + void ProcessAccessResponse( + const rc_event_engine::Event& event); + application_manager::ApplicationSharedPtr app_; + application_manager::ServicePtr service_; + bool auto_allowed_; + std::string disallowed_info_; + + friend struct OnDriverAnswerCallback; +}; + +} // namespace commands + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BASE_COMMAND_REQUEST_H_ diff --git a/src/components/remote_control/include/remote_control/commands/button_press_request.h b/src/components/remote_control/include/remote_control/commands/button_press_request.h new file mode 100644 index 0000000000..6c5a60a9fe --- /dev/null +++ b/src/components/remote_control/include/remote_control/commands/button_press_request.h @@ -0,0 +1,104 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_ + +#include "remote_control/commands/base_command_request.h" +#include "remote_control/event_engine/event.h" +#include "utils/macro.h" + +namespace remote_control { + +namespace commands { + +/** + * @brief ButtonPressRequest command class + */ +class ButtonPressRequest : public BaseCommandRequest { + public: + /** + * @brief ButtonPressRequest class constructor + * + * @param message Message from mobile + **/ + ButtonPressRequest(const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module); + /** + * @brief Execute command + */ + void Execute() FINAL; + + /** + * @brief AcquireResource Tries to acquire specific resource + * @param message Incoming message containg the resource name + * @return Acquire result + */ + AcquireResult::eType AcquireResource( + const Json::Value& message) OVERRIDE FINAL; + + /** + * @brief IsResourceFree check resource state + * @param module_type Resource name + * @return True if free, otherwise - false + */ + bool IsResourceFree(const std::string& module_type) const FINAL; + + /** + * @brief SetResourceState changes state of resource + * @param state State to set for resource + */ + void SetResourceState(const Json::Value& message, + const ResourceState::eType state) FINAL; + + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + void OnEvent(const rc_event_engine::Event& event); + + /** + * @brief ButtonPressRequest class destructor + */ + virtual ~ButtonPressRequest(); + + protected: + std::string ModuleType(const Json::Value& message) FINAL; +}; + +} // namespace commands + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_BUTTON_PRESS_REQUEST_H_ diff --git a/src/components/remote_control/include/remote_control/commands/command.h b/src/components/remote_control/include/remote_control/commands/command.h new file mode 100644 index 0000000000..ad471ba151 --- /dev/null +++ b/src/components/remote_control/include/remote_control/commands/command.h @@ -0,0 +1,84 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_ + +#include "utils/shared_ptr.h" +#include "remote_control/remote_plugin_interface.h" +#include "remote_control/event_engine/event.h" + +namespace remote_control { + +class RemotePluginInterface; + +namespace commands { + +/** + * @brief Command interface + **/ +class Command { + public: + /** + * @brief Execute command + */ + virtual void Run() = 0; + + /** + * \brief Command class destructor + */ + virtual ~Command() {} + + /** + * \brief Command on timeout reaction + */ + virtual void OnTimeout() = 0; + + /** + * @brief Interface method that is called whenever new event received + * @param event The received event + */ + virtual void on_event( + const rc_event_engine::Event& event) {} + + protected: + Command(RemotePluginInterface& rc_module) : rc_module_(rc_module) {} + + RemotePluginInterface& rc_module_; +}; + +} // namespace commands + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_COMMAND_H_ diff --git a/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h b/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h new file mode 100644 index 0000000000..d687221fbe --- /dev/null +++ b/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h @@ -0,0 +1,101 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_ + +#include "remote_control/commands/base_command_request.h" +#include "remote_control/event_engine/event.h" +#include "utils/macro.h" + +namespace remote_control { + +namespace commands { + +/** + * @brief GetInteriorVehicleDataRequest command class + */ +class GetInteriorVehicleDataRequest : public BaseCommandRequest { + public: + /** + * @brief GetInteriorVehicleDataRequest class constructor + * + * @param message Message from mobile + **/ + explicit GetInteriorVehicleDataRequest( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module); + + /** + * @brief Execute command + */ + void Execute() FINAL; + + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + void OnEvent(const rc_event_engine::Event& event); + + /** + * @brief Check if app wants to proceed with already setup subscription + * @param request_params request parameters to check + * @return true if app already subscribed(unsubsribed) for module type but + * wants to subscribe(unsubscribe) for the same module again + * otherwise - false + */ + bool HasRequestExcessiveSubscription(const Json::Value& request_params); + + protected: + virtual std::string ModuleType(const Json::Value& message); + + private: + /** + * @brief Handle subscription to vehicle data + * @param hmi_response json message with response from HMI + */ + void ProccessSubscription(const Json::Value& hmi_response); + + /** + * @brief Cuts off subscribe parameter + * @param request_params request parameters to handle + */ + void RemoveExcessiveSubscription(Json::Value& request_params); +}; + +} // namespace commands + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_GET_INTERIOR_VEHICLE_DATA_REQUEST_H_ diff --git a/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h b/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h new file mode 100644 index 0000000000..bc9c9bee8e --- /dev/null +++ b/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h @@ -0,0 +1,75 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ + +#include "utils/macro.h" +#include "remote_control/commands/base_command_notification.h" + +namespace remote_control { + +namespace commands { + +/** + * @brief OnInteriorVehicleDataNotification command class + */ +class OnInteriorVehicleDataNotification : public BaseCommandNotification { + public: + /** + * @brief OnInteriorVehicleDataNotification class constructor + * + * @param message Message with notification + **/ + OnInteriorVehicleDataNotification( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module); + + /** + * @brief Execute command + */ + void Execute() FINAL; + + /** + * @brief OnInteriorVehicleDataNotification class destructor + */ + virtual ~OnInteriorVehicleDataNotification(); + + protected: + std::string ModuleType(const Json::Value& message) FINAL; +}; + +} // namespace commands + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_INTERIOR_VEHICLE_DATA_NOTIFICATION_H_ diff --git a/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h b/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h new file mode 100644 index 0000000000..ef248a2b38 --- /dev/null +++ b/src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h @@ -0,0 +1,79 @@ +/* + Copyright (c) 2017, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_ + +#include "utils/macro.h" +#include "remote_control/commands/base_command_notification.h" + +namespace remote_control { + +namespace commands { + +/** + * @brief OnRemoteControlSettingsNotification command class + */ +class OnRemoteControlSettingsNotification : public BaseCommandNotification { + public: + /** + * @brief OnRemoteControlSettingsNotification class constructor + * + * @param message Message with notification + * @param rc_module Module used for handling RC functionality + **/ + OnRemoteControlSettingsNotification( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module); + + /** + * @brief Execute command + */ + void Execute() FINAL; + + private: + /** + * @brief Disalows RC functionality for all RC apps + * All registered apps with appHMIType REMOTE_CONTROL will be put to NONE hmi + * level + * OnHMIStatus (NONE) will be send to such apps + * All registered apps will be unsubsribed from OnInteriorVehicleData + * notifications + */ + void DisallowRCFunctionality(); +}; + +} // namespace commands + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_ON_REMOTE_CONTROL_SETTINGS_NOTIFICATION_H_ diff --git a/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h b/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h new file mode 100644 index 0000000000..92f449b034 --- /dev/null +++ b/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h @@ -0,0 +1,128 @@ +/* + Copyright (c) 2017, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_ + +#include "remote_control/commands/base_command_request.h" +#include "remote_control/event_engine/event.h" +#include "utils/macro.h" + +namespace remote_control { + +namespace commands { + +/** + * @brief SetInteriorVehicleDataRequest command class + */ +class SetInteriorVehicleDataRequest : public BaseCommandRequest { + public: + /** + * @brief SetInteriorVehicleDataRequest class constructor + * + * @param message Message from mobile + * @param rc_module Module used for handling RC functionality + **/ + SetInteriorVehicleDataRequest(const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module); + + /** + * @brief Execute command + */ + void Execute() FINAL; + + /** + * @brief AcquireResource proxy AcquireResource to Resource allocation manager + * @param message message of requires contatin module types + * @return result of acauiring resources + */ + AcquireResult::eType AcquireResource( + const Json::Value& message) OVERRIDE FINAL; + + /** + * @brief IsResourceFree check resource state + * @param module_type Resource name + * @return True if free, otherwise - false + */ + bool IsResourceFree(const std::string& module_type) const FINAL; + + /** + * @brief SetResourceState changes state of resource + * @param state State to set for resource + */ + void SetResourceState(const Json::Value& message, + const ResourceState::eType state) FINAL; + + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + void OnEvent(const rc_event_engine::Event& event) OVERRIDE; + + /** + * @brief Method that check if READ_ONLY parameters present + * @param request_params params from received message + * @return true if present , false - otherwise + */ + bool AreReadOnlyParamsPresent(const Json::Value& request_params); + + /** + * @brief Method that check if all request parameters are READ_ONLY + * @param request_params params from received message + * @return true if all are read only , false - otherwise + */ + bool AreAllParamsReadOnly(const Json::Value& request_params); + + /** + * @brief Method that cuts-off READ_ONLY parameters + * @param request_params params to handle + */ + void CutOffReadOnlyParams(Json::Value& request_params); + + /** + * @brief SetInteriorVehicleDataRequest class destructor + */ + virtual ~SetInteriorVehicleDataRequest(); + + protected: + virtual std::string ModuleType(const Json::Value& message) FINAL; + virtual std::vector ControlData( + const Json::Value& message) FINAL; +}; + +} // namespace commands + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_COMMANDS_SET_INTERIOR_VEHICLE_DATA_REQUEST_H_ diff --git a/src/components/remote_control/include/remote_control/event_engine/event.h b/src/components/remote_control/include/remote_control/event_engine/event.h new file mode 100644 index 0000000000..531c35135b --- /dev/null +++ b/src/components/remote_control/include/remote_control/event_engine/event.h @@ -0,0 +1,127 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_ + +#include +#include "remote_control/event_engine/event_dispatcher.h" +#include "utils/shared_ptr.h" +#include "application_manager/message.h" + +namespace rc_event_engine { + +template +class EventDispatcher; + +template +class Event { + public: + /* + * @brief Constructor with parameters + * + * @param id Event ID. + * @param message Message received in event + */ + Event(EventMessage& message, const EventID& id); + + /* + * @brief Destructor + */ + virtual ~Event() {} + + /* + * @brief Provides event ID + */ + inline const EventID& id() const; + + /* + * @brief Sets event message + * + * @param message The message received in event + */ + void set_event_message(EventMessage& message); + + /* + * @brief Retrieves event message + * + * @return The message received in event + */ + inline const EventMessage& event_message() const; + + /* + * @brief Retrieves event message request ID + */ + virtual int32_t event_message_function_id() const = 0; + + /* + * @brief Retrieves event message correlation ID + */ + virtual int32_t event_message_correlation_id() const = 0; + + /* + * @brief Retrieves event message response type + */ + virtual int32_t event_message_type() const = 0; + + void raise(EventDispatcher& event_dispatcher); + + protected: + EventMessage event_message_; + + private: + EventID id_; +}; + +template +const EventID& Event::id() const { + return id_; +} + +template +const EventMessage& Event::event_message() const { + return event_message_; +} + +template +Event::Event(EventMessage& message, const EventID& id) + : event_message_(message), id_(id) {} + +template +void Event::raise( + EventDispatcher& event_dispatcher) { + event_dispatcher.raise_event(*this); +} + +} // namespace event_engine + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_ diff --git a/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h b/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h new file mode 100644 index 0000000000..4776f355c4 --- /dev/null +++ b/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h @@ -0,0 +1,203 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_ + +#include +#include + +#include "utils/lock.h" + +#include "remote_control/event_engine/event.h" +#include "remote_control/event_engine/event_observer.h" + +#include "interfaces/HMI_API.h" + +namespace rc_event_engine { + +template +class Event; + +template +class EventObserver; + +template +class EventDispatcher { + public: + /** + * @brief Default constructor + */ + EventDispatcher(); + + /** + * @brief Destructor + */ + virtual ~EventDispatcher(); + + /* + * @brief Delivers the event to all subscribers + * + * @param event Received event + */ + void raise_event(const Event& event); + + /* + * @brief Subscribe the observer to event + * + * @param event_id The event ID to subscribe for + * @param hmi_correlation_id The event HMI correlation ID + * @param observer The observer to subscribe for event + */ + void add_observer(const EventID& event_id, + int32_t hmi_correlation_id, + EventObserver* const observer); + + /* + * @brief Unsubscribes the observer from specific event + * + * @param event_id The event ID to unsubscribe from + * @param observer The observer to be unsubscribed + */ + void remove_observer( + const EventID& event_id, + const EventObserver* const observer); + + /* + * @brief Unsubscribes the observer from all events + * + * @param observer The observer to be unsubscribed + */ + void remove_observer( + const EventObserver* const observer); + + protected: + private: + DISALLOW_COPY_AND_ASSIGN(EventDispatcher); + + // Data types section + typedef std::list*> ObserverList; + typedef std::map ObserversMap; + typedef std::map EventObserverMap; + + // Members section + sync_primitives::Lock state_lock_; + EventObserverMap observers_; +}; + +template +EventDispatcher::EventDispatcher() + : observers_() {} + +template +EventDispatcher::~EventDispatcher() {} + +template +void EventDispatcher::raise_event( + const Event& event) { + // create local list + ObserverList list; + { + sync_primitives::AutoLock auto_lock(state_lock_); + // check if event is notification + if (hmi_apis::messageType::notification == event.event_message_type()) { + // ObserversMap iterator + typename ObserversMap::iterator it = observers_[event.id()].begin(); + for (; observers_[event.id()].end() != it; ++it) { + list = it->second; + } + } + + if ((hmi_apis::messageType::response == event.event_message_type()) || + (hmi_apis::messageType::error_response == event.event_message_type())) { + list = observers_[event.id()][event.event_message_correlation_id()]; + } + } + + // Call observers + typename ObserverList::iterator observers = list.begin(); + for (; list.end() != observers; ++observers) { + (*observers)->on_event(event); + } +} + +template +void EventDispatcher::add_observer( + const EventID& event_id, + int32_t hmi_correlation_id, + EventObserver* const observer) { + sync_primitives::AutoLock auto_lock(state_lock_); + observers_[event_id][hmi_correlation_id].push_back(observer); +} + +template +void EventDispatcher::remove_observer( + const EventID& event_id, + const EventObserver* const observer) { + sync_primitives::AutoLock auto_lock(state_lock_); + typename ObserversMap::iterator it = observers_[event_id].begin(); + for (; observers_[event_id].end() != it; ++it) { + // ObserverList iterator + typename ObserverList::iterator observer_it = it->second.begin(); + while (it->second.end() != observer_it) { + if (observer->id() == (*observer_it)->id()) { + observer_it = it->second.erase(observer_it); + } else { + ++observer_it; + } + } + } +} + +template +void EventDispatcher::remove_observer( + const EventObserver* const observer) { + sync_primitives::AutoLock auto_lock(state_lock_); + typename EventObserverMap::iterator event_map = observers_.begin(); + for (; observers_.end() != event_map; ++event_map) { + typename ObserversMap::iterator it = event_map->second.begin(); + for (; event_map->second.end() != it; ++it) { + // ObserverList iterator + typename ObserverList::iterator observer_it = it->second.begin(); + while (it->second.end() != observer_it) { + if (observer->id() == (*observer_it)->id()) { + observer_it = it->second.erase(observer_it); + } else { + ++observer_it; + } + } + } + } +} +} + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_ diff --git a/src/components/remote_control/include/remote_control/event_engine/event_observer.h b/src/components/remote_control/include/remote_control/event_engine/event_observer.h new file mode 100644 index 0000000000..e2f3d8ea1e --- /dev/null +++ b/src/components/remote_control/include/remote_control/event_engine/event_observer.h @@ -0,0 +1,96 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_ + +#include +#include "remote_control/event_engine/event.h" + +namespace rc_event_engine { + +template +class Event; + +template +class EventObserver { + public: + // Typedef for possible Observer ID's from mobile_apis functionID enum + typedef unsigned long ObserverID; + + /* + * @brief Constructor + * + */ + EventObserver(); + + /* + * @brief Destructor + */ + virtual ~EventObserver(); + + /** + * @brief Retrieves observer unique id + * + * @return Unique Observer id + */ + const ObserverID& id() const { + return id_; + } + + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const Event& event) = 0; + + private: + ObserverID id_; + + DISALLOW_COPY_AND_ASSIGN(EventObserver); +}; + +template +EventObserver::EventObserver() + : id_(0) { + // Get unique id based on this + id_ = reinterpret_cast(this); +} + +template +EventObserver::~EventObserver() { + // unsubscribe_from_all_events(); +} +} + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_ diff --git a/src/components/remote_control/include/remote_control/message_helper.h b/src/components/remote_control/include/remote_control/message_helper.h new file mode 100644 index 0000000000..f90e621e1e --- /dev/null +++ b/src/components/remote_control/include/remote_control/message_helper.h @@ -0,0 +1,135 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_ + +#include +#include +#include + +#include "utils/macro.h" +#include "json/json.h" +#include "interfaces/HMI_API.h" +#include "functional_module/function_ids.h" +#include "remote_control/remote_plugin_interface.h" +#include "application_manager/message.h" + +namespace remote_control { + +/** + * @brief MessageHelper class + **/ +class MessageHelper { + public: + /** + * @brief Returns unique correlation ID for next CAN request + * + * @return Unique correlation ID + */ + static uint32_t GetNextRCCorrelationID(); + static const std::string GetMobileAPIName( + functional_modules::RCFunctionID func_id); + + /** + * @brief Convert Json::Value to std::string + * + * @param value Value with json + * + * @return string with json + */ + static std::string ValueToString(const Json::Value& value); + + /** + * @brief Convert std::string to Json::Value + * + * @param string string with json + * + * @return Value created from string with json + */ + static Json::Value StringToValue(const std::string& string); + + /** + * Validates structure DeviceInfo + * @param value json of DeviceInfo + * @return true if json is valid + */ + static bool ValidateDeviceInfo(const Json::Value& value); + + /** + * Validates structure InteriorZone + * @param value json of InteriorZone + * @return true if json is valid + */ + static bool ValidateInteriorZone(const Json::Value& value); + + /** + * Creates hmi request + * @param function_id - API function we create request for + * @param message_params - params in request + * @param rc_module - used module for requests handling + * @param hmi_app_id - app is used between SDL & HMI + * @return creted request - reqdy to be sent to hmi + */ + static application_manager::MessagePtr CreateHmiRequest( + const char* function_id, + const uint32_t hmi_app_id, + const Json::Value& message_params, + RemotePluginInterface& rc_module); + + /** @brief Converts string to hmi AccessMode enum value + * @param access_mode stringified value + * @return hmi AccessMode enum value if succedeed, otherwise - INVALID_ENUM + * value + */ + static hmi_apis::Common_RCAccessMode::eType AccessModeFromString( + const std::string& access_mode); + + private: + MessageHelper(); + + static uint32_t next_correlation_id_; + static const std::map + kMobileAPINames; + DISALLOW_COPY_AND_ASSIGN(MessageHelper); +}; + +/** @brief Check for existence of specified key in Json::Value + * @param value Value with json + * @param key string with key name + * @return true if key exist + */ +bool IsMember(const Json::Value& value, const std::string& key); + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_ diff --git a/src/components/remote_control/include/remote_control/module_helper.h b/src/components/remote_control/include/remote_control/module_helper.h new file mode 100644 index 0000000000..a964fe1422 --- /dev/null +++ b/src/components/remote_control/include/remote_control/module_helper.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MODULE_HELPER_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MODULE_HELPER_H_ + +#include "functional_module/generic_module.h" +#include "json/json.h" +#include "interfaces/HMI_API.h" +#include "remote_control/remote_plugin_interface.h" + +namespace remote_control { + +/** + * @brief ModuleHelper class + **/ +class ModuleHelper { + public: + static void ProccessOnReverseAppsDisallowed(RemotePluginInterface& rc_module); + + private: + ModuleHelper(); + + static application_manager::MessagePtr ResponseToHMI( + unsigned int id, + hmi_apis::Common_Result::eType result_code, + const std::string& method_name); + DISALLOW_COPY_AND_ASSIGN(ModuleHelper); +}; + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MODULE_HELPER_H_ diff --git a/src/components/remote_control/include/remote_control/policy_helper.h b/src/components/remote_control/include/remote_control/policy_helper.h new file mode 100644 index 0000000000..92be79775a --- /dev/null +++ b/src/components/remote_control/include/remote_control/policy_helper.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_ + +#include +#include "application_manager/application.h" +#include "remote_control/remote_plugin_interface.h" + +namespace remote_control { + +class PolicyHelper { + public: + static void OnRSDLFunctionalityAllowing(bool allowed, + RemotePluginInterface& rc_module); + static void ChangeDeviceRank(const uint32_t device_handle, + const std::string& rank, + RemotePluginInterface& rc_module); + static void SetIsAppOnPrimaryDevice( + application_manager::ApplicationSharedPtr app, + RemotePluginInterface& rc_module); + + private: + static void MarkApplications(const uint32_t device_handle, + RemotePluginInterface& rc_module); + static void MarkAppOnPrimaryDevice( + application_manager::ApplicationSharedPtr app, + const uint32_t device_handle, + RemotePluginInterface& rc_module); +}; + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_ diff --git a/src/components/remote_control/include/remote_control/rc_app_extension.h b/src/components/remote_control/include/remote_control/rc_app_extension.h new file mode 100644 index 0000000000..07a8eecb67 --- /dev/null +++ b/src/components/remote_control/include/remote_control/rc_app_extension.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_ + +#include +#include +#include "application_manager/service.h" +#include "application_manager/app_extension.h" +#include "remote_control/remote_control_plugin.h" +#include "json/json.h" + +namespace remote_control { + +class RCAppExtension : public application_manager::AppExtension { + public: + explicit RCAppExtension(application_manager::AppExtensionUID uid); + ~RCAppExtension(); + + /** + * @brief Checks is application has access to a radio tune control + * @return true if control given + */ + bool IsControlGiven() const; + + /** + * @brief Give radio tune control to application + * @param is_control_given true - give control, false - cancel control + */ + void GiveControl(bool is_control_given); + + bool is_on_driver_device() const { + return is_on_driver_device_; + } + + void set_is_on_driver_device(bool is_driver_dev) { + is_on_driver_device_ = is_driver_dev; + } + + /** + * @brief Subscribe to OnInteriorVehicleDataNotification + * @param module interior data specification(zone, data type) + */ + void SubscribeToInteriorVehicleData(const Json::Value& module_type); + + /** + * @brief Unsubscribe from OnInteriorVehicleDataNotification + * @param module interior data specification(zone, data type) + */ + void UnsubscribeFromInteriorVehicleData(const Json::Value& module_type); + + /** + * @brief Check if application subscribed to OnInteriorVehicleDataNotification + * @param module interior data specification(zone, data type) + */ + bool IsSubscibedToInteriorVehicleData(const Json::Value& module_type); + + private: + bool is_control_given_; + bool is_on_driver_device_; + std::set subscribed_interior_vehicle_data_; +}; + +typedef utils::SharedPtr RCAppExtensionPtr; + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_ diff --git a/src/components/remote_control/include/remote_control/rc_command_factory.h b/src/components/remote_control/include/remote_control/rc_command_factory.h new file mode 100644 index 0000000000..06332995b2 --- /dev/null +++ b/src/components/remote_control/include/remote_control/rc_command_factory.h @@ -0,0 +1,66 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_ + +#include "utils/shared_ptr.h" +#include "remote_control/commands/command.h" +#include "remote_control/remote_control_plugin.h" +#include "application_manager/message.h" +#include "utils/macro.h" + +namespace remote_control { + +/** + * @brief Factory class for command creation + **/ +class RCCommandFactory { + public: + /** + * @brief Create command object and return pointer to it + * + * @param message Message shared pointer. + * @return Pointer to created command object. + **/ + static utils::SharedPtr CreateCommand( + const application_manager::MessagePtr& msg, + RemotePluginInterface& rc_module); + + private: + RCCommandFactory(); + DISALLOW_COPY_AND_ASSIGN(RCCommandFactory); +}; + +} // namespace can_cooperaion + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_COMMAND_FACTORY_H_ diff --git a/src/components/remote_control/include/remote_control/rc_module_constants.h b/src/components/remote_control/include/remote_control/rc_module_constants.h new file mode 100644 index 0000000000..503266f35c --- /dev/null +++ b/src/components/remote_control/include/remote_control/rc_module_constants.h @@ -0,0 +1,306 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_ + +namespace remote_control { + +namespace strings {} // strings + +namespace result_codes { +const char kSuccess[] = "SUCCESS"; +const char kUnsupportedRequest[] = "UNSUPPORTED_REQUEST"; +const char kUnsupportedResource[] = "UNSUPPORTED_RESOURCE"; +const char kDisallowed[] = "DISALLOWED"; +const char kRejected[] = "REJECTED"; +const char kAborted[] = "ABORTED"; +const char kIgnored[] = "IGNORED"; +const char kRetry[] = "RETRY"; +const char kInUse[] = "IN_USE"; +const char kVehicleDataNotAvailable[] = "VEHICLE_DATA_NOT_AVAILABLE"; +const char kTimedOut[] = "TIMED_OUT"; +const char kInvalidData[] = "INVALID_DATA"; +const char kCharLimitExceeded[] = "CHAR_LIMIT_EXCEEDED"; +const char kInvalidId[] = "INVALID_ID"; +const char kDuplicateName[] = "DUPLICATE_NAME"; +const char kApplicationNotRegistered[] = "APPLICATION_NOT_REGISTERED"; +const char kOutOfMemory[] = "OUT_OF_MEMORY"; +const char kTooManyPendingRequests[] = "TOO_MANY_PENDING_REQUESTS"; +const char kWarnings[] = "WARNINGS"; +const char kWrongLanguage[] = "WRONG_LANGUAGE"; +const char kGenericError[] = "GENERIC_ERROR"; +const char kUserDisallowed[] = "USER_DISALLOWED"; +const char kReadOnly[] = "READ_ONLY"; +} // result_codes + +namespace json_keys { +const char kParams[] = "params"; +const char kSuccess[] = "success"; +const char kResultCode[] = "resultCode"; +const char kResult[] = "result"; +const char kInfo[] = "info"; +const char kId[] = "id"; +const char kJsonrpc[] = "jsonrpc"; +const char kMethod[] = "method"; +const char kError[] = "error"; +const char kMessage[] = "message"; +const char kData[] = "data"; +const char kAppId[] = "appID"; +const char kCode[] = "code"; +} // json_keys + +namespace message_params { +/* +const char kCustomPresets[] = "customPresets"; +const char kRadioStation[] = "radioStation"; +const char kSongInfo[] = "songInfo"; +const char kEvent[] = "event"; +const char kAdvertisement[] = "advertisement"; +const char kActivity[] = "activity"; +const char kTriggerSource[] = "triggerSource"; + +// RadioStation struct +const char kFrequency[] = "frequency"; +const char kFraction[] = "fraction"; +const char kAvailableHDs[] = "availableHDs"; +const char kCurrentHD[] = "currentHD"; +// RadioStation struct + +// Time struct +const char kHours[] = "hours"; +const char kMinutes[] = "minutes"; +const char kSeconds[] = "seconds"; +const char kYear[] = "year"; +const char kMonth[] = "month"; +const char kDay[] = "day"; +const char kTZD[] = "TZD"; +// Time struct + +// Address struct +const char kState[] = "state"; +const char kZipCode[] = "zipcode"; +const char kCity[] = "city"; +const char kStreet[] = "street"; +// Address struct + +// Location struct +const char kGPSCoordinates[] = "gpsCoordinates"; +const char kAddress[] = "address"; +// Location struct + +// SongInfo struct +const char kArtist[] = "artist"; +const char kGenre[] = "genre"; +const char kAlbum[] = "album"; +const char kSongYear[] = "year"; +const char kDuration[] = "duration"; +// SongInfo struct + +// Advertisement struct +const char kProductName[] = "productName"; +const char kCompanyName[] = "companyName"; +const char kPhoneNumber[] = "phoneNumber"; +const char kLocation[] = "location"; +// Advertisement struct + +// EventDetails struct +const char kEventName[] = "eventName"; +// const char kPhoneNumber[] = "phoneNumber"; +const char kPrice[] = "price"; +const char kEventTime[] = "eventTime"; +// EventDetails struct + +// WebActivity struct +const char kURL[] = "url"; +const char kActionCode[] = "actionCode"; +// WebActivity struct +*/ + +// SetInteriorVehicleData request +const char kModuleData[] = "moduleData"; +// SetInteriorVehicleData request + +// SetInteriorVehicleData response +// const char kModuleData[] = "moduleData"; +// SetInteriorVehicleData response + +// GetInteriorVehicleData request +const char kSubscribe[] = "subscribe"; +// GetInteriorVehicleData request + +// GetInteriorVehicleData response +// const char kModuleData[] = "moduleData"; +const char kIsSubscribed[] = "isSubscribed"; +// GetInteriorVehicleData response + +// OnInteriorVehicleData notification +// const char kModuleData[] = "moduleData"; +// OnInteriorVehicleData notification + +// OnRemoteControlSettings notification +const char kAccessMode[] = "accessMode"; +const char kAllowed[] = "allowed"; +// OnRemoteControlSettings notification + +// RC.OnDriverRankChanged notification +const char kDevice[] = "device"; +const char kName[] = "name"; +const char kRank[] = "deviceRank"; +// RC.OnDriverRankChanged notification + +// ButtonPress request +const char kModuleType[] = "moduleType"; +const char kButtonName[] = "buttonName"; +const char kButtonPressMode[] = "buttonPressMode"; +// ButtonPress request + +// RdsData struct +const char kPS[] = "PS"; +const char kRT[] = "RT"; +const char kCT[] = "CT"; +const char kPI[] = "PI"; +const char kPTY[] = "PTY"; +const char kTA[] = "TA"; +const char kTP[] = "TP"; +const char kREG[] = "REG"; +// RdsData struct + +// RadioControlData struct +const char kFrequencyInteger[] = "frequencyInteger"; +const char kFrequencyFraction[] = "frequencyFraction"; +const char kBand[] = "band"; +const char kRdsData[] = "rdsData"; +const char kAvailableHDs[] = "availableHDs"; +const char kHdChannel[] = "hdChannel"; +const char kSignalStrength[] = "signalStrength"; +const char kSignalChangeThreshold[] = "signalChangeThreshold"; +const char kRadioEnable[] = "radioEnable"; +const char kState[] = "state"; +// RadioControlData struct + +// ClimateControlData struct +const char kFanSpeed[] = "fanSpeed"; +const char kCurrentTemperature[] = "currentTemperature"; +const char kDesiredTemperature[] = "desiredTemperature"; +const char kTemperatureUnit[] = "temperatureUnit"; +const char kACEnable[] = "acEnable"; +const char kCirculateAirEnable[] = "circulateAirEnable"; +const char kAutoModeEnable[] = "autoModeEnable"; +const char kDefrostZone[] = "defrostZone"; +const char kDualModeEnable[] = "dualModeEnable"; +const char kACMaxEnable[] = "acMaxEnable"; +const char kVentilationMode[] = "ventilationMode"; +// ClimateControlData struct + +// ModuleData struct +const char kRadioControlData[] = "radioControlData"; +const char kClimateControlData[] = "climateControlData"; +// ModuleData struct + +const char kHMIAppID[] = "appID"; +const char kHmiLevel[] = "hmiLevel"; +const char kSysContext[] = "systemContext"; +const char kAudioState[] = "audioStreamingState"; +} // namespace message_params + +namespace enums_value { +// TriggerSource enum +// const char kMenu[] = "MENU"; +// const char kVR[] = "VR"; +// TriggerSource enum + +// ModuleType enum +const char kClimate[] = "CLIMATE"; +const char kRadio[] = "RADIO"; +// ModuleType enum + +// RadioBand enum +const char kAM[] = "AM"; +const char kFM[] = "FM"; +const char kXM[] = "XM"; +// RadioBand enum + +// RadioState enum +const char kAcquiring[] = "ACQUIRING"; +const char kAcquired[] = "ACQUIRED"; +const char kMulticast[] = "MULTICAST"; +const char kNotFound[] = "NOT_FOUND"; +// RadioState enum + +// DefrostZone enum +const char kFront[] = "FRONT"; +const char kRear[] = "REAR"; +const char kAll[] = "ALL"; +// DefrostZone enum + +// TemperatureUnit enum +const char kFahrenheit[] = "FAHRENHEIT"; +const char kCelsius[] = "CELSIUS"; +// TemperatureUnit enum + +// ButtonName enum +const char kACMax[] = "AC_MAX"; +const char kAC[] = "AC"; +const char kRecirculate[] = "RECIRCULATE"; +const char kFanUp[] = "FAN_UP"; +const char kFanDown[] = "FAN_DOWN"; +const char kTempUp[] = "TEMP_UP"; +const char kTempDown[] = "TEMP_DOWN"; +const char kDefrostMax[] = "DEFROST_MAX"; +const char kDefrost[] = "DEFROST"; +const char kDefrostRear[] = "DEFROST_REAR"; +const char kUpperVent[] = "UPPER_VENT"; +const char kLowerVent[] = "LOWER_VENT"; +const char kVolumeUp[] = "VOLUME_UP"; +const char kVolumeDown[] = "VOLUME_DOWN"; +const char kEject[] = "EJECT"; +const char kSource[] = "SOURCE"; +const char kShuffle[] = "SHUFFLE"; +const char kRepeat[] = "REPEAT"; +// ButtonName enum + +// ButtonPressMode enum +const char kLong[] = "LONG"; +const char kShort[] = "SHORT"; +// ButtonPressMode enum + +// Access mode enum +const char kAutoAllow[] = "AUTO_ALLOW"; +const char kAutoDeny[] = "AUTO_DENY"; +const char kAskDriver[] = "ASK_DRIVER"; +// Access mode enum +} // namespace enums_value + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_ diff --git a/src/components/remote_control/include/remote_control/rc_module_timer.h b/src/components/remote_control/include/remote_control/rc_module_timer.h new file mode 100644 index 0000000000..dbc072a62d --- /dev/null +++ b/src/components/remote_control/include/remote_control/rc_module_timer.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_ + +#include "functional_module/timer/module_timer.h" + +namespace remote_control { + +class TrackableMessage : public functional_modules::Trackable { + public: + TrackableMessage(uint32_t app_id, uint32_t correlation_id) + : custom_interval_(0), app_id_(app_id), correlation_id_(correlation_id) {} + + functional_modules::TimeUnit custom_interval() const { + return custom_interval_; + } + + uint32_t app_id() const { + return app_id_; + } + + uint32_t correlation_id() const { + return correlation_id_; + } + + bool operator==(const TrackableMessage& other) const { + return (other.app_id_ == app_id_ && + other.correlation_id_ == correlation_id_); + } + + private: + functional_modules::TimeUnit custom_interval_; + uint32_t app_id_; + uint32_t correlation_id_; +}; + +} // namesapce remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_TIMER_H_ diff --git a/src/components/remote_control/include/remote_control/remote_control_event.h b/src/components/remote_control/include/remote_control/remote_control_event.h new file mode 100644 index 0000000000..4623310557 --- /dev/null +++ b/src/components/remote_control/include/remote_control/remote_control_event.h @@ -0,0 +1,82 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_ + +#include + +#include "application_manager/message.h" + +#include "remote_control/event_engine/event.h" + +namespace remote_control { + +class RCPluginEvent + : public rc_event_engine::Event { + public: + /* + * @brief Constructor with parameters + * + * @param id Event ID. (HMI or CAN function name) + * @param message Message received in HMI or CAN response + */ + RCPluginEvent(application_manager::MessagePtr& message, + const std::string& id); + + /* + * @brief Destructor + */ + virtual ~RCPluginEvent(); + + /* + * @brief Retrieves event message request ID + */ + virtual int32_t event_message_function_id() const; + + /* + * @brief Retrieves event message correlation ID + */ + virtual int32_t event_message_correlation_id() const; + + /* + * @brief Retrieves event message response type + */ + virtual int32_t event_message_type() const; + + private: + DISALLOW_COPY_AND_ASSIGN(RCPluginEvent); +}; +} + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_ diff --git a/src/components/remote_control/include/remote_control/remote_control_plugin.h b/src/components/remote_control/include/remote_control/remote_control_plugin.h new file mode 100644 index 0000000000..9875723f43 --- /dev/null +++ b/src/components/remote_control/include/remote_control/remote_control_plugin.h @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_ + +#include +#include + +#include "remote_control/remote_plugin_interface.h" +#include "functional_module/generic_module.h" +#include "remote_control/request_controller.h" +#include "utils/threads/message_loop_thread.h" +#include "remote_control/event_engine/event_dispatcher.h" +#include "remote_control/resource_allocation_manager_impl.h" + +namespace remote_control { +typedef rc_event_engine::EventDispatcher RCEventDispatcher; + +class RemoteControlPlugin : public RemotePluginInterface { + public: + RemoteControlPlugin(); + ~RemoteControlPlugin(); + + functional_modules::PluginInfo GetPluginInfo() const; + virtual functional_modules::ProcessResult ProcessMessage( + application_manager::MessagePtr msg); + virtual functional_modules::ProcessResult ProcessHMIMessage( + application_manager::MessagePtr msg); + + /** + * @brief Sends response to mobile application + * @param msg response mesage + */ + void SendResponseToMobile(application_manager::MessagePtr msg); + + /** + * @brief Sends timeout response to mobile application + * @param msg response mesage + */ + void SendTimeoutResponseToMobile(application_manager::MessagePtr msg); + + /** + * @brief Remove extension created for specified application + * @param app_id application id + */ + virtual void RemoveAppExtension(uint32_t app_id); + + /** + * @brief Check registering app can be handled by plugin + * @param msg Registration message + * @param app Application basis already create by Core + */ + bool IsAppForPlugin(application_manager::ApplicationSharedPtr app); + + /** + * @brief Notify about change of HMILevel of plugin's app + * @param app App with new HMILevel + * @param old_level Old HMILevel of app + */ + void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType old_level); + + /** + * @brief Checks if plugin hasn't put restrictions on app's HMI Level + * @param app App with old HMILevel + * @param new_level HMILevel which is about to be set to app + */ + virtual bool CanAppChangeHMILevel( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType new_level); + + /** + * Handles removing (disconnecting) device + * @param device removed + */ + void OnDeviceRemoved(const connection_handler::DeviceHandle& device) OVERRIDE; + + /** + * @brief OnUnregisterApplication handles application unregistering event + * @param app_id application id which was unregistered + */ + void OnUnregisterApplication(const uint32_t app_id) OVERRIDE; + + void SendHmiStatusNotification( + application_manager::ApplicationSharedPtr app) OVERRIDE; + + RCEventDispatcher& event_dispatcher() OVERRIDE; + + ResourceAllocationManager& resource_allocation_manager() OVERRIDE; + + protected: + /** + * @brief Remove extension for all applications + */ + virtual void RemoveAppExtensions() OVERRIDE; + + private: + void SubscribeOnFunctions(); + void NotifyMobiles(application_manager::MessagePtr msg); + + functional_modules::ProcessResult HandleMessage( + application_manager::MessagePtr msg); + + functional_modules::PluginInfo plugin_info_; + bool is_scan_started_; + request_controller::RequestController request_controller_; + + RCEventDispatcher event_dispatcher_; + + ResourceAllocationManagerImpl resource_allocation_manager_; + DISALLOW_COPY_AND_ASSIGN(RemoteControlPlugin); +}; + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_ diff --git a/src/components/remote_control/include/remote_control/remote_plugin_interface.h b/src/components/remote_control/include/remote_control/remote_plugin_interface.h new file mode 100644 index 0000000000..31e894db99 --- /dev/null +++ b/src/components/remote_control/include/remote_control/remote_plugin_interface.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_ + +#include +#include +#include "functional_module/generic_module.h" +#include "remote_control/request_controller.h" +#include "remote_control/event_engine/event_dispatcher.h" +#include "utils/threads/message_loop_thread.h" +#include "utils/shared_ptr.h" + +namespace remote_control { + +class RCAppExtension; +class ResourceAllocationManager; + +typedef utils::SharedPtr RCAppExtensionPtr; + +class RemotePluginInterface : public functional_modules::GenericModule { + public: + RemotePluginInterface() : GenericModule(kCANModuleID) {} + virtual ~RemotePluginInterface() {} + virtual functional_modules::PluginInfo GetPluginInfo() const = 0; + virtual functional_modules::ProcessResult ProcessMessage( + application_manager::MessagePtr msg) = 0; + virtual functional_modules::ProcessResult ProcessHMIMessage( + application_manager::MessagePtr msg) = 0; + + /** + * @brief Sends response to mobile application + * @param msg response mesage + */ + virtual void SendResponseToMobile(application_manager::MessagePtr msg) = 0; + + /** + * @brief Sends timeout response to mobile application + * @param msg response mesage + */ + virtual void SendTimeoutResponseToMobile( + application_manager::MessagePtr msg) = 0; + + /** + * @brief Remove extension created for specified application + * @param app_id application id + */ + virtual void RemoveAppExtension(uint32_t app_id) = 0; + + /** + * @brief Check registering app can be handled by plugin + * @param msg Registration message + * @param app Application basis already create by Core + */ + virtual bool IsAppForPlugin( + application_manager::ApplicationSharedPtr app) = 0; + + /** + * @brief Notify about change of HMILevel of plugin's app + * @param app App with new HMILevel + * @param old_level Old HMILevel of app + */ + virtual void OnAppHMILevelChanged( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType old_level) = 0; + + /** + * @brief Checks if plugin hasn't put restrictions on app's HMI Level + * @param app App with old HMILevel + * @param new_level HMILevel which is about to be set to app + */ + virtual bool CanAppChangeHMILevel( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType new_level) = 0; + + /** + * Handles removing (disconnecting) device + * @param device removed + */ + virtual void OnDeviceRemoved( + const connection_handler::DeviceHandle& device) = 0; + + virtual void SendHmiStatusNotification( + application_manager::ApplicationSharedPtr app) = 0; + + typedef rc_event_engine::EventDispatcher RCPluginEventDispatcher; + + virtual RCPluginEventDispatcher& event_dispatcher() = 0; + + virtual ResourceAllocationManager& resource_allocation_manager() = 0; + + protected: + /** + * @brief Remove extension for all applications + */ + virtual void RemoveAppExtensions() = 0; + + // TODO(VS): must be uid + static const functional_modules::ModuleID kCANModuleID = 153; +}; + +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_ diff --git a/src/components/remote_control/include/remote_control/request_controller.h b/src/components/remote_control/include/remote_control/request_controller.h new file mode 100644 index 0000000000..c42d4b9c08 --- /dev/null +++ b/src/components/remote_control/include/remote_control/request_controller.h @@ -0,0 +1,98 @@ +/** + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_ + +#include + +#include "remote_control/commands/command.h" +#include "remote_control/rc_module_timer.h" +#include "functional_module/timer/timer_director.h" + +namespace remote_control { + +namespace commands { +class Command; +} + +namespace request_controller { + +typedef utils::SharedPtr MobileRequestPtr; +typedef uint32_t correlation_id; + +/** + * @brief RequestController class is used to manage mobile requests lifetime. + */ +class RequestController + : public functional_modules::TimerObserver { + public: + /** + * @brief Class constructor + * + */ + RequestController(); + + /** + * @brief Class destructor + * + */ + virtual ~RequestController(); + + /** + * @brief Adds pointer to request. + * @param mobile_correlation_id mobile request correlation id + * @param command pointer to request created in mobile factory + */ + void AddRequest(const uint32_t mobile_correlation_id, + MobileRequestPtr request); + + /** + * @brief Removes request + * @param mobile_corellation_id mobile request correlation id + */ + void DeleteRequest(const uint32_t& mobile_correlation_id); + + void OnTimeoutTriggered(const TrackableMessage& expired); + + private: + DISALLOW_COPY_AND_ASSIGN(RequestController); + + std::map mobile_request_list_; + functional_modules::ModuleTimer timer_; + functional_modules::TimerDirector time_director_; +}; + +} // namespace request_controller +} // namespace remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_ diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager.h b/src/components/remote_control/include/remote_control/resource_allocation_manager.h new file mode 100644 index 0000000000..0c1943eaf8 --- /dev/null +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager.h @@ -0,0 +1,111 @@ +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H +#include +#include "utils/macro.h" +#include "utils/shared_ptr.h" +#include "interfaces/HMI_API.h" +#include "remote_control/event_engine/event.h" + +namespace remote_control { + +/** + * Enum for list of results of allocation resources + */ +namespace AcquireResult { +enum eType { ALLOWED = 0, IN_USE, ASK_DRIVER, REJECTED }; +} + +/** + * Defines states of acquired resource + */ +namespace ResourceState { +enum eType { FREE = 0, BUSY }; +} + +/** + * @brief The AskDriverCallBack class callback for GetInteriourConsent response + */ +class AskDriverCallBack + : public rc_event_engine::EventObserver { + public: + virtual ~AskDriverCallBack() {} +}; + +typedef utils::SharedPtr AskDriverCallBackPtr; + +class ResourceAllocationManager { + public: + /** + * @brief AcquireResource acquires resource by application + * @param module_type resource to acquire + * @param app_id application that acquire resource + * @return ALLOWED if resource acquired \ + * IN_USE if subscription is not allowed + * ASK_DRIVER if driver confirmation is required + */ + virtual AcquireResult::eType AcquireResource(const std::string& module_type, + const uint32_t app_id) = 0; + + /** + * @brief SetResourceState changes resource state. Resource must be acquired + * beforehand. + * @param module_type Resource to change its state + * @param app_id Application aquired resource before + * @param state State to set for resource + */ + virtual void SetResourceState(const std::string& module_type, + const uint32_t app_id, + const ResourceState::eType state) = 0; + + /** + * @brief IsResourceFree check resource state + * @param module_type Resource name + * @return True if free, otherwise - false + */ + virtual bool IsResourceFree(const std::string& module_type) const = 0; + + /** + * @brief OnUnregisterApplication handles application unregistering event + * @param app_id application id which was unregistered + */ + virtual void OnUnregisterApplication(const uint32_t app_id) = 0; + + /** + * @brief AcquireResource forces acquiring resource by application + * @param module_type resource to acquire + * @param app_id application that acquire resource + */ + virtual void ForceAcquireResource(const std::string& module_type, + const uint32_t app_id) = 0; + + /** + * @brief OnDriverDisallowed callback for rejecting acquiring resource + * @param module_type resource type + * @param app_id application id + */ + virtual void OnDriverDisallowed(const std::string& module_type, + const uint32_t app_id) = 0; + /** + * @brief AskDriver send GetInteriorConsent request to HMI for acquiring + * resource + * @param module_type resource to acquire + * @param app_id application that acquire resource + * @param callback will be executed on OnInteriorConsent response + */ + virtual void AskDriver(const std::string& module_type, + const uint32_t app_id, + AskDriverCallBackPtr callback) = 0; + + /** + * @brief Set current access mode for acquiring resource + * @param access_mode + */ + virtual void SetAccessMode( + const hmi_apis::Common_RCAccessMode::eType access_mode) = 0; + + virtual ~ResourceAllocationManager() {} +}; + +} // namespace remote_control +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h new file mode 100644 index 0000000000..5dbbc219a8 --- /dev/null +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h @@ -0,0 +1,80 @@ +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H +#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H +#include "remote_control/resource_allocation_manager.h" +#include "remote_control/remote_plugin_interface.h" +#include "utils/macro.h" +namespace remote_control { + +typedef rc_event_engine::EventDispatcher RCEventDispatcher; + +class ResourceAllocationManagerImpl : public ResourceAllocationManager { + public: + ResourceAllocationManagerImpl(RemotePluginInterface& rc_plugin); + + ~ResourceAllocationManagerImpl(); + + AcquireResult::eType AcquireResource(const std::string& module_type, + const uint32_t app_id) OVERRIDE FINAL; + + void SetResourceState(const std::string& module_type, + const uint32_t app_id, + const ResourceState::eType state) FINAL; + + bool IsResourceFree(const std::string& module_type) const FINAL; + + void AskDriver(const std::string& module_type, + const uint32_t hmi_app_id, + AskDriverCallBackPtr callback) OVERRIDE FINAL; + + void SetAccessMode( + const hmi_apis::Common_RCAccessMode::eType access_mode) FINAL; + + void ForceAcquireResource(const std::string& module_type, + const uint32_t app_id) OVERRIDE FINAL; + + void OnDriverDisallowed(const std::string& module_type, + const uint32_t app_id) OVERRIDE FINAL; + + void OnUnregisterApplication(const uint32_t app_id) FINAL; + + private: + /** + * @brief IsModuleTypeRejected check if current resource was rejected by + * driver for current application + * @param module_type resource to check + * @param app_id application id + * @return true if current resource was rejected by driver for current + * application, otherwise - false + */ + bool IsModuleTypeRejected(const std::string& module_type, + const uint32_t app_id); + + /** + * @brief AllocatedResources contains link between resource and application + * owning that resource + */ + typedef std::map AllocatedResources; + AllocatedResources allocated_resources_; + + /** + * @brief ResourcesState contains states of ALLOCATED resources + */ + typedef std::map ResourcesState; + ResourcesState resources_state_; + + /** + * @brief RejectedResources type for connecting list of resources rejected by + * driver for application + * application_id : [vector of rejected resources] + */ + typedef std::map > RejectedResources; + RejectedResources rejected_resources_for_application_; + + hmi_apis::Common_RCAccessMode::eType current_access_mode_; + AskDriverCallBackPtr active_call_back_; + RemotePluginInterface& rc_plugin_; +}; +} // remote_control + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H diff --git a/src/components/remote_control/remote_sdl_pt.json b/src/components/remote_control/remote_sdl_pt.json new file mode 100644 index 0000000000..e013c70112 --- /dev/null +++ b/src/components/remote_control/remote_sdl_pt.json @@ -0,0 +1,2359 @@ +{ + "policy_table": { + "module_config": { + "equipment": { + }, + "preloaded_pt": true, + "country_consent_passengersRC": true, + "exchange_after_x_ignition_cycles": 100, + "exchange_after_x_kilometers": 1800, + "exchange_after_x_days": 30, + "timeout_after_x_seconds": 60, + "seconds_between_retries": [1, + 5, + 25, + 125, + 625], + "endpoints": { + "0x07": { + "default": ["http://policies.telematics.ford.com/api/policies"] + }, + "0x04": { + "default": ["http://ivsu.software.ford.com/api/getsoftwareupdates"] + }, + "queryAppsUrl": { + "default": ["http://sdl.shaid.server"] + } + }, + "notifications_per_minute_by_priority": { + "EMERGENCY": 60, + "NAVIGATION": 15, + "VOICECOM": 20, + "COMMUNICATION": 6, + "NORMAL": 4, + "NONE": 0 + } + }, + "functional_groupings": { + "Base-4": { + "rpcs": { + "AddCommand": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "AddSubMenu": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "Alert": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "ChangeRegistration": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "CreateInteractionChoiceSet": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "DeleteCommand": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "DeleteFile": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "DeleteInteractionChoiceSet": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "DeleteSubMenu": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "EncodedSyncPData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "EndAudioPassThru": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "GenericResponse": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "ListFiles": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnAppInterfaceUnregistered": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnAudioPassThru": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "OnButtonEvent": { + "hmi_levels": ["FULL", + "LIMITED", + "BACKGROUND"] + }, + "OnButtonPress": { + "hmi_levels": ["FULL", + "LIMITED", + "BACKGROUND"] + }, + "OnCommand": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "OnDriverDistraction": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "OnEncodedSyncPData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnHashChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnHMIStatus": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnLanguageChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnPermissionsChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnSystemRequest": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "PerformAudioPassThru": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "PerformInteraction": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "PutFile": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "RegisterAppInterface": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "ResetGlobalProperties": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "ScrollableMessage": { + "hmi_levels": ["FULL"] + }, + "SetAppIcon": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetDisplayLayout": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetGlobalProperties": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetMediaClockTimer": { + "hmi_levels": ["FULL", + "LIMITED", + "BACKGROUND"] + }, + "Show": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "Slider": { + "hmi_levels": ["FULL"] + }, + "Speak": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "SubscribeButton": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "SystemRequest": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "UnregisterAppInterface": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "UnsubscribeButton": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + } + } + }, + "Location-1": { + "user_consent_prompt": "Location", + "rpcs": { + "GetVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["gps", + "speed"] + }, + "OnVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["gps", + "speed"] + }, + "SubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["gps", + "speed"] + }, + "UnsubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["gps", + "speed"] + } + } + }, + "Notifications": { + "user_consent_prompt": "Notifications", + "rpcs": { + "Alert": { + "hmi_levels": ["BACKGROUND"] + } + } + }, + "Notifications-RC": { + "rpcs": { + "OnPermissionsChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnHMIStatus": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnSystemRequest": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + } + } + }, + "pre_BaseRC-1": { + "rpcs": { + "OnPermissionsChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnHMIStatus": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + } + } + }, + "DrivingCharacteristics-3": { + "user_consent_prompt": "DrivingCharacteristics", + "rpcs": { + "GetVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["accPedalPosition", + "beltStatus", + "driverBraking", + "myKey", + "prndl", + "rpm", + "steeringWheelAngle"] + }, + "OnVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["accPedalPosition", + "beltStatus", + "driverBraking", + "myKey", + "prndl", + "rpm", + "steeringWheelAngle"] + }, + "SubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["accPedalPosition", + "beltStatus", + "driverBraking", + "myKey", + "prndl", + "rpm", + "steeringWheelAngle"] + }, + "UnsubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["accPedalPosition", + "beltStatus", + "driverBraking", + "myKey", + "prndl", + "rpm", + "steeringWheelAngle"] + } + } + }, + "VehicleInfo-3": { + "user_consent_prompt": "VehicleInfo", + "rpcs": { + "GetVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["bodyInformation", + "deviceStatus", + "engineTorque", + "externalTemperature", + "fuelLevel", + "fuelLevel_State", + "headLampStatus", + "instantFuelConsumption", + "odometer", + "tirePressure", + "vin", + "wiperStatus"] + }, + "OnVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["bodyInformation", + "deviceStatus", + "engineTorque", + "externalTemperature", + "fuelLevel", + "fuelLevel_State", + "headLampStatus", + "instantFuelConsumption", + "odometer", + "tirePressure", + "vin", + "wiperStatus"] + }, + "SubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["bodyInformation", + "deviceStatus", + "engineTorque", + "externalTemperature", + "fuelLevel", + "fuelLevel_State", + "headLampStatus", + "instantFuelConsumption", + "odometer", + "tirePressure", + "wiperStatus"] + }, + "UnsubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["bodyInformation", + "deviceStatus", + "engineTorque", + "externalTemperature", + "fuelLevel", + "fuelLevel_State", + "headLampStatus", + "instantFuelConsumption", + "odometer", + "tirePressure", + "wiperStatus"] + } + } + }, + "PropriataryData-1": { + "rpcs": { + "DiagnosticMessage": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "GetDTCs": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "ReadDID": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + } + } + }, + "PropriataryData-2": { + "rpcs": { + "DiagnosticMessage": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "GetDTCs": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "ReadDID": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + } + } + }, + "ProprietaryData-3": { + "rpcs": { + "GetDTCs": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "ReadDID": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + } + } + }, + "Emergency-1": { + "rpcs": { + "GetVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["airbagStatus", + "clusterModeStatus", + "eCallInfo", + "emergencyEvent"] + }, + "OnVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["airbagStatus", + "clusterModeStatus", + "eCallInfo", + "emergencyEvent"] + }, + "SubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["airbagStatus", + "clusterModeStatus", + "eCallInfo", + "emergencyEvent"] + }, + "UnsubscribeVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"], + "parameters": ["airbagStatus", + "clusterModeStatus", + "eCallInfo", + "emergencyEvent"] + } + } + }, + "Navigation-1": { + "rpcs": { + "AlertManeuver": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "ShowConstantTBT": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "UpdateTurnList": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + } + } + }, + "Base-6": { + "rpcs": { + "AddCommand": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "AddSubMenu": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "Alert": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "ChangeRegistration": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "CreateInteractionChoiceSet": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "DeleteCommand": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "DeleteFile": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "DeleteInteractionChoiceSet": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "DeleteSubMenu": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "EncodedSyncPData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "EndAudioPassThru": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "GenericResponse": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "ListFiles": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnAppInterfaceUnregistered": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnAudioPassThru": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "OnButtonEvent": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "OnButtonPress": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "OnCommand": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "OnDriverDistraction": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "OnEncodedSyncPData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnHMIStatus": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnLanguageChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnPermissionsChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnSyncPData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnTBTClientState": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "PerformAudioPassThru": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "PerformInteraction": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "PutFile": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "RegisterAppInterface": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "ResetGlobalProperties": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "ScrollableMessage": { + "hmi_levels": ["FULL"] + }, + "SetAppIcon": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetDisplayLayout": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetGlobalProperties": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "SetMediaClockTimer": { + "hmi_levels": ["FULL"] + }, + "Show": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "Slider": { + "hmi_levels": ["FULL"] + }, + "Speak": { + "hmi_levels": ["FULL", + "LIMITED"] + }, + "SubscribeButton": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "SyncPData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "UnregisterAppInterface": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "UnsubscribeButton": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + } + } + }, + "OnKeyboardInputOnlyGroup": { + "rpcs": { + "OnKeyboardInput": { + "hmi_levels": ["FULL"] + } + } + }, + "OnTouchEventOnlyGroup": { + "rpcs": { + "OnTouchEvent": { + "hmi_levels": ["FULL"] + } + } + }, + "DiagnosticMessageOnly": { + "rpcs": { + "DiagnosticMessage": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + } + } + }, + "DataConsent-2": { + "user_consent_prompt": "DataConsent", + "rpcs": null + }, + "BaseBeforeDataConsent": { + "rpcs": { + "ChangeRegistration": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "DeleteFile": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "EncodedSyncPData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "ListFiles": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnAppInterfaceUnregistered": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnEncodedSyncPData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnHashChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnHMIStatus": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnLanguageChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnPermissionsChange": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnSystemRequest": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "PutFile": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "RegisterAppInterface": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "ResetGlobalProperties": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetGlobalProperties": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetAppIcon": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetDisplayLayout": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SystemRequest": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "UnregisterAppInterface": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + } + } + }, + "SendLocation": { + "rpcs": { + "SendLocation": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + } + } + }, + "BackgroundAPT": { + "rpcs": { + "EndAudioPassThru": { + "hmi_levels": ["BACKGROUND"] + }, + "OnAudioPassThru": { + "hmi_levels": ["BACKGROUND"] + }, + "PerformAudioPassThru": { + "hmi_levels": ["BACKGROUND"] + } + } + }, + "RemoteControl": { + "rpcs": { + "ButtonPress": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "GetInteriorVehicleDataCapabilities": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "GetInteriorVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "SetInteriorVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + }, + "OnInteriorVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] + }, + "SystemRequest": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] + } + } + } + }, + "consumer_friendly_messages": { + "version": "001.001.021", + "messages": { + "AppPermissions": { + "languages": { + "de-de": { + "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.", + "line1": "Zugriffsanfrage(n)", + "line2": "erlauben?" + }, + "en-au": { + "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.", + "line1": "Grant requested", + "line2": "permission(s)?" + }, + "en-gb": { + "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.", + "line1": "Grant requested", + "line2": "permission(s)?", + "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu." + }, + "en-ie": { + "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.", + "line1": "Grant requested", + "line2": "permission(s)?" + }, + "en-us": { + "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. Please press yes to allow or no to deny.", + "line1": "Grant Requested", + "line2": "Permission(s)?", + "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. \n\nIf you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu." + }, + "es-en": { + "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.", + "line1": "¿Otorgar permiso(s)", + "line2": "solicitado(s)?", + "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. \n\n Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles." + }, + "es-es": { + "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.", + "line1": "¿Conceder permisos", + "line2": "solicitados?" + }, + "es-mx": { + "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.", + "line1": "¿Otorgar permiso(s)", + "line2": "solicitado(s)?", + "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. \n\nSi presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles." + }, + "fr-ca": { + "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.", + "line1": "Accorder permission(s)", + "line2": "demandée(s)", + "textBody": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles." + }, + "fr-fr": { + "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.", + "line1": "Accorder permission(s)", + "line2": "demandée(s)" + }, + "it-it": { + "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.", + "line1": "Concedi autorizzaz.", + "line2": "richiesta(e)?" + }, + "nl-nl": { + "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.", + "line1": "Aangevraagde", + "line2": "permissie(s) verlenen?" + }, + "pl-pl": { + "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.", + "line1": "Udzielić żądanych", + "line2": "pozwoleń?" + }, + "pt-br": { + "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.", + "line1": "Conceder permissão", + "line2": "solicitada?" + }, + "pt-pt": { + "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.", + "line1": "Conceder permiss.", + "line2": "solicitada(s)?" + }, + "ru-ru": { + "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.", + "line1": "Предост. заправш.", + "line2": "разрешения?" + }, + "sv-se": { + "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.", + "line1": "Vill du ge", + "line2": "tillstånd?" + }, + "tr-tr": { + "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.", + "line1": "İstenen izinler", + "line2": "verilsin mi?" + }, + "zh-cn": { + "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。", + "line1": "是否允许请求的", + "line2": "权限?" + }, + "zh-tw": { + "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。", + "line1": "允許", + "line2": "授權請求?" + } + } + }, + "AppPermissionsHelp": { + "languages": { + "de-de": { + "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab." + }, + "en-au": { + "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny." + }, + "en-gb": { + "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny." + }, + "en-ie": { + "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny." + }, + "en-us": { + "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny." + }, + "es-en": { + "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar." + }, + "es-es": { + "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo." + }, + "es-mx": { + "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar." + }, + "fr-ca": { + "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser." + }, + "fr-fr": { + "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser." + }, + "it-it": { + "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle." + }, + "nl-nl": { + "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren." + }, + "pl-pl": { + "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania." + }, + "pt-br": { + "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar." + }, + "pt-pt": { + "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar." + }, + "ru-ru": { + "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять." + }, + "sv-se": { + "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka." + }, + "tr-tr": { + "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın." + }, + "zh-cn": { + "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。" + }, + "zh-tw": { + "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。" + } + } + }, + "AppPermissionsRevoked": { + "languages": { + "de-de": { + "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.." + }, + "en-au": { + "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device." + }, + "en-gb": { + "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device." + }, + "en-ie": { + "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device." + }, + "en-us": { + "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device." + }, + "es-en": { + "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil." + }, + "es-es": { + "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil." + }, + "es-mx": { + "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil." + }, + "fr-ca": { + "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile." + }, + "fr-fr": { + "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile." + }, + "it-it": { + "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile." + }, + "nl-nl": { + "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt." + }, + "pl-pl": { + "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji." + }, + "pt-br": { + "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel." + }, + "pt-pt": { + "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel." + }, + "ru-ru": { + "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения." + }, + "sv-se": { + "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten." + }, + "tr-tr": { + "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun." + }, + "zh-cn": { + "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。" + }, + "zh-tw": { + "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。" + } + } + }, + "AppUnauthorized": { + "languages": { + "de-de": { + "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.", + "line1": "nicht autorisiert" + }, + "en-au": { + "tts": "This version of %appName% is not authorized and will not work with SYNC.", + "line1": "not authorized" + }, + "en-gb": { + "tts": "This version of %appName% is not authorized and will not work with SYNC.", + "line1": "not authorized", + "textBody": "This version of %appName% is not authorized and will not work with SYNC." + }, + "en-ie": { + "tts": "This version of %appName% is not authorized and will not work with SYNC.", + "line1": "not authorized" + }, + "en-us": { + "tts": "This version of %appName% is not authorized and will not work with SYNC.", + "line1": "Not Authorized", + "textBody": "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%." + }, + "es-en": { + "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.", + "line1": "no autorizada", + "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC." + }, + "es-es": { + "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.", + "line1": "No autorizada" + }, + "es-mx": { + "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.", + "line1": "no autorizada", + "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC." + }, + "fr-ca": { + "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.", + "line1": "non autorisée", + "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC." + }, + "fr-fr": { + "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.", + "line1": "non autorisée" + }, + "it-it": { + "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.", + "line1": "non autorizzata" + }, + "nl-nl": { + "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.", + "line1": "niet geautoriseerd" + }, + "pl-pl": { + "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.", + "line1": "brak autoryzacji" + }, + "pt-br": { + "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.", + "line1": "não autorizado" + }, + "pt-pt": { + "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.", + "line1": "não autorizada" + }, + "ru-ru": { + "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.", + "line1": "не авторизировано" + }, + "sv-se": { + "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.", + "line1": "är ej godkänd" + }, + "tr-tr": { + "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.", + "line1": "için izin yok" + }, + "zh-cn": { + "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。", + "line1": "未得到授权" + }, + "zh-tw": { + "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。", + "line1": "無授權" + } + } + }, + "AppUnsupported": { + "languages": { + "de-de": { + "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.", + "line1": "nicht unterstützt" + }, + "en-au": { + "tts": "This version of %appName% is not supported by SYNC.", + "line1": "not supported" + }, + "en-gb": { + "tts": "This version of %appName% is not supported by SYNC.", + "line1": "not supported", + "textBody": "This version of %appName% is not supported by SYNC." + }, + "en-ie": { + "tts": "This version of %appName% is not supported by SYNC.", + "line1": "not supported" + }, + "en-us": { + "tts": "This version of %appName% is not supported by SYNC.", + "line1": "Not Supported", + "textBody": "Your version of %appName% is not supported by SYNC." + }, + "es-en": { + "tts": "Esta versión de %appName% no es compatible con SYNC.", + "line1": "no compatible", + "textBody": "Esta versión de %appName% no es compatible con SYNC." + }, + "es-es": { + "tts": "Esta versión de %appName% no es compatible con SYNC.", + "line1": "No compatible" + }, + "es-mx": { + "tts": "Esta versión de %appName% no es compatible con SYNC.", + "line1": "no compatible", + "textBody": "Esta versión de %appName% no es compatible con SYNC." + }, + "fr-ca": { + "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.", + "line1": "incompatible", + "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC." + }, + "fr-fr": { + "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.", + "line1": "incompatible" + }, + "it-it": { + "tts": "Questa versione di %appName% non è supportata dal SYNC.", + "line1": "non supportata" + }, + "nl-nl": { + "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.", + "line1": "niet ondersteund" + }, + "pl-pl": { + "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.", + "line1": "aplikacja nie obsług." + }, + "pt-br": { + "tts": "Esta versão do %appName% não é suportada pelo SYNC.", + "line1": "não suportado" + }, + "pt-pt": { + "tts": "Esta versão de %appName% não é suportado pelo SYNC.", + "line1": "não suportada" + }, + "ru-ru": { + "tts": "Эта версия %appName% не поддерживается SYNC.", + "line1": "не поддерживается" + }, + "sv-se": { + "tts": "SYNC har inte stöd för den här versionen av %appName%.", + "line1": "stöds ej" + }, + "tr-tr": { + "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.", + "line1": "desteklenmiyor" + }, + "zh-cn": { + "tts": "SYNC不支持此版本的%appName%。", + "line1": "不受支持" + }, + "zh-tw": { + "tts": "SYNC 不支援此版本的%appName% 。", + "line1": "不支援" + } + } + }, + "DataConsent": { + "languages": { + "en-gb": { + "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. \r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information." + }, + "en-us": { + "line1": "Enable Mobile Apps", + "line2": "on SYNC? (Uses Data)", + "textBody": "Would you like to enable Mobile Apps on SYNC?\r\n\r\nTo use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S.\r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information." + }, + "es-mx": { + "textBody": "Para usar aplicaciones móviles con SYNC, este debe comunicarse con Ford al menos una vez al mes a través del plan de datos de su dispositivo móvil. Pueden aplicar tarifas normales. SYNC enviará su VIN y el número de módulo de SYNC a Ford de Estados Unidos de América. \n\nLas actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario. \n\nPresione Sí para permitir y No para denegar." + }, + "fr-ca": { + "textBody": "Pour utiliser AppLink, SYNC devra communiquer avec Ford au moins une fois par mois en utilisant le forfait de données de votre appareil mobile. Les tarifs réguliers peuvent s’appliquer. SYNC enverra votre NIV et le numéro de votre module SYNC à Ford États-Unis. Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements.\r\n\r\nVeuillez appuyer sur Oui pour autoriser ou sur Non pour refuser." + } + } + }, + "DataConsentHelp": { + "languages": { + "en-us": { + "textBody": "By enabling mobile apps, you consent to allowing SYNC to communicate with Ford at least once per month using your mobile device’s data plan. Disabling will stop all data usage, but you will not be able to use mobile apps on SYNC. See your Owner Guide for more information." + }, + "es-mx": { + "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario." + }, + "fr-ca": { + "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements." + } + } + }, + "DisableApps": { + "languages": { + "de-de": { + "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.", + "line1": "Auto-Update", + "line2": "und Mobile Apps deaktivieren" + }, + "en-au": { + "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.", + "line1": "Disable auto-updates", + "line2": "and Mobile Apps?" + }, + "en-gb": { + "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.", + "line1": "Disable auto-updates", + "line2": "and Mobile Apps?", + "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel." + }, + "en-ie": { + "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.", + "line1": "Disable auto-updates", + "line2": "and Mobile Apps?" + }, + "en-us": { + "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.", + "line1": "Disable Auto-Updates", + "line2": "and Mobile Apps?", + "textBody": "If you disable, you will not be able to use any mobile apps with SYNC and your vehicle will stop receiving mobile app permission updates via your device`s data plan. Please press yes to disable mobile apps or no to cancel." + }, + "es-en": { + "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.", + "line1": "¿Deshab. actualiz.", + "line2": "autom. y aplic. móv.?", + "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar." + }, + "es-es": { + "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.", + "line1": "¿Desact. actual. auto", + "line2": "y apl. móviles?" + }, + "es-mx": { + "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.", + "line1": "¿Deshab. actualiz.", + "line2": "autom. y aplic. móv.?", + "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar." + }, + "fr-ca": { + "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.", + "line1": "Désactiver màj autom.", + "line2": "et app. mobiles?", + "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler." + }, + "fr-fr": { + "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.", + "line1": "Désactiver màj autom.", + "line2": "et app. mobiles?" + }, + "it-it": { + "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.", + "line1": "Disabilitare agg. aut.", + "line2": "e app mobili?" + }, + "nl-nl": { + "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.", + "line1": "Auto-updates en mob.", + "line2": "apps uitschakelen?" + }, + "pl-pl": { + "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.", + "line1": "Wył. automat. aktual.", + "line2": "i aplikacje mobilne?" + }, + "pt-br": { + "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.", + "line1": "Desativar atualizações", + "line2": "autom. e aplicativos?" + }, + "pt-pt": { + "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.", + "line1": "Desact. actual. autom.", + "line2": "e aplicações móveis?" + }, + "ru-ru": { + "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.", + "line1": "Откл. автообновления", + "line2": "и мобил. прилож.?" + }, + "sv-se": { + "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.", + "line1": "Avaktiverar autouppdat.", + "line2": "och mobilappar?" + }, + "tr-tr": { + "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.", + "line1": "Oto. güncelleme ve", + "line2": "mobil uygul. kapat?" + }, + "zh-cn": { + "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。", + "line1": "是否禁用自动更新和", + "line2": "移动应用程序?" + }, + "zh-tw": { + "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。", + "line1": "停用自動更新", + "line2": "和行動應用程式?" + } + } + }, + "DrivingCharacteristics": { + "languages": { + "de-de": { + "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.", + "label": "Fahreigenschaften" + }, + "en-au": { + "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.", + "label": "Driving characteristics" + }, + "en-gb": { + "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.", + "label": "Driving characteristics", + "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status." + }, + "en-ie": { + "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.", + "label": "Driving characteristics" + }, + "en-us": { + "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status.", + "label": "Driving Characteristics", + "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status." + }, + "es-en": { + "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.", + "label": "Características del manejo", + "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad." + }, + "es-es": { + "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.", + "label": "Características de conducción" + }, + "es-mx": { + "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.", + "label": "Características del manejo", + "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad." + }, + "fr-ca": { + "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.", + "label": "Caractéristiques de conduite", + "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité." + }, + "fr-fr": { + "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.", + "label": "Caractéristiques de conduite" + }, + "it-it": { + "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.", + "label": "Caratteristiche di guida" + }, + "nl-nl": { + "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.", + "label": "Rijkenmerken" + }, + "pl-pl": { + "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.", + "label": "Informacje dotyczące stylu jazdy" + }, + "pt-br": { + "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.", + "label": "Características de condução" + }, + "pt-pt": { + "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.", + "label": "Características de condução" + }, + "ru-ru": { + "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.", + "label": "Характеристики движения" + }, + "sv-se": { + "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.", + "label": "Köregenskaper" + }, + "tr-tr": { + "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.", + "label": "Sürüş karakteristikleri" + }, + "zh-cn": { + "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态", + "label": "行驶特性" + }, + "zh-tw": { + "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態", + "label": "駕駛特性" + } + } + }, + "Location": { + "languages": { + "de-de": { + "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.", + "label": "GPS und Geschwindigkeit" + }, + "en-au": { + "tts": "An app can access vehicle GPS and speed.", + "label": "GPS and speed" + }, + "en-gb": { + "tts": "An app can access vehicle GPS and speed.", + "label": "GPS and speed", + "textBody": "An app can access vehicle GPS and speed." + }, + "en-ie": { + "tts": "An app can access vehicle GPS and speed.", + "label": "GPS and speed" + }, + "en-us": { + "tts": "An app can access vehicle GPS and speed.", + "label": "GPS and speed", + "textBody": "An app can access vehicle GPS and speed." + }, + "es-en": { + "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.", + "label": "GPS y velocidad", + "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo." + }, + "es-es": { + "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.", + "label": "GPS y velocidad" + }, + "es-mx": { + "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.", + "label": "GPS y velocidad", + "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo." + }, + "fr-ca": { + "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.", + "label": "GPS et vitesse", + "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule." + }, + "fr-fr": { + "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.", + "label": "GPS et vitesse" + }, + "it-it": { + "tts": "Un'app può avere accesso a GPS e velocità del veicolo.", + "label": "GPS e velocità" + }, + "nl-nl": { + "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.", + "label": "Gps en snelheid" + }, + "pl-pl": { + "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.", + "label": "GPS i prędkość" + }, + "pt-br": { + "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.", + "label": "GPS e velocidade" + }, + "pt-pt": { + "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.", + "label": "GPS e velocidade" + }, + "ru-ru": { + "tts": "Приложение имеет доступ к GPS и скорости автомобиля.", + "label": "GPS и скорость" + }, + "sv-se": { + "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.", + "label": "GPS och hastighet" + }, + "tr-tr": { + "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.", + "label": "GPS ve hız" + }, + "zh-cn": { + "tts": "移动应用程序可以访问车辆 GPS 和车速信息。", + "label": "GPS 和车速" + }, + "zh-tw": { + "tts": "應用程式可存取車輛的GPS和速度。", + "label": "GPS和車速" + } + } + }, + "Notifications": { + "languages": { + "de-de": { + "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.", + "label": "Push-Benachrichtigungen" + }, + "en-au": { + "tts": "An app can send notifications when running in the background.", + "label": "Push notifications" + }, + "en-gb": { + "tts": "An app can send notifications when running in the background.", + "label": "Push notifications", + "textBody": "An app can send notifications when running in the background." + }, + "en-ie": { + "tts": "An app can send notifications when running in the background.", + "label": "Push notifications" + }, + "en-us": { + "tts": "An app can send notifications when running in the background.", + "label": "Push notifications", + "textBody": "An app can send notifications when running in the background." + }, + "es-en": { + "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.", + "label": "Notificaciones tipo Push", + "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano." + }, + "es-es": { + "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.", + "label": "Notificaciones push" + }, + "es-mx": { + "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.", + "label": "Notificaciones tipo Push", + "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano." + }, + "fr-ca": { + "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.", + "label": "Notifications instantanées", + "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan." + }, + "fr-fr": { + "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.", + "label": "Notifications push" + }, + "it-it": { + "tts": "Un'app può inviare notifiche se eseguita in background.", + "label": "Notifiche push" + }, + "nl-nl": { + "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.", + "label": "Push-meldingen" + }, + "pl-pl": { + "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.", + "label": "Powiadomienia Push" + }, + "pt-br": { + "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.", + "label": "Notificações Push" + }, + "pt-pt": { + "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.", + "label": "Notificações push" + }, + "ru-ru": { + "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.", + "label": "Оповещения о пересылке" + }, + "sv-se": { + "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.", + "label": "Push-notiser" + }, + "tr-tr": { + "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.", + "label": "Anlık bildirimleri" + }, + "zh-cn": { + "tts": "移动应用程序在后台运行时可推送通知。", + "label": "推送通知" + }, + "zh-tw": { + "tts": "車輛行進時,應用程式可在背景中傳送通知。", + "label": "傳送通知" + } + } + }, + "SettingDisableUpdates": { + "languages": { + "de-de": { + "line1": "Updates deakt." + }, + "en-au": { + "line1": "Disable updates" + }, + "en-gb": { + "line1": "Disable updates" + }, + "en-ie": { + "line1": "Disable updates" + }, + "en-us": { + "line1": "Disable Updates", + "textBody": "Disable Updates" + }, + "es-en": { + "line1": "Deshab. actual.", + "textBody": "Deshab. actual." + }, + "es-es": { + "line1": "Desact. actual." + }, + "es-mx": { + "line1": "Deshab. actual.", + "textBody": "Deshab. actual." + }, + "fr-ca": { + "line1": "Désactiver MAJ", + "textBody": "Désactiver MAJ" + }, + "fr-fr": { + "line1": "Désactiver màj" + }, + "it-it": { + "line1": "Disabilita agg." + }, + "nl-nl": { + "line1": "Upd. uitschak." + }, + "pl-pl": { + "line1": "Wyłącz aktual." + }, + "pt-br": { + "line1": "Desat. atualiz." + }, + "pt-pt": { + "line1": "Desact. actualiz." + }, + "ru-ru": { + "line1": "Откл. обновл." + }, + "sv-se": { + "line1": "Inaktivera uppd." + }, + "tr-tr": { + "line1": "Güncell. Kapat" + }, + "zh-cn": { + "line1": "禁用更新" + }, + "zh-tw": { + "line1": "停用更新" + } + } + }, + "SettingEnableUpdates": { + "languages": { + "de-de": { + "line1": "Apps aktivieren" + }, + "en-au": { + "line1": "Enable Apps" + }, + "en-gb": { + "line1": "Enable Apps" + }, + "en-ie": { + "line1": "Enable Apps" + }, + "en-us": { + "line1": "Enable Apps" + }, + "es-en": { + "line1": "Hab. aplic." + }, + "es-es": { + "line1": "Activar apl." + }, + "es-mx": { + "line1": "Hab. aplic." + }, + "fr-ca": { + "line1": "Activer app.", + "textBody": "Activer app." + }, + "fr-fr": { + "line1": "Activer app." + }, + "it-it": { + "line1": "Abilita app" + }, + "nl-nl": { + "line1": "Apps inschak." + }, + "pl-pl": { + "line1": "Włącz aplikacje" + }, + "pt-br": { + "line1": "Ativar aplic." + }, + "pt-pt": { + "line1": "Activar actualiz." + }, + "ru-ru": { + "line1": "Вкл. прилож." + }, + "sv-se": { + "line1": "Aktivera appar" + }, + "tr-tr": { + "line1": "Uygulamaları aç" + }, + "zh-cn": { + "line1": "启用应用程序" + }, + "zh-tw": { + "line1": "啟用應用程式" + } + } + }, + "SettingUpdateAuto": { + "languages": { + "de-de": { + "line1": "Update anford." + }, + "en-au": { + "line1": "Request update" + }, + "en-gb": { + "line1": "Request update" + }, + "en-ie": { + "line1": "Request update" + }, + "en-us": { + "line1": "Request Update", + "textBody": "Select `Update now` to receive app permissions for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute." + }, + "es-en": { + "line1": "Solicit. actualiz.", + "textBody": "Solicit. actualiz." + }, + "es-es": { + "line1": "Solicitar actual." + }, + "es-mx": { + "line1": "Solicit. actualiz.", + "textBody": "Solicit. actualiz." + }, + "fr-ca": { + "line1": "Demander MAJ", + "textBody": "Demander MAJ" + }, + "fr-fr": { + "line1": "Demander màj" + }, + "it-it": { + "line1": "Rich. aggiorn." + }, + "nl-nl": { + "line1": "Upd. aanvragen" + }, + "pl-pl": { + "line1": "Zażądaj aktual." + }, + "pt-br": { + "line1": "Solicitar atualiz." + }, + "pt-pt": { + "line1": "Solicit. actualiz." + }, + "ru-ru": { + "line1": "Запрос на обн." + }, + "sv-se": { + "line1": "Begär uppdat." + }, + "tr-tr": { + "line1": "Güncelleme iste" + }, + "zh-cn": { + "line1": "请求更新" + }, + "zh-tw": { + "line1": "請求更新" + } + } + }, + "StatusNeeded": { + "languages": { + "de-de": { + "line1": "Update benötigt" + }, + "en-au": { + "line1": "Update needed" + }, + "en-gb": { + "line1": "Update needed", + "textBody": "Update needed" + }, + "en-ie": { + "line1": "Update needed" + }, + "en-us": { + "line1": "Update Needed", + "textBody": "Update Needed" + }, + "es-en": { + "line1": "Actualiz. neces.", + "textBody": "Actualiz. neces." + }, + "es-es": { + "line1": "Actu. necesaria" + }, + "es-mx": { + "line1": "Actualiz. neces.", + "textBody": "Actualiz. neces." + }, + "fr-ca": { + "line1": "Màj requise", + "textBody": "Màj requise" + }, + "fr-fr": { + "line1": "Mise à jour requise" + }, + "it-it": { + "line1": "Necess. aggiorn." + }, + "nl-nl": { + "line1": "Update nodig" + }, + "pl-pl": { + "line1": "Potrzeba aktual." + }, + "pt-br": { + "line1": "Atualiz. necess." + }, + "pt-pt": { + "line1": "Actual. necess." + }, + "ru-ru": { + "line1": "Необх. обновл." + }, + "sv-se": { + "line1": "Uppdat. krävs" + }, + "tr-tr": { + "line1": "Güncellenmeli" + }, + "zh-cn": { + "line1": "需要进行更新" + }, + "zh-tw": { + "line1": "需更新" + } + } + }, + "StatusPending": { + "languages": { + "de-de": { + "line1": "Aktualisieren..." + }, + "en-au": { + "line1": "Updating..." + }, + "en-gb": { + "line1": "Updating...", + "textBody": "Updating..." + }, + "en-ie": { + "line1": "Updating..." + }, + "en-us": { + "line1": "Updating...", + "textBody": "Updating..." + }, + "es-en": { + "line1": "Actualizando...", + "textBody": "Actualizando..." + }, + "es-es": { + "line1": "Actualizando..." + }, + "es-mx": { + "line1": "Actualizando...", + "textBody": "Actualizando..." + }, + "fr-ca": { + "line1": "MAJ en cours...", + "textBody": "MAJ en cours..." + }, + "fr-fr": { + "line1": "Màj en cours..." + }, + "it-it": { + "line1": "Aggiornamento" + }, + "nl-nl": { + "line1": "Updaten..." + }, + "pl-pl": { + "line1": "Aktualizowanie" + }, + "pt-br": { + "line1": "Atualizando..." + }, + "pt-pt": { + "line1": "A actualizar..." + }, + "ru-ru": { + "line1": "Обновление..." + }, + "sv-se": { + "line1": "Uppdaterar..." + }, + "tr-tr": { + "line1": "Güncelleniyor..." + }, + "zh-cn": { + "line1": "正在更新......" + }, + "zh-tw": { + "line1": "更新中..." + } + } + }, + "StatusUpToDate": { + "languages": { + "de-de": { + "line1": "Aktuelle Version" + }, + "en-au": { + "line1": "Up-to-date" + }, + "en-gb": { + "line1": "Up-to-date", + "textBody": "Up-to-date" + }, + "en-ie": { + "line1": "Up-to-date" + }, + "en-us": { + "line1": "Up-To-Date", + "textBody": "Up-To-Date" + }, + "es-en": { + "line1": "Actualizado", + "textBody": "Actualizado" + }, + "es-es": { + "line1": "Actualizada" + }, + "es-mx": { + "line1": "Actualizado", + "textBody": "Actualizado" + }, + "fr-ca": { + "line1": "Déjà à jour", + "textBody": "Déjà à jour" + }, + "fr-fr": { + "line1": "Déjà à jour" + }, + "it-it": { + "line1": "più recente" + }, + "nl-nl": { + "line1": "Up-to-date" + }, + "pl-pl": { + "line1": "Aktualne" + }, + "pt-br": { + "line1": "Atualizado" + }, + "pt-pt": { + "line1": "Actualizado" + }, + "ru-ru": { + "line1": "Обновлено" + }, + "sv-se": { + "line1": "Uppdat. krävs ej" + }, + "tr-tr": { + "line1": "Güncel" + }, + "zh-cn": { + "line1": "最新更新" + }, + "zh-tw": { + "line1": "更新最新" + } + } + }, + "VehicleInfo": { + "languages": { + "de-de": { + "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.", + "label": "Fahrzeuginformationen" + }, + "en-au": { + "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.", + "label": "Vehicle information" + }, + "en-gb": { + "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.", + "label": "Vehicle information", + "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure." + }, + "en-ie": { + "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.", + "label": "Vehicle information" + }, + "en-us": { + "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure.", + "label": "Vehicle information", + "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure." + }, + "es-en": { + "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.", + "label": "Información del vehículo", + "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos." + }, + "es-es": { + "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.", + "label": "Información del vehículo" + }, + "es-mx": { + "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.", + "label": "Información del vehículo", + "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos." + }, + "fr-ca": { + "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus.", + "label": "Renseignements du véhicule", + "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus." + }, + "fr-fr": { + "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.", + "label": "Renseignements du véhicule" + }, + "it-it": { + "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.", + "label": "Informazioni sul veicolo" + }, + "nl-nl": { + "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.", + "label": "Voertuiginformatie" + }, + "pl-pl": { + "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.", + "label": "Informacje o pojeździe" + }, + "pt-br": { + "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.", + "label": "Informações sobre o veículo" + }, + "pt-pt": { + "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.", + "label": "Informações do veículo" + }, + "ru-ru": { + "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.", + "label": "Информация об автомобиле" + }, + "sv-se": { + "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.", + "label": "Fordonsinformation" + }, + "tr-tr": { + "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.", + "label": "Araç bilgisi" + }, + "zh-cn": { + "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.", + "label": "车辆信息" + }, + "zh-tw": { + "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.", + "label": "車輛資訊" + } + } + } + } + }, + "app_policies": { + "default": { + "keep_context": false, + "steal_focus": false, + "priority": "NONE", + "default_hmi": "NONE", + "moduleType": ["RADIO", "CLIMATE"], + "groups": ["Base-4"], + "groups_primaryRC": ["Base-4", "RemoteControl"], + "groups_nonPrimaryRC": ["Notifications-RC", "RemoteControl"] + }, + "pre_consent_passengersRC": { + "keep_context": false, + "steal_focus": false, + "priority": "NONE", + "default_hmi":"NONE", + "groups": ["pre_BaseRC-1"] + }, + "device": { + "keep_context": false, + "steal_focus": false, + "priority": "NONE", + "default_hmi": "NONE", + "groups": ["DataConsent-2"] + }, + "pre_DataConsent": { + "keep_context": false, + "steal_focus": false, + "priority": "NONE", + "default_hmi": "NONE", + "groups": ["BaseBeforeDataConsent"] + } + } + } +} diff --git a/src/components/remote_control/src/commands/base_command_notification.cc b/src/components/remote_control/src/commands/base_command_notification.cc new file mode 100644 index 0000000000..c79e800a88 --- /dev/null +++ b/src/components/remote_control/src/commands/base_command_notification.cc @@ -0,0 +1,154 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/base_command_notification.h" +#include "json/json.h" +#include "remote_control/remote_control_plugin.h" +#include "remote_control/rc_module_constants.h" +#include "application_manager/application_manager.h" + +namespace remote_control { + +namespace commands { + +CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") + +BaseCommandNotification::BaseCommandNotification( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module) + : Command(rc_module), service_(rc_module_.service()), message_(message) { + Json::Value value; + Json::Reader reader; + reader.parse(message_->json_message(), value); + if (value.isMember(json_keys::kParams)) { + Json::FastWriter writer; + message_->set_json_message(writer.write(value[json_keys::kParams])); + } else { + message_->set_json_message(""); + } +} + +BaseCommandNotification::~BaseCommandNotification() {} + +RCAppExtensionPtr BaseCommandNotification::GetAppExtension( + application_manager::ApplicationSharedPtr app) const { + if (!app) { + return NULL; + } + + functional_modules::ModuleID id = rc_module_.GetModuleID(); + + RCAppExtensionPtr rc_app_extension; + application_manager::AppExtensionPtr app_extension = app->QueryInterface(id); + if (!app_extension) { + return NULL; + } + + rc_app_extension = + application_manager::AppExtensionPtr::static_pointer_cast( + app_extension); + + return rc_app_extension; +} + +void BaseCommandNotification::Run() { + LOG4CXX_AUTO_TRACE(logger_); + Execute(); +} + +void BaseCommandNotification::NotifyApplications() { + LOG4CXX_AUTO_TRACE(logger_); + typedef std::vector AppList; + AppList applications = service_->GetApplications(rc_module_.GetModuleID()); + for (AppList::iterator i = applications.begin(); i != applications.end(); + ++i) { + application_manager::MessagePtr message( + new application_manager::Message(*message_)); + message->set_connection_key((*i)->app_id()); + NotifyOneApplication(message); + } +} + +void BaseCommandNotification::NotifyOneApplication( + application_manager::MessagePtr message) { + LOG4CXX_AUTO_TRACE(logger_); + if (CheckPolicy(message)) { + service_->SendMessageToMobile(message); + } else { + LOG4CXX_WARN(logger_, + "Function \"" << message->function_name() << "\" (#" + << message->function_id() + << ") not allowed by policy"); + } +} + +bool BaseCommandNotification::CheckPolicy( + application_manager::MessagePtr message) { + LOG4CXX_AUTO_TRACE(logger_); + application_manager::ApplicationSharedPtr app = + service_->GetApplication(message->connection_key()); + + if (!app) { + LOG4CXX_WARN(logger_, + "Application " << message->connection_key() + << "isn't registered"); + return false; + } + + mobile_apis::Result::eType permission = + service_->CheckPolicyPermissions(message); + + Json::Value value; + Json::Reader reader; + LOG4CXX_DEBUG(logger_, "Notification: " << message->json_message()); + reader.parse(message->json_message(), value); + + return permission == mobile_apis::Result::eType::SUCCESS && + service_->CheckModule(app->app_id(), ModuleType(value)); +} + +std::string BaseCommandNotification::ModuleType(const Json::Value& message) { + return ""; +} + +bool BaseCommandNotification::Validate() { + return true; +} + +std::vector BaseCommandNotification::ControlData( + const Json::Value& message) { + return std::vector(); +} + +} // namespace commands + +} // namespace remote_control diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc new file mode 100644 index 0000000000..900d94a190 --- /dev/null +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -0,0 +1,647 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/base_command_request.h" +#include +#include "utils/make_shared.h" +#include "remote_control/event_engine/event_dispatcher.h" +#include "remote_control/message_helper.h" +#include "remote_control/remote_control_plugin.h" +#include "remote_control/rc_module_constants.h" +#include "application_manager/application_manager_impl.h" + +namespace remote_control { + +namespace commands { + +using rc_event_engine::EventDispatcher; + +using namespace json_keys; + +CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") + +BaseCommandRequest::BaseCommandRequest( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module) + : Command(rc_module), message_(message), auto_allowed_(false) { + service_ = rc_module_.service(); + app_ = service_->GetApplication(message_->connection_key()); +} + +BaseCommandRequest::~BaseCommandRequest() { + rc_module_.event_dispatcher().remove_observer(this); +} + +void BaseCommandRequest::OnTimeout() { + LOG4CXX_AUTO_TRACE(logger_); + PrepareResponse( + false, result_codes::kGenericError, "Request timeout expired."); + rc_module_.SendTimeoutResponseToMobile(message_); +} + +void BaseCommandRequest::PrepareResponse(const bool success, + const char* result_code, + const std::string& info) { + message_->set_message_type(application_manager::MessageType::kResponse); + Json::Value msg_params; + + if (!response_params_.isNull()) { + msg_params = response_params_; + } + + msg_params[kSuccess] = success; + msg_params[kResultCode] = result_code; + if (!info.empty()) { + msg_params[kInfo] = info; + } + + Json::FastWriter writer; + std::string params = writer.write(msg_params); + message_->set_json_message(params); +} + +void BaseCommandRequest::SendResponse(const bool success, + const char* result_code, + const std::string& info) { + LOG4CXX_AUTO_TRACE(logger_); + PrepareResponse(success, result_code, info); + rc_module_.SendResponseToMobile(message_); +} + +struct OnDriverAnswerCallback : AskDriverCallBack { + public: + OnDriverAnswerCallback(application_manager::MessagePtr hmi_message_to_send, + ResourceAllocationManager& resource_manager, + BaseCommandRequest& request, + application_manager::Service& service, + const std::string& module_type, + uint32_t app_id) + : hmi_message_to_send_(hmi_message_to_send) + , resource_manager_(resource_manager) + , request_(request) + , service_(service) + , module_type_(module_type) + , app_id_(app_id) {} + + void on_event(const rc_event_engine::Event& event) FINAL { + LOG4CXX_AUTO_TRACE(logger_); + application_manager::Message& hmi_response = *(event.event_message()); + const application_manager::MessageValidationResult validate_result = + service_.ValidateMessageBySchema(hmi_response); + LOG4CXX_DEBUG(logger_, + "HMI response validation result is " << validate_result); + if (validate_result != + application_manager::MessageValidationResult::SUCCESS) { + request_.SendResponse(false, + result_codes::kGenericError, + "HMI has sent invalid parameters"); + return; + } + + const Json::Value value = + MessageHelper::StringToValue(hmi_response.json_message()); + + std::string result_code; + std::string info; + const bool is_response_successful = + request_.ParseResultCode(value, result_code, info); + + if (result_codes::kTimedOut == result_code) { + info = "The resource is in use and the driver did not respond in time"; + } + + if (!is_response_successful) { + request_.SendResponse(false, result_code.c_str(), info); + return; + } + + const bool allowed = + value[json_keys::kResult][message_params::kAllowed].asBool(); + + if (allowed) { + request_.rc_module_.event_dispatcher().add_observer( + hmi_message_to_send_->function_name(), + hmi_message_to_send_->correlation_id(), + &request_); + LOG4CXX_DEBUG(logger_, + "HMI Request:\n " << hmi_message_to_send_->json_message()); + + resource_manager_.ForceAcquireResource(module_type_, app_id_); + request_.SetResourceState( + MessageHelper::StringToValue(request_.message_->json_message()), + ResourceState::BUSY); + + service_.SendMessageToHMI(hmi_message_to_send_); + } else { + request_.SendResponse(false, + result_codes::kRejected, + "The resource is in use and the driver disallows " + "this remote control RPC"); + resource_manager_.OnDriverDisallowed(module_type_, app_id_); + } + } + + application_manager::MessagePtr hmi_message_to_send_; + ResourceAllocationManager& resource_manager_; + BaseCommandRequest& request_; + application_manager::Service& service_; + const std::string module_type_; + const uint32_t app_id_; +}; + +void BaseCommandRequest::SendMessageToHMI( + const application_manager::MessagePtr& message_to_send) { + LOG4CXX_AUTO_TRACE(logger_); + const Json::Value message_params = + MessageHelper::StringToValue(message_->json_message()); + + if (!IsResourceFree(ModuleType(message_params))) { + LOG4CXX_WARN(logger_, "Resource is busy."); + SendResponse(false, result_codes::kInUse, ""); + return; + } + + AcquireResult::eType acquire_result = AcquireResource(message_params); + switch (acquire_result) { + case AcquireResult::ALLOWED: { + SetResourceState(MessageHelper::StringToValue(message_->json_message()), + ResourceState::BUSY); + + rc_module_.event_dispatcher().add_observer( + message_to_send->function_name(), + message_to_send->correlation_id(), + this); + LOG4CXX_DEBUG(logger_, + "HMI Request:\n " << message_to_send->json_message()); + service_->SendMessageToHMI(message_to_send); + break; + } + case AcquireResult::IN_USE: { + SendResponse(false, result_codes::kInUse, ""); + break; + } + case AcquireResult::ASK_DRIVER: { + ResourceAllocationManager& resource_manager = + rc_module_.resource_allocation_manager(); + AskDriverCallBackPtr callback( + new OnDriverAnswerCallback(message_to_send, + resource_manager, + *this, + *service(), + ModuleType(message_params), + app()->app_id())); + resource_manager.AskDriver( + ModuleType(message_params), app()->hmi_app_id(), callback); + break; + } + case AcquireResult::REJECTED: { + SendResponse(false, result_codes::kRejected, ""); + break; + } + } +} + +void BaseCommandRequest::SendRequest(const char* function_id, + const Json::Value& message_params) { + LOG4CXX_AUTO_TRACE(logger_); + application_manager::MessagePtr message_to_send = + CreateHmiRequest(function_id, message_params); + SendMessageToHMI(message_to_send); +} + +application_manager::MessagePtr BaseCommandRequest::CreateHmiRequest( + const char* function_id, const Json::Value& message_params) { + LOG4CXX_AUTO_TRACE(logger_); + const uint32_t hmi_app_id = app_->hmi_app_id(); + return MessageHelper::CreateHmiRequest( + function_id, hmi_app_id, message_params, rc_module_); +} + +bool BaseCommandRequest::Validate() { + return application_manager::MessageValidationResult::SUCCESS == + service_->ValidateMessageBySchema(*message_); +} + +bool BaseCommandRequest::ParseJsonString(Json::Value* parsed_msg) { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK(parsed_msg); + if (!parsed_msg) + return false; + + (*parsed_msg) = MessageHelper::StringToValue(message_->json_message()); + if (Json::ValueType::nullValue == parsed_msg->type()) { + LOG4CXX_ERROR(logger_, + "Invalid JSON received in " << message_->json_message()); + SendResponse( + false, result_codes::kInvalidData, "Mobile request validation failed!"); + return false; + } + return true; +} + +const char* BaseCommandRequest::GetMobileResultCode( + const hmi_apis::Common_Result::eType& hmi_code) const { + LOG4CXX_AUTO_TRACE(logger_); + switch (hmi_code) { + case hmi_apis::Common_Result::SUCCESS: { + return result_codes::kSuccess; + } + case hmi_apis::Common_Result::UNSUPPORTED_REQUEST: { + return result_codes::kUnsupportedRequest; + } + case hmi_apis::Common_Result::UNSUPPORTED_RESOURCE: { + return result_codes::kUnsupportedResource; + } + case hmi_apis::Common_Result::DISALLOWED: { + return result_codes::kDisallowed; + } + case hmi_apis::Common_Result::REJECTED: { + return result_codes::kRejected; + } + case hmi_apis::Common_Result::ABORTED: { + return result_codes::kAborted; + } + case hmi_apis::Common_Result::IGNORED: { + return result_codes::kIgnored; + } + case hmi_apis::Common_Result::RETRY: { + return result_codes::kRetry; + } + case hmi_apis::Common_Result::IN_USE: { + return result_codes::kInUse; + } + case hmi_apis::Common_Result::DATA_NOT_AVAILABLE: { + return result_codes::kVehicleDataNotAvailable; + } + case hmi_apis::Common_Result::TIMED_OUT: { + return result_codes::kTimedOut; + } + case hmi_apis::Common_Result::INVALID_DATA: { + return result_codes::kInvalidData; + } + case hmi_apis::Common_Result::CHAR_LIMIT_EXCEEDED: { + return result_codes::kCharLimitExceeded; + } + case hmi_apis::Common_Result::INVALID_ID: { + return result_codes::kInvalidId; + } + case hmi_apis::Common_Result::DUPLICATE_NAME: { + return result_codes::kDuplicateName; + } + case hmi_apis::Common_Result::APPLICATION_NOT_REGISTERED: { + return result_codes::kApplicationNotRegistered; + } + case hmi_apis::Common_Result::WRONG_LANGUAGE: { + return result_codes::kWrongLanguage; + } + case hmi_apis::Common_Result::OUT_OF_MEMORY: { + return result_codes::kOutOfMemory; + } + case hmi_apis::Common_Result::TOO_MANY_PENDING_REQUESTS: { + return result_codes::kTooManyPendingRequests; + } + case hmi_apis::Common_Result::NO_APPS_REGISTERED: { + return result_codes::kApplicationNotRegistered; + } + case hmi_apis::Common_Result::NO_DEVICES_CONNECTED: { + return result_codes::kApplicationNotRegistered; + } + case hmi_apis::Common_Result::WARNINGS: { + return result_codes::kWarnings; + } + case hmi_apis::Common_Result::GENERIC_ERROR: { + return result_codes::kGenericError; + } + case hmi_apis::Common_Result::USER_DISALLOWED: { + return result_codes::kUserDisallowed; + } + case hmi_apis::Common_Result::READ_ONLY: { + return result_codes::kReadOnly; + } + default: { + LOG4CXX_ERROR(logger_, "Unknown HMI result code " << hmi_code); + return result_codes::kGenericError; + } + } +} + +RCAppExtensionPtr BaseCommandRequest::GetAppExtension( + application_manager::ApplicationSharedPtr app) const { + LOG4CXX_AUTO_TRACE(logger_); + if (!app) { + return NULL; + } + + functional_modules::ModuleID id = rc_module_.GetModuleID(); + + RCAppExtensionPtr rc_app_extension; + application_manager::AppExtensionPtr app_extension = app->QueryInterface(id); + if (!app_extension) { + LOG4CXX_DEBUG(logger_, "New app extension will be created"); + app_extension = new RCAppExtension(id); + app->AddExtension(app_extension); + } + + rc_app_extension = + application_manager::AppExtensionPtr::static_pointer_cast( + app_extension); + + return rc_app_extension; +} + +bool BaseCommandRequest::ParseResultCode(const Json::Value& value, + std::string& result_code, + std::string& info) { + LOG4CXX_AUTO_TRACE(logger_); + result_code = result_codes::kInvalidData; + info = ""; + + if (IsMember(value, kResult) && IsMember(value[kResult], kCode)) { + result_code = + GetMobileResultCode(static_cast( + value[kResult][kCode].asInt())); + } else if (IsMember(value, kError) && IsMember(value[kError], kCode)) { + result_code = + GetMobileResultCode(static_cast( + value[kError][kCode].asInt())); + + if (IsMember(value[kError], kMessage)) { + info = value[kError][kMessage].asCString(); + } + } + + if ((result_codes::kSuccess == result_code) || + (result_codes::kWarnings == result_code)) { + return true; + } + + return false; +} + +void BaseCommandRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + if (Validate()) { + LOG4CXX_INFO(logger_, "Request message validated successfully!"); + if (CheckPolicyPermissions() && CheckDriverConsent()) { + Execute(); // run child's logic + } + } else { + SendResponse(false, result_codes::kInvalidData, ""); + } +} + +bool BaseCommandRequest::CheckPolicyPermissions() { + LOG4CXX_AUTO_TRACE(logger_); + if (!app_) { + LOG4CXX_ERROR(logger_, "Application doesn't registered!"); + SendResponse(false, result_codes::kApplicationNotRegistered, ""); + return false; + } + + mobile_apis::Result::eType ret = service_->CheckPolicyPermissions(message_); + if (ret != mobile_apis::Result::eType::SUCCESS) { + SendResponse(false, result_codes::kDisallowed, ""); + LOG4CXX_WARN(logger_, + "Function \"" << message_->function_name() << "\" (#" + << message_->function_id() + << ") not allowed by policy"); + return false; + } + + return true; +} + +application_manager::TypeAccess BaseCommandRequest::CheckAccess( + const Json::Value& message) { + const std::string& module = ModuleType(message); + return service_->CheckAccess( + app_->app_id(), module, message_->function_name(), ControlData(message)); +} + +bool BaseCommandRequest::CheckDriverConsent() { + LOG4CXX_AUTO_TRACE(logger_); + RCAppExtensionPtr extension = GetAppExtension(app_); + if (!extension) { + return false; + } + Json::Value value; + Json::Reader reader; + LOG4CXX_DEBUG(logger_, "Request: " << message_->json_message()); + reader.parse(message_->json_message(), value); + + application_manager::TypeAccess access = CheckAccess(value); + + if (IsAutoAllowed(access)) { + set_auto_allowed(true); + return true; + } + if (IsNeededDriverConsent(access)) { + SendGetUserConsent(value); + } else { + SendDisallowed(access); + } + return false; +} + +bool BaseCommandRequest::IsNeededDriverConsent( + application_manager::TypeAccess access) const { + return access == application_manager::kManual; +} + +bool BaseCommandRequest::IsAutoAllowed( + application_manager::TypeAccess access) const { + return access == application_manager::kAllowed; +} + +void BaseCommandRequest::SendDisallowed( + application_manager::TypeAccess access) { + LOG4CXX_AUTO_TRACE(logger_); + std::string info; + switch (access) { + case application_manager::kAllowed: + case application_manager::kManual: + return; + case application_manager::kDisallowed: + info = disallowed_info_.empty() + ? "The RPC is disallowed by vehicle settings" + : disallowed_info_; + break; + case application_manager::kNone: + info = "Internal issue"; + break; + default: + info = "Unknown issue"; + } + LOG4CXX_ERROR(logger_, info); + SendResponse(false, result_codes::kDisallowed, info); +} + +void BaseCommandRequest::SendGetUserConsent(const Json::Value& value) { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK(app_); + Json::Value params; + params[json_keys::kAppId] = app_->hmi_app_id(); + params[message_params::kModuleType] = ModuleType(value); + SendRequest(functional_modules::hmi_api::get_user_consent, params); +} + +std::string BaseCommandRequest::ModuleType(const Json::Value& message) { + return ""; +} + +std::vector BaseCommandRequest::ControlData( + const Json::Value& message) { + return std::vector(); +} + +void BaseCommandRequest::on_event( + const rc_event_engine::Event& + event) { + LOG4CXX_AUTO_TRACE(logger_); + if (event.id() == functional_modules::hmi_api::get_user_consent) { + ProcessAccessResponse(event); + } else { + if (auto_allowed()) { + UpdateHMILevel(event); + } + SetResourceState(MessageHelper::StringToValue(message_->json_message()), + ResourceState::FREE); + OnEvent(event); // run child's logic + } +} + +void BaseCommandRequest::UpdateHMILevel( + const rc_event_engine::Event& + event) { + LOG4CXX_AUTO_TRACE(logger_); + RCAppExtensionPtr extension = GetAppExtension(app_); + if (!extension) { + return; + } + if (!extension->is_on_driver_device()) { + Json::Value value = + MessageHelper::StringToValue(event.event_message()->json_message()); + std::string result_code; + std::string info; + bool success = ParseResultCode(value, result_code, info); + CheckHMILevel(application_manager::kAllowed, success); + } +} + +void BaseCommandRequest::ProcessAccessResponse( + const rc_event_engine::Event& + event) { + LOG4CXX_AUTO_TRACE(logger_); + if (!app_) { + LOG4CXX_ERROR(logger_, "Application doesn't registered!"); + SendResponse(false, result_codes::kApplicationNotRegistered, ""); + return; + } + Json::Value value; + Json::Reader reader; + reader.parse(event.event_message()->json_message(), value); + + std::string result_code; + std::string info; + bool allowed = ParseResultCode(value, result_code, info); + // Check if valid successfull message has arrived + if (allowed) { + if (IsMember(value[kResult], message_params::kAllowed) && + value[kResult][message_params::kAllowed].isBool()) { + allowed = value[kResult][message_params::kAllowed].asBool(); + } else { + allowed = false; + } + } + + // Check the actual User's answer. + if (allowed) { + Json::Value request; + reader.parse(message_->json_message(), request); + std::string module = ModuleType(request); + LOG4CXX_DEBUG(logger_, + "Setting allowed access for " << app_->app_id() << " for " + << module); + service_->SetAccess(app_->app_id(), module, allowed); + CheckHMILevel(application_manager::kManual, allowed); + Execute(); // run child's logic + } else { + SendResponse(false, + result_codes::kRejected, + "The resource is in use and the driver disallows this remote " + "control RPC"); + } +} + +void BaseCommandRequest::CheckHMILevel(application_manager::TypeAccess access, + bool user_consented) { + LOG4CXX_AUTO_TRACE(logger_); + switch (access) { + case application_manager::kAllowed: + if (user_consented) { + if (app_->hmi_level() == mobile_apis::HMILevel::eType::HMI_NONE) { + LOG4CXX_DEBUG(logger_, + "RSDL functionality for " + << app_->name().c_str() + << " is auto allowed; setting BACKGROUND level."); + service_->ChangeNotifyHMILevel( + app_, mobile_apis::HMILevel::eType::HMI_BACKGROUND); + } + } + break; + case application_manager::kManual: { + if (user_consented) { + if (app_->hmi_level() == mobile_apis::HMILevel::eType::HMI_NONE || + app_->hmi_level() == mobile_apis::HMILevel::eType::HMI_BACKGROUND) { + LOG4CXX_DEBUG(logger_, + "User consented RSDL functionality for " + << app_->name().c_str() + << "; setting LIMITED level."); + service_->ChangeNotifyHMILevel( + app_, mobile_apis::HMILevel::eType::HMI_LIMITED); + } + } + break; + } + case application_manager::kDisallowed: + case application_manager::kNone: + default: + LOG4CXX_DEBUG(logger_, + "No access information or disallowed: " + << "do nothing about hmi levels"); + break; + } +} + +} // namespace commands +} // namespace remote_control diff --git a/src/components/remote_control/src/commands/button_press_request.cc b/src/components/remote_control/src/commands/button_press_request.cc new file mode 100644 index 0000000000..5423504ad2 --- /dev/null +++ b/src/components/remote_control/src/commands/button_press_request.cc @@ -0,0 +1,156 @@ +/* + Copyright (c) 2017, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/button_press_request.h" +#include "remote_control/message_helper.h" +#include "remote_control/rc_module_constants.h" +#include "functional_module/function_ids.h" +#include "json/json.h" + +namespace remote_control { + +namespace commands { + +using namespace json_keys; +using namespace message_params; + +CREATE_LOGGERPTR_GLOBAL(logger_, "ButtonPressRequest") + +ButtonPressRequest::ButtonPressRequest( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module) + : BaseCommandRequest(message, rc_module) {} + +ButtonPressRequest::~ButtonPressRequest() {} + +const bool CheckButtonName(const std::string& module_type, + const std::string& button_name) { + if (enums_value::kRadio == module_type) { + return (button_name == enums_value::kVolumeUp) || + (button_name == enums_value::kVolumeDown) || + (button_name == enums_value::kEject) || + (button_name == enums_value::kSource) || + (button_name == enums_value::kShuffle) || + (button_name == enums_value::kRepeat); + } + + if (enums_value::kClimate == module_type) { + return (button_name == enums_value::kACMax) || + (button_name == enums_value::kAC) || + (button_name == enums_value::kRecirculate) || + (button_name == enums_value::kFanUp) || + (button_name == enums_value::kFanDown) || + (button_name == enums_value::kTempUp) || + (button_name == enums_value::kTempDown) || + (button_name == enums_value::kDefrostMax) || + (button_name == enums_value::kDefrost) || + (button_name == enums_value::kDefrostRear) || + (button_name == enums_value::kUpperVent) || + (button_name == enums_value::kLowerVent); + } + return false; +} + +void ButtonPressRequest::Execute() { + LOG4CXX_AUTO_TRACE(logger_); + + const Json::Value request_params = + MessageHelper::StringToValue(message_->json_message()); + + const std::string button_name = request_params[kButtonName].asString(); + const std::string module_type = request_params[kModuleType].asString(); + const bool button_name_matches_module_type = + CheckButtonName(module_type, button_name); + + if (button_name_matches_module_type) { + SendRequest(functional_modules::hmi_api::button_press, request_params); + } else { + LOG4CXX_WARN(logger_, "Request module type and button name mismatch!"); + SendResponse(false, + result_codes::kInvalidData, + "Request module type and button name mismatch!"); + } +} + +AcquireResult::eType ButtonPressRequest::AcquireResource( + const Json::Value& message) { + ResourceAllocationManager& allocation_manager = + rc_module_.resource_allocation_manager(); + const std::string& module_type = ModuleType(message); + const uint32_t app_id = app()->app_id(); + return allocation_manager.AcquireResource(module_type, app_id); +} + +bool ButtonPressRequest::IsResourceFree(const std::string& module_type) const { + return rc_module_.resource_allocation_manager().IsResourceFree(module_type); +} + +void ButtonPressRequest::SetResourceState(const Json::Value& message, + const ResourceState::eType state) { + const std::string& module_type = ModuleType(message); + const uint32_t app_id = app()->app_id(); + + ResourceAllocationManager& allocation_manager = + rc_module_.resource_allocation_manager(); + allocation_manager.SetResourceState(module_type, app_id, state); +} + +void ButtonPressRequest::OnEvent( + const rc_event_engine::Event& + event) { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK_OR_RETURN_VOID( + (functional_modules::hmi_api::button_press == event.id())); + + application_manager::Message& hmi_response = *(event.event_message()); + const Json::Value value = + MessageHelper::StringToValue(hmi_response.json_message()); + + std::string result_code; + std::string info; + + bool is_response_successful = ParseResultCode(value, result_code, info); + + if (remote_control::result_codes::kReadOnly == result_code) { + is_response_successful = false; + result_code = result_codes::kGenericError; + } + SendResponse(is_response_successful, result_code.c_str(), info); +} + +std::string ButtonPressRequest::ModuleType(const Json::Value& message) { + return message.get(message_params::kModuleType, Json::Value("")).asString(); +} + +} // namespace commands + +} // namespace remote_control diff --git a/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc new file mode 100644 index 0000000000..cfd08b47f6 --- /dev/null +++ b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc @@ -0,0 +1,191 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include + +#include "remote_control/commands/get_interior_vehicle_data_request.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "remote_control/remote_control_plugin.h" +#include "functional_module/function_ids.h" +#include "json/json.h" + +namespace remote_control { + +namespace commands { + +using namespace enums_value; +using namespace json_keys; +using namespace message_params; + +CREATE_LOGGERPTR_GLOBAL(logger_, "GetInteriorVehicleDataRequest") + +GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module) + : BaseCommandRequest(message, rc_module) {} + +void GetInteriorVehicleDataRequest::Execute() { + LOG4CXX_AUTO_TRACE(logger_); + Json::Value request_params = + MessageHelper::StringToValue(message_->json_message()); + + if (HasRequestExcessiveSubscription(request_params)) { + RemoveExcessiveSubscription(request_params); + } + + SendRequest(functional_modules::hmi_api::get_interior_vehicle_data, + request_params); +} + +void GetInteriorVehicleDataRequest::OnEvent( + const rc_event_engine::Event& + event) { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK_OR_RETURN_VOID( + (functional_modules::hmi_api::get_interior_vehicle_data == event.id())); + + application_manager::Message& hmi_response = *(event.event_message()); + const bool validate_result = + application_manager::MessageValidationResult::SUCCESS == + service()->ValidateMessageBySchema(hmi_response); + LOG4CXX_DEBUG(logger_, + "HMI response validation result is " << validate_result); + const Json::Value value = + MessageHelper::StringToValue(hmi_response.json_message()); + std::string result_code; + std::string info; + bool success = validate_result && ParseResultCode(value, result_code, info); + + if (!validate_result || + remote_control::result_codes::kReadOnly == result_code) { + success = false; + result_code = result_codes::kGenericError; + } + + if (success) { + ProccessSubscription(value); + response_params_[kModuleData] = value[kResult][kModuleData]; + } + SendResponse(success, result_code.c_str(), info); +} + +void GetInteriorVehicleDataRequest::ProccessSubscription( + const Json::Value& hmi_response) { + LOG4CXX_AUTO_TRACE(logger_); + Json::Value request_params; + Json::Reader reader; + reader.parse(message_->json_message(), request_params); + + const bool is_subscribe_present_in_request = + IsMember(request_params, kSubscribe); + const bool isSubscribed_present_in_response = + IsMember(hmi_response[kResult], kIsSubscribed); + + if (!is_subscribe_present_in_request && !isSubscribed_present_in_response) { + return; + } + + RCAppExtensionPtr extension = GetAppExtension(app()); + if (is_subscribe_present_in_request && !isSubscribed_present_in_response) { + LOG4CXX_WARN(logger_, + "conditional mandatory parameter " + << kIsSubscribed << " missed in hmi response"); + response_params_[kIsSubscribed] = + extension->IsSubscibedToInteriorVehicleData( + request_params[kModuleType]); + return; + } + + if (!is_subscribe_present_in_request && isSubscribed_present_in_response) { + LOG4CXX_WARN(logger_, + "Parameter " << kIsSubscribed << " is ignored due to absence '" + << kSubscribe << "' parameter in request"); + return; + } + + const bool request_subscribe = request_params[kSubscribe].asBool(); + const bool response_subscribe = hmi_response[kResult][kIsSubscribed].asBool(); + response_params_[kIsSubscribed] = response_subscribe; + LOG4CXX_TRACE(logger_, "request_subscribe = " << request_subscribe); + LOG4CXX_TRACE(logger_, "response_subscribe = " << response_subscribe); + if (request_subscribe == response_subscribe) { + if (response_subscribe) { + LOG4CXX_DEBUG(logger_, + "SubscribeToInteriorVehicleData " + << app()->app_id() << " " + << request_params[kModuleType].asString()); + extension->SubscribeToInteriorVehicleData(request_params[kModuleType]); + } else { + LOG4CXX_DEBUG(logger_, + "UnsubscribeFromInteriorVehicleData " + << app()->app_id() << " " + << request_params[kModuleType].asString()); + extension->UnsubscribeFromInteriorVehicleData( + request_params[kModuleType]); + } + } +} + +bool GetInteriorVehicleDataRequest::HasRequestExcessiveSubscription( + const Json::Value& request_params) { + LOG4CXX_AUTO_TRACE(logger_); + const bool is_subscribe_present_in_request = + IsMember(request_params, kSubscribe); + if (is_subscribe_present_in_request) { + RCAppExtensionPtr extension = GetAppExtension(app()); + const bool is_app_already_subscribed = + extension->IsSubscibedToInteriorVehicleData( + request_params[kModuleType]); + const bool app_wants_to_subscribe = request_params[kSubscribe].asBool(); + if (!app_wants_to_subscribe && !is_app_already_subscribed) { + return true; + } + return app_wants_to_subscribe && is_app_already_subscribed; + } + return false; +} + +void GetInteriorVehicleDataRequest::RemoveExcessiveSubscription( + Json::Value& request_params) { + LOG4CXX_AUTO_TRACE(logger_); + request_params.removeMember(kSubscribe); +} + +std::string GetInteriorVehicleDataRequest::ModuleType( + const Json::Value& message) { + return message.get(message_params::kModuleType, "").asString(); +} + +} // namespace commands + +} // namespace remote_control diff --git a/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc b/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc new file mode 100644 index 0000000000..79e8491a30 --- /dev/null +++ b/src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc @@ -0,0 +1,103 @@ +/* + Copyright (c) 2017, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/on_interior_vehicle_data_notification.h" +#include +#include +#include "json/json.h" +#include "utils/make_shared.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "remote_control/remote_control_plugin.h" +#include "remote_control/rc_app_extension.h" + +namespace remote_control { + +namespace commands { + +CREATE_LOGGERPTR_GLOBAL(logger_, "OnInteriorVehicleDataNotification") + +OnInteriorVehicleDataNotification::OnInteriorVehicleDataNotification( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module) + : BaseCommandNotification(message, rc_module) {} + +OnInteriorVehicleDataNotification::~OnInteriorVehicleDataNotification() {} + +void OnInteriorVehicleDataNotification::Execute() { + LOG4CXX_AUTO_TRACE(logger_); + + Json::Value json; + + application_manager::MessagePtr msg = message(); + + json = MessageHelper::StringToValue(msg->json_message()); + + Json::Value module_type = ModuleType(json); + + typedef std::vector AppPtrs; + AppPtrs apps = service_->GetApplications(rc_module_.GetModuleID()); + + for (AppPtrs::iterator it = apps.begin(); it != apps.end(); ++it) { + DCHECK(*it); + application_manager::Application& app = **it; + + RCAppExtensionPtr extension = + application_manager::AppExtensionPtr::static_pointer_cast< + RCAppExtension>(app.QueryInterface(rc_module_.GetModuleID())); + DCHECK(extension); + LOG4CXX_TRACE(logger_, "Check subscription for " << app.app_id()); + if (extension->IsSubscibedToInteriorVehicleData(module_type)) { + application_manager::MessagePtr message = + utils::MakeShared(*msg); + message->set_message_type( + application_manager::MessageType::kNotification); + message->set_protocol_version(application_manager::kV3); + message->set_function_id(functional_modules::ON_INTERIOR_VEHICLE_DATA); + message->set_function_name(MessageHelper::GetMobileAPIName( + functional_modules::ON_INTERIOR_VEHICLE_DATA)); + message->set_connection_key(app.app_id()); + NotifyOneApplication(message); + } + } +} + +std::string OnInteriorVehicleDataNotification::ModuleType( + const Json::Value& message) { + const Json::Value& module_data = + message.get(message_params::kModuleData, Json::Value(Json::objectValue)); + return module_data.get(message_params::kModuleType, "").asString(); +} + +} // namespace commands + +} // namespace remote_control diff --git a/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc new file mode 100644 index 0000000000..6f70d4e0f8 --- /dev/null +++ b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc @@ -0,0 +1,113 @@ +/* + Copyright (c) 2017, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/on_remote_control_settings_notification.h" +#include +#include +#include "json/json.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "remote_control/remote_control_plugin.h" +#include "remote_control/rc_app_extension.h" +#include "functional_module/function_ids.h" + +namespace remote_control { + +namespace commands { + +CREATE_LOGGERPTR_GLOBAL(logger_, "OnRemoteControlSettingsNotification"); + +OnRemoteControlSettingsNotification::OnRemoteControlSettingsNotification( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module) + : BaseCommandNotification(message, rc_module) {} + +void UnsubscribeFromInteriorVehicleDataForAllModules( + RCAppExtensionPtr extension) { + LOG4CXX_AUTO_TRACE(logger_); + const Json::Value climate(enums_value::kClimate); + extension->UnsubscribeFromInteriorVehicleData(climate); + const Json::Value radio(enums_value::kRadio); + extension->UnsubscribeFromInteriorVehicleData(radio); +} + +void OnRemoteControlSettingsNotification::DisallowRCFunctionality() { + LOG4CXX_AUTO_TRACE(logger_); + typedef std::vector Apps; + Apps apps = service_->GetApplications(rc_module_.GetModuleID()); + for (Apps::iterator it = apps.begin(); it != apps.end(); ++it) { + application_manager::ApplicationSharedPtr app = *it; + DCHECK(app); + service_->ChangeNotifyHMILevel(app, mobile_apis::HMILevel::eType::HMI_NONE); + + const RCAppExtensionPtr extension = + application_manager::AppExtensionPtr::static_pointer_cast< + RCAppExtension>(app->QueryInterface(rc_module_.GetModuleID())); + if (extension) { + UnsubscribeFromInteriorVehicleDataForAllModules(extension); + } + } +} + +void OnRemoteControlSettingsNotification::Execute() { + LOG4CXX_AUTO_TRACE(logger_); + const Json::Value value = + MessageHelper::StringToValue(message()->json_message()); + + if (!value.isMember(message_params::kAllowed)) { + LOG4CXX_DEBUG(logger_, + "Notification is ignored due to \"allow\" parameter absense"); + LOG4CXX_DEBUG(logger_, "RC Functionality remains unchanged"); + return; + } + const bool is_allowed = value[message_params::kAllowed].asBool(); + if (is_allowed) { + LOG4CXX_DEBUG(logger_, "Allowing RC Functionality"); + const std::string access_mode = + value.get(message_params::kAccessMode, enums_value::kAutoAllow) + .asString(); + + const hmi_apis::Common_RCAccessMode::eType access_mode_ = + MessageHelper::AccessModeFromString(access_mode); + ResourceAllocationManager& allocation_manager = + rc_module_.resource_allocation_manager(); + LOG4CXX_DEBUG(logger_, "Setting up access mode : " << access_mode); + allocation_manager.SetAccessMode(access_mode_); + } else { + LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality"); + DisallowRCFunctionality(); + } +} + +} // namespace commands + +} // namespace remote_control diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc new file mode 100644 index 0000000000..e2d25e719e --- /dev/null +++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc @@ -0,0 +1,248 @@ +/* + Copyright (c) 2017, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/set_interior_vehicle_data_request.h" +#include +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "functional_module/function_ids.h" +#include "json/json.h" +#include "utils/helpers.h" + +namespace remote_control { + +namespace commands { + +using namespace json_keys; +using namespace message_params; + +namespace { +std::vector GetModuleReadOnlyParams( + const std::string& module_type) { + std::vector module_ro_params; + if (enums_value::kClimate == module_type) { + module_ro_params.push_back(kCurrentTemperature); + } else if (enums_value::kRadio == module_type) { + module_ro_params.push_back(kRdsData); + module_ro_params.push_back(kAvailableHDs); + module_ro_params.push_back(kSignalStrength); + module_ro_params.push_back(kSignalChangeThreshold); + module_ro_params.push_back(kState); + } + return module_ro_params; +} + +} // namespace + +CREATE_LOGGERPTR_GLOBAL(logger_, "SetInteriorVehicleDataRequest") + +SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest( + const application_manager::MessagePtr& message, + RemotePluginInterface& rc_module) + : BaseCommandRequest(message, rc_module) {} + +SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {} + +void SetInteriorVehicleDataRequest::Execute() { + LOG4CXX_AUTO_TRACE(logger_); + + Json::Value request_params = + MessageHelper::StringToValue(message_->json_message()); + const Json::Value module_data = request_params[kModuleData]; + const std::string module_type = module_data[kModuleType].asString(); + bool module_type_and_data_match = true; + + if (enums_value::kRadio == module_type) { + module_type_and_data_match = !IsMember(module_data, kClimateControlData); + } + + if (enums_value::kClimate == module_type) { + module_type_and_data_match = !IsMember(module_data, kRadioControlData); + } + + if (module_type_and_data_match) { + if (AreAllParamsReadOnly(request_params)) { + LOG4CXX_WARN(logger_, "All request params in module type are READ ONLY!"); + SendResponse(false, + result_codes::kReadOnly, + "All request params in module type are READ ONLY!"); + return; + } + if (AreReadOnlyParamsPresent(request_params)) { + LOG4CXX_DEBUG(logger_, "Request module type has READ ONLY parameters"); + LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameters... "); + CutOffReadOnlyParams(request_params); + } + application_manager::MessagePtr hmi_request = CreateHmiRequest( + functional_modules::hmi_api::set_interior_vehicle_data, request_params); + service()->RemoveHMIFakeParameters(hmi_request); + SendMessageToHMI(hmi_request); + } else { + LOG4CXX_WARN(logger_, "Request module type & data mismatch!"); + SendResponse(false, + result_codes::kInvalidData, + "Request module type & data mismatch!"); + } +} + +AcquireResult::eType SetInteriorVehicleDataRequest::AcquireResource( + const Json::Value& message) { + return rc_module_.resource_allocation_manager().AcquireResource( + ModuleType(message), app()->app_id()); +} + +bool SetInteriorVehicleDataRequest::IsResourceFree( + const std::string& module_type) const { + return rc_module_.resource_allocation_manager().IsResourceFree(module_type); +} + +void SetInteriorVehicleDataRequest::SetResourceState( + const Json::Value& message, const ResourceState::eType state) { + const std::string& module_type = ModuleType(message); + const uint32_t app_id = app()->app_id(); + + ResourceAllocationManager& allocation_manager = + rc_module_.resource_allocation_manager(); + + allocation_manager.SetResourceState(module_type, app_id, state); +} + +bool SetInteriorVehicleDataRequest::AreReadOnlyParamsPresent( + const Json::Value& request_params) { + LOG4CXX_AUTO_TRACE(logger_); + std::vector module_type_params = ControlData(request_params); + std::vector::iterator it = module_type_params.begin(); + std::vector ro_params = + GetModuleReadOnlyParams(ModuleType(request_params)); + for (; it != module_type_params.end(); ++it) { + if (helpers::in_range(ro_params, *it)) { + return true; + } + } + return false; +} + +void SetInteriorVehicleDataRequest::CutOffReadOnlyParams( + Json::Value& request_params) { + LOG4CXX_AUTO_TRACE(logger_); + std::vector module_type_params = ControlData(request_params); + std::vector::iterator it = module_type_params.begin(); + const std::string module_type = ModuleType(request_params); + std::vector ro_params = GetModuleReadOnlyParams(module_type); + for (; it != module_type_params.end(); ++it) { + if (helpers::in_range(ro_params, *it)) { + if (enums_value::kClimate == module_type) { + request_params[message_params::kModuleData] + [message_params::kClimateControlData].removeMember(*it); + LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << *it); + } else if (enums_value::kRadio == module_type) { + request_params[message_params::kModuleData] + [message_params::kRadioControlData].removeMember(*it); + LOG4CXX_DEBUG(logger_, "Cutting-off READ ONLY parameter: " << *it); + } + } + } +} + +bool SetInteriorVehicleDataRequest::AreAllParamsReadOnly( + const Json::Value& request_params) { + LOG4CXX_AUTO_TRACE(logger_); + std::vector module_type_params = ControlData(request_params); + std::vector::iterator it = module_type_params.begin(); + std::vector ro_params = + GetModuleReadOnlyParams(ModuleType(request_params)); + for (; it != module_type_params.end(); ++it) { + if (!helpers::in_range(ro_params, *it)) { + return false; + } + } + return true; +} + +void SetInteriorVehicleDataRequest::OnEvent( + const rc_event_engine::Event& + event) { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK_OR_RETURN_VOID( + (functional_modules::hmi_api::set_interior_vehicle_data == event.id())); + + application_manager::Message& hmi_response = *(event.event_message()); + const bool validate_result = + application_manager::MessageValidationResult::SUCCESS == + service()->ValidateMessageBySchema(hmi_response); + LOG4CXX_DEBUG(logger_, + "HMI response validation result is " << validate_result); + const Json::Value value = + MessageHelper::StringToValue(hmi_response.json_message()); + + std::string result_code; + std::string info; + + const bool success = + validate_result && ParseResultCode(value, result_code, info); + + if (success) { + response_params_[kModuleData] = value[kResult][kModuleData]; + } else if (!validate_result) { + result_code = result_codes::kGenericError; + } + + SendResponse(success, result_code.c_str(), info); +} + +std::string SetInteriorVehicleDataRequest::ModuleType( + const Json::Value& message) { + const Json::Value& module_data = + message.get(message_params::kModuleData, Json::Value(Json::objectValue)); + return module_data.get(message_params::kModuleType, "").asString(); +} + +std::vector SetInteriorVehicleDataRequest::ControlData( + const Json::Value& message) { + Json::Value data = + message.get(message_params::kModuleData, Json::Value(Json::objectValue)); + const char* name_control_data; + std::string module = ModuleType(message); + if (module == enums_value::kRadio) { + name_control_data = message_params::kRadioControlData; + } + if (module == enums_value::kClimate) { + name_control_data = message_params::kClimateControlData; + } + Json::Value params = + data.get(name_control_data, Json::Value(Json::objectValue)); + return params.getMemberNames(); +} + +} // namespace commands + +} // namespace remote_control diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc new file mode 100644 index 0000000000..5bd786a0eb --- /dev/null +++ b/src/components/remote_control/src/message_helper.cc @@ -0,0 +1,157 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include +#include "remote_control/message_helper.h" +#include "remote_control/rc_module_constants.h" +#include "utils/make_shared.h" + +namespace remote_control { +using functional_modules::RCFunctionID; +namespace { +std::map GenerateAPINames() { + std::map result; + result.insert(std::make_pair( + RCFunctionID::BUTTON_PRESS, "ButtonPress")); + result.insert(std::make_pair( + RCFunctionID::GET_INTERIOR_VEHICLE_DATA, "GetInteriorVehicleData")); + result.insert(std::make_pair( + RCFunctionID::SET_INTERIOR_VEHICLE_DATA, "SetInteriorVehicleData")); + result.insert(std::make_pair( + RCFunctionID::ON_INTERIOR_VEHICLE_DATA, "OnInteriorVehicleData")); + result.insert(std::make_pair( + RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSettingd")); + return result; +} +} + +uint32_t MessageHelper::next_correlation_id_ = 1; +const std::map MessageHelper::kMobileAPINames = + GenerateAPINames(); + +uint32_t MessageHelper::GetNextRCCorrelationID() { + return next_correlation_id_++; +} + +const std::string MessageHelper::GetMobileAPIName(RCFunctionID func_id) { + std::map::const_iterator it = + kMobileAPINames.find(func_id); + if (kMobileAPINames.end() != it) { + return it->second; + } else { + return ""; + } +} + +std::string MessageHelper::ValueToString(const Json::Value& value) { + Json::FastWriter writer; + + return writer.write(value); +} + +Json::Value MessageHelper::StringToValue(const std::string& string) { + Json::Reader reader; + + Json::Value json; + + if (reader.parse(string, json)) { + return json; + } + + return Json::Value(Json::ValueType::nullValue); +} + +bool IsMember(const Json::Value& value, const std::string& key) { + if (!value.isObject()) { + return false; + } + + return value.isMember(key); +} + +// TODO(KKolodiy): after creating commands for notification from HMI +// this validate methods may move to commands +bool MessageHelper::ValidateDeviceInfo(const Json::Value& value) { + return value.isObject() && value.isMember(json_keys::kId) && + value.isMember(message_params::kName) && + value[message_params::kName].isString(); +} + +application_manager::MessagePtr MessageHelper::CreateHmiRequest( + const char* function_id, + const uint32_t hmi_app_id, + const Json::Value& message_params, + RemotePluginInterface& rc_module) { + using namespace json_keys; + Json::Value msg; + + msg[json_keys::kId] = rc_module.service()->GetNextCorrelationID(); + + msg[kJsonrpc] = "2.0"; + msg[kMethod] = function_id; + if (!message_params.isNull()) { + msg[kParams] = message_params; + } + + msg[kParams][json_keys::kAppId] = hmi_app_id; + + Json::FastWriter writer; + application_manager::MessagePtr message_to_send = + utils::MakeShared( + application_manager::Message( + protocol_handler::MessagePriority::kDefault)); + message_to_send->set_protocol_version( + application_manager::ProtocolVersion::kHMI); + message_to_send->set_correlation_id(msg[json_keys::kId].asInt()); + message_to_send->set_function_name(msg[kMethod].asString()); + std::string json_msg = writer.write(msg); + message_to_send->set_json_message(json_msg); + message_to_send->set_message_type(application_manager::MessageType::kRequest); + + return message_to_send; +} + +hmi_apis::Common_RCAccessMode::eType MessageHelper::AccessModeFromString( + const std::string& access_mode) { + if (enums_value::kAutoAllow == access_mode) { + return hmi_apis::Common_RCAccessMode::AUTO_ALLOW; + } + if (enums_value::kAutoDeny == access_mode) { + return hmi_apis::Common_RCAccessMode::AUTO_DENY; + } + if (enums_value::kAskDriver == access_mode) { + return hmi_apis::Common_RCAccessMode::ASK_DRIVER; + } + return hmi_apis::Common_RCAccessMode::INVALID_ENUM; +} + +} // namespace remote_control diff --git a/src/components/remote_control/src/module_helper.cc b/src/components/remote_control/src/module_helper.cc new file mode 100644 index 0000000000..8a7f565691 --- /dev/null +++ b/src/components/remote_control/src/module_helper.cc @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/module_helper.h" +#include "remote_control/remote_control_plugin.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/rc_app_extension.h" +#include "application_manager/message.h" +#include "remote_control/message_helper.h" + +namespace remote_control { + +using functional_modules::ProcessResult; +using application_manager::AppExtensionPtr; + +application_manager::MessagePtr ModuleHelper::ResponseToHMI( + unsigned int id, + hmi_apis::Common_Result::eType result_code, + const std::string& method_name) { + Json::Value msg; + msg[json_keys::kId] = id; + msg[json_keys::kJsonrpc] = "2.0"; + + if (hmi_apis::Common_Result::eType::SUCCESS == result_code) { + msg[json_keys::kResult] = Json::Value(Json::ValueType::objectValue); + msg[json_keys::kResult][json_keys::kCode] = result_code; + msg[json_keys::kResult][json_keys::kMethod] = method_name; + } else { + msg[json_keys::kError] = Json::Value(Json::ValueType::objectValue); + msg[json_keys::kError][json_keys::kCode] = result_code; + msg[json_keys::kError][json_keys::kData] = + Json::Value(Json::ValueType::objectValue); + msg[json_keys::kError][json_keys::kData][json_keys::kMethod] = method_name; + } + + application_manager::MessagePtr message(new application_manager::Message( + protocol_handler::MessagePriority::kDefault)); + message->set_protocol_version(application_manager::ProtocolVersion::kHMI); + message->set_correlation_id(msg[json_keys::kId].asInt()); + Json::FastWriter writer; + std::string json_msg = writer.write(msg); + message->set_json_message(json_msg); + message->set_message_type(application_manager::MessageType::kResponse); + return message; +} + +// (TODO)VS: Replace this functions for separate OnReverseAppsDisallowed +// notiifcation +void ModuleHelper::ProccessOnReverseAppsDisallowed( + RemotePluginInterface& rc_module) { + std::vector applications = + rc_module.service()->GetApplications(rc_module.GetModuleID()); + + for (uint32_t i = 0; i < applications.size(); ++i) { + application_manager::AppExtensionPtr app_extension = + applications[i]->QueryInterface(rc_module.GetModuleID()); + if (app_extension) { + RCAppExtensionPtr rc_app_extension = + application_manager::AppExtensionPtr::static_pointer_cast< + RCAppExtension>(app_extension); + if (!rc_app_extension->is_on_driver_device()) { + } + } + } +} + +} // namespace remote_control diff --git a/src/components/remote_control/src/policy_helper.cc b/src/components/remote_control/src/policy_helper.cc new file mode 100644 index 0000000000..5ef0b780fb --- /dev/null +++ b/src/components/remote_control/src/policy_helper.cc @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/policy_helper.h" +#include "remote_control/remote_control_plugin.h" +#include "remote_control/rc_app_extension.h" +#include "utils/logger.h" + +CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl") + +namespace remote_control { + +void PolicyHelper::OnRSDLFunctionalityAllowing( + bool allowed, RemotePluginInterface& rc_module) { + rc_module.service()->SetRemoteControl(allowed); +} + +void PolicyHelper::ChangeDeviceRank(const uint32_t device_handle, + const std::string& rank, + RemotePluginInterface& rc_module) { + if (rank == "DRIVER") { + rc_module.service()->SetPrimaryDevice(device_handle); + // MarkApplications(device_handle); + } else if (rank == "PASSENGER") { + if (rc_module.service()->PrimaryDevice() == device_handle) { + rc_module.service()->ResetPrimaryDevice(); + // MarkApplications(0); + } + } else { + LOG4CXX_WARN(logger_, "Unknown device rank"); + } +} + +void PolicyHelper::SetIsAppOnPrimaryDevice( + application_manager::ApplicationSharedPtr app, + RemotePluginInterface& rc_module) { + MarkAppOnPrimaryDevice(app, rc_module.service()->PrimaryDevice(), rc_module); +} + +void PolicyHelper::MarkAppOnPrimaryDevice( + application_manager::ApplicationSharedPtr app, + const uint32_t device_handle, + RemotePluginInterface& rc_module) { + application_manager::AppExtensionUID module_id = rc_module.GetModuleID(); + RCAppExtensionPtr extension = + application_manager::AppExtensionPtr::static_pointer_cast( + app->QueryInterface(module_id)); + DCHECK(extension); + bool is_driver = (app->device() == device_handle); + extension->set_is_on_driver_device(is_driver); +} + +void PolicyHelper::MarkApplications(const uint32_t device_handle, + RemotePluginInterface& rc_module) { + application_manager::AppExtensionUID module_id = rc_module.GetModuleID(); + std::vector applications = + rc_module.service()->GetApplications(module_id); + + for (size_t i = 0; i < applications.size(); ++i) { + MarkAppOnPrimaryDevice(applications[i], device_handle, rc_module); + } +} + +} // namespace remote_control diff --git a/src/components/remote_control/src/rc_app_extension.cc b/src/components/remote_control/src/rc_app_extension.cc new file mode 100644 index 0000000000..ded3a15775 --- /dev/null +++ b/src/components/remote_control/src/rc_app_extension.cc @@ -0,0 +1,68 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/rc_app_extension.h" + +namespace remote_control { +RCAppExtension::RCAppExtension(application_manager::AppExtensionUID uid) + : AppExtension(uid) + , is_control_given_(false) + , is_on_driver_device_(false) {} + +bool RCAppExtension::IsControlGiven() const { + return is_control_given_; +} + +void RCAppExtension::GiveControl(bool is_control_given) { + is_control_given_ = is_control_given; +} + +void RCAppExtension::SubscribeToInteriorVehicleData( + const Json::Value& module_type) { + subscribed_interior_vehicle_data_.insert(module_type); +} + +void RCAppExtension::UnsubscribeFromInteriorVehicleData( + const Json::Value& module_type) { + subscribed_interior_vehicle_data_.erase(module_type); +} + +bool RCAppExtension::IsSubscibedToInteriorVehicleData( + const Json::Value& module_type) { + std::set::iterator it = + subscribed_interior_vehicle_data_.find(module_type); + + return (it != subscribed_interior_vehicle_data_.end()); +} + +RCAppExtension::~RCAppExtension() {} +} // namespace remote_control diff --git a/src/components/remote_control/src/rc_command_factory.cc b/src/components/remote_control/src/rc_command_factory.cc new file mode 100644 index 0000000000..410b7eadfa --- /dev/null +++ b/src/components/remote_control/src/rc_command_factory.cc @@ -0,0 +1,86 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" +#include "remote_control/rc_command_factory.h" +#include "functional_module/function_ids.h" +#include "remote_control/commands/get_interior_vehicle_data_request.h" +#include "remote_control/commands/set_interior_vehicle_data_request.h" +#include "remote_control/commands/button_press_request.h" +#include "remote_control/commands/on_interior_vehicle_data_notification.h" +#include "remote_control/commands/on_remote_control_settings_notification.h" + +namespace remote_control { + +CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl") + +using functional_modules::RCFunctionID; + +utils::SharedPtr RCCommandFactory::CreateCommand( + const application_manager::MessagePtr& msg, + RemotePluginInterface& rc_module) { + switch (msg->function_id()) { + case RCFunctionID::GET_INTERIOR_VEHICLE_DATA: { + return utils::MakeShared( + msg, rc_module); + break; + } + case RCFunctionID::SET_INTERIOR_VEHICLE_DATA: { + return utils::MakeShared( + msg, rc_module); + break; + } + case RCFunctionID::BUTTON_PRESS: { + return utils::MakeShared(msg, rc_module); + break; + } + case RCFunctionID::ON_INTERIOR_VEHICLE_DATA: { + return utils::MakeShared( + msg, rc_module); + break; + } + case RCFunctionID::ON_REMOTE_CONTROL_SETTINGS: { + return utils::MakeShared( + msg, rc_module); + break; + } + default: { + utils::SharedPtr invalid_command; + LOG4CXX_DEBUG(logger_, + "RSDL unable to proces function " << msg->function_id()); + return invalid_command; + } + } +} + +} // namespace remote_control diff --git a/src/components/remote_control/src/remote_control_event.cc b/src/components/remote_control/src/remote_control_event.cc new file mode 100644 index 0000000000..ef8a2c4e6f --- /dev/null +++ b/src/components/remote_control/src/remote_control_event.cc @@ -0,0 +1,56 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/remote_control_event.h" + +namespace remote_control { + +RCPluginEvent::RCPluginEvent(application_manager::MessagePtr& message, + const std::string& id) + : rc_event_engine::Event( + message, id) {} + +RCPluginEvent::~RCPluginEvent() {} + +int32_t RCPluginEvent::event_message_function_id() const { + return event_message_->function_id(); +} + +int32_t RCPluginEvent::event_message_correlation_id() const { + return event_message_->correlation_id(); +} + +int32_t RCPluginEvent::event_message_type() const { + return event_message_->type(); +} + +} // namespace remote_control diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc new file mode 100644 index 0000000000..6d265d579b --- /dev/null +++ b/src/components/remote_control/src/remote_control_plugin.cc @@ -0,0 +1,369 @@ +/* + Copyright (c) 2013, Ford Motor Company + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 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. + + Neither the name of the Ford Motor Company nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/remote_control_plugin.h" +#include "remote_control/rc_command_factory.h" +#include "remote_control/remote_control_event.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/message_helper.h" +#include "remote_control/policy_helper.h" +#include "remote_control/module_helper.h" +#include "utils/logger.h" +#include "interfaces/MOBILE_API.h" +#include "utils/macro.h" +#include "utils/make_shared.h" +#include "application_manager/smart_object_keys.h" + +namespace remote_control { + +using functional_modules::ProcessResult; +using functional_modules::GenericModule; +using functional_modules::PluginInfo; +using functional_modules::RCFunctionID; +namespace hmi_api = functional_modules::hmi_api; + +using namespace json_keys; + +CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl"); + +EXPORT_FUNCTION_IMPL(remote_control::RemoteControlPlugin); + +RemoteControlPlugin::RemoteControlPlugin() + : is_scan_started_(false), resource_allocation_manager_(*this) { + plugin_info_.name = "RemoteControlPlugin"; + plugin_info_.version = 1; + SubscribeOnFunctions(); +} + +void RemoteControlPlugin::SubscribeOnFunctions() { + plugin_info_.rc_function_list.push_back(RCFunctionID::BUTTON_PRESS); + plugin_info_.rc_function_list.push_back( + RCFunctionID::GET_INTERIOR_VEHICLE_DATA); + plugin_info_.rc_function_list.push_back( + RCFunctionID::SET_INTERIOR_VEHICLE_DATA); + plugin_info_.rc_function_list.push_back( + RCFunctionID::ON_INTERIOR_VEHICLE_DATA); + + plugin_info_.hmi_function_list.push_back(hmi_api::get_interior_vehicle_data); + plugin_info_.hmi_function_list.push_back(hmi_api::set_interior_vehicle_data); + plugin_info_.hmi_function_list.push_back(hmi_api::on_interior_vehicle_data); + plugin_info_.hmi_function_list.push_back(hmi_api::button_press); + plugin_info_.hmi_function_list.push_back(hmi_api::get_user_consent); + plugin_info_.hmi_function_list.push_back(hmi_api::on_remote_control_settings); +} + +RemoteControlPlugin::~RemoteControlPlugin() { + RemoveAppExtensions(); +} + +functional_modules::PluginInfo RemoteControlPlugin::GetPluginInfo() const { + return plugin_info_; +} + +const std::string ExtractFunctionAndAddMetadata( + const Json::Value& value, application_manager::Message& out_msg) { + if (value.isMember(json_keys::kMethod)) { + const std::string& function_name = + value.get(json_keys::kMethod, "").asCString(); + + // Existence of method name must be guaranteed by plugin manager + DCHECK_OR_RETURN(!function_name.empty(), ""); + + if (value.isMember(json_keys::kId)) { + out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt()); + out_msg.set_message_type(application_manager::MessageType::kRequest); + } else { + out_msg.set_message_type(application_manager::MessageType::kNotification); + } + return function_name; + } + + if (value.isMember(json_keys::kResult)) { + const Json::Value& result = value.get(json_keys::kResult, Json::Value()); + const std::string& function_name = + result.get(json_keys::kMethod, "").asCString(); + out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt()); + + // Existence of method name must be guaranteed by plugin manager + DCHECK_OR_RETURN(!function_name.empty(), ""); + + out_msg.set_message_type(application_manager::MessageType::kResponse); + return function_name; + } + + if (value.isMember(json_keys::kError)) { + const Json::Value& error = value.get(json_keys::kError, Json::Value()); + const Json::Value& data = error.get(json_keys::kData, Json::Value()); + const std::string& function_name = + data.get(json_keys::kMethod, "").asCString(); + + // Existence of method name must be guaranteed by plugin manager + DCHECK_OR_RETURN(!function_name.empty(), ""); + + out_msg.set_message_type(application_manager::MessageType::kErrorResponse); + out_msg.set_correlation_id(value.get(json_keys::kId, "").asInt()); + return function_name; + } + return std::string(); +} + +ProcessResult RemoteControlPlugin::ProcessMessage( + application_manager::MessagePtr msg) { + DCHECK_OR_RETURN(msg, ProcessResult::FAILED); + + const std::string& function_name = MessageHelper::GetMobileAPIName( + static_cast(msg->function_id())); + + LOG4CXX_DEBUG(logger_, "Function name to set : " << function_name); + msg->set_function_name(function_name); + + LOG4CXX_DEBUG(logger_, "Mobile message: " << msg->json_message()); + + request_controller::MobileRequestPtr command( + RCCommandFactory::CreateCommand(msg, *this)); + if (command) { + request_controller_.AddRequest(msg->correlation_id(), command); + command->Run(); + } else { + return ProcessResult::CANNOT_PROCESS; + } + + return ProcessResult::PROCESSED; +} + +ProcessResult RemoteControlPlugin::ProcessHMIMessage( + application_manager::MessagePtr msg) { + LOG4CXX_AUTO_TRACE(logger_); + + Json::Value value; + Json::Reader reader; + reader.parse(msg->json_message(), value); + LOG4CXX_TRACE(logger_, "Process " << msg->json_message()); + const std::string& function_name = ExtractFunctionAndAddMetadata(value, *msg); + + // Existence of method name must be guaranteed by plugin manager + DCHECK_OR_RETURN(!function_name.empty(), ProcessResult::FAILED); + + LOG4CXX_DEBUG(logger_, "Process " << function_name); + + switch (msg->type()) { + case application_manager::MessageType::kResponse: + case application_manager::MessageType::kErrorResponse: { + RCPluginEvent event(msg, function_name); + LOG4CXX_DEBUG(logger_, "Response received"); + event_dispatcher_.raise_event(event); + return ProcessResult::PROCESSED; + } + case application_manager::MessageType::kRequest: + case application_manager::MessageType::kNotification: { + if (hmi_api::on_interior_vehicle_data == function_name) { + msg->set_function_id(functional_modules::ON_INTERIOR_VEHICLE_DATA); + } + if (hmi_api::on_remote_control_settings == function_name) { + msg->set_function_id(functional_modules::ON_REMOTE_CONTROL_SETTINGS); + } + const application_manager::MessageValidationResult validation_result = + service()->ValidateMessageBySchema(*msg); + utils::SharedPtr command = + RCCommandFactory::CreateCommand(msg, *this); + if ((validation_result == + application_manager::MessageValidationResult::SUCCESS) && + command) { + command->Run(); + return ProcessResult::PROCESSED; + } + LOG4CXX_DEBUG(logger_, "Message validation failed"); + break; + } + default: { LOG4CXX_DEBUG(logger_, "Unknown message type"); } + } + return ProcessResult::CANNOT_PROCESS; +} + +void RemoteControlPlugin::SendHmiStatusNotification( + application_manager::ApplicationSharedPtr app) { + LOG4CXX_AUTO_TRACE(logger_); + application_manager::MessagePtr msg = new application_manager::Message( + protocol_handler::MessagePriority::kDefault); + Json::Value msg_params; + + msg->set_function_id(mobile_apis::FunctionID::OnHMIStatusID); + msg->set_message_type(application_manager::MessageType::kNotification); + + msg->set_connection_key(app->app_id()); + msg->set_protocol_version(application_manager::kV3); + + msg_params["hmiLevel"] = static_cast(app->hmi_level()); + + msg_params["audioStreamingState"] = + static_cast(app->audio_streaming_state()); + + msg_params["systemContext"] = static_cast(app->system_context()); + + application_manager::AppExtensionPtr app_extension = + app->QueryInterface(GetModuleID()); + RCAppExtensionPtr rc_app_extension = + application_manager::AppExtensionPtr::static_pointer_cast( + app_extension); + + if (rc_app_extension->is_on_driver_device()) { + msg_params[message_params::kRank] = "DRIVER"; + } else { + msg_params[message_params::kRank] = "PASSENGER"; + } + + msg->set_json_message(MessageHelper::ValueToString(msg_params)); + + service()->SendMessageToMobile(msg); +} + +void RemoteControlPlugin::NotifyMobiles( + application_manager::MessagePtr message) { + LOG4CXX_AUTO_TRACE(logger_); + request_controller::MobileRequestPtr command = + RCCommandFactory::CreateCommand(message, *this); + if (command) { + command->Run(); + } +} + +void RemoteControlPlugin::SendResponseToMobile( + application_manager::MessagePtr msg) { + LOG4CXX_DEBUG(logger_, "Response to mobile: " << msg->json_message()); + service()->SendMessageToMobile(msg); + request_controller_.DeleteRequest(msg->correlation_id()); +} + +void RemoteControlPlugin::SendTimeoutResponseToMobile( + application_manager::MessagePtr msg) { + LOG4CXX_DEBUG( + logger_, + "Timeout is expired. Response to mobile: " << msg->json_message()); + service()->SendMessageToMobile(msg); +} + +void RemoteControlPlugin::RemoveAppExtensions() { + std::vector applications = + service()->GetApplications(GetModuleID()); + + std::vector::iterator it = + applications.begin(); + + for (; it != applications.end(); ++it) { + application_manager::ApplicationSharedPtr app = *it; + if (app) { + app->RemoveExtension(GetModuleID()); + } + } +} + +void RemoteControlPlugin::RemoveAppExtension(uint32_t app_id) { + application_manager::ApplicationSharedPtr app = + service()->GetApplication(app_id); + + if (app) { + app->RemoveExtension(GetModuleID()); + } +} + +bool RemoteControlPlugin::IsAppForPlugin( + application_manager::ApplicationSharedPtr app) { + LOG4CXX_AUTO_TRACE(logger_); + application_manager::AppExtensionPtr app_extension = + app->QueryInterface(GetModuleID()); + if (app_extension) { + return true; + } + + if (service()->IsRemoteControlApplication(app)) { + RCAppExtensionPtr rc_app_extension = new RCAppExtension(GetModuleID()); + app->AddExtension(rc_app_extension); + service()->NotifyHMIAboutHMILevel(app, app->hmi_level()); + service()->SetPrimaryDevice(app->device()); + PolicyHelper::SetIsAppOnPrimaryDevice(app, *this); + return true; + } + return false; +} + +void RemoteControlPlugin::OnAppHMILevelChanged( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType) { + LOG4CXX_DEBUG(logger_, + "RSDL application " << app->name().AsMBString() + << " has changed hmi level to " + << app->hmi_level()); + service()->NotifyHMIAboutHMILevel(app, app->hmi_level()); +} + +bool RemoteControlPlugin::CanAppChangeHMILevel( + application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType new_level) { + application_manager::AppExtensionPtr app_extension = + app->QueryInterface(GetModuleID()); + if (!app_extension) { + return true; + } + RCAppExtensionPtr rc_app_extension = + application_manager::AppExtensionPtr::static_pointer_cast( + app_extension); + if (new_level == mobile_apis::HMILevel::eType::HMI_FULL || + new_level == mobile_apis::HMILevel::eType::HMI_LIMITED) { + return rc_app_extension->is_on_driver_device(); + } + return true; +} + +void RemoteControlPlugin::OnDeviceRemoved( + const connection_handler::DeviceHandle& device) { + LOG4CXX_AUTO_TRACE(logger_); + bool is_driver = service()->PrimaryDevice() == device; + if (is_driver) { + service()->ResetPrimaryDevice(); + } +} + +void RemoteControlPlugin::OnUnregisterApplication(const uint32_t app_id) { + LOG4CXX_AUTO_TRACE(logger_); + resource_allocation_manager_.OnUnregisterApplication(app_id); +} + +RCEventDispatcher& RemoteControlPlugin::event_dispatcher() { + return event_dispatcher_; +} + +ResourceAllocationManager& RemoteControlPlugin::resource_allocation_manager() { + return resource_allocation_manager_; +} + +} // namespace remote_control diff --git a/src/components/remote_control/src/request_controller.cc b/src/components/remote_control/src/request_controller.cc new file mode 100644 index 0000000000..c457e94586 --- /dev/null +++ b/src/components/remote_control/src/request_controller.cc @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/request_controller.h" +#include "json/json.h" +#include "utils/logger.h" +#include "functional_module/settings.h" + +namespace remote_control { +namespace request_controller { + +CREATE_LOGGERPTR_GLOBAL(logger_, "RCRequestController") + +RequestController::RequestController() { + functional_modules::TimeUnit timeout_seconds = 100; + functional_modules::Settings settings; + settings.ReadParameter( + "Remote Control", "timeout_period_seconds", &timeout_seconds); + timer_.set_period(timeout_seconds); + LOG4CXX_DEBUG(logger_, "Timeout is set to " << timeout_seconds); + timer_.AddObserver(this); + time_director_.RegisterTimer(timer_); +} + +RequestController::~RequestController() { + time_director_.UnregisterTimer(timer_); + timer_.RemoveObserver(this); +} + +void RequestController::AddRequest(const uint32_t mobile_correlation_id, + MobileRequestPtr request) { + // TODO(VS) Research and fix be problem with overlap correlation ids from two + // different apllications(on two different mobile devices) + LOG4CXX_DEBUG(logger_, + "Add request with correlation_id: " << mobile_correlation_id); + mobile_request_list_[mobile_correlation_id] = request; + // TODO(VS): add app id + timer_.AddTrackable(TrackableMessage(0, mobile_correlation_id)); + time_director_.ResetTimer(timer_); +} + +void RequestController::DeleteRequest(const uint32_t& mobile_correlation_id) { + LOG4CXX_DEBUG( + logger_, "Delete request with correlation_id: " << mobile_correlation_id); + mobile_request_list_.erase(mobile_correlation_id); + // TODO(VS): add app id + timer_.RemoveTrackable(TrackableMessage(0, mobile_correlation_id)); +} + +void RequestController::OnTimeoutTriggered(const TrackableMessage& expired) { + LOG4CXX_DEBUG(logger_, + "Timeout is expired for request with correlation_id: " + << expired.correlation_id()); + std::map::iterator it = + mobile_request_list_.find(expired.correlation_id()); + if (mobile_request_list_.end() == it) { + // no corresponding request found, error. + return; + } + it->second->OnTimeout(); + mobile_request_list_.erase(it); +} + +} // namespace request_controller +} // namespace remote_control diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc new file mode 100644 index 0000000000..f2c3b63600 --- /dev/null +++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc @@ -0,0 +1,229 @@ +#include "remote_control/resource_allocation_manager_impl.h" +#include "application_manager/application.h" +#include "application_manager/message_helper.h" +#include "remote_control/rc_module_constants.h" +#include "json/json.h" +#include "utils/helpers.h" +#include "utils/make_shared.h" +#include "remote_control/message_helper.h" + +namespace remote_control { + +CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") + +ResourceAllocationManagerImpl::ResourceAllocationManagerImpl( + RemotePluginInterface& rc_plugin) + : current_access_mode_(hmi_apis::Common_RCAccessMode::AUTO_ALLOW) + , active_call_back_() + , rc_plugin_(rc_plugin) {} + +ResourceAllocationManagerImpl::~ResourceAllocationManagerImpl() {} + +AcquireResult::eType ResourceAllocationManagerImpl::AcquireResource( + const std::string& module_type, const uint32_t app_id) { + LOG4CXX_AUTO_TRACE(logger_); + const application_manager::ApplicationSharedPtr acquiring_app = + rc_plugin_.service()->GetApplication(app_id); + if (!acquiring_app) { + LOG4CXX_WARN(logger_, "App with app_id: " << app_id << "does not exist!"); + return AcquireResult::IN_USE; + } + + const AllocatedResources::const_iterator allocated_it = + allocated_resources_.find(module_type); + if (allocated_resources_.end() == allocated_it) { + allocated_resources_[module_type] = app_id; + LOG4CXX_DEBUG(logger_, + "Resource is not acquired yet. " + << "App: " << app_id << " is allowed to acquire " + << module_type); + return AcquireResult::ALLOWED; + } + + if (app_id == allocated_resources_[module_type]) { + LOG4CXX_DEBUG(logger_, + "App: " << app_id << " is already acquired resource " + << module_type); + return AcquireResult::ALLOWED; + } + + if (IsModuleTypeRejected(module_type, app_id)) { + LOG4CXX_DEBUG(logger_, + "Driver disallowed app: " << app_id << " to acquire " + << module_type); + return AcquireResult::REJECTED; + } + + const mobile_apis::HMILevel::eType acquiring_app_hmi_level = + acquiring_app->hmi_level(); + + if (mobile_apis::HMILevel::HMI_FULL != acquiring_app_hmi_level) { + LOG4CXX_DEBUG( + logger_, + "Aquiring resources is not allowed in HMI level: " + << application_manager::MessageHelper::StringifiedHMILevel( + acquiring_app_hmi_level) << ". App: " << app_id + << " is disallowed to acquire " << module_type); + return AcquireResult::REJECTED; + } + + switch (current_access_mode_) { + case hmi_apis::Common_RCAccessMode::AUTO_DENY: { + LOG4CXX_DEBUG(logger_, + "Current access_mode is AUTO_DENY. " + << "App: " << app_id << " is disallowed to acquire " + << module_type); + return AcquireResult::IN_USE; + } + case hmi_apis::Common_RCAccessMode::ASK_DRIVER: { + LOG4CXX_DEBUG(logger_, + "Current access_mode is ASK_DRIVER. " + "Driver confirmation is required for app: " + << app_id << " to acquire " << module_type); + return AcquireResult::ASK_DRIVER; + } + case hmi_apis::Common_RCAccessMode::AUTO_ALLOW: { + LOG4CXX_DEBUG(logger_, + "Current access_mode is AUTO_ALLOW. " + << "App: " << app_id << " is allowed to acquire " + << module_type); + + allocated_resources_[module_type] = app_id; + return AcquireResult::ALLOWED; + } + default: { DCHECK_OR_RETURN(false, AcquireResult::IN_USE); } + } +} + +void ResourceAllocationManagerImpl::SetResourceState( + const std::string& module_type, + const uint32_t app_id, + const ResourceState::eType state) { + LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_DEBUG(logger_, + "Setting state for " << module_type << " by app_id " << app_id + << " to state " << state); + const AllocatedResources::const_iterator allocated_it = + allocated_resources_.find(module_type); + + DCHECK_OR_RETURN_VOID(allocated_resources_.end() != allocated_it) + LOG4CXX_DEBUG(logger_, + "Resource " << module_type << " is acquired." + << " Owner application id is " + << allocated_it->second + << " Changing application id is " << app_id); + DCHECK_OR_RETURN_VOID(app_id == allocated_it->second); + + resources_state_[module_type] = state; + LOG4CXX_DEBUG(logger_, "Resource" << module_type << " got state " << state); +} + +bool ResourceAllocationManagerImpl::IsResourceFree( + const std::string& module_type) const { + LOG4CXX_AUTO_TRACE(logger_); + const ResourcesState::const_iterator resource = + resources_state_.find(module_type); + + if (resources_state_.end() == resource) { + LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is free."); + return true; + } + + LOG4CXX_DEBUG(logger_, + "Resource " << module_type << " state is " << resource->second); + + return ResourceState::FREE == resource->second; +} + +void ResourceAllocationManagerImpl::SetAccessMode( + const hmi_apis::Common_RCAccessMode::eType access_mode) { + if (hmi_apis::Common_RCAccessMode::ASK_DRIVER != access_mode) { + rejected_resources_for_application_.clear(); + } + current_access_mode_ = access_mode; +} + +void ResourceAllocationManagerImpl::AskDriver(const std::string& module_type, + const uint32_t hmi_app_id, + AskDriverCallBackPtr callback) { + LOG4CXX_AUTO_TRACE(logger_); + DCHECK(callback); + // Create GetInteriorConsent request to HMI + Json::Value params; + params[message_params::kModuleType] = module_type; + application_manager::MessagePtr message_to_send = + remote_control::MessageHelper::CreateHmiRequest( + functional_modules::hmi_api::get_user_consent, + hmi_app_id, + params, + rc_plugin_); + + LOG4CXX_DEBUG(logger_, + "Request to HMI: \n" << message_to_send->json_message()); + // Send GetInteriorConsent request to HMI + rc_plugin_.service()->SendMessageToHMI(message_to_send); + + // Execute callback on response + rc_plugin_.event_dispatcher().add_observer(message_to_send->function_name(), + message_to_send->correlation_id(), + callback.get()); + active_call_back_ = callback; +} + +void ResourceAllocationManagerImpl::ForceAcquireResource( + const std::string& module_type, const uint32_t app_id) { + LOG4CXX_DEBUG(logger_, "Force " << app_id << " acquiring " << module_type); + allocated_resources_[module_type] = app_id; +} + +bool ResourceAllocationManagerImpl::IsModuleTypeRejected( + const std::string& module_type, const uint32_t app_id) { + LOG4CXX_AUTO_TRACE(logger_); + RejectedResources::iterator it = + rejected_resources_for_application_.find(app_id); + + if (rejected_resources_for_application_.end() == it) { + return false; + } + + const std::vector& list_of_rejected_resources = + rejected_resources_for_application_[app_id]; + + return helpers::in_range(list_of_rejected_resources, module_type); +} + +void ResourceAllocationManagerImpl::OnDriverDisallowed( + const std::string& module_type, const uint32_t app_id) { + LOG4CXX_AUTO_TRACE(logger_); + RejectedResources::iterator it = + rejected_resources_for_application_.find(app_id); + + if (rejected_resources_for_application_.end() == it) { + rejected_resources_for_application_[app_id] = std::vector(); + } + std::vector& list_of_rejected_resources = + rejected_resources_for_application_[app_id]; + list_of_rejected_resources.push_back(module_type); +} + +void ResourceAllocationManagerImpl::OnUnregisterApplication( + const uint32_t app_id) { + LOG4CXX_AUTO_TRACE(logger_); + + rejected_resources_for_application_.erase(app_id); + for (AllocatedResources::const_iterator it = allocated_resources_.begin(); + it != allocated_resources_.end();) { + if (app_id == it->second) { + LOG4CXX_INFO(logger_, + "Application " << app_id + << " is unregistered. Releasing resource " + << it->first); + resources_state_.erase(it->first); + it = allocated_resources_.erase(it); + } else { + ++it; + } + } +} + +} // namespace remote_control diff --git a/src/components/remote_control/test/CMakeLists.txt b/src/components/remote_control/test/CMakeLists.txt new file mode 100644 index 0000000000..75d2e15fa9 --- /dev/null +++ b/src/components/remote_control/test/CMakeLists.txt @@ -0,0 +1,73 @@ +include_directories ( + ${LOG4CXX_INCLUDE_DIRECTORY} + ${GMOCK_INCLUDE_DIRECTORY} + ${CMAKE_SOURCE_DIR}/src/components/functional_module/include/ + ${CMAKE_SOURCE_DIR}/src/components/functional_module/test/ + ${CMAKE_SOURCE_DIR}/src/components/remote_control/include/ + ${CMAKE_SOURCE_DIR}/src/components/remote_control/test/include/ + ${CMAKE_SOURCE_DIR}/src/components/include/ + ${CMAKE_SOURCE_DIR}/src/components/application_manager/test/include/ + ${CMAKE_SOURCE_DIR}/src/components/connection_handler/include/ + ${CMAKE_SOURCE_DIR}/src/components/smart_objects/include/ + ${CMAKE_SOURCE_DIR}/src/components/policy/src/policy/usage_statistics/include/ + ${JSONCPP_INCLUDE_DIRECTORY} + ${CMAKE_BINARY_DIR}/src/components/ + include/ +) + +set (SOURCES + src/rc_module_test.cc + src/rc_app_extension_test.cc + src/resource_allocation_manager_impl_test.cc + ${CMAKE_SOURCE_DIR}/src/components/application_manager/test/mock_message_helper.cc +) + +set (LIBRARIES + gtest + gmock + gmock_main + RemoteControlModule + SmartObjects + gcov + Policy +) + +if (ENABLE_TEST_COV_COUNT) + set(GCOV_FLAGS "-ftest-coverage -fprofile-arcs") +else() + set(GCOV_FLAGS "") +endif() + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCOV_FLAGS}") + +configure_file(lc.awk lc.awk COPYONLY) +configure_file(run_calc_comments.sh run_calc_comments.sh COPYONLY) +configure_file(run_mem_check.sh run_mem_check.sh COPYONLY) +configure_file(smartDeviceLink.ini smartDeviceLink.ini COPYONLY) +configure_file(../InteriorVehicleDataCapabilities.json InteriorVehicleDataCapabilities.json COPYONLY) + +# use, i.e. don't skip the full RPATH for the build tree +#SET(CMAKE_SKIP_BUILD_RPATH FALSE) + +# when building, don't use the install RPATH already +# (but later on when installing) +#SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + +#SET(RPATH_DIRECTORIES +# ${CMAKE_BINARY_DIR}/src/components/remote_control/ +# /usr/local/lib +# /usr/local +# ${CMAKE_BINARY_DIR}/src/components/utils +#) + +#SET(CMAKE_INSTALL_RPATH "${RPATH_DIRECTORIES}") + +add_custom_command( +OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libPolicy.so + COMMAND ${CMAKE_COMMAND} -E + copy ${COMPONENTS_DIR}/policy/libPolicy.so ${CMAKE_CURRENT_BINARY_DIR}) + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath=${CMAKE_CURRENT_BINARY_DIR}") + +create_test("remote_control_test" "${SOURCES}" "${LIBRARIES}") +add_subdirectory(commands) diff --git a/src/components/remote_control/test/commands/CMakeLists.txt b/src/components/remote_control/test/commands/CMakeLists.txt new file mode 100644 index 0000000000..1ac186ebf8 --- /dev/null +++ b/src/components/remote_control/test/commands/CMakeLists.txt @@ -0,0 +1,62 @@ +# Copyright (c) 2016, Ford Motor Company +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# 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. +# +# Neither the name of the Ford Motor Company nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + +include(${CMAKE_SOURCE_DIR}/tools/cmake/helpers/sources.cmake) + +include_directories( + ${GMOCK_INCLUDE_DIRECTORY} + ${COMPONENTS_DIR}/remote_control/include/ + ${COMPONENTS_DIR}/remote_control/include/remote_control/ + ${COMPONENTS_DIR}/remote_control/include/remote_control/commands/ + ${COMPONENTS_DIR}/remote_control/test/include +) + +set(RC_COMMANDS_TEST_DIR ${RC_TEST_DIR}/commands) + +file(GLOB SOURCES + ${COMPONENTS_DIR}/application_manager/test/mock_message_helper.cc + ${RC_COMMANDS_TEST_DIR}/* +) + +set(LIBRARIES + gmock + RemoteControlModule + Utils + SmartObjects + jsoncpp + HMI_API + MOBILE_API + ApplicationManager + AMHMICommandsLibrary + AMMobileCommandsLibrary + connectionHandler +) + +create_test("rc_commands_test" "${SOURCES}" "${LIBRARIES}" ) diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc new file mode 100644 index 0000000000..e4de8902fd --- /dev/null +++ b/src/components/remote_control/test/commands/button_press_request_test.cc @@ -0,0 +1,295 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/button_press_request.h" +#include "gtest/gtest.h" +#include "mock_remote_control_plugin.h" +#include "mock_application.h" +#include "mock_resource_allocation_manager.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/remote_control_event.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "remote_control/rc_command_factory.h" +#include "remote_control/event_engine/event_dispatcher.h" +#include "functional_module/function_ids.h" +#include "include/mock_service.h" +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" + +using functional_modules::RCFunctionID; +using application_manager::ServicePtr; + +using application_manager::MockService; +using test::components::remote_control_test::MockApplication; + +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SaveArg; +using ::application_manager::Message; +using ::application_manager::MessageType; +using ::protocol_handler::MessagePriority; +using remote_control::RemotePluginInterface; +using remote_control::MessageHelper; + +namespace { +const int kModuleId = 153; + +const std::string kCorrectMobileRequest = + "{\"moduleType\":\"CLIMATE\",\"buttonName\":\"AC\",\"buttonPressMode\":" + "\"SHORT\"}"; +const std::string kWrongMobileRequest = + "{\"moduleType\":\"RADIO\",\"buttonName\":\"AC\",\"buttonPressMode\":" + "\"SHORT\"}"; +const std::string kValidHmiResponse = + "{\"result\":{\"code\":0,\"method\":\"Buttons.ButtonPress\"},\"id\":31," + "\"jsonrpc\":\"2.0\"} "; +const std::string KReadOnlyHmiResponse = + "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":26,\"data\":{\"method\":" + "\"Buttons.ButtonPress\"},\"message\":\"Read only parameters " + "received\"},\"id\":31}"; +const uint32_t kAppId = 11u; +} + +namespace test { +namespace components { +namespace remote_control_test { +namespace button_press_request_test { + +class ButtonPressRequestTest : public ::testing::Test { + public: + ButtonPressRequestTest() + : mock_service_(utils::MakeShared >()) + , mock_app_(utils::MakeShared >()) + , rc_app_extention_( + utils::MakeShared(kModuleId)) { + ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_)); + ON_CALL(mock_module_, resource_allocation_manager()) + .WillByDefault(ReturnRef(mock_allocation_manager_)); + ON_CALL(*mock_service_, GetApplication(kAppId)) + .WillByDefault(Return(mock_app_)); + EXPECT_CALL(mock_module_, event_dispatcher()) + .WillRepeatedly(ReturnRef(event_dispatcher_)); + ServicePtr exp_service(mock_service_); + mock_module_.set_service(exp_service); + } + + remote_control::request_controller::MobileRequestPtr CreateCommand( + application_manager::MessagePtr msg) { + return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_); + } + + application_manager::MessagePtr CreateBasicMessage() { + application_manager::MessagePtr message = utils::MakeShared( + MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc)); + message->set_function_id(RCFunctionID::BUTTON_PRESS); + message->set_function_name( + MessageHelper::GetMobileAPIName(functional_modules::BUTTON_PRESS)); + message->set_connection_key(kAppId); + return message; + } + + protected: + utils::SharedPtr > mock_service_; + utils::SharedPtr > mock_app_; + utils::SharedPtr rc_app_extention_; + testing::NiceMock + mock_module_; + testing::NiceMock + mock_allocation_manager_; + RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_; +}; + +TEST_F(ButtonPressRequestTest, + Execute_ButtonNameMatchesModuleType_ExpectCorrectMessageSentToHMI) { + namespace json_keys = remote_control::json_keys; + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kCorrectMobileRequest); + // Expectations + ON_CALL(*mock_app_, app_id()) + .WillByDefault(Return(mobile_message->connection_key())); + EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key())) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message)) + .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + application_manager::AppExtensionPtr app_extension; + EXPECT_CALL(*mock_app_, AddExtension(_)) + .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); + EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1)); + + const std::string resource = "CLIMATE"; + + EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource)) + .WillOnce(Return(true)); + EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId)) + .WillOnce(Return(remote_control::AcquireResult::ALLOWED)); + EXPECT_CALL( + mock_allocation_manager_, + SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY)); + + application_manager::MessagePtr result_msg; + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)) + .WillOnce(SaveArg<0>(&result_msg)); + + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->Run(); + // Assertions + EXPECT_EQ(kModuleId, app_extension->uid()); + EXPECT_EQ(application_manager::ProtocolVersion::kHMI, + result_msg->protocol_version()); + EXPECT_EQ(1, result_msg->correlation_id()); + EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type()); + const Json::Value& hmi_request_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_EQ(functional_modules::hmi_api::button_press, + hmi_request_params[json_keys::kMethod].asString()); +} + +TEST_F( + ButtonPressRequestTest, + Execute_ButtonNameDoesNotMatchModuleType_ExpectMessageNotSentToHMI_AndFalseSentToMobile) { + namespace json_keys = remote_control::json_keys; + namespace result_codes = remote_control::result_codes; + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kWrongMobileRequest); + // Expectations + EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key())) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message)) + .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + application_manager::AppExtensionPtr app_extension; + EXPECT_CALL(*mock_app_, AddExtension(_)) + .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); + EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->Run(); + // Assertions + const Json::Value& response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_FALSE(response_params[result_codes::kSuccess].asBool()); + EXPECT_EQ(result_codes::kInvalidData, + response_params[json_keys::kResultCode].asString()); +} + +TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) { + namespace json_keys = remote_control::json_keys; + namespace result_codes = remote_control::result_codes; + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kCorrectMobileRequest); + + application_manager::MessagePtr hmi_message = CreateBasicMessage(); + hmi_message->set_json_message(kValidHmiResponse); + hmi_message->set_message_type(application_manager::MessageType::kResponse); + // Expectations + EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key())) + .WillOnce(Return(mock_app_)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + // Act + remote_control::RCPluginEvent event( + hmi_message, functional_modules::hmi_api::button_press); + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->on_event(event); + // Assertions + const Json::Value& response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_TRUE(response_params[json_keys::kSuccess].asBool()); + EXPECT_EQ(result_codes::kSuccess, + response_params[json_keys::kResultCode].asString()); +} + +TEST_F(ButtonPressRequestTest, + OnEvent_ReadOnlyParamFromHMI_ExpectFalseSentToMobile) { + namespace json_keys = remote_control::json_keys; + namespace result_codes = remote_control::result_codes; + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kCorrectMobileRequest); + + application_manager::MessagePtr hmi_message = CreateBasicMessage(); + hmi_message->set_json_message(KReadOnlyHmiResponse); + hmi_message->set_message_type(application_manager::MessageType::kResponse); + // Expectations + EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key())) + .WillOnce(Return(mock_app_)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + // Act + remote_control::RCPluginEvent event( + hmi_message, functional_modules::hmi_api::button_press); + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->on_event(event); + // Assertions + const Json::Value& response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_FALSE(response_params[json_keys::kSuccess].asBool()); + EXPECT_EQ(result_codes::kGenericError, + response_params[json_keys::kResultCode].asString()); +} + +} // namespace button_press_request_test +} // namespace remote_control_test +} // namespace components +} // namespace test diff --git a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc new file mode 100644 index 0000000000..b8a6c0f675 --- /dev/null +++ b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc @@ -0,0 +1,288 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/get_interior_vehicle_data_request.h" +#include "gtest/gtest.h" +#include "mock_remote_control_plugin.h" +#include "mock_application.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/remote_control_event.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "remote_control/rc_command_factory.h" +#include "remote_control/event_engine/event_dispatcher.h" +#include "functional_module/function_ids.h" +#include "include/mock_service.h" +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" + +using functional_modules::RCFunctionID; +using application_manager::ServicePtr; + +using application_manager::MockService; +using test::components::remote_control_test::MockApplication; + +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::StrictMock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SaveArg; +using ::application_manager::Message; +using ::application_manager::MessageType; +using ::application_manager::ApplicationSharedPtr; +using ::protocol_handler::MessagePriority; +using remote_control::RemotePluginInterface; +using remote_control::MessageHelper; +using namespace remote_control; + +namespace { +const int32_t kConnectionKey = 5; +const int kModuleId = 153; +const std::string kInvalidMobileRequest = "{{\"moduleTip\":\"LUXOFT\"}}"; +const std::string kValidMobileRequest = + "{\"subscribe\":true,\"moduleDescription\":{\"moduleType\":\"CLIMATE\"}}"; +const std::string kValidHmiResponse = + "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":0,\"method\":\"RC." + "GetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\"," + "\"climateControlData\":{\"fanSpeed\":0,\"currentTemperature\":{\"unit\":" + "\"CELSIUS\",\"value\":20},\"desiredTemperature\":{\"unit\":\"CELSIUS\"," + "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true," + "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true," + "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":" + "true}}"; +const std::string kInvalidHmiResponse = + "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":21,\"method\":\"RC." + "GetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\"," + "\"ControlData\":{\"Speed\":0,\"outsideTemperature\":{\"unit\":" + "\"CELSIUS\",\"value\":\"high\"},\"desiredTemperature\":{\"unit\":" + "\"CELSIUS\"," + "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true," + "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true," + "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":" + "false}}"; +} + +namespace test { +namespace components { +namespace remote_control_test { +namespace get_interior_vehicle_data_request_test { + +class GetInteriorVehicleDataRequestTest : public ::testing::Test { + public: + typedef utils::SharedPtr + GIVDRequestPtr; + typedef rc_event_engine::Event + GIVD_HMI_Response; + GetInteriorVehicleDataRequestTest() + : mock_service_(utils::MakeShared >()) + , mock_app_(utils::MakeShared >()) + , rc_app_extention_( + utils::MakeShared(kModuleId)) { + ON_CALL(*mock_app_, app_id()).WillByDefault(Return(app_id_)); + ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_)); + ON_CALL(*mock_service_, GetApplication(app_id_)) + .WillByDefault(Return(mock_app_)); + EXPECT_CALL(mock_module_, event_dispatcher()) + .WillRepeatedly(ReturnRef(event_dispatcher_)); + ServicePtr exp_service(mock_service_); + mock_module_.set_service(exp_service); + } + + remote_control::request_controller::MobileRequestPtr CreateCommand( + application_manager::MessagePtr msg) { + return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_); + } + + application_manager::MessagePtr CreateBasicMessage() { + application_manager::MessagePtr message = utils::MakeShared( + MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc)); + message->set_connection_key(kConnectionKey); + message->set_function_id(RCFunctionID::GET_INTERIOR_VEHICLE_DATA); + message->set_function_name("GetInteriorVehicleData"); + return message; + } + + protected: + utils::SharedPtr > mock_service_; + utils::SharedPtr > mock_app_; + utils::SharedPtr rc_app_extention_; + remote_control_test::MockRemotePluginInterface mock_module_; + RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_; + const uint32_t app_id_ = 11u; +}; + +TEST_F(GetInteriorVehicleDataRequestTest, + Execute_MessageValidationOk_ExpectCorrectMessageSentToHMI) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kValidMobileRequest); + // Expectations + EXPECT_CALL(mock_module_, service()).Times(2).WillOnce(Return(mock_service_)); + EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key())) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message)) + .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + application_manager::AppExtensionPtr app_extension; + EXPECT_CALL(*mock_app_, AddExtension(_)) + .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); + EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)) + .WillOnce(SaveArg<0>(&result_msg)); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->Run(); + // Assertions + EXPECT_EQ(kModuleId, app_extension->uid()); + EXPECT_EQ(application_manager::ProtocolVersion::kHMI, + result_msg->protocol_version()); + EXPECT_EQ(1, result_msg->correlation_id()); + EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type()); + const Json::Value hmi_request_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_EQ(functional_modules::hmi_api::get_interior_vehicle_data, + hmi_request_params[json_keys::kMethod].asString()); +} + +TEST_F( + GetInteriorVehicleDataRequestTest, + Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kInvalidMobileRequest); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key())) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message)) + .WillOnce( + Return(application_manager::MessageValidationResult::INVALID_JSON)); + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->Run(); + // Assertions + const Json::Value response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_FALSE(response_params[result_codes::kSuccess].asBool()); + EXPECT_EQ(result_codes::kInvalidData, + response_params[json_keys::kResultCode].asString()); +} + +TEST_F(GetInteriorVehicleDataRequestTest, + OnEvent_ValidHmiResponse_ExpectSuccessfullResponseSentToMobile) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kValidMobileRequest); + + application_manager::MessagePtr hmi_message = CreateBasicMessage(); + hmi_message->set_json_message(kValidHmiResponse); + hmi_message->set_message_type(application_manager::MessageType::kResponse); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key())) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(rc_app_extention_)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + // Act + remote_control::RCPluginEvent event( + hmi_message, functional_modules::hmi_api::get_interior_vehicle_data); + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->on_event(event); + // Assertions + const Json::Value response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_TRUE(response_params[json_keys::kSuccess].asBool()); + EXPECT_EQ(result_codes::kSuccess, + response_params[json_keys::kResultCode].asString()); +} + +TEST_F(GetInteriorVehicleDataRequestTest, + OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kValidMobileRequest); + application_manager::MessagePtr hmi_message = CreateBasicMessage(); + hmi_message->set_json_message(kInvalidHmiResponse); + hmi_message->set_message_type(application_manager::MessageType::kResponse); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(*mock_service_, GetApplication(mobile_message->connection_key())) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message)) + .WillOnce( + Return(application_manager::MessageValidationResult::INVALID_JSON)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + remote_control::RCPluginEvent event( + hmi_message, functional_modules::hmi_api::get_interior_vehicle_data); + command->on_event(event); + const Json::Value response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_FALSE(response_params[json_keys::kSuccess].asBool()); + EXPECT_EQ(result_codes::kGenericError, + response_params[json_keys::kResultCode].asString()); + const Json::Value hmi_response = + MessageHelper::StringToValue(hmi_message->json_message()); + EXPECT_EQ(hmi_response[json_keys::kInfo].asString(), + response_params[json_keys::kInfo].asString()); +} + +} // namespace get_interior_vehicle_data_request_test +} // namespace remote_control_test +} // namespace components +} // namespace test diff --git a/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc new file mode 100644 index 0000000000..2bf7771199 --- /dev/null +++ b/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/on_interior_vehicle_data_notification.h" +#include "gtest/gtest.h" +#include "mock_remote_control_plugin.h" +#include "mock_application.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/remote_control_event.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "remote_control/rc_command_factory.h" +#include "remote_control/event_engine/event_dispatcher.h" +#include "functional_module/function_ids.h" +#include "include/mock_service.h" +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" + +using functional_modules::RCFunctionID; +using application_manager::ServicePtr; + +using application_manager::MockService; +using test::components::remote_control_test::MockApplication; + +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::SaveArg; +using ::application_manager::Message; +using ::application_manager::MessageType; +using ::application_manager::ApplicationSharedPtr; +using ::protocol_handler::MessagePriority; +using remote_control::RemotePluginInterface; +using remote_control::MessageHelper; +using namespace remote_control; + +namespace { +const int kModuleId = 153; +const std::string kJson = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnInteriorVehicleData\",\ + \"params\":{\"moduleData\":{\ + \"moduleType\": \"CLIMATE\",\"climateControlData\": {\"fanSpeed\": 100}}}}"; +const uint32_t kAppId_ = 11u; +} + +namespace test { +namespace components { +namespace remote_control_test { +namespace on_interior_vehicle_data_notification_test { + +class OnInteriorVehicleDataNotificationTest : public ::testing::Test { + public: + OnInteriorVehicleDataNotificationTest() + : mock_service_(utils::MakeShared >()) + , mock_app_(utils::MakeShared >()) + , rc_app_extention_( + utils::MakeShared(kModuleId)) { + ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_)); + ServicePtr exp_service(mock_service_); + mock_module_.set_service(exp_service); + } + + remote_control::request_controller::MobileRequestPtr CreateCommand( + application_manager::MessagePtr msg) { + return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_); + } + + application_manager::MessagePtr CreateBasicMessage() { + application_manager::MessagePtr message = utils::MakeShared( + MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc)); + message->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA); + message->set_function_name("OnInteriorVehicleData"); + message->set_json_message(kJson); + return message; + } + + protected: + utils::SharedPtr > mock_service_; + utils::SharedPtr > mock_app_; + utils::SharedPtr rc_app_extention_; + remote_control_test::MockRemotePluginInterface mock_module_; + std::vector apps_; +}; + +TEST_F(OnInteriorVehicleDataNotificationTest, + Execute_SendMessageToMobile_IfAppIsSubscribed) { + // Arrange + application_manager::MessagePtr message = CreateBasicMessage(); + Json::Value json_value = MessageHelper::StringToValue(kJson); + Json::Value module_type = + json_value[json_keys::kParams][message_params::kModuleData] + [message_params::kModuleType]; + rc_app_extention_->SubscribeToInteriorVehicleData(module_type); + apps_.push_back(mock_app_); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(*mock_service_, GetApplications(kModuleId)) + .WillOnce(Return(apps_)); + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(rc_app_extention_)); + ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId_)); + EXPECT_CALL(*mock_service_, GetApplication(kAppId_)) + .WillOnce(Return(mock_app_)); + EXPECT_CALL(*mock_service_, CheckPolicyPermissions(_)) + .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); + EXPECT_CALL(*mock_service_, CheckModule(kAppId_, enums_value::kClimate)) + .WillOnce(Return(true)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(*mock_service_, SendMessageToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); + // Assertions + EXPECT_EQ(application_manager::ProtocolVersion::kV3, + result_msg->protocol_version()); + EXPECT_EQ(application_manager::MessageType::kNotification, + result_msg->type()); + EXPECT_EQ(functional_modules::ON_INTERIOR_VEHICLE_DATA, + result_msg->function_id()); + EXPECT_EQ(MessageHelper::GetMobileAPIName( + functional_modules::ON_INTERIOR_VEHICLE_DATA), + result_msg->function_name()); +} + +TEST_F(OnInteriorVehicleDataNotificationTest, + Execute_NotSendMessageToMobile_IfAppUnsubscribed) { + // Arrange + application_manager::MessagePtr message = CreateBasicMessage(); + apps_.push_back(mock_app_); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(*mock_service_, GetApplications(kModuleId)) + .WillOnce(Return(apps_)); + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(rc_app_extention_)); + EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); +} + +} // namespace on_interior_vehicle_data_notification_test +} // namespace remote_control_test +} // namespace components +} // namespace test diff --git a/src/components/remote_control/test/commands/on_remote_control_settings_test.cc b/src/components/remote_control/test/commands/on_remote_control_settings_test.cc new file mode 100644 index 0000000000..879e9e1de0 --- /dev/null +++ b/src/components/remote_control/test/commands/on_remote_control_settings_test.cc @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/on_remote_control_settings_notification.h" +#include "gtest/gtest.h" +#include "mock_remote_control_plugin.h" +#include "mock_application.h" +#include "mock_resource_allocation_manager.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/remote_control_event.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "remote_control/rc_command_factory.h" +#include "remote_control/event_engine/event_dispatcher.h" +#include "functional_module/function_ids.h" +#include "include/mock_service.h" +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" + +using functional_modules::RCFunctionID; +using application_manager::ServicePtr; + +using application_manager::MockService; +using test::components::remote_control_test::MockApplication; + +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SaveArg; +using ::application_manager::Message; +using ::application_manager::MessageType; +using ::application_manager::ApplicationSharedPtr; +using ::protocol_handler::MessagePriority; +using remote_control::RemotePluginInterface; +using remote_control::MessageHelper; +using namespace remote_control; + +namespace { +const int kModuleId = 153; +const std::string kAllowedTrueAUTO_ALLOWJson = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\ + \"params\":{\"accessMode\": \"AUTO_ALLOW\", \"allowed\":true}}"; +const std::string kAllowedTrueASK_DRIVERJson = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\ + \"params\":{\"accessMode\": \"ASK_DRIVER\", \"allowed\":true}}"; +const std::string kAllowedTrueAUTO_DENYJson = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\ + \"params\":{\"accessMode\": \"AUTO_DENY\", \"allowed\":true}}"; +const std::string kAllowedFalseAUTO_ALLOWJson = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\ + \"params\":{\"accessMode\": \"AUTO_ALLOW\", \"allowed\":false}}"; +const std::string kAllowedFalseASK_DRIVERJson = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\ + \"params\":{\"accessMode\": \"ASK_DRIVER\", \"allowed\":false}}"; +const std::string kAllowedFalseAUTO_DENYJson = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\",\ + \"params\":{\"accessMode\": \"AUTO_DENY\", \"allowed\":false}}"; +const std::string kWithoutParamsJson = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnRemoteControlSettings\"}"; +} + +namespace test { +namespace components { +namespace remote_control_test { +namespace on_remote_control_settings_notification_test { + +class OnRemoteControlSettingsNotificationTest : public ::testing::Test { + public: + OnRemoteControlSettingsNotificationTest() + : mock_service_(utils::MakeShared >()) + , mock_app_(utils::MakeShared >()) + , rc_app_extention_( + utils::MakeShared(kModuleId)) { + ON_CALL(mock_module_, resource_allocation_manager()) + .WillByDefault(ReturnRef(mock_allocation_manager_)); + apps_.push_back(mock_app_); + } + + remote_control::request_controller::MobileRequestPtr CreateCommand( + application_manager::MessagePtr msg) { + return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_); + } + + application_manager::MessagePtr CreateBasicMessage( + const std::string& json_message) { + application_manager::MessagePtr message = utils::MakeShared( + MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc)); + message->set_function_id(RCFunctionID::ON_REMOTE_CONTROL_SETTINGS); + message->set_function_name( + MessageHelper::GetMobileAPIName(functional_modules::BUTTON_PRESS)); + message->set_json_message(json_message); + return message; + } + + protected: + utils::SharedPtr > mock_service_; + utils::SharedPtr > mock_app_; + utils::SharedPtr rc_app_extention_; + remote_control_test::MockRemotePluginInterface mock_module_; + std::vector apps_; + testing::NiceMock + mock_allocation_manager_; +}; + +TEST_F(OnRemoteControlSettingsNotificationTest, + Execute_SetAccessModeAUTO_ALLOW_IfAllowedTrue) { + // Arrange + const Json::Value value = + MessageHelper::StringToValue(kAllowedTrueAUTO_ALLOWJson); + const std::string access_mode = + value[json_keys::kParams][message_params::kAccessMode].asString(); + const hmi_apis::Common_RCAccessMode::eType access_mode_ = + MessageHelper::AccessModeFromString(access_mode); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)); + + application_manager::MessagePtr message = + CreateBasicMessage(kAllowedTrueAUTO_ALLOWJson); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); +} + +TEST_F(OnRemoteControlSettingsNotificationTest, + Execute_SetAccessModeAUTO_DENY_IfAllowedTrue) { + // Arrange + const Json::Value value = + MessageHelper::StringToValue(kAllowedTrueAUTO_DENYJson); + const std::string access_mode = + value[json_keys::kParams][message_params::kAccessMode].asString(); + const hmi_apis::Common_RCAccessMode::eType access_mode_ = + MessageHelper::AccessModeFromString(access_mode); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)); + + application_manager::MessagePtr message = + CreateBasicMessage(kAllowedTrueAUTO_DENYJson); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); +} + +TEST_F(OnRemoteControlSettingsNotificationTest, + Execute_SetAccessModeASK_DRIVER_IfAllowedTrue) { + // Arrange + const Json::Value value = + MessageHelper::StringToValue(kAllowedTrueASK_DRIVERJson); + const std::string access_mode = + value[json_keys::kParams][message_params::kAccessMode].asString(); + const hmi_apis::Common_RCAccessMode::eType access_mode_ = + MessageHelper::AccessModeFromString(access_mode); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)); + application_manager::MessagePtr message = + CreateBasicMessage(kAllowedTrueASK_DRIVERJson); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); +} + +TEST_F(OnRemoteControlSettingsNotificationTest, + Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeAUTO_ALLOW) { + // Arrange + const Json::Value module_type(enums_value::kClimate); + rc_app_extention_->SubscribeToInteriorVehicleData(module_type); + const Json::Value value = + MessageHelper::StringToValue(kAllowedFalseAUTO_ALLOWJson); + const std::string access_mode = + value[json_keys::kParams][message_params::kAccessMode].asString(); + const hmi_apis::Common_RCAccessMode::eType access_mode_ = + MessageHelper::AccessModeFromString(access_mode); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0); + EXPECT_CALL(*mock_service_, GetApplications(kModuleId)) + .WillOnce(Return(apps_)); + EXPECT_CALL( + *mock_service_, + ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE)); + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(rc_app_extention_)); + EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type), + true); + application_manager::MessagePtr message = + CreateBasicMessage(kAllowedFalseAUTO_ALLOWJson); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); + // Assertions + EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type), + false); +} + +TEST_F(OnRemoteControlSettingsNotificationTest, + Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeASK_DRIVER) { + // Arrange + const Json::Value module_type(enums_value::kRadio); + rc_app_extention_->SubscribeToInteriorVehicleData(module_type); + const Json::Value value = + MessageHelper::StringToValue(kAllowedFalseASK_DRIVERJson); + const std::string access_mode = + value[json_keys::kParams][message_params::kAccessMode].asString(); + const hmi_apis::Common_RCAccessMode::eType access_mode_ = + MessageHelper::AccessModeFromString(access_mode); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0); + EXPECT_CALL(*mock_service_, GetApplications(kModuleId)) + .WillOnce(Return(apps_)); + EXPECT_CALL( + *mock_service_, + ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE)); + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(rc_app_extention_)); + EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type), + true); + application_manager::MessagePtr message = + CreateBasicMessage(kAllowedFalseASK_DRIVERJson); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); + // Assertions + EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type), + false); +} + +TEST_F(OnRemoteControlSettingsNotificationTest, + Execute_DisallowRCFunctionality_IfAllowedFalseAccessModeAUTO_DENY) { + // Arrange + const Json::Value module_type(enums_value::kClimate); + rc_app_extention_->SubscribeToInteriorVehicleData(module_type); + const Json::Value value = + MessageHelper::StringToValue(kAllowedFalseAUTO_DENYJson); + const std::string access_mode = + value[json_keys::kParams][message_params::kAccessMode].asString(); + const hmi_apis::Common_RCAccessMode::eType access_mode_ = + MessageHelper::AccessModeFromString(access_mode); + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(mock_allocation_manager_, SetAccessMode(access_mode_)).Times(0); + EXPECT_CALL(*mock_service_, GetApplications(kModuleId)) + .WillOnce(Return(apps_)); + EXPECT_CALL( + *mock_service_, + ChangeNotifyHMILevel(apps_[0], mobile_apis::HMILevel::eType::HMI_NONE)); + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(rc_app_extention_)); + EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type), + true); + application_manager::MessagePtr message = + CreateBasicMessage(kAllowedFalseAUTO_DENYJson); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); + // Assertions + EXPECT_EQ(rc_app_extention_->IsSubscibedToInteriorVehicleData(module_type), + false); +} + +TEST_F(OnRemoteControlSettingsNotificationTest, + Execute_NothingHappens_IfParamsOmitted) { + // Expectations + EXPECT_CALL(mock_module_, service()).WillOnce(Return(mock_service_)); + EXPECT_CALL(mock_allocation_manager_, SetAccessMode(_)).Times(0); + EXPECT_CALL(*mock_service_, GetApplications(kModuleId)).Times(0); + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)).Times(0); + EXPECT_CALL(*mock_service_, + ChangeNotifyHMILevel( + apps_[0], mobile_apis::HMILevel::eType::HMI_NONE)).Times(0); + + application_manager::MessagePtr message = + CreateBasicMessage(kWithoutParamsJson); + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(message); + command->Run(); +} + +} // namespace on_remote_control_settings_notification_test +} // namespace remote_control_test +} // namespace components +} // namespace test diff --git a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc new file mode 100644 index 0000000000..44dd422468 --- /dev/null +++ b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc @@ -0,0 +1,429 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "remote_control/commands/set_interior_vehicle_data_request.h" +#include "gtest/gtest.h" +#include "mock_remote_control_plugin.h" +#include "mock_application.h" +#include "mock_resource_allocation_manager.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/remote_control_event.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "remote_control/rc_command_factory.h" +#include "remote_control/event_engine/event_dispatcher.h" +#include "functional_module/function_ids.h" +#include "include/mock_service.h" +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" + +using functional_modules::RCFunctionID; +using application_manager::ServicePtr; + +using application_manager::MockService; +using test::components::remote_control_test::MockApplication; + +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::StrictMock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SaveArg; +using ::application_manager::Message; +using ::application_manager::MessageType; +using ::application_manager::ApplicationSharedPtr; +using ::protocol_handler::MessagePriority; +using remote_control::RemotePluginInterface; +using remote_control::MessageHelper; +using namespace remote_control; + +namespace { +const uint32_t kAppId = 11u; +const int32_t kConnectionKey = 5; +const int kModuleId = 153; +const uint32_t kCorrelationId = 1u; +const std::string kValidMobileRequestWithOnlySettableParams = + "{\"moduleData\":{\"moduleType\":\"CLIMATE\", " + "\"climateControlData\":{\"defrostZone\":" + "\"FRONT\", \"fanSpeed\":10}}}"; +const std::string kValidMobileRequestWithSettableAndReadOnlyParams = + "{\"moduleData\":{\"moduleType\":\"CLIMATE\", " + "\"climateControlData\":{\"defrostZone\":" + "\"FRONT\", \"fanSpeed\":10, \"currentTemperature\":{\"unit\":\"CELSIUS\", " + "\"value\":17.5}}}}"; +const std::string kValidMobileRequestWithoutSettableAndWithReadOnlyParams = + "{\"moduleData\":{\"moduleType\":\"CLIMATE\", \"climateControlData\":" + "{\"currentTemperature\":{\"unit\":\"CELSIUS\", \"value\":17.5}}}}"; +const std::string kInvalidMobileRequest = "{{\"moduleTip\":\"LUXOFT\"}}"; +const std::string kValidHmiResponse = + "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":0,\"method\":\"RC." + "SetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\"," + "\"climateControlData\":{\"fanSpeed\":0,\"desiredTemperature\":{\"unit\":" + "\"CELSIUS\"," + "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true," + "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true," + "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}}}}"; +const std::string kInvalidHmiResponse = + "{\"jsonrpc\":\"2.0\",\"id\":51,\"result\":{\"code\":21,\"method\":\"RC." + "SetInteriorVehicleData\",\"moduleData\":{\"moduleType\":\"CLIMATE\"," + "\"ControlData\":{\"Speed\":0,\"outsideTemperature\":{\"unit\":" + "\"CELSIUS\",\"value\":\"high\"},\"desiredTemperature\":{\"unit\":" + "\"CELSIUS\"," + "\"value\":25},\"acEnable\":true,\"circulateAirEnable\":true," + "\"autoModeEnable\":true,\"defrostZone\":\"ALL\",\"dualModeEnable\":true," + "\"acMaxEnable\":true,\"ventilationMode\":\"BOTH\"}},\"isSubscribed\":" + "false}}"; +} + +namespace test { +namespace components { +namespace remote_control_test { +namespace set_interior_vehicle_data_request_test { + +class SetInteriorVehicleDataRequestTest : public ::testing::Test { + public: + SetInteriorVehicleDataRequestTest() + : mock_service_(utils::MakeShared >()) + , mock_app_(utils::MakeShared >()) + , rc_app_extention_( + utils::MakeShared(kModuleId)) { + ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId)); + ON_CALL(mock_module_, resource_allocation_manager()) + .WillByDefault(ReturnRef(mock_allocation_manager_)); + ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_)); + ON_CALL(*mock_service_, GetApplication(_)).WillByDefault(Return(mock_app_)); + ON_CALL(mock_module_, event_dispatcher()) + .WillByDefault(ReturnRef(event_dispatcher_)); + ServicePtr exp_service(mock_service_); + } + + remote_control::request_controller::MobileRequestPtr CreateCommand( + application_manager::MessagePtr msg) { + return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_); + } + + application_manager::MessagePtr CreateBasicMessage() { + application_manager::MessagePtr message = utils::MakeShared( + MessagePriority::FromServiceType(protocol_handler::ServiceType::kRpc)); + message->set_connection_key(kConnectionKey); + message->set_function_id(RCFunctionID::SET_INTERIOR_VEHICLE_DATA); + message->set_function_name(MessageHelper::GetMobileAPIName( + functional_modules::SET_INTERIOR_VEHICLE_DATA)); + return message; + } + + protected: + utils::SharedPtr > mock_service_; + utils::SharedPtr > mock_app_; + utils::SharedPtr rc_app_extention_; + testing::NiceMock + mock_module_; + testing::NiceMock + mock_allocation_manager_; + RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_; +}; + +TEST_F(SetInteriorVehicleDataRequestTest, + Execute_ValidWithoutReadOnlyParams_ExpectResendToHMI) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams); + + // Expectations + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message)) + .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + + application_manager::AppExtensionPtr app_extension; + EXPECT_CALL(*mock_app_, AddExtension(_)) + .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); + EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, GetNextCorrelationID()) + .WillOnce(Return(kCorrelationId)); + + const std::string resource = "CLIMATE"; + + EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource)) + .WillOnce(Return(true)); + EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId)) + .WillOnce(Return(remote_control::AcquireResult::ALLOWED)); + EXPECT_CALL( + mock_allocation_manager_, + SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY)); + + application_manager::MessagePtr result_msg; + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)) + .WillOnce(SaveArg<0>(&result_msg)); + + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->Run(); + + // Assertions + EXPECT_EQ(kModuleId, app_extension->uid()); + EXPECT_EQ(application_manager::ProtocolVersion::kHMI, + result_msg->protocol_version()); + EXPECT_EQ(1, result_msg->correlation_id()); + EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type()); + const Json::Value hmi_request_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_EQ(functional_modules::hmi_api::set_interior_vehicle_data, + hmi_request_params[json_keys::kMethod].asString()); + const Json::Value hmi_request_climate_control_data = + hmi_request_params[json_keys::kParams][message_params::kModuleData] + [message_params::kClimateControlData]; + EXPECT_EQ(2u, hmi_request_climate_control_data.size()); + const Json::Value hmi_request_module_data_fan_speed = + hmi_request_climate_control_data[message_params::kFanSpeed]; + const Json::Value hmi_request_module_data_defrost_zone = + hmi_request_climate_control_data[message_params::kDefrostZone]; + EXPECT_EQ("FRONT", hmi_request_module_data_defrost_zone.asString()); + EXPECT_EQ(10, hmi_request_module_data_fan_speed.asInt()); +} + +TEST_F( + SetInteriorVehicleDataRequestTest, + Execute_ValidWithSettableAndReadOnlyParams_ExpectCutReadOnlyAndResendToHMI) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message( + kValidMobileRequestWithSettableAndReadOnlyParams); + + // Expectations + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message)) + .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); + + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + + application_manager::AppExtensionPtr app_extension; + EXPECT_CALL(*mock_app_, AddExtension(_)) + .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); + EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, GetNextCorrelationID()) + .WillOnce(Return(kCorrelationId)); + + const std::string resource = "CLIMATE"; + + EXPECT_CALL(mock_allocation_manager_, IsResourceFree(resource)) + .WillOnce(Return(true)); + EXPECT_CALL(mock_allocation_manager_, AcquireResource(resource, kAppId)) + .WillOnce(Return(remote_control::AcquireResult::ALLOWED)); + EXPECT_CALL( + mock_allocation_manager_, + SetResourceState(resource, kAppId, remote_control::ResourceState::BUSY)); + + application_manager::MessagePtr result_msg; + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)) + .WillOnce(SaveArg<0>(&result_msg)); + + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->Run(); + + // Assertions + EXPECT_EQ(kModuleId, app_extension->uid()); + EXPECT_EQ(application_manager::ProtocolVersion::kHMI, + result_msg->protocol_version()); + EXPECT_EQ(1, result_msg->correlation_id()); + EXPECT_EQ(application_manager::MessageType::kRequest, result_msg->type()); + const Json::Value hmi_request_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_EQ(functional_modules::hmi_api::set_interior_vehicle_data, + hmi_request_params[json_keys::kMethod].asString()); + const Json::Value hmi_request_climate_control_data = + hmi_request_params[json_keys::kParams][message_params::kModuleData] + [message_params::kClimateControlData]; + EXPECT_EQ(2u, hmi_request_climate_control_data.size()); + const Json::Value hmi_request_module_data_fan_speed = + hmi_request_climate_control_data[message_params::kFanSpeed]; + const Json::Value hmi_request_module_data_defrost_zone = + hmi_request_climate_control_data[message_params::kDefrostZone]; + EXPECT_EQ("FRONT", hmi_request_module_data_defrost_zone.asString()); + EXPECT_EQ(10, hmi_request_module_data_fan_speed.asInt()); +} + +TEST_F(SetInteriorVehicleDataRequestTest, + Execute_ValidWithOnlyParamsReadOnly_ExpectResponseReadOnly) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message( + kValidMobileRequestWithoutSettableAndWithReadOnlyParams); + + // Expectations + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message)) + .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); + + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + + application_manager::AppExtensionPtr app_extension; + EXPECT_CALL(*mock_app_, AddExtension(_)) + .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); + EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0); + + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->Run(); + + // Assertions + const Json::Value response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_FALSE(response_params[result_codes::kSuccess].asBool()); + EXPECT_EQ(result_codes::kReadOnly, + response_params[json_keys::kResultCode].asString()); +} + +TEST_F( + SetInteriorVehicleDataRequestTest, + Execute_MessageValidationFailed_ExpectMessageNotSentToHMI_AndFalseSentToMobile) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kInvalidMobileRequest); + + // Expectations + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*mobile_message)) + .WillOnce( + Return(application_manager::MessageValidationResult::INVALID_JSON)); + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->Run(); + + // Assertions + const Json::Value response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_FALSE(response_params[result_codes::kSuccess].asBool()); + EXPECT_EQ(result_codes::kInvalidData, + response_params[json_keys::kResultCode].asString()); +} + +TEST_F(SetInteriorVehicleDataRequestTest, + OnEvent_ValidHmiResponse_ExpectSuccessfulResponseSentToMobile) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams); + + application_manager::MessagePtr hmi_message = CreateBasicMessage(); + hmi_message->set_json_message(kValidHmiResponse); + hmi_message->set_message_type(application_manager::MessageType::kResponse); + + // Expectations + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + + // Act + remote_control::RCPluginEvent event( + hmi_message, functional_modules::hmi_api::set_interior_vehicle_data); + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + command->on_event(event); + + // Assertions + const Json::Value response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_TRUE(response_params[json_keys::kSuccess].asBool()); + EXPECT_EQ(result_codes::kSuccess, + response_params[json_keys::kResultCode].asString()); +} + +TEST_F(SetInteriorVehicleDataRequestTest, + OnEvent_InvalidHmiResponse_ExpectGenericErrorResponseSentToMobile) { + // Arrange + application_manager::MessagePtr mobile_message = CreateBasicMessage(); + mobile_message->set_json_message(kValidMobileRequestWithOnlySettableParams); + application_manager::MessagePtr hmi_message = CreateBasicMessage(); + hmi_message->set_json_message(kInvalidHmiResponse); + hmi_message->set_message_type(application_manager::MessageType::kResponse); + + // Expectations + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(*hmi_message)) + .WillOnce( + Return(application_manager::MessageValidationResult::INVALID_JSON)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(mock_module_, SendResponseToMobile(_)) + .WillOnce(SaveArg<0>(&result_msg)); + + // Act + remote_control::request_controller::MobileRequestPtr command = + CreateCommand(mobile_message); + remote_control::RCPluginEvent event( + hmi_message, functional_modules::hmi_api::set_interior_vehicle_data); + command->on_event(event); + const Json::Value response_params = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_FALSE(response_params[json_keys::kSuccess].asBool()); + EXPECT_EQ(result_codes::kGenericError, + response_params[json_keys::kResultCode].asString()); + const Json::Value hmi_response = + MessageHelper::StringToValue(hmi_message->json_message()); + EXPECT_EQ(hmi_response[json_keys::kInfo].asString(), + response_params[json_keys::kInfo].asString()); +} + +} // namespace set_interior_vehicle_data_request_test +} // namespace remote_control_test +} // namespace components +} // namespace test diff --git a/src/components/remote_control/test/include/mock_application.h b/src/components/remote_control/test/include/mock_application.h new file mode 100644 index 0000000000..d466ba9ca5 --- /dev/null +++ b/src/components/remote_control/test/include/mock_application.h @@ -0,0 +1,329 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_ + +#include + +#include +#include "gmock/gmock.h" +#include "application_manager/application.h" +#include "interfaces/MOBILE_API.h" +#include "application_manager/app_extension.h" +#include "smart_objects/smart_object.h" +#include "utils/custom_string.h" +#include "application_manager/usage_statistics.h" + +namespace test { +namespace components { +namespace remote_control_test { + +namespace am = application_manager; +namespace mobile_api = mobile_apis; +namespace custom_str = utils::custom_string; + +namespace custom_str = utils::custom_string; +class MockApplication : public ::application_manager::Application { + public: + MockApplication() {} + MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(curHash, const std::string&()); + MOCK_METHOD0(UpdateHash, void()); + MOCK_CONST_METHOD0(flag_sending_hash_change_after_awake, bool()); + MOCK_METHOD1(set_flag_sending_hash_change_after_awake, void(bool flag)); + MOCK_CONST_METHOD0(is_application_data_changed, bool()); + MOCK_METHOD1(set_is_application_data_changed, + void(bool state_application_data)); + MOCK_METHOD0(CloseActiveMessage, void()); + MOCK_CONST_METHOD0(IsFullscreen, bool()); + MOCK_METHOD0(ChangeSupportingAppHMIType, void()); + MOCK_CONST_METHOD0(is_navi, bool()); + MOCK_METHOD1(set_is_navi, void(bool allow)); + MOCK_CONST_METHOD0(video_streaming_approved, bool()); + MOCK_METHOD1(set_video_streaming_approved, void(bool state)); + MOCK_CONST_METHOD0(audio_streaming_approved, bool()); + MOCK_METHOD1(set_audio_streaming_approved, void(bool state)); + MOCK_CONST_METHOD0(video_streaming_allowed, bool()); + MOCK_METHOD1(set_video_streaming_allowed, void(bool state)); + MOCK_CONST_METHOD0(audio_streaming_allowed, bool()); + MOCK_METHOD1(set_audio_streaming_allowed, void(bool state)); + MOCK_CONST_METHOD0(is_audio, bool()); + MOCK_METHOD1(StartStreaming, + void(protocol_handler::ServiceType service_type)); + MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type)); + MOCK_METHOD1(StopStreamingForce, + void(protocol_handler::ServiceType service_type)); + MOCK_METHOD1(SuspendStreaming, + void(protocol_handler::ServiceType service_type)); + MOCK_METHOD1(WakeUpStreaming, + void(protocol_handler::ServiceType service_type)); + MOCK_CONST_METHOD0(is_voice_communication_supported, bool()); + MOCK_METHOD1(set_voice_communication_supported, + void(bool is_voice_communication_supported)); + MOCK_CONST_METHOD0(app_allowed, bool()); + MOCK_CONST_METHOD0(has_been_activated, bool()); + MOCK_METHOD1(set_activated, bool(bool is_active)); + MOCK_CONST_METHOD0(version, const ::application_manager::Version&()); + MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id)); + MOCK_CONST_METHOD0(hmi_app_id, uint32_t()); + MOCK_CONST_METHOD0(name, const custom_str::CustomString&()); + MOCK_METHOD1(set_folder_name, void(const std::string& folder_name)); + MOCK_CONST_METHOD0(folder_name, const std::string()); + MOCK_CONST_METHOD0(is_media_application, bool()); + MOCK_CONST_METHOD0(hmi_level, const mobile_apis::HMILevel::eType()); + MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType()); + MOCK_CONST_METHOD0(audio_streaming_state, + const mobile_apis::AudioStreamingState::eType()); + MOCK_CONST_METHOD0(app_icon_path, const std::string&()); + MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle()); + MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr()); + MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr()); + MOCK_CONST_METHOD0(PostponedHmiState, + const application_manager::HmiStatePtr()); + MOCK_METHOD1(set_tts_properties_in_none, void(bool active)); + MOCK_METHOD0(tts_properties_in_none, bool()); + MOCK_METHOD1(set_tts_properties_in_full, void(bool active)); + MOCK_METHOD0(tts_properties_in_full, bool()); + MOCK_METHOD1(set_version, + void(const ::application_manager::Version& version)); + MOCK_METHOD1(set_name, void(const custom_str::CustomString& name)); + MOCK_METHOD1(set_is_media_application, void(bool is_media)); + MOCK_METHOD0(increment_put_file_in_none_count, void()); + MOCK_METHOD0(increment_delete_file_in_none_count, void()); + MOCK_METHOD0(increment_list_files_in_none_count, void()); + MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name)); + MOCK_METHOD1(set_app_allowed, void(const bool allowed)); + MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device)); + MOCK_CONST_METHOD0(get_grammar_id, uint32_t()); + MOCK_METHOD1(set_grammar_id, void(uint32_t value)); + MOCK_METHOD1( + set_protocol_version, + void(const ::application_manager::ProtocolVersion& protocol_version)); + MOCK_CONST_METHOD0(protocol_version, + ::application_manager::ProtocolVersion()); + MOCK_METHOD1(set_is_resuming, void(bool)); + MOCK_CONST_METHOD0(is_resuming, bool()); + MOCK_METHOD1(AddFile, bool(const ::application_manager::AppFile& file)); + MOCK_CONST_METHOD0(getAppFiles, const ::application_manager::AppFilesMap&()); + MOCK_METHOD1(UpdateFile, bool(const ::application_manager::AppFile& file)); + MOCK_METHOD1(DeleteFile, bool(const std::string& file_name)); + MOCK_METHOD1( + GetFile, + const ::application_manager::AppFile*(const std::string& file_name)); + MOCK_METHOD1(SubscribeToButton, + bool(mobile_apis::ButtonName::eType btn_name)); + MOCK_METHOD1(IsSubscribedToButton, + bool(mobile_apis::ButtonName::eType btn_name)); + MOCK_METHOD1(UnsubscribeFromButton, + bool(mobile_apis::ButtonName::eType btn_name)); + MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type)); + MOCK_CONST_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type)); + MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type)); + MOCK_METHOD0(ResetDataInNone, void()); + MOCK_METHOD2(AreCommandLimitsExceeded, + bool(mobile_apis::FunctionID::eType cmd_id, + ::application_manager::TLimitSource source)); + MOCK_METHOD0(usage_report, ::application_manager::UsageStatistics&()); + MOCK_METHOD1(SetRegularState, void(::application_manager::HmiStatePtr state)); + MOCK_METHOD1(SetPostponedState, + void(::application_manager::HmiStatePtr state)); + MOCK_METHOD0(RemovePostponedState, void()); + MOCK_METHOD1(AddHMIState, void(::application_manager::HmiStatePtr state)); + MOCK_METHOD1(RemoveHMIState, + void(::application_manager::HmiState::StateID state_id)); + MOCK_METHOD2(SubscribeToSoftButtons, + void(int32_t cmd_id, + const ::application_manager::SoftButtonID& softbuttons_id)); + MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id)); + MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id)); + MOCK_CONST_METHOD0(IsAudioApplication, bool()); + MOCK_METHOD0(LoadPersistentFiles, void()); + // InitialApplicationData methods + MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(policy_app_id, std::string()); + MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(ngn_media_screen_name, + const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(language, const mobile_apis::Language::eType&()); + MOCK_CONST_METHOD0(ui_language, const mobile_apis::Language::eType&()); + MOCK_METHOD1(set_app_types, + void(const smart_objects::SmartObject& app_types)); + MOCK_METHOD1(set_vr_synonyms, + void(const smart_objects::SmartObject& vr_synonyms)); + MOCK_METHOD1(set_policy_app_id, void(const std::string& policy_app_id)); + MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name)); + MOCK_METHOD1(set_ngn_media_screen_name, + void(const smart_objects::SmartObject& ngn_name)); + MOCK_METHOD1(set_language, + void(const mobile_apis::Language::eType& language)); + MOCK_METHOD1(set_ui_language, + void(const mobile_apis::Language::eType& ui_language)); + // DynamicApplicationData methods + MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_help_title, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_help, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(tbt_state, const mobile_apis::TBTState::eType&()); + MOCK_CONST_METHOD0(show_command, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0( + SubscribedButtons, + DataAccessor< ::application_manager::ButtonSubscriptions>()); + MOCK_CONST_METHOD0( + SubscribedIVI, + DataAccessor< ::application_manager::VehicleInfoSubscriptions>()); + MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*()); + MOCK_METHOD1(load_global_properties, + void(const smart_objects::SmartObject& so)); + MOCK_METHOD1(set_help_prompt, + void(const smart_objects::SmartObject& help_prompt)); + MOCK_METHOD1(set_timeout_prompt, + void(const smart_objects::SmartObject& timeout_prompt)); + MOCK_METHOD1(set_vr_help_title, + void(const smart_objects::SmartObject& vr_help_title)); + MOCK_METHOD0(reset_vr_help_title, void()); + MOCK_METHOD1(set_vr_help, void(const smart_objects::SmartObject& vr_help)); + MOCK_METHOD0(reset_vr_help, void()); + MOCK_METHOD1(set_tbt_state, + void(const mobile_apis::TBTState::eType& tbt_state)); + MOCK_METHOD1(set_show_command, + void(const smart_objects::SmartObject& show_command)); + MOCK_METHOD1(set_tbt_show_command, + void(const smart_objects::SmartObject& tbt_show)); + MOCK_METHOD1(set_keyboard_props, + void(const smart_objects::SmartObject& keyboard_props)); + MOCK_METHOD1(set_menu_title, + void(const smart_objects::SmartObject& menu_title)); + MOCK_METHOD1(set_menu_icon, + void(const smart_objects::SmartObject& menu_icon)); + MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t()); + MOCK_METHOD1(set_audio_stream_retry_number, + void(const uint32_t& audio_stream_retry_number)); + MOCK_CONST_METHOD0(video_stream_retry_number, uint32_t()); + MOCK_METHOD1(set_video_stream_retry_number, + void(const uint32_t& video_stream_retry_number)); + MOCK_METHOD2(AddCommand, + void(uint32_t cmd_id, + const smart_objects::SmartObject& command)); + MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id)); + MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id)); + MOCK_METHOD2(AddSubMenu, + void(uint32_t menu_id, const smart_objects::SmartObject& menu)); + MOCK_METHOD1(RemoveSubMenu, void(uint32_t menu_id)); + MOCK_CONST_METHOD1(FindSubMenu, + smart_objects::SmartObject*(uint32_t menu_id)); + MOCK_METHOD1(IsSubMenuNameAlreadyExist, bool(const std::string& name)); + MOCK_METHOD2(AddChoiceSet, + void(uint32_t choice_set_id, + const smart_objects::SmartObject& choice_set)); + MOCK_METHOD1(RemoveChoiceSet, void(uint32_t choice_set_id)); + MOCK_METHOD1(FindChoiceSet, + smart_objects::SmartObject*(uint32_t choice_set_id)); + MOCK_METHOD3(AddPerformInteractionChoiceSet, + void(uint32_t correlation_id, + uint32_t choice_set_id, + const smart_objects::SmartObject& choice_set)); + MOCK_METHOD1(DeletePerformInteractionChoiceSet, + void(uint32_t correlation_id)); + MOCK_CONST_METHOD0( + performinteraction_choice_set_map, + DataAccessor< ::application_manager::PerformChoiceSetMap>()); + MOCK_CONST_METHOD0(commands_map, + DataAccessor< ::application_manager::CommandsMap>()); + MOCK_CONST_METHOD0(sub_menu_map, + DataAccessor< ::application_manager::SubMenuMap>()); + MOCK_CONST_METHOD0(choice_set_map, + DataAccessor< ::application_manager::ChoiceSetMap>()); + MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active)); + MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t()); + MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode)); + MOCK_CONST_METHOD0(perform_interaction_mode, int32_t()); + MOCK_METHOD1(set_perform_interaction_layout, + void(mobile_apis::LayoutMode::eType mode)); + MOCK_CONST_METHOD0(perform_interaction_layout, + mobile_apis::LayoutMode::eType()); + MOCK_METHOD1(set_reset_global_properties_active, void(bool active)); + MOCK_CONST_METHOD0(is_reset_global_properties_active, bool()); + MOCK_CONST_METHOD0(app_id, uint32_t()); + MOCK_CONST_METHOD0(mac_address, const std::string&()); + MOCK_CONST_METHOD0(bundle_id, const std::string&()); + MOCK_METHOD1(set_bundle_id, void(const std::string& bundle_id)); + MOCK_METHOD0(GetAvailableDiskSpace, uint32_t()); + + MOCK_METHOD1(set_mobile_app_id, void(const std::string& policy_app_id)); + MOCK_CONST_METHOD0(is_foreground, bool()); + MOCK_METHOD1(set_foreground, void(bool is_foreground)); + MOCK_CONST_METHOD0(IsRegistered, bool()); + MOCK_CONST_METHOD0(SchemaUrl, std::string()); + MOCK_CONST_METHOD0(PackageName, std::string()); + +#ifdef SDL_REMOTE_CONTROL + MOCK_METHOD1( + set_system_context, + void(const application_manager::mobile_api::SystemContext::eType&)); + MOCK_METHOD1( + set_audio_streaming_state, + void(const application_manager::mobile_api::AudioStreamingState::eType& + state)); + MOCK_METHOD1(IsSubscribedToInteriorVehicleData, + bool(smart_objects::SmartObject module)); + MOCK_METHOD1(SubscribeToInteriorVehicleData, + bool(smart_objects::SmartObject module)); + MOCK_METHOD1(UnsubscribeFromInteriorVehicleData, + bool(smart_objects::SmartObject module)); + MOCK_METHOD1( + set_hmi_level, + void(const application_manager::mobile_api::HMILevel::eType& hmi_level)); + MOCK_METHOD1(QueryInterface, + application_manager::AppExtensionPtr( + application_manager::AppExtensionUID uid)); + MOCK_METHOD1(AddExtension, + bool(application_manager::AppExtensionPtr extention)); + MOCK_METHOD1(RemoveExtension, bool(application_manager::AppExtensionUID uid)); + MOCK_METHOD0(RemoveExtensions, void()); + MOCK_CONST_METHOD0(SubscribesIVI, const std::set&()); + +#endif // SDL_REMOTE_CONTROL +}; + +} // namespace remote_control_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_APPLICATION_H_ diff --git a/src/components/remote_control/test/include/mock_remote_control_plugin.h b/src/components/remote_control/test/include/mock_remote_control_plugin.h new file mode 100644 index 0000000000..fccaac2828 --- /dev/null +++ b/src/components/remote_control/test/include/mock_remote_control_plugin.h @@ -0,0 +1,55 @@ +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_ + +#include +#include "remote_control/remote_plugin_interface.h" +#include "remote_control/resource_allocation_manager.h" +#include "application_manager/message.h" +#include "mock_application.h" + +namespace test { +namespace components { +namespace remote_control_test { + +class RCAppExtension; +typedef utils::SharedPtr RCAppExtensionPtr; + +class MockRemotePluginInterface : public remote_control::RemotePluginInterface { + public: + MOCK_CONST_METHOD0(GetPluginInfo, functional_modules::PluginInfo()); + MOCK_METHOD1( + ProcessMessage, + functional_modules::ProcessResult(application_manager::MessagePtr msg)); + MOCK_METHOD1( + ProcessHMIMessage, + functional_modules::ProcessResult(application_manager::MessagePtr msg)); + MOCK_METHOD1(SendResponseToMobile, void(application_manager::MessagePtr msg)); + MOCK_METHOD1(SendTimeoutResponseToMobile, + void(application_manager::MessagePtr msg)); + MOCK_METHOD1(RemoveAppExtension, void(uint32_t app_id)); + MOCK_METHOD1(IsAppForPlugin, + bool(application_manager::ApplicationSharedPtr app)); + MOCK_METHOD2(OnAppHMILevelChanged, + void(application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType old_level)); + MOCK_METHOD2(CanAppChangeHMILevel, + bool(application_manager::ApplicationSharedPtr app, + mobile_apis::HMILevel::eType new_level)); + MOCK_METHOD1(OnDeviceRemoved, + void(const connection_handler::DeviceHandle& device)); + MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id)); + MOCK_METHOD1(SendHmiStatusNotification, + void(application_manager::ApplicationSharedPtr app)); + MOCK_METHOD0(event_dispatcher, RCPluginEventDispatcher&()); + MOCK_METHOD0(RemoveAppExtensions, void()); + MOCK_METHOD0(service, application_manager::ServicePtr()); + MOCK_CONST_METHOD0(GetModuleID, functional_modules::ModuleID()); + MOCK_METHOD0(resource_allocation_manager, + remote_control::ResourceAllocationManager&()); +}; + +} // namespace remote_control_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_REMOTE_CONTROL_PLUGIN_H_ diff --git a/src/components/remote_control/test/include/mock_resource_allocation_manager.h b/src/components/remote_control/test/include/mock_resource_allocation_manager.h new file mode 100644 index 0000000000..5a83410932 --- /dev/null +++ b/src/components/remote_control/test/include/mock_resource_allocation_manager.h @@ -0,0 +1,47 @@ +#ifndef SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_ +#define SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_ + +#include "gmock/gmock.h" +#include "remote_control/resource_allocation_manager.h" + +namespace test { +namespace components { +namespace remote_control_test { + +class MockAskDriverCallBack : public remote_control::AskDriverCallBack { + public: + MOCK_METHOD1( + on_event, + void(const rc_event_engine::Event& event)); +}; + +class MockResourceAllocationManager + : public remote_control::ResourceAllocationManager { + public: + MOCK_METHOD2(AcquireResource, + remote_control::AcquireResult::eType( + const std::string& module_type, const uint32_t app_id)); + MOCK_METHOD2(ForceAcquireResource, + void(const std::string& module_type, const uint32_t app_id)); + MOCK_METHOD2(OnDriverDisallowed, + void(const std::string& module_type, const uint32_t app_id)); + MOCK_METHOD3(AskDriver, + void(const std::string& module_type, + const uint32_t app_id, + remote_control::AskDriverCallBackPtr callback)); + MOCK_METHOD1(SetAccessMode, + void(const hmi_apis::Common_RCAccessMode::eType access_mode)); + MOCK_METHOD3(SetResourceState, + void(const std::string& module_type, + const uint32_t app_id, + const remote_control::ResourceState::eType state)); + MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id)); + MOCK_CONST_METHOD1(IsResourceFree, bool(const std::string& module_type)); +}; + +} // namespace remote_control_test +} // namespace components +} // namespace test + +#endif // SRC_COMPONENTS_REMOTE_CONTROL_TEST_INCLUDE_MOCK_RESOURCE_ALLOCATION_MANAGER_H_ diff --git a/src/components/remote_control/test/lc.awk b/src/components/remote_control/test/lc.awk new file mode 100755 index 0000000000..6bc2331c5d --- /dev/null +++ b/src/components/remote_control/test/lc.awk @@ -0,0 +1,170 @@ +#!/usr/bin/awk +#---------------------------------------------------------------------------- +# +# Awk program to count lines of code in C source files. +# Has logic to keep track of comments as well. +# +# Assumptions/limitations: +# - Does *not* undestand inline asm - counted as source lines! +# - Does not include blank lines in the average +# - Assumes no code on a line after a "*/" - poss change this? +# - Counts *any* non-comment line as code eg { or } by themselves, etc +# - depends on hash order of awk - this is risky! (See END code) +# - Presently, the output redirects quite badly - command line option? +# - Overflow if any number >32768 - mawk limitation. +# +# Paul Hubbard phubbard@computer.org written 5/1993 +# Apache 2.0 license - enjoy! + +#---------------------------------------------------------------------------- + +BEGIN { # Init vars at startup + print "" +} + +#---------------------------------------------------------------------------- +# Main loop + +# Print filename on read of first record +FNR == 1 { + printf("\r ") + printf("\rReading file: %s", FILENAME) + comments[FILENAME] = 0 + lines[FILENAME] = 0 + fname[FILENAME] = FILENAME + raw_linecount[FILENAME] = 0 + in_comment = 0 +} + +# Increment line count as first thing done +raw_linecount[FILENAME]++{} + +# Test for "//" in the first record +($1 ~ /\/\//) { # single line comment - skip to next rec + comments[FILENAME]++ + next +} + +# Test for "//" in rest of the record (comment after code - counts as both) +/\/\// { + in_comment = 0 + comments[FILENAME]++ # lines count will be incremented below +} + +# This wierd "/\/\*/" junk is awk-ish for the string "/*" - aka comment begin +/\/\*/ { # Begin multi-line comment + if($1 ~ /\/\*/) { # Comment is first record - no code here! + in_comment = 1 + } + else { # "/*" type comment AFTER code - is both + in_comment = 0 + comments[FILENAME]++ # Lines array inc below + } +} + +# And this is "*/" aka comment end +/\*\// { # End of multi-line comment + if(in_comment = 1){ # Multi line comment - can increment + comments[FILENAME]++ + in_comment = 0 # Reset Boolean + next # Assumes no code after "*/" !! + } +} + +# Test for empty lines and skip +(length($0) == 0) {next} + +(in_comment > 0) {comments[FILENAME]++} +(in_comment == 0) {lines[FILENAME]++} + +#---------------------------------------------------------------------------- +# Termination code +END { + + # Kluge clear EOL + printf("\r \n") + + CCT = LCT = 0 # init totals + idx = 0 # init pseudo-index + maxlen = 0 + name_len = 0 + + # Walk thru file names array to get maxlen + for(i in fname) { + if((length(fname[i])) > maxlen) {maxlen = length(fname[i])} + } + + maxlen++ + name_len = maxlen # save maxlen for formatting header + if(name_len < 4) {name_len = 4} + + # Build formatting string for sprintf; eg "%15s " to beautify output + spf_str = "%" + maxlen = maxlen "s " # Convert number to string and add trailer + spf_str = spf_str maxlen# Add pieces together to build format str + + # Walk thru file names array + for(i in fname) { + output[idx] = sprintf(spf_str, fname[i]) + idx++ + } + + idx = 0 + + # Walk thru lines array + for(i in lines) { + tempstr = sprintf("%5d", lines[i]) + output[idx] = output[idx] tempstr + LCT += lines[i] + idx++ + } + + idx = 0 + + # Walk thru comments array + for(i in comments) { + tempstr = sprintf("%11d", comments[i]) + output[idx] = output[idx] tempstr + CCT += comments[i] + idx++ + } + + idx = 0 + raw_lc = 0 + + # Walk thru array of raw line counts (includes empty lines) + for(i in raw_linecount) { + tempstr = sprintf("%12d", raw_linecount[i]) + output[idx] = output[idx] tempstr + idx++ + raw_lc += raw_linecount[i] + } + + # Print header + for(i = 0; i < (name_len - 4); i++) {printf"-"} + str = "File---Code---Comments---Raw Lines" + printf(str) + + j = length(str) + (name_len - 4) + + # Finish off the header line + printf("\n") + for(i = j; i < 80; i++) {printf("-")} + + # Dump constructed lines of data + for(i = 0; i < idx; i++) {print output[i]} + + # Print trailer line + for(i = 0; i < 80; i++) {printf("-")} + + #Dump totals + printf("\n Total code: %d", LCT) + printf("\n Total comments: %d", CCT) + printf("\n Total raw lines: %d\n", raw_lc) + + if((LCT + CCT) > 0) { + printf("Comment percentage: %f", (CCT / (LCT + CCT)) * 100) + } + + print "" +} \ No newline at end of file diff --git a/src/components/remote_control/test/run_calc_comments.sh b/src/components/remote_control/test/run_calc_comments.sh new file mode 100755 index 0000000000..bd295a6ce4 --- /dev/null +++ b/src/components/remote_control/test/run_calc_comments.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# Script to call awk line-counting script + +show_help() { + echo " + Usage: ./run_calc_comments.sh [OPTION]... + Counts comment percentage in source files.\n + Arguments: + -h displays help message and exits + -d PATH_TO_DIRECTORY specifies path to directory with source files.\ + Script applies counting to all files in directory recursively. \ + Default is current directory. + -f FILE_FORMAT specifies file extension or other format of file names. \ + Script applies counting to all files with specified file name recursively in directory. \ + Default is *.h.\n + Example: + ./run_calc_comments.sh -f *.h -d ../../../src/components/can_cooperation/\n" +} + + +OPTIND=1 +input_directory="." +file_type="*.h" + +while getopts "hd:f:" opt; do + case "$opt" in + h) + show_help + exit 0 + ;; + d) input_directory=$OPTARG + ;; + f) file_type=$OPTARG + ;; + esac +done + +find $input_directory -name "$file_type" -printf "%p " | xargs awk -f ./lc.awk \ No newline at end of file diff --git a/src/components/remote_control/test/run_mem_check.sh b/src/components/remote_control/test/run_mem_check.sh new file mode 100755 index 0000000000..ce6f128263 --- /dev/null +++ b/src/components/remote_control/test/run_mem_check.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# Srcipt to call valgring check + +OPTIND=1 +only_install=0 +install_quietly=0 +command_name="valgrind" + +show_help() { + echo " + Usage: ./run_mem_check.sh [OPTION]... + Runs valgring against binary. + Arguments: + -h displays help message and exits + -b specifies binary to be tested. Default is can_cooperation_test. + -q install missing software without prompting. Default is false. + -i only install missing software and exit. No prompts will be issued. + -x save XML output to file. Only for memcheck tool. + -t module tool name for analyse (memcheck - default, callgrind, massif and etc.) + -f to run selected tests (see examples below) + + GUI tools which you can use to analyse: + Valkyrie - memcheck + KCachegrind- callgrind + Massif-Visualizer - massif + + Example: + ./run_mem_check.sh -b ./test_can_module + ./run_mem_check.sh -t callgrind + ./run_mem_check.sh -x output.xml + ./run_mem_check.sh -f CanTcpConnectionTest* + ./run_mem_check.sh -f *WriteData +" +} + +installation_prompt() { + read -n 1 -p "Would you like to install $command_name? [Y/n] " is_ok + echo + if [ "$is_ok" == "y" -o "$is_ok" == "Y" ] + then + sudo apt-get install $command_name + else + echo "$command_name will no be installed. Quiting." + exit 0 + fi +} + +install_if_not() { + if command -v $command_name >/dev/null 2>&1; then + echo "Run $command_name" + else + echo "Installation of $command_name is required." + if [ $install_quietly -eq 1 ]; then + sudo apt-get install $command_name + else + installation_prompt + fi + fi +} + +binary_test="./can_cooperation_test" + +tool_name=memcheck +while getopts "t:x:hqib:f:" opt; do + case "$opt" in + h) + show_help + exit 0 + ;; + q) install_quietly=1 + ;; + i) only_install=1 + install_quietly=1 + install_if_not + exit 0 + ;; + b) binary_test=$OPTARG + ;; + x) xml_report="--xml=yes --xml-file=$OPTARG" + ;; + t) tool_name=$OPTARG + ;; + f) gtest_filter="--gtest_filter=$OPTARG" + ;; + esac +done + +install_if_not + +if [ "$tool_name" == "memcheck" ]; then + params="--leak-check=full --leak-check-heuristics=all --show-leak-kinds=all" +fi + +$command_name --tool=$tool_name $params $xml_report $binary_test $gtest_filter diff --git a/src/components/remote_control/test/setup_rsdl.sh b/src/components/remote_control/test/setup_rsdl.sh new file mode 100755 index 0000000000..b1d9082bcd --- /dev/null +++ b/src/components/remote_control/test/setup_rsdl.sh @@ -0,0 +1,160 @@ +#!/bin/bash + +show_help() { + echo " + Usage: ./setup_rsdl.sh [OPTION]... + Runs installers to setup environment. + Arguments: + -h displays help message and exits + -b Install basic packages: cmake; subversion; git; g++; sqlite. + -B Install BlueTooth related packages: libbluetooth3 libbluetooth-dev and bluez + -W Install WiFi additional packages: avahi + -U Install USB additional packages: libudev; sets USB permissions (recommended) + -A Install additional packages: chromium browser for HTML HMI; SSL for security feature. + -L Install lua packages: lua5.2 + -a Install all packages + -i Do not specify packages; prompt on each packages need to be installed + + Example: + ./setup_rsdl.sh -b + ./setup_rsdl.sh -a + ./setup_rsdl.sh -bBWUA +" +} + +install_base=false; +bt_install=false; +wifi_additional=false; +usb_install=false; +additional_install=false; +interact_mode=false; +lua_install=false; + +while getopts "hbBWUALai" opt; do + case "$opt" in + h) + show_help + exit 0 + ;; + b) install_base=true + ;; + B) bt_install=true + ;; + W) wifi_additional=true + ;; + U) usb_install=true + ;; + A) additional_install=true + ;; + L) lua_install=true + ;; + a) install_base=true + bt_install=true + wifi_additional=true + usb_install=true + additional_install=true + lua_install=true + ;; + i) interact_mode=true + install_base=true + bt_install=true + wifi_additional=true + usb_install=true + additional_install=true + lua_install=true + ;; + esac +done + +#apt-get install wrapper function +function apt-install() { + if [ -z "$1" ]; then + return 1; + fi + if ${interact_mode}; then + APT_ARGS="" + else + APT_ARGS="--yes --force-yes" + fi + set -x #Show install command to user" + apt-get install ${APT_ARGS} $* + set +x +} + +if ${install_base}; then + CMAKE_BUILD_SYSTEM="cmake" + SUBVERSION="subversion" + GIT="git" + GNU_CPP_COMPILER="g++" + LIB_SQLITE="libsqlite3-dev" +else + CMAKE_BUILD_SYSTEM="" + SUBVERSION="" + GIT="" + GNU_CPP_COMPILER="" + LIB_SQLITE="" +fi + +if ${bt_install}; then + BLUEZ_PROTOCOL_STACK="libbluetooth3 libbluetooth-dev" + BLUEZ_TOOLS="bluez-tools" +else + BLUEZ_PROTOCOL_STACK="" + BLUEZ_TOOLS="" +fi + +if ${wifi_additional}; then + AVAHI_CLIENT_LIBRARY="libavahi-client-dev" +else + AVAHI_CLIENT_LIBRARY="" +fi + +if ${usb_install}; then + LIB_UDEV="libudev-dev" + USB_PERMISSIONS="SUBSYSTEM==\"usb\", GROUP=\"users\", MODE=\"0666\"" +else + LIB_UDEV="" + USB_PERMISSIONS="" +fi + +if ${lua_install}; then + LUA_PACKAGE="lua5.2" +else + LUA_PACKAGE="" +fi + +if ${additional_install}; then + CHROMIUM_BROWSER="chromium-browser" + LIB_SSL="libssl-dev" +else + CHROMIUM_BROWSER="" + LIB_SSL="" +fi + +#apt-get update +apt-install ${CMAKE_BUILD_SYSTEM} +apt-install ${SUBVERSION} +apt-install ${GIT} +apt-install ${GNU_CPP_COMPILER} +apt-install ${LIB_SQLITE} +apt-install ${BLUEZ_PROTOCOL_STACK} +apt-install ${BLUEZ_TOOLS} +apt-install ${AVAHI_CLIENT_LIBRARY} +apt-install ${CHROMIUM_BROWSER} +apt-install ${LIB_SSL} +apt-install ${LUA_PACKAGE} + +apt-install ${LIB_UDEV} +if ${usb_install}; then + echo "Setting up USB permissions..." + if [ ! -f "/etc/udev/rules.d/90-usbpermission.rules" ]; then + echo "Create permission file" + touch /etc/udev/rules.d/90-usbpermission.rules + echo -e "\n" | tee /etc/udev/rules.d/90-usbpermission.rules + fi + + if ! grep --quiet "$USB_PERMISSIONS" /etc/udev/rules.d/90-usbpermission.rules; then + echo "Adding permissions..." + sed -i "\$i$USB_PERMISSIONS" /etc/udev/rules.d/90-usbpermission.rules + fi +fi diff --git a/src/components/remote_control/test/smartDeviceLink.ini b/src/components/remote_control/test/smartDeviceLink.ini new file mode 100644 index 0000000000..e9c07f3698 --- /dev/null +++ b/src/components/remote_control/test/smartDeviceLink.ini @@ -0,0 +1,5 @@ +[Remote Control] +InteriorVDCapabilitiesFile = ./InteriorVehicleDataCapabilities.json +address = 127.0.0.1 +port = 8092 +timeout_period_seconds = 10 diff --git a/src/components/remote_control/test/src/rc_app_extension_test.cc b/src/components/remote_control/test/src/rc_app_extension_test.cc new file mode 100644 index 0000000000..5022853e30 --- /dev/null +++ b/src/components/remote_control/test/src/rc_app_extension_test.cc @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "gtest/gtest.h" +#include "remote_control/rc_app_extension.h" + +namespace remote_control { + +TEST(CanAppExtensionTest, Create) { + RCAppExtension extension(7); + ASSERT_TRUE(extension.uid() == 7); +} + +TEST(CanAppExtensionTest, Control) { + RCAppExtension extension(3); + ASSERT_EQ(3, extension.uid()); + ASSERT_FALSE(extension.IsControlGiven()); + extension.GiveControl(true); + ASSERT_TRUE(extension.IsControlGiven()); +} + +TEST(CanAppExtensionTest, DriverDevice) { + RCAppExtension extension(5); + ASSERT_EQ(5, extension.uid()); + ASSERT_FALSE(extension.is_on_driver_device()); + extension.set_is_on_driver_device(true); + ASSERT_TRUE(extension.is_on_driver_device()); +} + +} // namespace remote_control diff --git a/src/components/remote_control/test/src/rc_library_test.cc b/src/components/remote_control/test/src/rc_library_test.cc new file mode 100644 index 0000000000..77a57c4c3f --- /dev/null +++ b/src/components/remote_control/test/src/rc_library_test.cc @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include +#include "gtest/gtest.h" +#include "remote_control/remote_control_plugin.h" +#include "mock_service.h" + +using functional_modules::PluginInfo; +using application_manager::MockService; + +using ::testing::Return; + +namespace remote_control { + +::testing::AssertionResult IsError(void* error) { + if (error) { + return ::testing::AssertionSuccess() << static_cast(error); + } else { + return ::testing::AssertionFailure() << error; + } +} + +TEST(CanLibraryTest, Load) { + const std::string kLibraryPath = "libRemoteControlModule.so"; + + void* handle = dlopen(kLibraryPath.c_str(), RTLD_LAZY); + EXPECT_FALSE(IsError(dlerror())); + ASSERT_TRUE(handle != NULL); + + const std::string kSymbol = "Create"; + void* symbol = dlsym(handle, kSymbol.c_str()); + EXPECT_FALSE(IsError(dlerror())); + ASSERT_TRUE(symbol != NULL); + + typedef CANModule* (*Create)(); + Create create_manager = reinterpret_cast(symbol); + CANModule* module = create_manager(); + ASSERT_TRUE(module != NULL); + + PluginInfo plugin = module->GetPluginInfo(); + EXPECT_EQ(plugin.name, "RemoteControlPlugin"); + EXPECT_EQ(plugin.version, 1); + + MockService* service = new MockService(); + module->set_service(service); + std::vector apps; + EXPECT_CALL(*service, GetApplications(module->GetModuleID())) + .Times(1) + .WillOnce(Return(apps)); + + // in order for all sub-threads to start before shutting them down + // The logic conditions must be chosen to insure that the "signal" is + // executed if the "wait" is ever processed. + // (see http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html) + sleep(3); + // CANModule::destroy(); + int ret = dlclose(handle); + EXPECT_FALSE(ret); + EXPECT_FALSE(IsError(dlerror())); +} + +} // namespace remote_control diff --git a/src/components/remote_control/test/src/rc_module_test.cc b/src/components/remote_control/test/src/rc_module_test.cc new file mode 100644 index 0000000000..4d4e1ac52d --- /dev/null +++ b/src/components/remote_control/test/src/rc_module_test.cc @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2015, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "gtest/gtest.h" +#include "remote_control/remote_control_plugin.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "functional_module/module_observer.h" +#include "application_manager/mock_application.h" +#include "include/mock_service.h" +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" +#include "application_manager/mock_message_helper.h" + +using functional_modules::PluginInfo; +using functional_modules::ProcessResult; +using functional_modules::RCFunctionID; +using application_manager::ServicePtr; + +using application_manager::MockService; +using application_manager::MockMessageHelper; +using test::components::application_manager_test::MockApplication; + +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::StrictMock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::Eq; +using ::application_manager::Message; +using ::application_manager::MessageType; +using ::application_manager::ApplicationSharedPtr; +using ::protocol_handler::MessagePriority; + +namespace { +const bool kDeviceHandle = 1u; +const std::string kDeviceId = "1"; +const std::string kDeviceName = "1"; +} + +namespace remote_control { + +class RCModuleTest : public ::testing::Test { + public: + RCModuleTest() + : mock_service_(utils::MakeShared >()) + , mock_message_helper_(*MockMessageHelper::message_helper_mock()) + , app0_(utils::MakeShared >()) + , app1_(utils::MakeShared >()) + , message_(utils::MakeShared(MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc))) + , rc_app_extention_( + utils::MakeShared(module_.GetModuleID())) {} + + void HandleMessage() { + module_.ProcessHMIMessage(message_); + } + + protected: + RemoteControlPlugin module_; + utils::SharedPtr > mock_service_; + MockMessageHelper& mock_message_helper_; + std::vector apps_; + utils::SharedPtr > app0_; + utils::SharedPtr > app1_; + application_manager::MessagePtr message_; + utils::SharedPtr rc_app_extention_; + + void SetUp() OVERRIDE { + Mock::VerifyAndClearExpectations(&mock_message_helper_); + ServicePtr exp_service(mock_service_); + module_.set_service(exp_service); + ServicePtr out_service = module_.service(); + EXPECT_EQ(exp_service.get(), out_service.get()); + } + + void TearDown() OVERRIDE { + Mock::VerifyAndClearExpectations(&mock_message_helper_); + EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) + .WillOnce(Return(apps_)); + } +}; + +TEST_F(RCModuleTest, Create) { + EXPECT_EQ(153, module_.GetModuleID()); + PluginInfo plugin = module_.GetPluginInfo(); + EXPECT_EQ(plugin.name, "RemoteControlPlugin"); + EXPECT_EQ(plugin.version, 1); +} + +TEST_F(RCModuleTest, ProcessMessageWrongMessage) { + message_->set_function_id(-1); + EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0); + EXPECT_EQ(ProcessResult::CANNOT_PROCESS, module_.ProcessMessage(message_)); +} + +TEST_F(RCModuleTest, ProcessMessageEmptyapps_List) { + message_->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA); + message_->set_function_name("OnInteriorVehicleData"); + + std::string json = + "{\"jsonrpc\": \"2.0\", \"method\": \"RC.OnInteriorVehicleData\",\ + \"params\": {\"moduleData\": {\"moduleType\": \"CLIMATE\",\ + \"climateControlData\": {\"fanSpeed\": 100} }}}"; + message_->set_json_message(json); + + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(_)) + .WillOnce(Return( + application_manager::MessageValidationResult::SCHEMA_MISMATCH)); + EXPECT_CALL(*mock_service_, SendMessageToMobile(_)).Times(0); + + // EXPECT_EQ(ProcessResult::PROCESSED, module_.ProcessMessage(message_)); + EXPECT_EQ(ProcessResult::CANNOT_PROCESS, module_.ProcessHMIMessage(message_)); +} + +TEST_F(RCModuleTest, ProcessMessagePass) { + message_->set_function_id(RCFunctionID::ON_INTERIOR_VEHICLE_DATA); + + std::string json = + "{ \"jsonrpc\": \"2.0\",\"method\": \"RC.OnInteriorVehicleData\",\ + \"params\":{\"moduleData\":{\ + \"moduleType\": \"CLIMATE\",\"climateControlData\": {\"fanSpeed\": 100}}}}"; + + message_->set_json_message(json); + + application_manager::BinaryData buf; + application_manager::BinaryData* data = &buf; + data->push_back(1); + + message_->set_binary_data(data); + + Json::Value json_value = MessageHelper::StringToValue(json); + Json::Value module_type = + json_value[json_keys::kParams][message_params::kModuleData] + [message_params::kModuleType]; + apps_.push_back(app0_); + rc_app_extention_->SubscribeToInteriorVehicleData(module_type); + EXPECT_CALL(*mock_service_, ValidateMessageBySchema(_)) + .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); + EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) + .WillOnce(Return(rc_app_extention_)); + EXPECT_CALL(*app0_, app_id()).WillRepeatedly(Return(1)); + EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) + .WillOnce(Return(apps_)); + EXPECT_CALL(*mock_service_, GetApplication(1)).WillOnce(Return(app0_)); + EXPECT_CALL(*mock_service_, CheckPolicyPermissions(_)) + .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); + EXPECT_CALL(*mock_service_, CheckModule(1, "CLIMATE")).WillOnce(Return(true)); + EXPECT_CALL(*mock_service_, SendMessageToMobile(_)); + + EXPECT_EQ(ProcessResult::PROCESSED, module_.ProcessHMIMessage(message_)); +} + +TEST_F(RCModuleTest, RemoveAppExtensionPassWay) { + EXPECT_CALL(*mock_service_, GetApplication(1)).WillOnce(Return(app0_)); + EXPECT_CALL(*app0_, RemoveExtension(module_.GetModuleID())); + + module_.RemoveAppExtension(1); +} + +TEST_F(RCModuleTest, RemoveAppExtensionIfAppNoExist) { + ApplicationSharedPtr invalid_app; + + EXPECT_CALL(*mock_service_, GetApplication(_)).WillOnce(Return(invalid_app)); + + module_.RemoveAppExtension(1); +} + +TEST_F(RCModuleTest, SendResponseToMobile) { + EXPECT_CALL(*mock_service_, SendMessageToMobile(message_)); + + module_.SendResponseToMobile(message_); +} + +TEST_F(RCModuleTest, IsAppForPluginSuccess) { + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + EXPECT_CALL(*app0_, AddExtension(_)).WillOnce(Return(true)); + mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL; + EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); + ON_CALL(*app0_, device()).WillByDefault(Return(1)); + EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)); + EXPECT_CALL(*mock_service_, PrimaryDevice()); + EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_))) + .WillOnce(Return(true)); + ASSERT_TRUE(module_.IsAppForPlugin(app0_)); +} + +TEST_F(RCModuleTest, IsAppForPluginNotNew) { + EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) + .WillOnce(Return(rc_app_extention_)); + EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)).Times(0); + ASSERT_TRUE(module_.IsAppForPlugin(app0_)); +} + +TEST_F(RCModuleTest, IsAppForPluginFail) { + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) + .WillOnce(Return(invalid_ext)); + EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_))) + .Times(1) + .WillOnce(Return(false)); + ASSERT_FALSE(module_.IsAppForPlugin(app0_)); +} + +TEST_F(RCModuleTest, OnAppHMILevelChanged) { + const application_manager::custom_str::CustomString name("name"); + ON_CALL(*app0_, name()).WillByDefault(ReturnRef(name)); + mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_NONE; + EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); + EXPECT_CALL(*mock_service_, + NotifyHMIAboutHMILevel(Eq(app0_), + mobile_apis::HMILevel::eType::HMI_NONE)); + module_.OnAppHMILevelChanged(app0_, mobile_apis::HMILevel::eType::HMI_FULL); +} + +TEST_F(RCModuleTest, SetDriverDeviceOnRegister) { + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) + .Times(2) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + EXPECT_CALL(*app0_, AddExtension(_)).WillOnce(Return(true)); + ON_CALL(*app0_, device()).WillByDefault(Return(12)); + mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_NONE; + EXPECT_CALL(*app0_, hmi_level()).Times(1).WillRepeatedly(Return(hmi)); + EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)).Times(1); + EXPECT_CALL(*mock_service_, PrimaryDevice()).Times(1).WillOnce(Return(12)); + EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_))) + .Times(1) + .WillOnce(Return(true)); + + ASSERT_TRUE(module_.IsAppForPlugin(app0_)); + ASSERT_TRUE(rc_app_extention_->is_on_driver_device()); +} + +TEST_F(RCModuleTest, SetDriverDeviceOnRegisterFail) { + application_manager::AppExtensionPtr invalid_ext; + EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) + .Times(2) + .WillOnce(Return(invalid_ext)) + .WillRepeatedly(Return(rc_app_extention_)); + EXPECT_CALL(*app0_, AddExtension(_)).WillOnce(Return(true)); + mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL; + EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); + ON_CALL(*app0_, device()).WillByDefault(Return(12)); + EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)).Times(1); + EXPECT_CALL(*mock_service_, PrimaryDevice()).Times(1).WillOnce(Return(3)); + EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_))) + .Times(1) + .WillOnce(Return(true)); + + ASSERT_TRUE(module_.IsAppForPlugin(app0_)); + ASSERT_FALSE(rc_app_extention_->is_on_driver_device()); +} + +// TODO(ILytvynenko): Uncomment after CANModule::HandleMessage implementtion +// TEST_F(RCModuleTest, ChangeDriverDevice) { +// Json::Value value(Json::ValueType::objectValue); +// value[json_keys::kMethod] = +// functional_modules::hmi_api::on_device_rank_changed; +// value[json_keys::kParams] = Json::Value(Json::ValueType::objectValue); +// value[json_keys::kParams][message_params::kDevice] = +// Json::Value(Json::ValueType::objectValue); +// value[json_keys::kParams][message_params::kDevice][json_keys::kId] = +// kDeviceId; +// value[json_keys::kParams][message_params::kDevice][message_params::kName] = +// kDeviceName; +// value[json_keys::kParams][message_params::kRank] = "DRIVER"; +// Json::FastWriter writer; +// std::string json_str = writer.write(value); + +// message_->set_function_name( +// functional_modules::hmi_api::on_device_rank_changed); +// message_->set_json_message(json_str); + +// apps_.push_back(app0_); + +// mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL; +// EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); +// EXPECT_CALL(*app0_, device()).WillRepeatedly(Return(1)); +// EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) +// .WillRepeatedly(Return(rc_app_extention_)); +// EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) +// .WillOnce(Return(apps_)); +// EXPECT_CALL(*mock_service_, GetDeviceHandlerById(kDeviceId)) +// .WillRepeatedly(Return(kDeviceHandle)); +// EXPECT_CALL(*mock_service_, SetPrimaryDevice(kDeviceHandle)).Times(1); +// EXPECT_CALL(*mock_service_, ResetPrimaryDevice()).Times(0); + +// RCModuleTest::HandleMessage(); +// ASSERT_TRUE(rc_app_extention_->is_on_driver_device()); +//} + +// TEST_F(RCModuleTest, ChangeDriverDeviceOnOther) { +// Json::Value value(Json::ValueType::objectValue); +// value[json_keys::kMethod] = +// functional_modules::hmi_api::on_device_rank_changed; +// value[json_keys::kParams] = Json::Value(Json::ValueType::objectValue); +// value[json_keys::kParams][message_params::kDevice] = +// Json::Value(Json::ValueType::objectValue); +// value[json_keys::kParams][message_params::kDevice][json_keys::kId] = +// kDeviceId; +// value[json_keys::kParams][message_params::kDevice][message_params::kName] = +// kDeviceName; +// value[json_keys::kParams][message_params::kRank] = "DRIVER"; +// Json::FastWriter writer; +// std::string json_str = writer.write(value); + +// message_->set_function_name( +// functional_modules::hmi_api::on_device_rank_changed); +// message_->set_message_type(MessageType::kNotification); +// message_->set_json_message(json_str); + +// apps_.push_back(app0_); +// apps_.push_back(app1_); + +// rc_app_extention_->set_is_on_driver_device(true); +// EXPECT_TRUE(rc_app_extention_->is_on_driver_device()); +// utils::SharedPtr ext = +// utils::MakeShared(module_.GetModuleID()); +// EXPECT_FALSE(ext->is_on_driver_device()); + +// EXPECT_CALL(*app0_, device()).WillOnce(Return(1)); +// EXPECT_CALL(*app1_, device()).WillOnce(Return(2)); +// EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) +// .WillOnce(Return(rc_app_extention_)); +// EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) +// .WillRepeatedly(Return(apps_)); +// EXPECT_CALL(*mock_service_, GetDeviceHandlerById(kDeviceId)) +// .WillRepeatedly(Return(kDeviceHandle)); +// EXPECT_CALL(*mock_service_, SetPrimaryDevice(kDeviceHandle)).Times(1); +// EXPECT_CALL(*mock_service_, ResetPrimaryDevice()).Times(0); + +// RCModuleTest::HandleMessage(); +// ASSERT_TRUE(rc_app_extention_->is_on_driver_device()); +// ASSERT_FALSE(ext->is_on_driver_device()); +//} + +// TEST_F(RCModuleTest, ChangeDriverDeviceToPassenger) { +// Json::Value value(Json::ValueType::objectValue); +// value[json_keys::kMethod] = +// functional_modules::hmi_api::on_device_rank_changed; +// value[json_keys::kParams] = Json::Value(Json::ValueType::objectValue); +// value[json_keys::kParams][message_params::kDevice] = +// Json::Value(Json::ValueType::objectValue); +// value[json_keys::kParams][message_params::kDevice][json_keys::kId] = +// kDeviceId; +// value[json_keys::kParams][message_params::kDevice][message_params::kName] = +// kDeviceName; +// value[json_keys::kParams][message_params::kRank] = "PASSENGER"; +// Json::FastWriter writer; +// std::string json_str = writer.write(value); + +// message_->set_function_name( +// functional_modules::hmi_api::on_device_rank_changed); +// message_->set_message_type(MessageType::kNotification); +// message_->set_json_message(json_str); + +// apps_.push_back(app0_); +// rc_app_extention_->set_is_on_driver_device(true); +// EXPECT_TRUE(rc_app_extention_->is_on_driver_device()); + +// mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL; +// EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); +// EXPECT_CALL(*app0_, device()).WillOnce(Return(1)); +// EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) +// .WillRepeatedly(Return(rc_app_extention_)); +// EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) +// .WillRepeatedly(Return(apps_)); +// EXPECT_CALL(*mock_service_, GetDeviceHandlerById(kDeviceId)) +// .WillRepeatedly(Return(kDeviceHandle)); +// EXPECT_CALL(*mock_service_, PrimaryDevice()).Times(1).WillOnce(Return(1)); +// EXPECT_CALL(*mock_service_, ResetPrimaryDevice()).Times(1); + +// RCModuleTest::HandleMessage(); +// ASSERT_FALSE(rc_app_extention_->is_on_driver_device()); +//} + +// TEST_F(RCModuleTest, ChangePassengerDeviceToPassenger) { +// Json::Value value(Json::ValueType::objectValue); +// value[json_keys::kMethod] = +// functional_modules::hmi_api::on_device_rank_changed; +// value[json_keys::kParams] = Json::Value(Json::ValueType::objectValue); +// value[json_keys::kParams][message_params::kDevice] = +// Json::Value(Json::ValueType::objectValue); +// value[json_keys::kParams][message_params::kDevice][json_keys::kId] = +// kDeviceId; +// value[json_keys::kParams][message_params::kDevice][message_params::kName] = +// kDeviceName; +// value[json_keys::kParams][message_params::kRank] = "PASSENGER"; +// Json::FastWriter writer; +// std::string json_str = writer.write(value); + +// message_->set_function_name( +// functional_modules::hmi_api::on_device_rank_changed); +// message_->set_message_type(MessageType::kNotification); +// message_->set_json_message(json_str); + +// apps_.push_back(app0_); +// rc_app_extention_->set_is_on_driver_device(false); +// EXPECT_FALSE(rc_app_extention_->is_on_driver_device()); + +// EXPECT_CALL(*app0_, device()).WillOnce(Return(1)); +// EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) +// .WillRepeatedly(Return(rc_app_extention_)); +// EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) +// .WillRepeatedly(Return(apps_)); +// EXPECT_CALL(*mock_service_, PrimaryDevice()).Times(1).WillOnce(Return(2)); +// EXPECT_CALL(*mock_service_, ResetPrimaryDevice()).Times(0); + +// RCModuleTest::HandleMessage(); +// ASSERT_FALSE(rc_app_extention_->is_on_driver_device()); +//} + +TEST_F(RCModuleTest, CanAppChangeHMILevelPrimary) { + apps_.push_back(app0_); + + rc_app_extention_->set_is_on_driver_device(true); + + EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) + .WillRepeatedly(Return(rc_app_extention_)); + + ASSERT_TRUE(module_.CanAppChangeHMILevel( + app0_, mobile_apis::HMILevel::eType::HMI_FULL)); + ASSERT_TRUE(module_.CanAppChangeHMILevel( + app0_, mobile_apis::HMILevel::eType::HMI_LIMITED)); + ASSERT_TRUE(module_.CanAppChangeHMILevel( + app0_, mobile_apis::HMILevel::eType::HMI_BACKGROUND)); + ASSERT_TRUE(module_.CanAppChangeHMILevel( + app0_, mobile_apis::HMILevel::eType::HMI_NONE)); +} + +TEST_F(RCModuleTest, CanAppChangeHMILevelPassenger) { + apps_.push_back(app0_); + + rc_app_extention_->set_is_on_driver_device(false); + + EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) + .WillRepeatedly(Return(rc_app_extention_)); + + ASSERT_FALSE(module_.CanAppChangeHMILevel( + app0_, mobile_apis::HMILevel::eType::HMI_FULL)); + ASSERT_FALSE(module_.CanAppChangeHMILevel( + app0_, mobile_apis::HMILevel::eType::HMI_LIMITED)); + ASSERT_TRUE(module_.CanAppChangeHMILevel( + app0_, mobile_apis::HMILevel::eType::HMI_BACKGROUND)); + ASSERT_TRUE(module_.CanAppChangeHMILevel( + app0_, mobile_apis::HMILevel::eType::HMI_NONE)); +} +} // namespace remote_control diff --git a/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc new file mode 100644 index 0000000000..7adfea0d52 --- /dev/null +++ b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc @@ -0,0 +1,282 @@ +/* + * Copyright (c) 2017, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. */ + +#include "gtest/gtest.h" +#include "remote_control/resource_allocation_manager_impl.h" +#include "mock_resource_allocation_manager.h" +#include "mock_remote_control_plugin.h" +#include "remote_control/rc_app_extension.h" +#include "remote_control/rc_module_constants.h" +#include "remote_control/message_helper.h" +#include "functional_module/module_observer.h" +#include "application_manager/mock_application.h" +#include "include/mock_service.h" +#include "utils/shared_ptr.h" +#include "utils/make_shared.h" +#include "interfaces/HMI_API.h" + +using functional_modules::PluginInfo; +using functional_modules::ProcessResult; +using functional_modules::RCFunctionID; +using application_manager::ServicePtr; + +using application_manager::MockService; +using namespace test::components; +using application_manager_test::MockApplication; + +using ::testing::_; +using ::testing::Mock; +using ::testing::NiceMock; +using ::testing::StrictMock; +using ::testing::Return; +using ::testing::ReturnRef; +using ::testing::SaveArg; +using ::testing::Eq; +using ::application_manager::Message; +using ::application_manager::MessageType; +using ::application_manager::ApplicationSharedPtr; +using ::protocol_handler::MessagePriority; + +namespace { +const bool kDeviceHandle = 1u; +const std::string kModuleType1 = "CLIMATE"; +const std::string kModuleType2 = "RADIO"; +const int32_t kConnectionKey = 5; +const int32_t kCorrelationId = 5; +const int kModuleId = 153; +const uint32_t kAppId1 = 11u; +const uint32_t kAppId2 = 22u; +} + +namespace remote_control { + +class RAManagerTest : public ::testing::Test { + public: + RAManagerTest() + : mock_service_(utils::MakeShared >()) + , mock_app_1_(utils::MakeShared >()) + , mock_app_2_(utils::MakeShared >()) + , message_(utils::MakeShared(MessagePriority::FromServiceType( + protocol_handler::ServiceType::kRpc))) { + EXPECT_CALL(mock_module_, service()).WillRepeatedly(Return(mock_service_)); + } + + void CheckResultWithHMILevelAndAccessMode( + ResourceAllocationManagerImpl& ra_manager, + mobile_apis::HMILevel::eType app_level, + const remote_control::AcquireResult::eType expected_result, + const hmi_apis::Common_RCAccessMode::eType access_mode) { + // Arrange + EXPECT_CALL(*mock_service_, GetApplication(kAppId1)) + .WillOnce(Return(mock_app_1_)); + ra_manager.SetAccessMode(access_mode); + EXPECT_EQ(remote_control::AcquireResult::ALLOWED, + ra_manager.AcquireResource(kModuleType1, kAppId1)); + EXPECT_CALL(*mock_service_, GetApplication(kAppId2)) + .WillOnce(Return(mock_app_2_)); + EXPECT_CALL(*mock_app_2_, hmi_level()).WillOnce(Return(app_level)); + // Second app tries to get already acquired resource by 1st app + EXPECT_EQ(expected_result, + ra_manager.AcquireResource(kModuleType1, kAppId2)); + } + + protected: + utils::SharedPtr > mock_service_; + utils::SharedPtr > mock_app_1_; + utils::SharedPtr > mock_app_2_; + application_manager::MessagePtr message_; + remote_control_test::MockRemotePluginInterface mock_module_; + RemotePluginInterface::RCPluginEventDispatcher event_dispatcher_; +}; + +TEST_F(RAManagerTest, AcquireResource_NoAppRegistered_Expect_InUse) { + // Arrange + EXPECT_CALL(*mock_service_, GetApplication(kAppId1)) + .WillOnce(Return(ApplicationSharedPtr())); + ResourceAllocationManagerImpl ra_manager(mock_module_); + // Act & Assert + EXPECT_EQ(remote_control::AcquireResult::IN_USE, + ra_manager.AcquireResource(kModuleType1, kAppId1)); +} + +TEST_F(RAManagerTest, + AcquireResource_AppRegisteredAnyHmiLevelResourceFree_Expect_Allowed) { + // Arrange + EXPECT_CALL(*mock_service_, GetApplication(kAppId1)) + .WillOnce(Return(mock_app_1_)); + ResourceAllocationManagerImpl ra_manager(mock_module_); + // Act & Assert + EXPECT_EQ(remote_control::AcquireResult::ALLOWED, + ra_manager.AcquireResource(kModuleType1, kAppId1)); +} + +TEST_F( + RAManagerTest, + AcquireResource_AppInAnyHmiLevelWantsToAcquireSameResourceTwice_Expect_Allowed) { + // Arrange + EXPECT_CALL(*mock_service_, GetApplication(kAppId1)) + .WillOnce(Return(mock_app_1_)); + ResourceAllocationManagerImpl ra_manager(mock_module_); + EXPECT_EQ(remote_control::AcquireResult::ALLOWED, + ra_manager.AcquireResource(kModuleType1, kAppId1)); + EXPECT_CALL(*mock_service_, GetApplication(kAppId1)) + .WillOnce(Return(mock_app_1_)); + // Same app tries to get already acquired resource + EXPECT_EQ(remote_control::AcquireResult::ALLOWED, + ra_manager.AcquireResource(kModuleType1, kAppId1)); +} + +TEST_F( + RAManagerTest, + AcquireResource_App2_NotInFULLWantsToGetAcquiredResource_Expect_Rejected) { + using namespace mobile_apis; + using namespace hmi_apis; + using namespace remote_control; + const HMILevel::eType app_level = HMILevel::eType::HMI_BACKGROUND; + const AcquireResult::eType expected_result = AcquireResult::REJECTED; + const Common_RCAccessMode::eType access_mode = + Common_RCAccessMode::eType::AUTO_ALLOW; + ResourceAllocationManagerImpl ra_manager(mock_module_); + CheckResultWithHMILevelAndAccessMode( + ra_manager, app_level, expected_result, access_mode); +} + +TEST_F( + RAManagerTest, + AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_DENY_Expect_InUse) { + using namespace mobile_apis; + using namespace hmi_apis; + using namespace remote_control; + const HMILevel::eType app_level = HMILevel::eType::HMI_FULL; + const AcquireResult::eType expected_result = AcquireResult::IN_USE; + const Common_RCAccessMode::eType access_mode = + Common_RCAccessMode::eType::AUTO_DENY; + ResourceAllocationManagerImpl ra_manager(mock_module_); + CheckResultWithHMILevelAndAccessMode( + ra_manager, app_level, expected_result, access_mode); +} + +TEST_F( + RAManagerTest, + AcquireResource_App2_InFULLWantsToGetAcquiredResource_AUTO_ALLOW_Expect_Allowed) { + using namespace mobile_apis; + using namespace hmi_apis; + using namespace remote_control; + const HMILevel::eType app_level = HMILevel::eType::HMI_FULL; + const AcquireResult::eType expected_result = AcquireResult::ALLOWED; + const Common_RCAccessMode::eType access_mode = + Common_RCAccessMode::eType::AUTO_ALLOW; + ResourceAllocationManagerImpl ra_manager(mock_module_); + CheckResultWithHMILevelAndAccessMode( + ra_manager, app_level, expected_result, access_mode); +} + +TEST_F( + RAManagerTest, + AcquireResource_App2_InFULLWantsToGetAcquiredResource_ASK_DRIVER_Expect_AskDriver) { + using namespace mobile_apis; + using namespace hmi_apis; + using namespace remote_control; + const HMILevel::eType app_level = HMILevel::eType::HMI_FULL; + const AcquireResult::eType expected_result = AcquireResult::ASK_DRIVER; + const Common_RCAccessMode::eType access_mode = + Common_RCAccessMode::eType::ASK_DRIVER; + ResourceAllocationManagerImpl ra_manager(mock_module_); + CheckResultWithHMILevelAndAccessMode( + ra_manager, app_level, expected_result, access_mode); +} + +TEST_F(RAManagerTest, + AcquireResource_AcquiredModuleIsRejectedForApp2_ExpectApp2Rejected) { + // Arrange + ResourceAllocationManagerImpl ra_manager(mock_module_); + EXPECT_CALL(*mock_service_, GetApplication(kAppId1)) + .WillOnce(Return(mock_app_1_)); + EXPECT_EQ(AcquireResult::ALLOWED, + ra_manager.AcquireResource(kModuleType1, kAppId1)); + + // Act + ra_manager.OnDriverDisallowed(kModuleType1, kAppId2); + + // Assert + EXPECT_CALL(*mock_service_, GetApplication(kAppId2)) + .WillOnce(Return(mock_app_2_)); + EXPECT_EQ(AcquireResult::REJECTED, + ra_manager.AcquireResource(kModuleType1, kAppId2)); +} + +TEST_F(RAManagerTest, + AcquireResource_App1OccupiedResourceAndDisconnected_ExpectApp2Allowed) { + // Arrange + ResourceAllocationManagerImpl ra_manager(mock_module_); + ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY); + + EXPECT_CALL(*mock_service_, GetApplication(kAppId1)) + .WillOnce(Return(mock_app_1_)); + EXPECT_EQ(remote_control::AcquireResult::ALLOWED, + ra_manager.AcquireResource(kModuleType1, kAppId1)); + + // Act + ra_manager.OnUnregisterApplication(kAppId1); + + // Assert + EXPECT_CALL(*mock_service_, GetApplication(kAppId2)) + .WillOnce(Return(mock_app_2_)); + EXPECT_EQ(remote_control::AcquireResult::ALLOWED, + ra_manager.AcquireResource(kModuleType1, kAppId2)); +} + +TEST_F(RAManagerTest, AskDriver_ExpectDriverConsentRequestSentToHMI) { + // Arrange + EXPECT_CALL(*mock_service_, GetNextCorrelationID()) + .WillOnce(Return(kCorrelationId)); + EXPECT_CALL(mock_module_, event_dispatcher()) + .WillOnce(ReturnRef(event_dispatcher_)); + application_manager::MessagePtr result_msg; + EXPECT_CALL(*mock_service_, SendMessageToHMI(_)) + .WillOnce(SaveArg<0>(&result_msg)); + ResourceAllocationManagerImpl ra_manager(mock_module_); + AskDriverCallBackPtr ask_driver_callback_ptr = + utils::MakeShared(); + ra_manager.AskDriver(kModuleType1, kAppId1, ask_driver_callback_ptr); + // Assertions + const Json::Value message_to_hmi = + MessageHelper::StringToValue(result_msg->json_message()); + EXPECT_EQ(kAppId1, + message_to_hmi[json_keys::kParams][json_keys::kAppId].asUInt()); + EXPECT_EQ(kModuleType1, + message_to_hmi[json_keys::kParams][message_params::kModuleType] + .asString()); + EXPECT_EQ(functional_modules::hmi_api::get_user_consent, + message_to_hmi[json_keys::kMethod].asString()); +} + +} // namespace remote_control diff --git a/src/components/telemetry_monitor/CMakeLists.txt b/src/components/telemetry_monitor/CMakeLists.txt index bb33857ecd..bb419a92e9 100644 --- a/src/components/telemetry_monitor/CMakeLists.txt +++ b/src/components/telemetry_monitor/CMakeLists.txt @@ -39,9 +39,11 @@ include_directories ( ${COMPONENTS_DIR}/connection_handler/include/ ${COMPONENTS_DIR}/transport_manager/include/ ${COMPONENTS_DIR}/application_manager/include/ + ${COMPONENTS_DIR}/remote_control/include/ ${POLICY_PATH}/include/ ${POLICY_GLOBAL_INCLUDE_PATH}/ ${COMPONENTS_DIR}/rpc_base/include/ + ${COMPONENTS_DIR}/functional_module/include/ ${COMPONENTS_DIR}/hmi_message_handler/include/ ${COMPONENTS_DIR}/formatters/include/ ${COMPONENTS_DIR}/media_manager/include/ -- cgit v1.2.1 From 5abab475694f03f74437bbdca194a9e63eb49197 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Thu, 10 Aug 2017 14:07:09 +0300 Subject: Remote control API and policy table changes --- src/appMain/sdl_preloaded_pt.json | 124 ++++++++- src/appMain/smartDeviceLink.ini | 6 + src/components/interfaces/HMI_API.xml | 398 +++++++++++++++++++++++++++++ src/components/interfaces/MOBILE_API.xml | 421 ++++++++++++++++++++++++++++++- 4 files changed, 947 insertions(+), 2 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index 29deab5278..783c4f5b2e 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -1,6 +1,8 @@ { "policy_table": { "module_config": { + "country_consent_passengersRC": true, + "equipment": {}, "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, @@ -307,6 +309,34 @@ } } }, + "Notifications-RC": { + "rpcs": { + "OnHMIStatus": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + }, + "OnPermissionsChange": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + }, + "OnSystemRequest": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + } + } + }, "DrivingCharacteristics-3": { "user_consent_prompt": "DrivingCharacteristics", "rpcs": { @@ -483,6 +513,57 @@ } } }, + "RemoteControl": { + "rpcs": { + "ButtonPress": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + }, + "GetInteriorVehicleData": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + }, + "GetInteriorVehicleDataCapabilities": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + }, + "OnInteriorVehicleData": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED" + ] + }, + "SetInteriorVehicleData": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + }, + "SystemRequest": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + } + } + }, "Emergency-1": { "rpcs": { "GetVehicleData": { @@ -932,6 +1013,26 @@ } } }, + "pre_BaseRC-1": { + "rpcs": { + "OnHMIStatus": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + }, + "OnPermissionsChange": { + "hmi_levels": [ + "BACKGROUND", + "FULL", + "LIMITED", + "NONE" + ] + } + } + } "BackgroundAPT": { "rpcs": { "EndAudioPassThru": { @@ -2276,13 +2377,25 @@ "steal_focus": false, "priority": "NONE", "default_hmi": "NONE", - "groups": ["Base-4"] + "groups": ["Base-4"], + "groups_nonPrimaryRC": [ + "Notifications-RC", + "RemoteControl" + ], + "groups_primaryRC": [ + "Base-4", + "RemoteControl" + ], }, "device": { "keep_context": false, "steal_focus": false, "priority": "NONE", "default_hmi": "NONE", + "moduleType": [ + "RADIO", + "CLIMATE" + ], "groups": ["DataConsent-2"] }, "pre_DataConsent": { @@ -2291,6 +2404,15 @@ "priority": "NONE", "default_hmi": "NONE", "groups": ["BaseBeforeDataConsent"] + }, + "pre_consent_passengersRC": { + "default_hmi": "NONE", + "groups": [ + "pre_BaseRC-1" + ], + "keep_context": false, + "priority": "NONE", + "steal_focus": false } } } diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini index c64e409e29..64772ebfd6 100644 --- a/src/appMain/smartDeviceLink.ini +++ b/src/appMain/smartDeviceLink.ini @@ -89,6 +89,7 @@ TimeTestingPort = 8090 ReadDIDRequest = 5, 1 ; Limitation for a number of GetVehicleData requests (the 1st value) per (the 2nd value) seconds GetVehicleDataRequest = 5, 1 +PluginFolder = plugins [MEDIA MANAGER] ; where 3 is a number of retries and 1000 is a timeout in milliseconds for request frequency @@ -271,3 +272,8 @@ WaitTimeBetweenApps = 4000 ; App Launch on iOS devices SDL feature enabler/disabler EnableAppLaunchIOS = true +[Remote Control] +InteriorVDCapabilitiesFile = ./plugins/InteriorVehicleDataCapabilities.json +address = 127.0.0.1 +port = 8092 +timeout_period_seconds = 10 diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 33dcc1225c..087ec60cf3 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -92,6 +92,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -265,6 +286,7 @@ + @@ -1390,6 +1412,292 @@ + + + + + + + + + + + + + + + Program Service Name + + + Radio Text + + + The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD + + + Program Identification - the call sign for the radio station + + + The program type - The region should be used to differentiate between EU and North America program types + + + Traffic Program Identification - Identifies a station that offers traffic + + + Traffic Announcement Identification - Indicates an ongoing traffic announcement + + + Region + + + + + + + + + + + + + The integer part of the frequency ie for 101.7 this value should be 101 + + + The fractional part of the frequency for 101.7 is 7 + + + + + + + number of HD sub-channels if available + + + Current HD sub-channel if available + + + + + If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency + + + True if the radio is on, false is the radio is off + + + + + + + Contains information about a radio control module's capabilities. + + The short name or a short description of the radio control module. + + + + Availability of the control of enable/disable radio. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of radio band. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of radio frequency. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of HD radio channel. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting Radio Data System (RDS) data. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the number of available HD channels. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the Radio state. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the signal strength. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the signal Change Threshold. + True: Available, False: Not Available, Not present: Not Available. + + + + + + + + + + + + + + + + + + + + + + + + + + Temperature Unit + + + Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains information about a climate control module's capabilities. + + The short name or a short description of the climate control module. + + + + Availability of the control of fan speed. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of desired temperature. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of turn on/off AC. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable air conditioning is ON on the maximum level. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable circulate Air mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable auto mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable dual mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of defrost zones. + True: Available, False: Not Available, Not present: Not Available. + + + + + A set of all defrost zones that are controllable. + + + + + Availability of the control of air ventilation mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + A set of all ventilation modes that are controllable. + + + + + + The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist + + + + + + + + + + + The device is ranked as driver's + + + The device is ranked as passenger's + + + + + Enumeration that describes possible remote control access mode the application might be in on HU. + + + + + + The name that identifies the field. See TextFieldName. @@ -2281,6 +2589,23 @@ Must be returned if the platform supports custom on-screen Presets + + + Method is invoked when the application tries to press a button + + The module where the button should be pressed + + + + Indicates whether this is a LONG or SHORT button press event. + + + ID of the application that triggers the permission prompt. + + + + + HU system must notify about every UP/DOWN event for buttons @@ -4460,4 +4785,77 @@ + + + + + + The module type and data to set + + + Internal SDL-assigned ID of the related application + + + + + Used to set the values of one zone and one data type within that zone + + + + + + + The module data to retrieve from the vehicle for that type + + + If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type + + + Internal SDL-assigned ID of the related application + + + + + + + + Is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request. + if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleDescription. + if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe. + + + + + Sender: SDL->HMI. + HMI is expected to display a permission prompt to the driver showing the RC module and app details (for example, app's name). + The driver is expected to have an ability to grant or deny the permission. + + The module type that the app requests to control. + + + ID of the application that triggers the permission prompt. + + + + + "true" - if the driver grants the permission for controlling to the named app; + "false" - in case the driver denies the permission for controlling to the named app. + + + + + + + + + + Sender: vehicle -> RSDL. Notification about remote-control settings changed. Sent after User`s choice through HMI. + + If "true" - RC is allowed; if "false" - RC is disallowed. + + + The remote control access mode specified by the driver via HMI. + + + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 0b77c0b6ca..ae8bec3b5b 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -135,6 +135,9 @@ The requested data is not available on this vehicle or is not published for the connected app + + The value being set is read only + @@ -538,6 +541,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -1420,6 +1445,282 @@ + + + + + + + + + + + + + + Program Service Name + + + Radio Text + + + The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD + + + Program Identification - the call sign for the radio station + + + The program type - The region should be used to differentiate between EU and North America program types + + + Traffic Program Identification - Identifies a station that offers traffic + + + Traffic Announcement Identification - Indicates an ongoing traffic announcement + + + Region + + + + + + + + + + + + + The integer part of the frequency ie for 101.7 this value should be 101 + + + The fractional part of the frequency for 101.7 is 7 + + + + + + + number of HD sub-channels if available + + + Current HD sub-channel if available + + + + + If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency + + + True if the radio is on, false is the radio is off + + + + + + + Contains information about a radio control module's capabilities. + + The short name or a short description of the radio control module. + + + + Availability of the control of enable/disable radio. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of radio band. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of radio frequency. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of HD radio channel. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting Radio Data System (RDS) data. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the number of available HD channels. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the Radio state. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the signal strength. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the signal Change Threshold. + True: Available, False: Not Available, Not present: Not Available. + + + + + + + + + + + + + + + + + + + + + + + + + + Temperature Unit + + + Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Contains information about a climate control module's capabilities. + + The short name or a short description of the climate control module. + + + + Availability of the control of fan speed. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of desired temperature. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of turn on/off AC. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable air conditioning is ON on the maximum level. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable circulate Air mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable auto mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable dual mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of defrost zones. + True: Available, False: Not Available, Not present: Not Available. + + + + + A set of all defrost zones that are controllable. + + + + + Availability of the control of air ventilation mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + A set of all ventilation modes that are controllable. + + + + + + The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist + + + + + + + + + + + The device is ranked as driver's + + + The device is ranked as passenger's + + + @@ -2179,6 +2480,7 @@ + @@ -2354,6 +2656,9 @@ + + + @@ -2379,6 +2684,7 @@ + -- cgit v1.2.1 From 3cd1ba6315bd14faf0f34aaf1c44e6e7e26c5cde Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 6 Aug 2017 14:43:09 +0300 Subject: Integate capabilities chack to button press request UT fix for system capabilities in button press --- .../include/application_manager/core_service.h | 1 + .../include/application_manager/service.h | 1 + .../application_manager/src/core_service.cc | 4 + .../functional_module/test/include/mock_service.h | 1 + .../include/remote_control/rc_module_constants.h | 9 ++- .../src/commands/button_press_request.cc | 93 +++++++++++++++++----- .../test/commands/button_press_request_test.cc | 42 +++++++++- 7 files changed, 127 insertions(+), 24 deletions(-) diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index d746b953dc..d668c0c8b8 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -209,6 +209,7 @@ class CoreService : public Service { void ChangeNotifyHMILevel(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level) FINAL; + const smart_objects::SmartObject* GetRCCapabilities() const FINAL; /** * @brief Notify HMI about app changing HMI Level * only NONE, BACKGROUND and LIMITED levels are sent diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index 4eea2b0b0f..099eb4fd14 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -211,6 +211,7 @@ class Service { virtual void NotifyHMIAboutHMILevel(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level) = 0; + virtual const smart_objects::SmartObject* GetRCCapabilities() const = 0; /** * Checks if application has remote control functions * @param app application diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index 5aca2e4c34..cb49ff641a 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -243,6 +243,10 @@ void CoreService::ChangeNotifyHMILevel(ApplicationSharedPtr app, MessageHelper::SendHMIStatusNotification(*app, application_manager_); } +const smart_objects::SmartObject* CoreService::GetRCCapabilities() const { + return application_manager_.hmi_capabilities().rc_capability(); +} + void CoreService::NotifyHMIAboutHMILevel(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level) { if (app->hmi_level() != mobile_apis::HMILevel::eType::HMI_FULL) { diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index 560fa91359..90bbbbe6ef 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -55,6 +55,7 @@ class MockService : public Service { MOCK_METHOD2(NotifyHMIAboutHMILevel, void(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level)); + MOCK_CONST_METHOD0(GetRCCapabilities, const smart_objects::SmartObject*()); MOCK_METHOD4(CheckAccess, TypeAccess(const ApplicationId& app_id, const std::string& module, diff --git a/src/components/remote_control/include/remote_control/rc_module_constants.h b/src/components/remote_control/include/remote_control/rc_module_constants.h index 503266f35c..98e7180194 100644 --- a/src/components/remote_control/include/remote_control/rc_module_constants.h +++ b/src/components/remote_control/include/remote_control/rc_module_constants.h @@ -35,7 +35,13 @@ namespace remote_control { -namespace strings {} // strings +namespace strings { +// RemoteControlCapabilities constants +const char kclimateControlCapabilities[] = "climateControlCapabilities"; +const char kradioControlCapabilities[] = "radioControlCapabilities"; +const char kbuttonCapabilities[] = "buttonCapabilities"; +// RemoteControlCapabilities constants +} // strings namespace result_codes { const char kSuccess[] = "SUCCESS"; @@ -299,6 +305,7 @@ const char kAutoAllow[] = "AUTO_ALLOW"; const char kAutoDeny[] = "AUTO_DENY"; const char kAskDriver[] = "ASK_DRIVER"; // Access mode enum + } // namespace enums_value } // namespace remote_control diff --git a/src/components/remote_control/src/commands/button_press_request.cc b/src/components/remote_control/src/commands/button_press_request.cc index 5423504ad2..f1b0f11560 100644 --- a/src/components/remote_control/src/commands/button_press_request.cc +++ b/src/components/remote_control/src/commands/button_press_request.cc @@ -35,6 +35,7 @@ #include "remote_control/rc_module_constants.h" #include "functional_module/function_ids.h" #include "json/json.h" +#include "utils/helpers.h" namespace remote_control { @@ -52,32 +53,80 @@ ButtonPressRequest::ButtonPressRequest( ButtonPressRequest::~ButtonPressRequest() {} -const bool CheckButtonName(const std::string& module_type, - const std::string& button_name) { +const std::vector buttons_climate() { + std::vector data; + data.push_back(enums_value::kACMax); + data.push_back(enums_value::kAC); + data.push_back(enums_value::kRecirculate); + data.push_back(enums_value::kFanUp); + data.push_back(enums_value::kFanDown); + data.push_back(enums_value::kTempUp); + data.push_back(enums_value::kTempDown); + data.push_back(enums_value::kDefrostMax); + data.push_back(enums_value::kDefrost); + data.push_back(enums_value::kDefrostRear); + data.push_back(enums_value::kUpperVent); + data.push_back(enums_value::kLowerVent); + return data; +} + +const std::vector buttons_radio() { + std::vector data; + data.push_back(enums_value::kVolumeUp); + data.push_back(enums_value::kVolumeDown); + data.push_back(enums_value::kEject); + data.push_back(enums_value::kSource); + data.push_back(enums_value::kShuffle); + data.push_back(enums_value::kRepeat); + return data; +} + +bool CheckIfButtonExistInRCCaps( + const smart_objects::SmartObject& rc_capabilities, + const std::string& button_name) { + if (rc_capabilities.keyExists(strings::kbuttonCapabilities)) { + const smart_objects::SmartObject& button_caps = + rc_capabilities[strings::kbuttonCapabilities]; + smart_objects::SmartArray::iterator it = button_caps.asArray()->begin(); + for (; it != button_caps.asArray()->end(); ++it) { + smart_objects::SmartObject& so = *it; + if (so[message_params::kName] == button_name) { + LOG4CXX_TRACE(logger_, + "Button " << button_name << " exist in capabilities"); + return true; + } + } + } + LOG4CXX_TRACE(logger_, + "Button " << button_name << " do not exist in capabilities"); + return false; +} + +bool CheckButtonName(const std::string& module_type, + const std::string& button_name, + const smart_objects::SmartObject* rc_capabilities) { + LOG4CXX_AUTO_TRACE(logger_); + if (rc_capabilities == NULL) { + LOG4CXX_ERROR(logger_, "No remote controll capabilities available"); + return false; + } + if (enums_value::kRadio == module_type) { - return (button_name == enums_value::kVolumeUp) || - (button_name == enums_value::kVolumeDown) || - (button_name == enums_value::kEject) || - (button_name == enums_value::kSource) || - (button_name == enums_value::kShuffle) || - (button_name == enums_value::kRepeat); + if (!helpers::in_range(buttons_radio(), button_name)) { + LOG4CXX_WARN(logger_, + "Trying to acceess climate button with module type radio"); + return false; + } } if (enums_value::kClimate == module_type) { - return (button_name == enums_value::kACMax) || - (button_name == enums_value::kAC) || - (button_name == enums_value::kRecirculate) || - (button_name == enums_value::kFanUp) || - (button_name == enums_value::kFanDown) || - (button_name == enums_value::kTempUp) || - (button_name == enums_value::kTempDown) || - (button_name == enums_value::kDefrostMax) || - (button_name == enums_value::kDefrost) || - (button_name == enums_value::kDefrostRear) || - (button_name == enums_value::kUpperVent) || - (button_name == enums_value::kLowerVent); + if (!helpers::in_range(buttons_climate(), button_name)) { + LOG4CXX_WARN(logger_, + "Trying to acceess radio button with module type climate"); + return false; + } } - return false; + return CheckIfButtonExistInRCCaps(*rc_capabilities, button_name); } void ButtonPressRequest::Execute() { @@ -89,7 +138,7 @@ void ButtonPressRequest::Execute() { const std::string button_name = request_params[kButtonName].asString(); const std::string module_type = request_params[kModuleType].asString(); const bool button_name_matches_module_type = - CheckButtonName(module_type, button_name); + CheckButtonName(module_type, button_name, service()->GetRCCapabilities()); if (button_name_matches_module_type) { SendRequest(functional_modules::hmi_api::button_press, request_params); diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc index 95662d69b1..7e3991188e 100644 --- a/src/components/remote_control/test/commands/button_press_request_test.cc +++ b/src/components/remote_control/test/commands/button_press_request_test.cc @@ -41,6 +41,7 @@ #include "remote_control/message_helper.h" #include "remote_control/rc_command_factory.h" #include "remote_control/event_engine/event_dispatcher.h" +#include "remote_control/rc_module_constants.h" #include "functional_module/function_ids.h" #include "include/mock_service.h" #include "utils/shared_ptr.h" @@ -91,7 +92,8 @@ namespace button_press_request_test { class ButtonPressRequestTest : public ::testing::Test { public: ButtonPressRequestTest() - : mock_service_(utils::MakeShared >()) + : rc_capabilities_(smart_objects::SmartType_Map) + , mock_service_(utils::MakeShared >()) , mock_app_(utils::MakeShared >()) , rc_app_extention_( utils::MakeShared(kModuleId)) { @@ -106,6 +108,43 @@ class ButtonPressRequestTest : public ::testing::Test { mock_module_.set_service(exp_service); } + smart_objects::SmartObject ButtonCapability(const std::string& button_name) { + smart_objects::SmartObject button(smart_objects::SmartType_Map); + button["name"] = button_name; + return button; + } + + void SetUp() OVERRIDE { + using namespace remote_control; + std::vector button_names; + button_names.push_back(enums_value::kACMax); + button_names.push_back(enums_value::kAC); + button_names.push_back(enums_value::kRecirculate); + button_names.push_back(enums_value::kFanUp); + button_names.push_back(enums_value::kFanDown); + button_names.push_back(enums_value::kTempUp); + button_names.push_back(enums_value::kTempDown); + button_names.push_back(enums_value::kDefrostMax); + button_names.push_back(enums_value::kDefrost); + button_names.push_back(enums_value::kDefrostRear); + button_names.push_back(enums_value::kUpperVent); + button_names.push_back(enums_value::kLowerVent); + button_names.push_back(enums_value::kVolumeUp); + button_names.push_back(enums_value::kVolumeDown); + button_names.push_back(enums_value::kEject); + button_names.push_back(enums_value::kSource); + button_names.push_back(enums_value::kShuffle); + button_names.push_back(enums_value::kRepeat); + + smart_objects::SmartObject button_caps(smart_objects::SmartType_Array); + for (size_t i = 0; i < button_names.size(); i++) { + button_caps[i] = ButtonCapability(button_names[i]); + } + rc_capabilities_[strings::kbuttonCapabilities] = button_caps; + ON_CALL(*mock_service_, GetRCCapabilities()) + .WillByDefault(Return(&rc_capabilities_)); + } + remote_control::request_controller::MobileRequestPtr CreateCommand( application_manager::MessagePtr msg) { return remote_control::RCCommandFactory::CreateCommand(msg, mock_module_); @@ -122,6 +161,7 @@ class ButtonPressRequestTest : public ::testing::Test { } protected: + smart_objects::SmartObject rc_capabilities_; utils::SharedPtr > mock_service_; utils::SharedPtr > mock_app_; utils::SharedPtr rc_app_extention_; -- cgit v1.2.1 From 705347a169bdb24607401406c375d2f3f51d7017 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 11 Aug 2017 11:59:07 +0300 Subject: Style fix after develop intagration --- src/components/remote_control/src/module_helper.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/remote_control/src/module_helper.cc b/src/components/remote_control/src/module_helper.cc index 4262274597..8b194b9b5f 100644 --- a/src/components/remote_control/src/module_helper.cc +++ b/src/components/remote_control/src/module_helper.cc @@ -64,7 +64,8 @@ application_manager::MessagePtr ModuleHelper::ResponseToHMI( application_manager::MessagePtr message(new application_manager::Message( protocol_handler::MessagePriority::kDefault)); - message->set_protocol_version(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI); + message->set_protocol_version( + protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI); message->set_correlation_id(msg[json_keys::kId].asInt()); Json::FastWriter writer; std::string json_msg = writer.write(msg); -- cgit v1.2.1 From 2c43f4b6b32857740d9dd10b0bcfdc2a048cd791 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 11 Aug 2017 12:40:13 +0300 Subject: Fix preloaded PT file Removed GetInteriorVehicleDataCapabilities from PT Removed NONE level for RC RPCs Removed/added invalid json symbols from PT --- src/appMain/sdl_preloaded_pt.json | 59 ++++++++---------------- src/components/remote_control/remote_sdl_pt.json | 17 ++----- 2 files changed, 23 insertions(+), 53 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index 783c4f5b2e..a2785e9bd5 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -516,51 +516,30 @@ "RemoteControl": { "rpcs": { "ButtonPress": { - "hmi_levels": [ - "BACKGROUND", - "FULL", - "LIMITED", - "NONE" - ] + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] }, "GetInteriorVehicleData": { - "hmi_levels": [ - "BACKGROUND", - "FULL", - "LIMITED", - "NONE" - ] + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] }, - "GetInteriorVehicleDataCapabilities": { - "hmi_levels": [ - "BACKGROUND", - "FULL", - "LIMITED", - "NONE" - ] + "SetInteriorVehicleData": { + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] }, "OnInteriorVehicleData": { - "hmi_levels": [ - "BACKGROUND", - "FULL", - "LIMITED" - ] - }, - "SetInteriorVehicleData": { - "hmi_levels": [ - "BACKGROUND", - "FULL", - "LIMITED", - "NONE" - ] + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED"] }, "SystemRequest": { - "hmi_levels": [ - "BACKGROUND", - "FULL", - "LIMITED", - "NONE" - ] + "hmi_levels": ["BACKGROUND", + "FULL", + "LIMITED", + "NONE"] } } }, @@ -1032,7 +1011,7 @@ ] } } - } + }, "BackgroundAPT": { "rpcs": { "EndAudioPassThru": { @@ -2385,7 +2364,7 @@ "groups_primaryRC": [ "Base-4", "RemoteControl" - ], + ] }, "device": { "keep_context": false, diff --git a/src/components/remote_control/remote_sdl_pt.json b/src/components/remote_control/remote_sdl_pt.json index e013c70112..54543335c8 100644 --- a/src/components/remote_control/remote_sdl_pt.json +++ b/src/components/remote_control/remote_sdl_pt.json @@ -963,33 +963,24 @@ "ButtonPress": { "hmi_levels": ["BACKGROUND", "FULL", - "LIMITED", - "NONE"] - }, - "GetInteriorVehicleDataCapabilities": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] + "LIMITED"] }, "GetInteriorVehicleData": { "hmi_levels": ["BACKGROUND", "FULL", - "LIMITED", - "NONE"] + "LIMITED"] }, "SetInteriorVehicleData": { "hmi_levels": ["BACKGROUND", "FULL", - "LIMITED", - "NONE"] + "LIMITED"] }, "OnInteriorVehicleData": { "hmi_levels": ["BACKGROUND", "FULL", "LIMITED"] }, - "SystemRequest": { + "SystemRequest": { "hmi_levels": ["BACKGROUND", "FULL", "LIMITED", -- cgit v1.2.1 From 69dfc4ba214b47b6549e05ad0d451a1572d67059 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Tue, 8 Aug 2017 14:04:46 +0300 Subject: Fixes crash on HMI response coming for already deleted request --- .../remote_control/commands/base_command_request.h | 20 ++++ .../src/commands/base_command_request.cc | 123 ++++++++++++--------- .../src/resource_allocation_manager_impl.cc | 9 +- 3 files changed, 99 insertions(+), 53 deletions(-) diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h index fd58f50722..cb76a79d55 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_request.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h @@ -256,8 +256,28 @@ class BaseCommandRequest void UpdateHMILevel( const rc_event_engine::Event& event); + + /** + * @brief CheckPolicyPermissions checks RPC permissions defined in policy + * table + * @return True if RPC is allowed, otherwise - false + */ bool CheckPolicyPermissions(); + + /** + * @brief CheckDriverConsent checks driver consent defined in policy table + * @return True if no consent is required, otherwise - false + */ bool CheckDriverConsent(); + + /** + * @brief AqcuireResources checks whether resource status is busy or not and + * then tries to acquire this resource. In case driver consent is required - + * sends consent request to HMI. + * @return True in case of resource is free and successfully acquired, + * otherwise false + */ + bool AqcuireResources(); inline bool IsAutoAllowed(application_manager::TypeAccess access) const; inline bool IsNeededDriverConsent( application_manager::TypeAccess access) const; diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index 900d94a190..db69c1e9d1 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -182,53 +182,20 @@ struct OnDriverAnswerCallback : AskDriverCallBack { void BaseCommandRequest::SendMessageToHMI( const application_manager::MessagePtr& message_to_send) { LOG4CXX_AUTO_TRACE(logger_); - const Json::Value message_params = - MessageHelper::StringToValue(message_->json_message()); - if (!IsResourceFree(ModuleType(message_params))) { - LOG4CXX_WARN(logger_, "Resource is busy."); - SendResponse(false, result_codes::kInUse, ""); - return; - } + const std::string function_name = message_to_send->function_name(); + const int32_t correlation_id = message_to_send->correlation_id(); + LOG4CXX_DEBUG(logger_, + "Subsribing to response for function: " + << function_name + << " and correlation id: " << correlation_id); - AcquireResult::eType acquire_result = AcquireResource(message_params); - switch (acquire_result) { - case AcquireResult::ALLOWED: { - SetResourceState(MessageHelper::StringToValue(message_->json_message()), - ResourceState::BUSY); + rc_module_.event_dispatcher().add_observer( + function_name, correlation_id, this); - rc_module_.event_dispatcher().add_observer( - message_to_send->function_name(), - message_to_send->correlation_id(), - this); - LOG4CXX_DEBUG(logger_, - "HMI Request:\n " << message_to_send->json_message()); - service_->SendMessageToHMI(message_to_send); - break; - } - case AcquireResult::IN_USE: { - SendResponse(false, result_codes::kInUse, ""); - break; - } - case AcquireResult::ASK_DRIVER: { - ResourceAllocationManager& resource_manager = - rc_module_.resource_allocation_manager(); - AskDriverCallBackPtr callback( - new OnDriverAnswerCallback(message_to_send, - resource_manager, - *this, - *service(), - ModuleType(message_params), - app()->app_id())); - resource_manager.AskDriver( - ModuleType(message_params), app()->hmi_app_id(), callback); - break; - } - case AcquireResult::REJECTED: { - SendResponse(false, result_codes::kRejected, ""); - break; - } - } + LOG4CXX_DEBUG(logger_, "HMI Request:\n " << message_to_send->json_message()); + + service_->SendMessageToHMI(message_to_send); } void BaseCommandRequest::SendRequest(const char* function_id, @@ -412,7 +379,8 @@ void BaseCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); if (Validate()) { LOG4CXX_INFO(logger_, "Request message validated successfully!"); - if (CheckPolicyPermissions() && CheckDriverConsent()) { + if (CheckPolicyPermissions() && CheckDriverConsent() && + AqcuireResources()) { Execute(); // run child's logic } } else { @@ -473,6 +441,50 @@ bool BaseCommandRequest::CheckDriverConsent() { return false; } +bool BaseCommandRequest::AqcuireResources() { + LOG4CXX_AUTO_TRACE(logger_); + const Json::Value message_params = + MessageHelper::StringToValue(message_->json_message()); + + if (!IsResourceFree(ModuleType(message_params))) { + LOG4CXX_WARN(logger_, "Resource is busy."); + SendResponse(false, result_codes::kInUse, ""); + return false; + } + + AcquireResult::eType acquire_result = AcquireResource(message_params); + switch (acquire_result) { + case AcquireResult::ALLOWED: { + SetResourceState(MessageHelper::StringToValue(message_->json_message()), + ResourceState::BUSY); + return true; + } + case AcquireResult::IN_USE: { + SendResponse(false, result_codes::kInUse, ""); + return false; + } + case AcquireResult::ASK_DRIVER: { + SetResourceState(MessageHelper::StringToValue(message_->json_message()), + ResourceState::BUSY); + + Json::Value value; + Json::Reader reader; + LOG4CXX_DEBUG(logger_, "Request: " << message_->json_message()); + reader.parse(message_->json_message(), value); + + SendGetUserConsent(value); + + return false; + } + case AcquireResult::REJECTED: { + SendResponse(false, result_codes::kRejected, ""); + return false; + } + } + + return false; +} + bool BaseCommandRequest::IsNeededDriverConsent( application_manager::TypeAccess access) const { return access == application_manager::kManual; @@ -528,14 +540,16 @@ void BaseCommandRequest::on_event( const rc_event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); + + SetResourceState(MessageHelper::StringToValue(message_->json_message()), + ResourceState::FREE); + if (event.id() == functional_modules::hmi_api::get_user_consent) { ProcessAccessResponse(event); } else { if (auto_allowed()) { UpdateHMILevel(event); } - SetResourceState(MessageHelper::StringToValue(message_->json_message()), - ResourceState::FREE); OnEvent(event); // run child's logic } } @@ -584,22 +598,31 @@ void BaseCommandRequest::ProcessAccessResponse( } } + Json::Value request; + reader.parse(message_->json_message(), request); + std::string module = ModuleType(request); + + ResourceAllocationManager& resource_manager = + rc_module_.resource_allocation_manager(); + // Check the actual User's answer. if (allowed) { - Json::Value request; - reader.parse(message_->json_message(), request); - std::string module = ModuleType(request); LOG4CXX_DEBUG(logger_, "Setting allowed access for " << app_->app_id() << " for " << module); service_->SetAccess(app_->app_id(), module, allowed); CheckHMILevel(application_manager::kManual, allowed); + + resource_manager.ForceAcquireResource(module, app_->app_id()); + Execute(); // run child's logic } else { SendResponse(false, result_codes::kRejected, "The resource is in use and the driver disallows this remote " "control RPC"); + + resource_manager.OnDriverDisallowed(module, app_->app_id()); } } diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc index f2c3b63600..4409d3bfba 100644 --- a/src/components/remote_control/src/resource_allocation_manager_impl.cc +++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc @@ -106,13 +106,16 @@ void ResourceAllocationManagerImpl::SetResourceState( const AllocatedResources::const_iterator allocated_it = allocated_resources_.find(module_type); - DCHECK_OR_RETURN_VOID(allocated_resources_.end() != allocated_it) + const std::string status = allocated_resources_.end() != allocated_it + ? " acquired " + : " not acquired "; LOG4CXX_DEBUG(logger_, - "Resource " << module_type << " is acquired." + "Resource " << module_type << " is " << status << " Owner application id is " << allocated_it->second << " Changing application id is " << app_id); - DCHECK_OR_RETURN_VOID(app_id == allocated_it->second); + + DCHECK_OR_RETURN_VOID(allocated_resources_.end() != allocated_it) resources_state_[module_type] = state; LOG4CXX_DEBUG(logger_, "Resource" << module_type << " got state " << state); -- cgit v1.2.1 From b241cf48424fb6f243ed56820b2892d199c0db39 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Wed, 9 Aug 2017 14:59:57 +0300 Subject: Removes obsolete code after fix --- .../remote_control/resource_allocation_manager.h | 23 ------ .../resource_allocation_manager_impl.h | 5 -- .../src/commands/base_command_request.cc | 82 ---------------------- .../src/resource_allocation_manager_impl.cc | 28 -------- .../include/mock_resource_allocation_manager.h | 12 ---- .../src/resource_allocation_manager_impl_test.cc | 25 ------- 6 files changed, 175 deletions(-) diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager.h b/src/components/remote_control/include/remote_control/resource_allocation_manager.h index 0c1943eaf8..1829ff7f7b 100644 --- a/src/components/remote_control/include/remote_control/resource_allocation_manager.h +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager.h @@ -22,18 +22,6 @@ namespace ResourceState { enum eType { FREE = 0, BUSY }; } -/** - * @brief The AskDriverCallBack class callback for GetInteriourConsent response - */ -class AskDriverCallBack - : public rc_event_engine::EventObserver { - public: - virtual ~AskDriverCallBack() {} -}; - -typedef utils::SharedPtr AskDriverCallBackPtr; - class ResourceAllocationManager { public: /** @@ -86,17 +74,6 @@ class ResourceAllocationManager { */ virtual void OnDriverDisallowed(const std::string& module_type, const uint32_t app_id) = 0; - /** - * @brief AskDriver send GetInteriorConsent request to HMI for acquiring - * resource - * @param module_type resource to acquire - * @param app_id application that acquire resource - * @param callback will be executed on OnInteriorConsent response - */ - virtual void AskDriver(const std::string& module_type, - const uint32_t app_id, - AskDriverCallBackPtr callback) = 0; - /** * @brief Set current access mode for acquiring resource * @param access_mode diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h index 5dbbc219a8..4dba4b4673 100644 --- a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h @@ -23,10 +23,6 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager { bool IsResourceFree(const std::string& module_type) const FINAL; - void AskDriver(const std::string& module_type, - const uint32_t hmi_app_id, - AskDriverCallBackPtr callback) OVERRIDE FINAL; - void SetAccessMode( const hmi_apis::Common_RCAccessMode::eType access_mode) FINAL; @@ -72,7 +68,6 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager { RejectedResources rejected_resources_for_application_; hmi_apis::Common_RCAccessMode::eType current_access_mode_; - AskDriverCallBackPtr active_call_back_; RemotePluginInterface& rc_plugin_; }; } // remote_control diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index db69c1e9d1..ecb297ab93 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -97,88 +97,6 @@ void BaseCommandRequest::SendResponse(const bool success, rc_module_.SendResponseToMobile(message_); } -struct OnDriverAnswerCallback : AskDriverCallBack { - public: - OnDriverAnswerCallback(application_manager::MessagePtr hmi_message_to_send, - ResourceAllocationManager& resource_manager, - BaseCommandRequest& request, - application_manager::Service& service, - const std::string& module_type, - uint32_t app_id) - : hmi_message_to_send_(hmi_message_to_send) - , resource_manager_(resource_manager) - , request_(request) - , service_(service) - , module_type_(module_type) - , app_id_(app_id) {} - - void on_event(const rc_event_engine::Event& event) FINAL { - LOG4CXX_AUTO_TRACE(logger_); - application_manager::Message& hmi_response = *(event.event_message()); - const application_manager::MessageValidationResult validate_result = - service_.ValidateMessageBySchema(hmi_response); - LOG4CXX_DEBUG(logger_, - "HMI response validation result is " << validate_result); - if (validate_result != - application_manager::MessageValidationResult::SUCCESS) { - request_.SendResponse(false, - result_codes::kGenericError, - "HMI has sent invalid parameters"); - return; - } - - const Json::Value value = - MessageHelper::StringToValue(hmi_response.json_message()); - - std::string result_code; - std::string info; - const bool is_response_successful = - request_.ParseResultCode(value, result_code, info); - - if (result_codes::kTimedOut == result_code) { - info = "The resource is in use and the driver did not respond in time"; - } - - if (!is_response_successful) { - request_.SendResponse(false, result_code.c_str(), info); - return; - } - - const bool allowed = - value[json_keys::kResult][message_params::kAllowed].asBool(); - - if (allowed) { - request_.rc_module_.event_dispatcher().add_observer( - hmi_message_to_send_->function_name(), - hmi_message_to_send_->correlation_id(), - &request_); - LOG4CXX_DEBUG(logger_, - "HMI Request:\n " << hmi_message_to_send_->json_message()); - - resource_manager_.ForceAcquireResource(module_type_, app_id_); - request_.SetResourceState( - MessageHelper::StringToValue(request_.message_->json_message()), - ResourceState::BUSY); - - service_.SendMessageToHMI(hmi_message_to_send_); - } else { - request_.SendResponse(false, - result_codes::kRejected, - "The resource is in use and the driver disallows " - "this remote control RPC"); - resource_manager_.OnDriverDisallowed(module_type_, app_id_); - } - } - - application_manager::MessagePtr hmi_message_to_send_; - ResourceAllocationManager& resource_manager_; - BaseCommandRequest& request_; - application_manager::Service& service_; - const std::string module_type_; - const uint32_t app_id_; -}; - void BaseCommandRequest::SendMessageToHMI( const application_manager::MessagePtr& message_to_send) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc index 4409d3bfba..90c50f68d4 100644 --- a/src/components/remote_control/src/resource_allocation_manager_impl.cc +++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc @@ -14,7 +14,6 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") ResourceAllocationManagerImpl::ResourceAllocationManagerImpl( RemotePluginInterface& rc_plugin) : current_access_mode_(hmi_apis::Common_RCAccessMode::AUTO_ALLOW) - , active_call_back_() , rc_plugin_(rc_plugin) {} ResourceAllocationManagerImpl::~ResourceAllocationManagerImpl() {} @@ -146,33 +145,6 @@ void ResourceAllocationManagerImpl::SetAccessMode( current_access_mode_ = access_mode; } -void ResourceAllocationManagerImpl::AskDriver(const std::string& module_type, - const uint32_t hmi_app_id, - AskDriverCallBackPtr callback) { - LOG4CXX_AUTO_TRACE(logger_); - DCHECK(callback); - // Create GetInteriorConsent request to HMI - Json::Value params; - params[message_params::kModuleType] = module_type; - application_manager::MessagePtr message_to_send = - remote_control::MessageHelper::CreateHmiRequest( - functional_modules::hmi_api::get_user_consent, - hmi_app_id, - params, - rc_plugin_); - - LOG4CXX_DEBUG(logger_, - "Request to HMI: \n" << message_to_send->json_message()); - // Send GetInteriorConsent request to HMI - rc_plugin_.service()->SendMessageToHMI(message_to_send); - - // Execute callback on response - rc_plugin_.event_dispatcher().add_observer(message_to_send->function_name(), - message_to_send->correlation_id(), - callback.get()); - active_call_back_ = callback; -} - void ResourceAllocationManagerImpl::ForceAcquireResource( const std::string& module_type, const uint32_t app_id) { LOG4CXX_DEBUG(logger_, "Force " << app_id << " acquiring " << module_type); diff --git a/src/components/remote_control/test/include/mock_resource_allocation_manager.h b/src/components/remote_control/test/include/mock_resource_allocation_manager.h index 5a83410932..cd147ee8e7 100644 --- a/src/components/remote_control/test/include/mock_resource_allocation_manager.h +++ b/src/components/remote_control/test/include/mock_resource_allocation_manager.h @@ -8,14 +8,6 @@ namespace test { namespace components { namespace remote_control_test { -class MockAskDriverCallBack : public remote_control::AskDriverCallBack { - public: - MOCK_METHOD1( - on_event, - void(const rc_event_engine::Event& event)); -}; - class MockResourceAllocationManager : public remote_control::ResourceAllocationManager { public: @@ -26,10 +18,6 @@ class MockResourceAllocationManager void(const std::string& module_type, const uint32_t app_id)); MOCK_METHOD2(OnDriverDisallowed, void(const std::string& module_type, const uint32_t app_id)); - MOCK_METHOD3(AskDriver, - void(const std::string& module_type, - const uint32_t app_id, - remote_control::AskDriverCallBackPtr callback)); MOCK_METHOD1(SetAccessMode, void(const hmi_apis::Common_RCAccessMode::eType access_mode)); MOCK_METHOD3(SetResourceState, diff --git a/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc index 7adfea0d52..d239272acf 100644 --- a/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc +++ b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc @@ -254,29 +254,4 @@ TEST_F(RAManagerTest, ra_manager.AcquireResource(kModuleType1, kAppId2)); } -TEST_F(RAManagerTest, AskDriver_ExpectDriverConsentRequestSentToHMI) { - // Arrange - EXPECT_CALL(*mock_service_, GetNextCorrelationID()) - .WillOnce(Return(kCorrelationId)); - EXPECT_CALL(mock_module_, event_dispatcher()) - .WillOnce(ReturnRef(event_dispatcher_)); - application_manager::MessagePtr result_msg; - EXPECT_CALL(*mock_service_, SendMessageToHMI(_)) - .WillOnce(SaveArg<0>(&result_msg)); - ResourceAllocationManagerImpl ra_manager(mock_module_); - AskDriverCallBackPtr ask_driver_callback_ptr = - utils::MakeShared(); - ra_manager.AskDriver(kModuleType1, kAppId1, ask_driver_callback_ptr); - // Assertions - const Json::Value message_to_hmi = - MessageHelper::StringToValue(result_msg->json_message()); - EXPECT_EQ(kAppId1, - message_to_hmi[json_keys::kParams][json_keys::kAppId].asUInt()); - EXPECT_EQ(kModuleType1, - message_to_hmi[json_keys::kParams][message_params::kModuleType] - .asString()); - EXPECT_EQ(functional_modules::hmi_api::get_user_consent, - message_to_hmi[json_keys::kMethod].asString()); -} - } // namespace remote_control -- cgit v1.2.1 From 65b33144922bfc279653b8028eceb33673cadd9c Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Thu, 10 Aug 2017 10:43:32 +0300 Subject: Fixes issues found from ATF tests --- .../remote_control/commands/base_command_request.h | 2 + .../commands/set_interior_vehicle_data_request.h | 1 - .../include/remote_control/request_controller.h | 2 + .../src/commands/base_command_request.cc | 83 +++++++++++++--------- .../commands/set_interior_vehicle_data_request.cc | 21 +++--- .../remote_control/src/message_helper.cc | 8 +-- .../remote_control/src/request_controller.cc | 3 + .../src/resource_allocation_manager_impl.cc | 4 +- 8 files changed, 70 insertions(+), 54 deletions(-) diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h index cb76a79d55..9949f00fd5 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_request.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h @@ -286,6 +286,8 @@ class BaseCommandRequest void ProcessAccessResponse( const rc_event_engine::Event& event); + + const Json::Value msg_json_; application_manager::ApplicationSharedPtr app_; application_manager::ServicePtr service_; bool auto_allowed_; diff --git a/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h b/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h index 92f449b034..bc1e3942e5 100644 --- a/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h +++ b/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h @@ -89,7 +89,6 @@ class SetInteriorVehicleDataRequest : public BaseCommandRequest { */ void OnEvent(const rc_event_engine::Event& event) OVERRIDE; - /** * @brief Method that check if READ_ONLY parameters present * @param request_params params from received message diff --git a/src/components/remote_control/include/remote_control/request_controller.h b/src/components/remote_control/include/remote_control/request_controller.h index c42d4b9c08..4e1e423e8e 100644 --- a/src/components/remote_control/include/remote_control/request_controller.h +++ b/src/components/remote_control/include/remote_control/request_controller.h @@ -38,6 +38,7 @@ #include "remote_control/commands/command.h" #include "remote_control/rc_module_timer.h" #include "functional_module/timer/timer_director.h" +#include "utils/lock.h" namespace remote_control { @@ -90,6 +91,7 @@ class RequestController std::map mobile_request_list_; functional_modules::ModuleTimer timer_; functional_modules::TimerDirector time_director_; + sync_primitives::Lock mobile_request_lock_; }; } // namespace request_controller diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index ecb297ab93..db0274f925 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -52,7 +52,10 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") BaseCommandRequest::BaseCommandRequest( const application_manager::MessagePtr& message, RemotePluginInterface& rc_module) - : Command(rc_module), message_(message), auto_allowed_(false) { + : Command(rc_module) + , message_(message) + , msg_json_(MessageHelper::StringToValue(message->json_message())) + , auto_allowed_(false) { service_ = rc_module_.service(); app_ = service_->GetApplication(message_->connection_key()); } @@ -63,6 +66,8 @@ BaseCommandRequest::~BaseCommandRequest() { void BaseCommandRequest::OnTimeout() { LOG4CXX_AUTO_TRACE(logger_); + SetResourceState(msg_json_, ResourceState::FREE); + PrepareResponse( false, result_codes::kGenericError, "Request timeout expired."); rc_module_.SendTimeoutResponseToMobile(message_); @@ -93,6 +98,7 @@ void BaseCommandRequest::SendResponse(const bool success, const char* result_code, const std::string& info) { LOG4CXX_AUTO_TRACE(logger_); + SetResourceState(msg_json_, ResourceState::FREE); PrepareResponse(success, result_code, info); rc_module_.SendResponseToMobile(message_); } @@ -316,11 +322,12 @@ bool BaseCommandRequest::CheckPolicyPermissions() { mobile_apis::Result::eType ret = service_->CheckPolicyPermissions(message_); if (ret != mobile_apis::Result::eType::SUCCESS) { - SendResponse(false, result_codes::kDisallowed, ""); LOG4CXX_WARN(logger_, "Function \"" << message_->function_name() << "\" (#" << message_->function_id() << ") not allowed by policy"); + + SendResponse(false, result_codes::kDisallowed, ""); return false; } @@ -373,8 +380,7 @@ bool BaseCommandRequest::AqcuireResources() { AcquireResult::eType acquire_result = AcquireResource(message_params); switch (acquire_result) { case AcquireResult::ALLOWED: { - SetResourceState(MessageHelper::StringToValue(message_->json_message()), - ResourceState::BUSY); + SetResourceState(msg_json_, ResourceState::BUSY); return true; } case AcquireResult::IN_USE: { @@ -382,8 +388,7 @@ bool BaseCommandRequest::AqcuireResources() { return false; } case AcquireResult::ASK_DRIVER: { - SetResourceState(MessageHelper::StringToValue(message_->json_message()), - ResourceState::BUSY); + SetResourceState(msg_json_, ResourceState::BUSY); Json::Value value; Json::Reader reader; @@ -459,8 +464,7 @@ void BaseCommandRequest::on_event( event) { LOG4CXX_AUTO_TRACE(logger_); - SetResourceState(MessageHelper::StringToValue(message_->json_message()), - ResourceState::FREE); + SetResourceState(msg_json_, ResourceState::FREE); if (event.id() == functional_modules::hmi_api::get_user_consent) { ProcessAccessResponse(event); @@ -499,48 +503,61 @@ void BaseCommandRequest::ProcessAccessResponse( SendResponse(false, result_codes::kApplicationNotRegistered, ""); return; } + + application_manager::Message& hmi_response = *(event.event_message()); + const application_manager::MessageValidationResult validate_result = + service_->ValidateMessageBySchema(hmi_response); + LOG4CXX_DEBUG(logger_, + "HMI response validation result is " << validate_result); + + if (validate_result != + application_manager::MessageValidationResult::SUCCESS) { + SendResponse( + false, result_codes::kGenericError, "HMI has sent invalid parameters"); + return; + } + Json::Value value; Json::Reader reader; reader.parse(event.event_message()->json_message(), value); std::string result_code; std::string info; - bool allowed = ParseResultCode(value, result_code, info); - // Check if valid successfull message has arrived - if (allowed) { + const bool is_succeeded = ParseResultCode(value, result_code, info); + + bool is_allowed = false; + if (is_succeeded) { if (IsMember(value[kResult], message_params::kAllowed) && value[kResult][message_params::kAllowed].isBool()) { - allowed = value[kResult][message_params::kAllowed].asBool(); - } else { - allowed = false; + is_allowed = value[kResult][message_params::kAllowed].asBool(); } - } - - Json::Value request; - reader.parse(message_->json_message(), request); - std::string module = ModuleType(request); - ResourceAllocationManager& resource_manager = - rc_module_.resource_allocation_manager(); + const std::string module = ModuleType(msg_json_); - // Check the actual User's answer. - if (allowed) { + // Check the actual User's answer. LOG4CXX_DEBUG(logger_, "Setting allowed access for " << app_->app_id() << " for " << module); - service_->SetAccess(app_->app_id(), module, allowed); - CheckHMILevel(application_manager::kManual, allowed); + service_->SetAccess(app_->app_id(), module, is_allowed); + CheckHMILevel(application_manager::kManual, is_succeeded); - resource_manager.ForceAcquireResource(module, app_->app_id()); + if (is_allowed) { + rc_module_.resource_allocation_manager().ForceAcquireResource( + module, app_->app_id()); - Execute(); // run child's logic - } else { - SendResponse(false, - result_codes::kRejected, - "The resource is in use and the driver disallows this remote " - "control RPC"); + Execute(); // run child's logic + } else { + rc_module_.resource_allocation_manager().OnDriverDisallowed( + module, app_->app_id()); - resource_manager.OnDriverDisallowed(module, app_->app_id()); + SendResponse( + false, + result_codes::kRejected, + "The resource is in use and the driver disallows this remote " + "control RPC"); + } + } else { + SendResponse(false, result_code.c_str(), info); } } diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc index e2d25e719e..b911e39785 100644 --- a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc +++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc @@ -196,27 +196,26 @@ void SetInteriorVehicleDataRequest::OnEvent( (functional_modules::hmi_api::set_interior_vehicle_data == event.id())); application_manager::Message& hmi_response = *(event.event_message()); - const bool validate_result = - application_manager::MessageValidationResult::SUCCESS == - service()->ValidateMessageBySchema(hmi_response); - LOG4CXX_DEBUG(logger_, - "HMI response validation result is " << validate_result); + if (application_manager::MessageValidationResult::SUCCESS != + service()->ValidateMessageBySchema(hmi_response)) { + SendResponse(false, result_codes::kGenericError, ""); + return; + } + + LOG4CXX_DEBUG(logger_, "HMI response is valid"); const Json::Value value = MessageHelper::StringToValue(hmi_response.json_message()); std::string result_code; std::string info; - const bool success = - validate_result && ParseResultCode(value, result_code, info); + const bool is_response_successful = ParseResultCode(value, result_code, info); - if (success) { + if (is_response_successful) { response_params_[kModuleData] = value[kResult][kModuleData]; - } else if (!validate_result) { - result_code = result_codes::kGenericError; } - SendResponse(success, result_code.c_str(), info); + SendResponse(is_response_successful, result_code.c_str(), info); } std::string SetInteriorVehicleDataRequest::ModuleType( diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc index 873e95716d..a15219775c 100644 --- a/src/components/remote_control/src/message_helper.cc +++ b/src/components/remote_control/src/message_helper.cc @@ -80,14 +80,10 @@ std::string MessageHelper::ValueToString(const Json::Value& value) { Json::Value MessageHelper::StringToValue(const std::string& string) { Json::Reader reader; - Json::Value json; - if (reader.parse(string, json)) { - return json; - } - - return Json::Value(Json::ValueType::nullValue); + return reader.parse(string, json) ? json + : Json::Value(Json::ValueType::nullValue); } bool IsMember(const Json::Value& value, const std::string& key) { diff --git a/src/components/remote_control/src/request_controller.cc b/src/components/remote_control/src/request_controller.cc index c457e94586..602aeb1331 100644 --- a/src/components/remote_control/src/request_controller.cc +++ b/src/components/remote_control/src/request_controller.cc @@ -60,6 +60,7 @@ void RequestController::AddRequest(const uint32_t mobile_correlation_id, MobileRequestPtr request) { // TODO(VS) Research and fix be problem with overlap correlation ids from two // different apllications(on two different mobile devices) + sync_primitives::AutoLock lock(mobile_request_lock_); LOG4CXX_DEBUG(logger_, "Add request with correlation_id: " << mobile_correlation_id); mobile_request_list_[mobile_correlation_id] = request; @@ -69,6 +70,7 @@ void RequestController::AddRequest(const uint32_t mobile_correlation_id, } void RequestController::DeleteRequest(const uint32_t& mobile_correlation_id) { + sync_primitives::AutoLock lock(mobile_request_lock_); LOG4CXX_DEBUG( logger_, "Delete request with correlation_id: " << mobile_correlation_id); mobile_request_list_.erase(mobile_correlation_id); @@ -77,6 +79,7 @@ void RequestController::DeleteRequest(const uint32_t& mobile_correlation_id) { } void RequestController::OnTimeoutTriggered(const TrackableMessage& expired) { + sync_primitives::AutoLock lock(mobile_request_lock_); LOG4CXX_DEBUG(logger_, "Timeout is expired for request with correlation_id: " << expired.correlation_id()); diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc index 90c50f68d4..cd8f2cb309 100644 --- a/src/components/remote_control/src/resource_allocation_manager_impl.cc +++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc @@ -114,10 +114,8 @@ void ResourceAllocationManagerImpl::SetResourceState( << allocated_it->second << " Changing application id is " << app_id); - DCHECK_OR_RETURN_VOID(allocated_resources_.end() != allocated_it) - resources_state_[module_type] = state; - LOG4CXX_DEBUG(logger_, "Resource" << module_type << " got state " << state); + LOG4CXX_DEBUG(logger_, "Resource " << module_type << " got state " << state); } bool ResourceAllocationManagerImpl::IsResourceFree( -- cgit v1.2.1 From 74f330fb4f389cad38eb20b56cd5077c21cbade8 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 11 Aug 2017 12:38:13 +0300 Subject: Check capabilities in Set InteriorVehicleData request --- .../include/remote_control/rc_module_constants.h | 3 + .../commands/set_interior_vehicle_data_request.cc | 72 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/src/components/remote_control/include/remote_control/rc_module_constants.h b/src/components/remote_control/include/remote_control/rc_module_constants.h index 98e7180194..36fb7281f2 100644 --- a/src/components/remote_control/include/remote_control/rc_module_constants.h +++ b/src/components/remote_control/include/remote_control/rc_module_constants.h @@ -41,6 +41,9 @@ const char kclimateControlCapabilities[] = "climateControlCapabilities"; const char kradioControlCapabilities[] = "radioControlCapabilities"; const char kbuttonCapabilities[] = "buttonCapabilities"; // RemoteControlCapabilities constants + +const char kRadioControlData[] = "radioControlData"; +const char kClimateControlData[] = "climateControlData"; } // strings namespace result_codes { diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc index b911e39785..fbea32ffd9 100644 --- a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc +++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc @@ -61,6 +61,33 @@ std::vector GetModuleReadOnlyParams( return module_ro_params; } +const std::map GetModuleDataToCapabilitiesMapping() { + std::map mapping; + // climate + mapping["fanSpeed"] = "fanSpeedAvailable"; + mapping["currentTemperature"] = "currentTemperatureAvailable"; + mapping["desiredTemperature"] = "desiredTemperatureAvailable"; + mapping["acEnable"] = "acEnableAvailable"; + mapping["circulateAirEnable"] = "circulateAirEnableAvailable"; + mapping["autoModeEnable"] = "autoModeEnableAvailable"; + mapping["defrostZone"] = "defrostZoneAvailable"; + mapping["dualModeEnable"] = "dualModeEnableAvailable"; + mapping["acMaxEnable"] = "acMaxEnableAvailable"; + mapping["ventilationMode"] = "ventilationModeAvailable"; + + // radio + mapping["band"] = "radioBandAvailable"; + mapping["frequencyInteger"] = "radioFrequencyAvailable"; + mapping["frequencyFraction"] = "radioFrequencyAvailable"; + mapping["rdsData"] = "rdsDataAvailable"; + mapping["availableHDs"] = "availableHDsAvailable"; + mapping["hdChannel"] = "availableHDsAvailable"; + mapping["signalStrength"] = "signalStrengthAvailable"; + mapping["radioEnable"] = "radioEnableAvailable"; + mapping["state"] = "stateAvailable"; + + return mapping; +} } // namespace CREATE_LOGGERPTR_GLOBAL(logger_, "SetInteriorVehicleDataRequest") @@ -72,6 +99,43 @@ SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest( SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {} +bool CheckControlDataByCapabilities( + const smart_objects::SmartObject& module_caps, + const Json::Value& control_data) { + std::map mapping = + GetModuleDataToCapabilitiesMapping(); + Json::Value::Members control_data_keys = control_data.getMemberNames(); + + Json::Value::Members::const_iterator it = control_data_keys.begin(); + for (; it != control_data_keys.end(); ++it) { + const std::string& caps_key = mapping[*it]; + DCHECK_OR_RETURN(module_caps.keyExists(caps_key), false); + if (!module_caps[caps_key].asBool()) { + return false; + } + } + return true; +} + +bool CheckIfModuleDataExistInCapabilities( + const smart_objects::SmartObject& rc_capabilities, + const Json::Value& module_data) { + if (rc_capabilities.keyExists(strings::kradioControlCapabilities)) { + const smart_objects::SmartObject& radio_caps = + rc_capabilities[strings::kradioControlCapabilities]; + return CheckControlDataByCapabilities( + radio_caps, module_data[strings::kRadioControlData]); + } + if (rc_capabilities.keyExists(strings::kclimateControlCapabilities)) { + const smart_objects::SmartObject& climate_caps = + rc_capabilities[strings::kclimateControlCapabilities]; + return CheckControlDataByCapabilities( + climate_caps, module_data[strings::kClimateControlData]); + } + DCHECK(false && "Module Data does not contains control data"); + return true; +} + void SetInteriorVehicleDataRequest::Execute() { LOG4CXX_AUTO_TRACE(logger_); @@ -90,6 +154,14 @@ void SetInteriorVehicleDataRequest::Execute() { } if (module_type_and_data_match) { + if (!CheckIfModuleDataExistInCapabilities(*(service()->GetRCCapabilities()), + module_data)) { + LOG4CXX_WARN(logger_, "Accessing not supported module data"); + SendResponse(false, + result_codes::kUnsupportedResource, + "Accessing not supported module data"); + return; + } if (AreAllParamsReadOnly(request_params)) { LOG4CXX_WARN(logger_, "All request params in module type are READ ONLY!"); SendResponse(false, -- cgit v1.2.1 From 7f17fa9084529188edc4676fac9ffbe8555f6139 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 11 Aug 2017 15:10:33 +0300 Subject: Reset allocation resourses on disabling RC --- .../include/remote_control/resource_allocation_manager.h | 5 +++++ .../include/remote_control/resource_allocation_manager_impl.h | 2 ++ .../src/commands/on_remote_control_settings_notification.cc | 5 +++-- .../remote_control/src/resource_allocation_manager_impl.cc | 7 +++++++ .../remote_control/test/include/mock_resource_allocation_manager.h | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager.h b/src/components/remote_control/include/remote_control/resource_allocation_manager.h index 1829ff7f7b..d54cdfa957 100644 --- a/src/components/remote_control/include/remote_control/resource_allocation_manager.h +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager.h @@ -81,6 +81,11 @@ class ResourceAllocationManager { virtual void SetAccessMode( const hmi_apis::Common_RCAccessMode::eType access_mode) = 0; + /** + * @brief Remove all information about all allocations + */ + virtual void ResetAllAllocations() = 0; + virtual ~ResourceAllocationManager() {} }; diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h index 4dba4b4673..716f2eadbb 100644 --- a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h @@ -34,6 +34,8 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager { void OnUnregisterApplication(const uint32_t app_id) FINAL; + void ResetAllAllocations() FINAL; + private: /** * @brief IsModuleTypeRejected check if current resource was rejected by diff --git a/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc index 6f70d4e0f8..e507a3f67f 100644 --- a/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc +++ b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc @@ -89,6 +89,8 @@ void OnRemoteControlSettingsNotification::Execute() { LOG4CXX_DEBUG(logger_, "RC Functionality remains unchanged"); return; } + ResourceAllocationManager& allocation_manager = + rc_module_.resource_allocation_manager(); const bool is_allowed = value[message_params::kAllowed].asBool(); if (is_allowed) { LOG4CXX_DEBUG(logger_, "Allowing RC Functionality"); @@ -98,13 +100,12 @@ void OnRemoteControlSettingsNotification::Execute() { const hmi_apis::Common_RCAccessMode::eType access_mode_ = MessageHelper::AccessModeFromString(access_mode); - ResourceAllocationManager& allocation_manager = - rc_module_.resource_allocation_manager(); LOG4CXX_DEBUG(logger_, "Setting up access mode : " << access_mode); allocation_manager.SetAccessMode(access_mode_); } else { LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality"); DisallowRCFunctionality(); + allocation_manager.ResetAllAllocations(); } } diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc index cd8f2cb309..e39af145ae 100644 --- a/src/components/remote_control/src/resource_allocation_manager_impl.cc +++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc @@ -199,4 +199,11 @@ void ResourceAllocationManagerImpl::OnUnregisterApplication( } } +void ResourceAllocationManagerImpl::ResetAllAllocations() { + LOG4CXX_AUTO_TRACE(logger_); + allocated_resources_.clear(); + rejected_resources_for_application_.clear(); + resources_state_.clear(); +} + } // namespace remote_control diff --git a/src/components/remote_control/test/include/mock_resource_allocation_manager.h b/src/components/remote_control/test/include/mock_resource_allocation_manager.h index cd147ee8e7..260fb7e924 100644 --- a/src/components/remote_control/test/include/mock_resource_allocation_manager.h +++ b/src/components/remote_control/test/include/mock_resource_allocation_manager.h @@ -26,6 +26,7 @@ class MockResourceAllocationManager const remote_control::ResourceState::eType state)); MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id)); MOCK_CONST_METHOD1(IsResourceFree, bool(const std::string& module_type)); + MOCK_METHOD0(ResetAllAllocations, void()); }; } // namespace remote_control_test -- cgit v1.2.1 From 27c0c39e0ab04d0d47d3d7f223622b2efc3fe92f Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 11 Aug 2017 15:16:30 +0300 Subject: Chack capabilities only if capabilities exist --- .../src/commands/set_interior_vehicle_data_request.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc index fbea32ffd9..ce62750cc9 100644 --- a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc +++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc @@ -154,8 +154,10 @@ void SetInteriorVehicleDataRequest::Execute() { } if (module_type_and_data_match) { - if (!CheckIfModuleDataExistInCapabilities(*(service()->GetRCCapabilities()), - module_data)) { + const smart_objects::SmartObject* capabilities = + service()->GetRCCapabilities(); + if (capabilities && + !CheckIfModuleDataExistInCapabilities(*capabilities, module_data)) { LOG4CXX_WARN(logger_, "Accessing not supported module data"); SendResponse(false, result_codes::kUnsupportedResource, -- cgit v1.2.1 From 76310d7dab285f71d79b509cf812deaf3f10873e Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Fri, 11 Aug 2017 15:43:52 +0300 Subject: Fix Mobile and HMI API RdsData sturcture according to proposal There is some difference between RdsData sturcture in current API and in proposal. This one in HMI API is ok but in Mobile API there is some differences. --- src/components/interfaces/MOBILE_API.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 293c3ca66a..f09131fd1b 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1457,28 +1457,28 @@ - + Program Service Name - + Radio Text The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD - + Program Identification - the call sign for the radio station - + The program type - The region should be used to differentiate between EU and North America program types - + Traffic Program Identification - Identifies a station that offers traffic - + Traffic Announcement Identification - Indicates an ongoing traffic announcement - + Region -- cgit v1.2.1 From f15c3516cf03f9b5cf99bec634514aef0fa7f77d Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 11 Aug 2017 16:06:08 +0300 Subject: Avoid double response if resourse in not aqcuired --- .../remote_control/src/commands/base_command_request.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index db0274f925..279e0af253 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -303,9 +303,13 @@ void BaseCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); if (Validate()) { LOG4CXX_INFO(logger_, "Request message validated successfully!"); - if (CheckPolicyPermissions() && CheckDriverConsent() && - AqcuireResources()) { - Execute(); // run child's logic + if (CheckPolicyPermissions() && CheckDriverConsent()) { + if (AqcuireResources()) { + Execute(); // run child's logic + } + // If resource is not aqcuired AqcuireResources method will + // either send response to mobile + // or send additional request to HMI to ask driver consent } } else { SendResponse(false, result_codes::kInvalidData, ""); -- cgit v1.2.1 From ca5f39b1f5b825e30bd2fc5fe23d2aaef2319bf5 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 11 Aug 2017 16:07:19 +0300 Subject: Mark variable as unused to avoid build fail without logs --- src/components/remote_control/src/resource_allocation_manager_impl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc index e39af145ae..f45a719c09 100644 --- a/src/components/remote_control/src/resource_allocation_manager_impl.cc +++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc @@ -108,6 +108,7 @@ void ResourceAllocationManagerImpl::SetResourceState( const std::string status = allocated_resources_.end() != allocated_it ? " acquired " : " not acquired "; + UNUSED(status); LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is " << status << " Owner application id is " -- cgit v1.2.1 From ae151c87a3851fb13411ad4841e618629ba4caa9 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Fri, 11 Aug 2017 16:26:22 +0300 Subject: Mock alocating resourses during UT run --- .../remote_control/test/commands/button_press_request_test.cc | 4 ++++ .../test/commands/set_interior_vehicle_data_request_test.cc | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc index 7e3991188e..ee796029ec 100644 --- a/src/components/remote_control/test/commands/button_press_request_test.cc +++ b/src/components/remote_control/test/commands/button_press_request_test.cc @@ -252,6 +252,10 @@ TEST_F( .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(mock_allocation_manager_, IsResourceFree(_)) + .WillOnce(Return(true)); + EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _)) + .WillOnce(Return(::remote_control::AcquireResult::ALLOWED)); EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0); application_manager::MessagePtr result_msg; EXPECT_CALL(mock_module_, SendResponseToMobile(_)) diff --git a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc index 2fc1a65b55..fc564e5db0 100644 --- a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc +++ b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc @@ -298,7 +298,10 @@ TEST_F(SetInteriorVehicleDataRequestTest, .WillOnce(Return(application_manager::MessageValidationResult::SUCCESS)); EXPECT_CALL(*mock_service_, CheckPolicyPermissions(mobile_message)) .WillOnce(Return(mobile_apis::Result::eType::SUCCESS)); - + EXPECT_CALL(mock_allocation_manager_, IsResourceFree(_)) + .WillOnce(Return(true)); + EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _)) + .WillOnce(Return(::remote_control::AcquireResult::ALLOWED)); application_manager::AppExtensionPtr invalid_ext; EXPECT_CALL(*mock_app_, QueryInterface(kModuleId)) .WillOnce(Return(invalid_ext)) -- cgit v1.2.1 From 5fc2b1752f96e15ebd7433fab1d0d1a602273580 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Fri, 11 Aug 2017 17:10:59 +0300 Subject: Fixes wrong AppHMIType conversion for RC applications --- src/appMain/sdl_preloaded_pt.json | 6 +++++- .../policy/policy_regular/include/policy/policy_table/enums.h | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index a2785e9bd5..f952b081d1 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -2364,7 +2364,11 @@ "groups_primaryRC": [ "Base-4", "RemoteControl" - ] + ], + "moduleType": [ + "RADIO", + "CLIMATE" + ] }, "device": { "keep_context": false, diff --git a/src/components/policy/policy_regular/include/policy/policy_table/enums.h b/src/components/policy/policy_regular/include/policy/policy_table/enums.h index 876ca03a27..66ab9a1b60 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/enums.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/enums.h @@ -104,8 +104,8 @@ enum AppHMIType { AHT_BACKGROUND_PROCESS, AHT_TESTING, AHT_SYSTEM, - AHT_REMOTE_CONTROL, - AHT_PROJECTION + AHT_PROJECTION, + AHT_REMOTE_CONTROL }; bool IsValidEnum(AppHMIType val); const char* EnumToJsonString(AppHMIType val); -- cgit v1.2.1 From 6d8d3c951fe5e5f7effe90f999ea1651a16392a7 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Wed, 9 Aug 2017 17:30:02 +0300 Subject: Fix instalation of bson to avoid root access --- src/3rd_party/FindBSON.cmake | 8 ++++++++ src/appMain/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/3rd_party/FindBSON.cmake b/src/3rd_party/FindBSON.cmake index 91d53624f1..a319687eda 100644 --- a/src/3rd_party/FindBSON.cmake +++ b/src/3rd_party/FindBSON.cmake @@ -10,7 +10,11 @@ find_library(BSON_LIB find_path(EMHASHMAP_INCLUDE_DIRECTORY emhashmap.h PATHS ${INCLUDE_PATH} +<<<<<<< 5fc2b1752f96e15ebd7433fab1d0d1a602273580 PATH_SUFFIXES emhashmap) +======= + PATH_SUFIXES emhashmap) +>>>>>>> Fix instalation of bson to avoid root access find_library(EMHASHMAP_LIB NAMES emhashmap @@ -19,8 +23,12 @@ find_library(EMHASHMAP_LIB include(FindPackageHandleStandardArgs) +<<<<<<< 5fc2b1752f96e15ebd7433fab1d0d1a602273580 find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_LIB EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB) +======= +find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_INCLUDE_DIRECTORY) +>>>>>>> Fix instalation of bson to avoid root access mark_as_advanced(BSON_INCLUDE_DIRECTORY BSON_LIB) mark_as_advanced(EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB) diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index 64c88bf22f..3c5f8e3345 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -147,7 +147,7 @@ if(ENABLE_LOG) list(APPEND LIBRARIES aprutil-1 -L${APR_UTIL_LIBS_DIRECTORY}) list(APPEND LIBRARIES expat -L${EXPAT_LIBS_DIRECTORY}) endif() -MESSAGE(INFO BSON_LIBS_DIRECTORY "${BSON_LIBS_DIRECTORY}") + list(APPEND LIBRARIES bson -L${BSON_LIBS_DIRECTORY}) list(APPEND LIBRARIES emhashmap -L${EMHASHMAP_LIBS_DIRECTORY}) -- cgit v1.2.1 From e343289acf819ae846a4766fe4f1da8097354799 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Sat, 12 Aug 2017 13:31:48 +0300 Subject: Fixes validation of SetInteriorVehicleData parameters with HMI capabilities --- src/appMain/hmi_capabilities.json | 870 +++++++++++++-------- .../commands/set_interior_vehicle_data_request.cc | 29 +- 2 files changed, 569 insertions(+), 330 deletions(-) diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index 58b1883884..46a94f2af5 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -340,338 +340,566 @@ "phoneCapability": { "dialNumberEnabled": true }, - "videoStreamingCapability": { - "preferredResolution": { - "resolutionWidth": 800, - "resolutionHeight": 350 - }, - "maxBitrate": 10000, - "supportedFormats": [ + "remoteControlCapability": { + "climateControlCapabilities": [ { - "protocol": "RAW", - "codec": "H264" + "moduleName": "primary_climate", + "fanSpeedAvailable": true, + "desiredTemperatureAvailable": true, + "currentTemperatureAvailable": true, + "acEnableAvailable": true, + "acMaxEnableAvailable": true, + "circulateAirEnableAvailable": true, + "autoModeEnableAvailable": true, + "dualModeEnableAvailable": true, + "defrostZoneAvailable": true, + "ventilationModeAvailable": true, + "defrostZone": [ + "FRONT", + "REAR", + "ALL", + "NONE" + ], + "ventilationMode": [ + "UPPER", + "LOWER", + "BOTH", + "NONE" + ] } ], - "remoteControlCapability": { - "climateControlCapabilities": [ - { - "moduleName": "primary_climate", - "fanSpeedAvailable": true, - "desiredTemperatureAvailable": true, - "acEnableAvailable": true, - "acMaxEnableAvailable": true, - "circulateAirEnableAvailable": true, - "autoModeEnableAvailable": true, - "dualModeEnableAvailable": true, - "defrostZoneAvailable": true, - "ventilationModeAvailable": true, - "defrostZone": [ - "FRONT", - "REAR", - "ALL", - "NONE" - ], - "ventilationMode": [ - "UPPER", - "LOWER", - "BOTH", - "NONE" - ] - } - ], - "radioControlCapabilities": [ - { - "moduleName": "radio", - "radioEnableAvailable": true, - "radioBandAvailable": true, - "radioFrequencyAvailable": true, - "hdChannelAvailable": true, - "rdsDataAvailable": true, - "availableHDsAvailable": true, - "stateAvailable": true, - "signalStrengthAvailable": true, - "signalChangeThresholdAvailable": true - } - ], - "buttonCapabilities": [ - { - "name": "AC_MAX", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "AC", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "RECIRCULATE", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "FAN_UP", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "FAN_DOWN", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "TEMP_UP", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "TEMP_DOWN", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "DEFROST_MAX", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "DEFROST", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "DEFROST_REAR", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "UPPER_VENT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "LOWER_VENT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "VOLUME_UP", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "VOLUME_DOWN", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "EJECT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "SOURCE", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "SHUFFLE", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "REPEAT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - } - ] - } + "radioControlCapabilities": [ + { + "moduleName": "radio", + "radioEnableAvailable": true, + "radioBandAvailable": true, + "radioFrequencyAvailable": true, + "hdChannelAvailable": true, + "rdsDataAvailable": true, + "availableHDsAvailable": true, + "stateAvailable": true, + "signalStrengthAvailable": true, + "signalChangeThresholdAvailable": true + } + ], + "buttonCapabilities": [ + { + "name": "AC_MAX", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "AC", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "RECIRCULATE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "FAN_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "FAN_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "TEMP_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "TEMP_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST_MAX", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST_REAR", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "UPPER_VENT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "LOWER_VENT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "VOLUME_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "VOLUME_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "EJECT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "SOURCE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "SHUFFLE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "REPEAT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + } + ] } }, - "VR": { - "capabilities": [ - "TEXT" - ], - "language": "EN-US", - "languages": [ - "EN-US", - "ES-MX", - "FR-CA", - "DE-DE", - "ES-ES", - "EN-GB", - "RU-RU", - "TR-TR", - "PL-PL", - "FR-FR", - "IT-IT", - "SV-SE", - "PT-PT", - "NL-NL", - "ZH-TW", - "JA-JP", - "AR-SA", - "KO-KR", - "PT-BR", - "CS-CZ", - "DA-DK", - "NO-NO" - ] + "mediaClockFormats": [ + "CLOCK1", + "CLOCK2", + "CLOCK3", + "CLOCKTEXT1", + "CLOCKTEXT2", + "CLOCKTEXT3", + "CLOCKTEXT4" + ], + "graphicSupported": true, + "templatesAvailable": [ + "DEFAULT", + "MEDIA", + "NON-MEDIA", + "ONSCREEN_PRESETS", + "NAV_FULLSCREEN_MAP", + "NAV_KEYBOARD", + "GRAPHIC_WITH_TEXT", + "TEXT_WITH_GRAPHIC", + "TILES_ONLY", + "TEXTBUTTONS_ONLY", + "GRAPHIC_WITH_TILES", + "TILES_WITH_GRAPHIC", + "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", + "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC", + "GRAPHIC_WITH_TEXTBUTTONS", + "TEXTBUTTONS_WITH_GRAPHIC", + "LARGE_GRAPHIC_WITH_SOFTBUTTONS", + "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS", + "LARGE_GRAPHIC_ONLY" + ], + "screenParams": { + "resolution": { + "resolutionWidth": 800, + "resolutionHeight": 350 + }, + "touchEventAvailable": { + "pressAvailable": true, + "multiTouchAvailable": false, + "doublePressAvailable": false + } }, - "TTS": { - "capabilities": [ - "TEXT" - ], - "language": "EN-US", - "languages": [ - "EN-US", - "ES-MX", - "FR-CA", - "DE-DE", - "ES-ES", - "EN-GB", - "RU-RU", - "TR-TR", - "PL-PL", - "FR-FR", - "IT-IT", - "SV-SE", - "PT-PT", - "NL-NL", - "ZH-TW", - "JA-JP", - "AR-SA", - "KO-KR", - "PT-BR", - "CS-CZ", - "DA-DK", - "NO-NO" - ] + "numCustomPresetsAvailable": 8, + "imageCapabilities": [ + "DYNAMIC", + "STATIC" + ] + }, + "audioPassThruCapabilities": { + "samplingRate": "44KHZ", + "bitsPerSample": "RATE_8_BIT", + "audioType": "PCM" + }, + "pcmStreamCapabilities": { + "samplingRate": "16KHZ", + "bitsPerSample": "RATE_16_BIT", + "audioType": "PCM" + }, + "hmiZoneCapabilities": "FRONT", + "softButtonCapabilities": [ + { + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true, + "imageSupported": true + } + ], + "systemCapabilities": { + "navigationCapability": { + "sendLocationEnabled": true, + "getWayPointsEnabled": true }, - "Buttons": { - "capabilities": [ - { - "name": "PRESET_0", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_1", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_2", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_3", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_4", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_5", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_6", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_7", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_8", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "PRESET_9", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "OK", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "SEEKLEFT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "SEEKRIGHT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, - { - "name": "TUNEUP", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true - }, + "phoneCapability": { + "dialNumberEnabled": true + }, + "videoStreamingCapability": { + "preferredResolution": { + "resolutionWidth": 800, + "resolutionHeight": 350 + }, + "maxBitrate": 10000, + "supportedFormats": [ { - "name": "TUNEDOWN", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true + "protocol": "RAW", + "codec": "H264" } ], - "presetBankCapabilities": { - "onScreenPresetsAvailable": true + "remoteControlCapability": { + "climateControlCapabilities": [ + { + "moduleName": "primary_climate", + "fanSpeedAvailable": true, + "desiredTemperatureAvailable": true, + "acEnableAvailable": true, + "acMaxEnableAvailable": true, + "circulateAirEnableAvailable": true, + "autoModeEnableAvailable": true, + "dualModeEnableAvailable": true, + "defrostZoneAvailable": true, + "ventilationModeAvailable": true, + "defrostZone": [ + "FRONT", + "REAR", + "ALL", + "NONE" + ], + "ventilationMode": [ + "UPPER", + "LOWER", + "BOTH", + "NONE" + ] + } + ], + "radioControlCapabilities": [ + { + "moduleName": "radio", + "radioEnableAvailable": true, + "radioBandAvailable": true, + "radioFrequencyAvailable": true, + "hdChannelAvailable": true, + "rdsDataAvailable": true, + "availableHDsAvailable": true, + "stateAvailable": true, + "signalStrengthAvailable": true, + "signalChangeThresholdAvailable": true + } + ], + "buttonCapabilities": [ + { + "name": "AC_MAX", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "AC", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "RECIRCULATE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "FAN_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "FAN_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "TEMP_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "TEMP_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST_MAX", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "DEFROST_REAR", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "UPPER_VENT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "LOWER_VENT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "VOLUME_UP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "VOLUME_DOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "EJECT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "SOURCE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "SHUFFLE", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + }, + { + "name": "REPEAT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": false + } + ] } - }, - "VehicleInfo": { - "make": "Ford", - "model": "Fiesta", - "modelYear": "2013", - "trim": "SE" - }, - "SyncMessageVersion": { - "majorVersion": 3, - "minorVersion": 0 } + }, + "VR": { + "capabilities": [ + "TEXT" + ], + "language": "EN-US", + "languages": [ + "EN-US", + "ES-MX", + "FR-CA", + "DE-DE", + "ES-ES", + "EN-GB", + "RU-RU", + "TR-TR", + "PL-PL", + "FR-FR", + "IT-IT", + "SV-SE", + "PT-PT", + "NL-NL", + "ZH-TW", + "JA-JP", + "AR-SA", + "KO-KR", + "PT-BR", + "CS-CZ", + "DA-DK", + "NO-NO" + ] + }, + "TTS": { + "capabilities": [ + "TEXT" + ], + "language": "EN-US", + "languages": [ + "EN-US", + "ES-MX", + "FR-CA", + "DE-DE", + "ES-ES", + "EN-GB", + "RU-RU", + "TR-TR", + "PL-PL", + "FR-FR", + "IT-IT", + "SV-SE", + "PT-PT", + "NL-NL", + "ZH-TW", + "JA-JP", + "AR-SA", + "KO-KR", + "PT-BR", + "CS-CZ", + "DA-DK", + "NO-NO" + ] + }, + "Buttons": { + "capabilities": [ + { + "name": "PRESET_0", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_1", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_2", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_3", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_4", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_5", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_6", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_7", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_8", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "PRESET_9", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "OK", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "SEEKLEFT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "SEEKRIGHT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "TUNEUP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + }, + { + "name": "TUNEDOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true + } + ], + "presetBankCapabilities": { + "onScreenPresetsAvailable": true + } + }, + "VehicleInfo": { + "make": "Ford", + "model": "Fiesta", + "modelYear": "2013", + "trim": "SE" + }, + "SyncMessageVersion": { + "majorVersion": 3, + "minorVersion": 0 } } \ No newline at end of file diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc index ce62750cc9..5f121636cf 100644 --- a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc +++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc @@ -83,6 +83,7 @@ const std::map GetModuleDataToCapabilitiesMapping() { mapping["availableHDs"] = "availableHDsAvailable"; mapping["hdChannel"] = "availableHDsAvailable"; mapping["signalStrength"] = "signalStrengthAvailable"; + mapping["signalChangeThreshold"] = "signalChangeThresholdAvailable"; mapping["radioEnable"] = "radioEnableAvailable"; mapping["state"] = "stateAvailable"; @@ -108,9 +109,15 @@ bool CheckControlDataByCapabilities( Json::Value::Members::const_iterator it = control_data_keys.begin(); for (; it != control_data_keys.end(); ++it) { - const std::string& caps_key = mapping[*it]; - DCHECK_OR_RETURN(module_caps.keyExists(caps_key), false); - if (!module_caps[caps_key].asBool()) { + const std::string& request_parameter = *it; + const std::string& caps_key = mapping[request_parameter]; + const smart_objects::SmartObject& capabilities_status = module_caps[0]; + LOG4CXX_DEBUG(logger_, + "Checking request parameter " + << request_parameter + << " with capabilities. Appropriate key is " << caps_key); + DCHECK_OR_RETURN(capabilities_status.keyExists(caps_key), false); + if (!capabilities_status[caps_key].asBool()) { return false; } } @@ -120,20 +127,24 @@ bool CheckControlDataByCapabilities( bool CheckIfModuleDataExistInCapabilities( const smart_objects::SmartObject& rc_capabilities, const Json::Value& module_data) { - if (rc_capabilities.keyExists(strings::kradioControlCapabilities)) { + bool is_radio_data_valid = true; + bool is_climate_data_valid = true; + if (IsMember(module_data, kRadioControlData) && + rc_capabilities.keyExists(strings::kradioControlCapabilities)) { const smart_objects::SmartObject& radio_caps = rc_capabilities[strings::kradioControlCapabilities]; - return CheckControlDataByCapabilities( + is_radio_data_valid = CheckControlDataByCapabilities( radio_caps, module_data[strings::kRadioControlData]); } - if (rc_capabilities.keyExists(strings::kclimateControlCapabilities)) { + if (IsMember(module_data, kClimateControlData) && + rc_capabilities.keyExists(strings::kclimateControlCapabilities)) { const smart_objects::SmartObject& climate_caps = rc_capabilities[strings::kclimateControlCapabilities]; - return CheckControlDataByCapabilities( + is_climate_data_valid = CheckControlDataByCapabilities( climate_caps, module_data[strings::kClimateControlData]); } - DCHECK(false && "Module Data does not contains control data"); - return true; + + return is_radio_data_valid && is_climate_data_valid; } void SetInteriorVehicleDataRequest::Execute() { -- cgit v1.2.1 From c586d53a95d36558cd93342d0777590b03ed6e26 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Sat, 12 Aug 2017 14:45:25 +0300 Subject: Fix UNSUPPORTED_RESOURCE response in case HMI RC interface is not available There was no checks that RC interface is not ready on HMI side so SDL sends RC RPCs all time. Following changes were done: - Added IsInterfaceAvailable function to core service to check HMI interfaces availability - Added check of RC interface availability in base command request - Fixed unit tests due to changes in implementation --- .../include/application_manager/core_service.h | 8 ++++++++ .../include/application_manager/service.h | 9 +++++++++ src/components/application_manager/src/core_service.cc | 11 +++++++++++ .../remote_control/src/commands/base_command_request.cc | 13 +++++++++++++ 4 files changed, 41 insertions(+) diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index d668c0c8b8..a1c806c3ba 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -156,6 +156,14 @@ class CoreService : public Service { */ bool IsRemoteControlApplication(ApplicationSharedPtr app) const FINAL; + /** + * @brief Gets current state of the specified interface + * @param interface which state to get + * @return true if specified interface available otherwise false + */ + bool IsInterfaceAvailable( + const HmiInterfaces::InterfaceID interface) const FINAL; + /** * Removes fake parameters from request to HMI * @param message message to handle diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index 099eb4fd14..a1d8d58a48 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -38,6 +38,7 @@ #include #include "application_manager/application.h" #include "application_manager/message.h" +#include "application_manager/hmi_interfaces.h" namespace application_manager { @@ -219,6 +220,14 @@ class Service { */ virtual bool IsRemoteControlApplication(ApplicationSharedPtr app) const = 0; + /** + * @brief Gets current state of the specified interface + * @param interface which state to get + * @return true if specified interface available otherwise false + */ + virtual bool IsInterfaceAvailable( + const HmiInterfaces::InterfaceID interface) const = 0; + /** * Gets all allowed module types * @param app_id unique identifier of application diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index cb49ff641a..b2dacefa7d 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -193,6 +193,17 @@ bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const { return false; } +bool CoreService::IsInterfaceAvailable( + const HmiInterfaces::InterfaceID interface) const { +#ifdef SDL_REMOTE_CONTROL + HmiInterfaces& hmi_interfaces = application_manager_.hmi_interfaces(); + const HmiInterfaces::InterfaceState state = + hmi_interfaces.GetInterfaceState(interface); + return HmiInterfaces::STATE_NOT_AVAILABLE != state; +#endif // SDL_REMOTE_CONTROL + return false; +} + void CoreService::RemoveHMIFakeParameters( application_manager::MessagePtr& message) { application_manager_.RemoveHMIFakeParameters(message); diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index 279e0af253..88a3f95c2f 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -106,6 +106,19 @@ void BaseCommandRequest::SendResponse(const bool success, void BaseCommandRequest::SendMessageToHMI( const application_manager::MessagePtr& message_to_send) { LOG4CXX_AUTO_TRACE(logger_); + using application_manager::HmiInterfaces; + + const bool is_rc_available = + service_->IsInterfaceAvailable(HmiInterfaces::HMI_INTERFACE_RC); + LOG4CXX_DEBUG(logger_, "HMI interface RC is available: " << is_rc_available); + if (!is_rc_available) { + const bool success = false; + const char* result_code = result_codes::kUnsupportedResource; + const std::string info = "Remote control is not supported by system"; + + SendResponse(success, result_code, info); + return; + } const std::string function_name = message_to_send->function_name(); const int32_t correlation_id = message_to_send->correlation_id(); -- cgit v1.2.1 From 1cdae5f3f26731cffa5492646e72c489b71f3348 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Sat, 12 Aug 2017 14:50:13 +0300 Subject: Fix RC command unit tests due to changes in implementation --- src/components/functional_module/test/include/mock_service.h | 2 ++ .../remote_control/test/commands/button_press_request_test.cc | 2 ++ .../test/commands/get_interior_vehicle_data_request_test.cc | 2 ++ .../remote_control/test/commands/on_remote_control_settings_test.cc | 2 ++ .../test/commands/set_interior_vehicle_data_request_test.cc | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index 90bbbbe6ef..1d97558297 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -80,6 +80,8 @@ class MockService : public Service { MOCK_CONST_METHOD1(IsRemoteControlApplication, bool(ApplicationSharedPtr app)); + MOCK_CONST_METHOD1(IsInterfaceAvailable, + bool(const HmiInterfaces::InterfaceID interface)); MOCK_CONST_METHOD2(GetModuleTypes, bool(const std::string& application_id, std::vector* modules)); diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc index ee796029ec..24ffa4adff 100644 --- a/src/components/remote_control/test/commands/button_press_request_test.cc +++ b/src/components/remote_control/test/commands/button_press_request_test.cc @@ -143,6 +143,8 @@ class ButtonPressRequestTest : public ::testing::Test { rc_capabilities_[strings::kbuttonCapabilities] = button_caps; ON_CALL(*mock_service_, GetRCCapabilities()) .WillByDefault(Return(&rc_capabilities_)); + ON_CALL(*mock_service_, IsInterfaceAvailable(_)) + .WillByDefault(Return(true)); } remote_control::request_controller::MobileRequestPtr CreateCommand( diff --git a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc index 8799cd904f..6bc24273ee 100644 --- a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc +++ b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc @@ -113,6 +113,8 @@ class GetInteriorVehicleDataRequestTest : public ::testing::Test { ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_)); ON_CALL(*mock_service_, GetApplication(app_id_)) .WillByDefault(Return(mock_app_)); + ON_CALL(*mock_service_, IsInterfaceAvailable(_)) + .WillByDefault(Return(true)); EXPECT_CALL(mock_module_, event_dispatcher()) .WillRepeatedly(ReturnRef(event_dispatcher_)); ServicePtr exp_service(mock_service_); diff --git a/src/components/remote_control/test/commands/on_remote_control_settings_test.cc b/src/components/remote_control/test/commands/on_remote_control_settings_test.cc index 879e9e1de0..977ae996fa 100644 --- a/src/components/remote_control/test/commands/on_remote_control_settings_test.cc +++ b/src/components/remote_control/test/commands/on_remote_control_settings_test.cc @@ -104,6 +104,8 @@ class OnRemoteControlSettingsNotificationTest : public ::testing::Test { utils::MakeShared(kModuleId)) { ON_CALL(mock_module_, resource_allocation_manager()) .WillByDefault(ReturnRef(mock_allocation_manager_)); + ON_CALL(*mock_service_, IsInterfaceAvailable(_)) + .WillByDefault(Return(true)); apps_.push_back(mock_app_); } diff --git a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc index fc564e5db0..3f48013324 100644 --- a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc +++ b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc @@ -122,6 +122,8 @@ class SetInteriorVehicleDataRequestTest : public ::testing::Test { .WillByDefault(ReturnRef(mock_allocation_manager_)); ON_CALL(mock_module_, service()).WillByDefault(Return(mock_service_)); ON_CALL(*mock_service_, GetApplication(_)).WillByDefault(Return(mock_app_)); + ON_CALL(*mock_service_, IsInterfaceAvailable(_)) + .WillByDefault(Return(true)); ON_CALL(mock_module_, event_dispatcher()) .WillByDefault(ReturnRef(event_dispatcher_)); ServicePtr exp_service(mock_service_); -- cgit v1.2.1 From e9735eda0a03cc434d836c2a6b79ef0b2855041b Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Sat, 12 Aug 2017 16:44:30 +0300 Subject: Fix ButtonName INVALID_DATA response on any request There was a problem with checking is button name present in HMI capabilities, which SDL receives in RC.GetCapabilities response from HMI. This capabilities is stored as enum values in smart object, however in ButtonRequest button name param comes as string and SDL tries to find this string in enum array which always finishes with false result. To fix this issue was added map with pairs of string values and their equivalent id values. This helps SDL to search button by its id which exactly stored in HMI capabilities smart object. --- .../src/commands/button_press_request.cc | 66 +++++++++++++++++++--- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/src/components/remote_control/src/commands/button_press_request.cc b/src/components/remote_control/src/commands/button_press_request.cc index f1b0f11560..ab65b5b835 100644 --- a/src/components/remote_control/src/commands/button_press_request.cc +++ b/src/components/remote_control/src/commands/button_press_request.cc @@ -36,6 +36,7 @@ #include "functional_module/function_ids.h" #include "json/json.h" #include "utils/helpers.h" +#include "interfaces/MOBILE_API.h" namespace remote_control { @@ -44,6 +45,8 @@ namespace commands { using namespace json_keys; using namespace message_params; +typedef std::map ButtonsMap; + CREATE_LOGGERPTR_GLOBAL(logger_, "ButtonPressRequest") ButtonPressRequest::ButtonPressRequest( @@ -81,24 +84,53 @@ const std::vector buttons_radio() { return data; } +const ButtonsMap buttons_map() { + using namespace mobile_apis; + + ButtonsMap buttons_map; + buttons_map[enums_value::kACMax] = ButtonName::AC_MAX; + buttons_map[enums_value::kAC] = ButtonName::AC; + buttons_map[enums_value::kRecirculate] = ButtonName::RECIRCULATE; + buttons_map[enums_value::kFanUp] = ButtonName::FAN_UP; + buttons_map[enums_value::kFanDown] = ButtonName::FAN_DOWN; + buttons_map[enums_value::kTempUp] = ButtonName::TEMP_UP; + buttons_map[enums_value::kTempDown] = ButtonName::TEMP_DOWN; + buttons_map[enums_value::kDefrostMax] = ButtonName::DEFROST_MAX; + buttons_map[enums_value::kDefrost] = ButtonName::DEFROST; + buttons_map[enums_value::kDefrostRear] = ButtonName::DEFROST_REAR; + buttons_map[enums_value::kUpperVent] = ButtonName::UPPER_VENT; + buttons_map[enums_value::kLowerVent] = ButtonName::LOWER_VENT; + buttons_map[enums_value::kVolumeUp] = ButtonName::VOLUME_UP; + buttons_map[enums_value::kVolumeDown] = ButtonName::VOLUME_DOWN; + buttons_map[enums_value::kEject] = ButtonName::EJECT; + buttons_map[enums_value::kSource] = ButtonName::SOURCE; + buttons_map[enums_value::kShuffle] = ButtonName::SHUFFLE; + buttons_map[enums_value::kRepeat] = ButtonName::REPEAT; + + return buttons_map; +} + bool CheckIfButtonExistInRCCaps( const smart_objects::SmartObject& rc_capabilities, - const std::string& button_name) { + const mobile_apis::ButtonName::eType button_id) { if (rc_capabilities.keyExists(strings::kbuttonCapabilities)) { const smart_objects::SmartObject& button_caps = rc_capabilities[strings::kbuttonCapabilities]; smart_objects::SmartArray::iterator it = button_caps.asArray()->begin(); for (; it != button_caps.asArray()->end(); ++it) { smart_objects::SmartObject& so = *it; - if (so[message_params::kName] == button_name) { + const mobile_apis::ButtonName::eType current_id = + static_cast( + so[message_params::kName].asInt()); + if (current_id == button_id) { LOG4CXX_TRACE(logger_, - "Button " << button_name << " exist in capabilities"); + "Button id " << button_id << " exist in capabilities"); return true; } } } LOG4CXX_TRACE(logger_, - "Button " << button_name << " do not exist in capabilities"); + "Button id " << button_id << " do not exist in capabilities"); return false; } @@ -126,7 +158,7 @@ bool CheckButtonName(const std::string& module_type, return false; } } - return CheckIfButtonExistInRCCaps(*rc_capabilities, button_name); + return true; } void ButtonPressRequest::Execute() { @@ -137,16 +169,34 @@ void ButtonPressRequest::Execute() { const std::string button_name = request_params[kButtonName].asString(); const std::string module_type = request_params[kModuleType].asString(); + + static ButtonsMap btn_map = buttons_map(); + mobile_apis::ButtonName::eType button_id = + mobile_apis::ButtonName::INVALID_ENUM; + if (btn_map.end() != btn_map.find(button_name)) { + button_id = btn_map[button_name]; + } + + const smart_objects::SmartObject* rc_capabilities = + service()->GetRCCapabilities(); const bool button_name_matches_module_type = - CheckButtonName(module_type, button_name, service()->GetRCCapabilities()); + CheckButtonName(module_type, button_name, rc_capabilities); + const bool button_id_exist_in_caps = + rc_capabilities && + CheckIfButtonExistInRCCaps(*rc_capabilities, button_id); - if (button_name_matches_module_type) { + if (button_name_matches_module_type && button_id_exist_in_caps) { SendRequest(functional_modules::hmi_api::button_press, request_params); - } else { + } else if (!button_name_matches_module_type) { LOG4CXX_WARN(logger_, "Request module type and button name mismatch!"); SendResponse(false, result_codes::kInvalidData, "Request module type and button name mismatch!"); + } else { + LOG4CXX_WARN(logger_, "Requested button is not exists in capabilities!"); + SendResponse(false, + result_codes::kInvalidData, + "Requested button is not exists in capabilities!"); } } -- cgit v1.2.1 From dbb5336d51473b2d3959dfbec8cc99aeaa26ab36 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Sat, 12 Aug 2017 16:52:07 +0300 Subject: Fix ButtonPress unit tests --- .../test/commands/button_press_request_test.cc | 43 ++++++++++++---------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc index 24ffa4adff..4b74fb333c 100644 --- a/src/components/remote_control/test/commands/button_press_request_test.cc +++ b/src/components/remote_control/test/commands/button_press_request_test.cc @@ -108,7 +108,8 @@ class ButtonPressRequestTest : public ::testing::Test { mock_module_.set_service(exp_service); } - smart_objects::SmartObject ButtonCapability(const std::string& button_name) { + smart_objects::SmartObject ButtonCapability( + const mobile_apis::ButtonName::eType button_name) { smart_objects::SmartObject button(smart_objects::SmartType_Map); button["name"] = button_name; return button; @@ -116,25 +117,27 @@ class ButtonPressRequestTest : public ::testing::Test { void SetUp() OVERRIDE { using namespace remote_control; - std::vector button_names; - button_names.push_back(enums_value::kACMax); - button_names.push_back(enums_value::kAC); - button_names.push_back(enums_value::kRecirculate); - button_names.push_back(enums_value::kFanUp); - button_names.push_back(enums_value::kFanDown); - button_names.push_back(enums_value::kTempUp); - button_names.push_back(enums_value::kTempDown); - button_names.push_back(enums_value::kDefrostMax); - button_names.push_back(enums_value::kDefrost); - button_names.push_back(enums_value::kDefrostRear); - button_names.push_back(enums_value::kUpperVent); - button_names.push_back(enums_value::kLowerVent); - button_names.push_back(enums_value::kVolumeUp); - button_names.push_back(enums_value::kVolumeDown); - button_names.push_back(enums_value::kEject); - button_names.push_back(enums_value::kSource); - button_names.push_back(enums_value::kShuffle); - button_names.push_back(enums_value::kRepeat); + using namespace mobile_apis; + + std::vector button_names; + button_names.push_back(ButtonName::AC_MAX); + button_names.push_back(ButtonName::AC); + button_names.push_back(ButtonName::RECIRCULATE); + button_names.push_back(ButtonName::FAN_UP); + button_names.push_back(ButtonName::FAN_DOWN); + button_names.push_back(ButtonName::TEMP_UP); + button_names.push_back(ButtonName::TEMP_DOWN); + button_names.push_back(ButtonName::DEFROST_MAX); + button_names.push_back(ButtonName::DEFROST); + button_names.push_back(ButtonName::DEFROST_REAR); + button_names.push_back(ButtonName::UPPER_VENT); + button_names.push_back(ButtonName::LOWER_VENT); + button_names.push_back(ButtonName::VOLUME_UP); + button_names.push_back(ButtonName::VOLUME_DOWN); + button_names.push_back(ButtonName::EJECT); + button_names.push_back(ButtonName::SOURCE); + button_names.push_back(ButtonName::SHUFFLE); + button_names.push_back(ButtonName::REPEAT); smart_objects::SmartObject button_caps(smart_objects::SmartType_Array); for (size_t i = 0; i < button_names.size(); i++) { -- cgit v1.2.1 From 4986fac8db19c725dd4b96624797eced5825c147 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sat, 12 Aug 2017 18:21:47 +0300 Subject: Change param name to module name in radio and climate capabilities --- src/components/interfaces/HMI_API.xml | 4 ++-- src/components/interfaces/MOBILE_API.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index a1d745bed9..0c40d6c22f 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1490,7 +1490,7 @@ Contains information about a radio control module's capabilities. - + The short name or a short description of the radio control module. @@ -1602,7 +1602,7 @@ Contains information about a climate control module's capabilities. - + The short name or a short description of the climate control module. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index f09131fd1b..c893b27674 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1521,7 +1521,7 @@ Contains information about a radio control module's capabilities. - + The short name or a short description of the radio control module. @@ -1633,7 +1633,7 @@ Contains information about a climate control module's capabilities. - + The short name or a short description of the climate control module. -- cgit v1.2.1 From 5d3a8fcc2dc7a872912987bea279817c4aec3670 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sat, 12 Aug 2017 18:21:56 +0300 Subject: Do not assert if field is not present in capabilities --- .../src/commands/set_interior_vehicle_data_request.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc index 5f121636cf..5055146c80 100644 --- a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc +++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc @@ -116,8 +116,18 @@ bool CheckControlDataByCapabilities( "Checking request parameter " << request_parameter << " with capabilities. Appropriate key is " << caps_key); - DCHECK_OR_RETURN(capabilities_status.keyExists(caps_key), false); + if (!capabilities_status.keyExists(caps_key)) { + LOG4CXX_DEBUG(logger_, + "Capability " + << caps_key + << " is missed in RemoteControl capabilities"); + return false; + } if (!capabilities_status[caps_key].asBool()) { + LOG4CXX_DEBUG(logger_, + "Capability " + << caps_key + << " is switched off in RemoteControl capabilities"); return false; } } -- cgit v1.2.1 From 67b3cd2f592f4b9f2e98a0dd931a076fc2102df5 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 13 Aug 2017 14:57:30 +0300 Subject: Check unsuported resource before all other capabilities checks --- .../src/commands/base_command_request.cc | 34 +++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index 88a3f95c2f..b70ff93380 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -314,19 +314,31 @@ bool BaseCommandRequest::ParseResultCode(const Json::Value& value, void BaseCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - if (Validate()) { - LOG4CXX_INFO(logger_, "Request message validated successfully!"); - if (CheckPolicyPermissions() && CheckDriverConsent()) { - if (AqcuireResources()) { - Execute(); // run child's logic - } - // If resource is not aqcuired AqcuireResources method will - // either send response to mobile - // or send additional request to HMI to ask driver consent + if (!Validate()) { + LOG4CXX_WARN(logger_, "Request message validation failed !"); + SendResponse( + false, result_codes::kInvalidData, "Validation by schema failed"); + return; + } + LOG4CXX_TRACE(logger_, "Request message validated successfully!"); + using application_manager::HmiInterfaces; + if (!service_->IsInterfaceAvailable(HmiInterfaces::HMI_INTERFACE_RC)) { + LOG4CXX_WARN(logger_, "HMI interface RC is not available"); + SendResponse(false, + result_codes::kUnsupportedResource, + "Remote control is not supported by system"); + return; + } + LOG4CXX_TRACE(logger_, "RC interface is available!"); + if (CheckPolicyPermissions() && CheckDriverConsent()) { + if (AqcuireResources()) { + Execute(); // run child's logic } - } else { - SendResponse(false, result_codes::kInvalidData, ""); + // If resource is not aqcuired, AqcuireResources method will either + // send response to mobile or + // send additional request to HMI to ask driver consent } + // TODO : send error in case if policy permissions failed } bool BaseCommandRequest::CheckPolicyPermissions() { -- cgit v1.2.1 From 36f37bbdba2ace3be4d8befa025252ec7d357aca Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 13 Aug 2017 15:11:54 +0300 Subject: Add missed addCurrentTemperature parameter in climate capabilities --- src/components/interfaces/HMI_API.xml | 6 ++++++ src/components/interfaces/MOBILE_API.xml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 0c40d6c22f..d0ff048fec 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1605,6 +1605,12 @@ The short name or a short description of the climate control module. + + + Availability of the reading of current temperature. + True: Available, False: Not Available, Not present: Not Available. + + Availability of the control of fan speed. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index c893b27674..834d98fd84 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1636,6 +1636,12 @@ The short name or a short description of the climate control module. + + + Availability of the reading of current temperature. + True: Available, False: Not Available, Not present: Not Available. + + Availability of the control of fan speed. -- cgit v1.2.1 From a69e692924376860465814f2fa0f71b576bc66de Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 13 Aug 2017 15:36:27 +0300 Subject: Make RadioControllCapabilities parameters optional --- src/components/interfaces/HMI_API.xml | 16 ++++++++-------- src/components/interfaces/MOBILE_API.xml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index d0ff048fec..72bcde37dd 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1499,49 +1499,49 @@ True: Available, False: Not Available, Not present: Not Available. - + Availability of the control of radio band. True: Available, False: Not Available, Not present: Not Available. - + Availability of the control of radio frequency. True: Available, False: Not Available, Not present: Not Available. - + Availability of the control of HD radio channel. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting Radio Data System (RDS) data. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting the number of available HD channels. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting the Radio state. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting the signal strength. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting the signal Change Threshold. True: Available, False: Not Available, Not present: Not Available. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 834d98fd84..6ec12befad 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1530,49 +1530,49 @@ True: Available, False: Not Available, Not present: Not Available. - + Availability of the control of radio band. True: Available, False: Not Available, Not present: Not Available. - + Availability of the control of radio frequency. True: Available, False: Not Available, Not present: Not Available. - + Availability of the control of HD radio channel. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting Radio Data System (RDS) data. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting the number of available HD channels. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting the Radio state. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting the signal strength. True: Available, False: Not Available, Not present: Not Available. - + Availability of the getting the signal Change Threshold. True: Available, False: Not Available, Not present: Not Available. -- cgit v1.2.1 From cd9f13558f854f6659299d4f79380f8cc439e953 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 13 Aug 2017 16:07:29 +0300 Subject: Add converting stringto enum in checking button capabilities In Button capabilities values saved as string convert string to enums for checking --- .../src/commands/button_press_request.cc | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/components/remote_control/src/commands/button_press_request.cc b/src/components/remote_control/src/commands/button_press_request.cc index ab65b5b835..3498ceec29 100644 --- a/src/components/remote_control/src/commands/button_press_request.cc +++ b/src/components/remote_control/src/commands/button_press_request.cc @@ -112,25 +112,34 @@ const ButtonsMap buttons_map() { bool CheckIfButtonExistInRCCaps( const smart_objects::SmartObject& rc_capabilities, - const mobile_apis::ButtonName::eType button_id) { + const mobile_apis::ButtonName::eType button) { if (rc_capabilities.keyExists(strings::kbuttonCapabilities)) { const smart_objects::SmartObject& button_caps = rc_capabilities[strings::kbuttonCapabilities]; smart_objects::SmartArray::iterator it = button_caps.asArray()->begin(); for (; it != button_caps.asArray()->end(); ++it) { smart_objects::SmartObject& so = *it; - const mobile_apis::ButtonName::eType current_id = - static_cast( - so[message_params::kName].asInt()); - if (current_id == button_id) { + int64_t current_id = so[message_params::kName].asInt(); + if (-1 == current_id) { + // capabilities received from HMI contains enum values + // capabilities loaded from file contains string values + // TODO : unificate capabilities storing + const std::string& bt_name = so[message_params::kName].asString(); + static ButtonsMap btn_map = buttons_map(); + current_id = btn_map[bt_name]; + } + const mobile_apis::ButtonName::eType current_button = + static_cast(current_id); + if (current_button == button) { LOG4CXX_TRACE(logger_, - "Button id " << button_id << " exist in capabilities"); + "Button id " << current_button + << " exist in capabilities"); return true; } } } LOG4CXX_TRACE(logger_, - "Button id " << button_id << " do not exist in capabilities"); + "Button id " << button << " do not exist in capabilities"); return false; } -- cgit v1.2.1 From 11c42f8cca889071cc43c1ff5d8bb9afc294a4b7 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 13 Aug 2017 17:07:35 +0300 Subject: Return unsupported resource instead of invalid data If button do not exist in capabilities SDL should respond unsupported resource to mobile --- src/components/remote_control/src/commands/button_press_request.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/remote_control/src/commands/button_press_request.cc b/src/components/remote_control/src/commands/button_press_request.cc index 3498ceec29..1e5eef1e64 100644 --- a/src/components/remote_control/src/commands/button_press_request.cc +++ b/src/components/remote_control/src/commands/button_press_request.cc @@ -204,7 +204,7 @@ void ButtonPressRequest::Execute() { } else { LOG4CXX_WARN(logger_, "Requested button is not exists in capabilities!"); SendResponse(false, - result_codes::kInvalidData, + result_codes::kUnsupportedResource, "Requested button is not exists in capabilities!"); } } -- cgit v1.2.1 From 9149eea9fb300cdf186b53a9345c036923831d4b Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Mon, 14 Aug 2017 10:17:07 +0300 Subject: Style fix --- src/components/remote_control/src/commands/base_command_request.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index b70ff93380..51291f8aed 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -335,7 +335,7 @@ void BaseCommandRequest::Run() { Execute(); // run child's logic } // If resource is not aqcuired, AqcuireResources method will either - // send response to mobile or + // send response to mobile or // send additional request to HMI to ask driver consent } // TODO : send error in case if policy permissions failed -- cgit v1.2.1 From 7d051034794594f368a42c80ccd2e5ec7bbf9171 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Mon, 14 Aug 2017 12:59:20 +0300 Subject: Check if capabilities is null If capabilities is null SDl should send Unsuported resourse on request with module type or module data related to this capabilities --- .../commands/get_interior_vehicle_data_request.cc | 29 ++++++++++++++++++++++ .../commands/set_interior_vehicle_data_request.cc | 15 ++++++++--- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc index cfd08b47f6..0c62ee4711 100644 --- a/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc +++ b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc @@ -54,11 +54,40 @@ GetInteriorVehicleDataRequest::GetInteriorVehicleDataRequest( RemotePluginInterface& rc_module) : BaseCommandRequest(message, rc_module) {} +bool CheckIfModuleTypeExistInCapabilities( + const smart_objects::SmartObject& rc_capabilities, + const std::string& module_type) { + LOG4CXX_AUTO_TRACE(logger_); + if (enums_value::kRadio == module_type && + !rc_capabilities.keyExists(strings::kradioControlCapabilities)) { + LOG4CXX_DEBUG(logger_, " Radio control capabilities not present"); + return false; + } + if (enums_value::kClimate == module_type && + !rc_capabilities.keyExists(strings::kclimateControlCapabilities)) { + LOG4CXX_DEBUG(logger_, " Climate control capabilities not present"); + return false; + } + + return true; +} + void GetInteriorVehicleDataRequest::Execute() { LOG4CXX_AUTO_TRACE(logger_); Json::Value request_params = MessageHelper::StringToValue(message_->json_message()); + const smart_objects::SmartObject* capabilities = + service()->GetRCCapabilities(); + if (capabilities && + !CheckIfModuleTypeExistInCapabilities(*capabilities, + ModuleType(request_params))) { + LOG4CXX_WARN(logger_, "Accessing not supported module data"); + SendResponse(false, + result_codes::kUnsupportedResource, + "Accessing not supported module data"); + return; + } if (HasRequestExcessiveSubscription(request_params)) { RemoveExcessiveSubscription(request_params); } diff --git a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc index 5055146c80..e010cbb8b7 100644 --- a/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc +++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc @@ -137,17 +137,24 @@ bool CheckControlDataByCapabilities( bool CheckIfModuleDataExistInCapabilities( const smart_objects::SmartObject& rc_capabilities, const Json::Value& module_data) { + LOG4CXX_AUTO_TRACE(logger_); bool is_radio_data_valid = true; bool is_climate_data_valid = true; - if (IsMember(module_data, kRadioControlData) && - rc_capabilities.keyExists(strings::kradioControlCapabilities)) { + if (IsMember(module_data, kRadioControlData)) { + if (!rc_capabilities.keyExists(strings::kradioControlCapabilities)) { + LOG4CXX_DEBUG(logger_, " Radio control capabilities not present"); + return false; + } const smart_objects::SmartObject& radio_caps = rc_capabilities[strings::kradioControlCapabilities]; is_radio_data_valid = CheckControlDataByCapabilities( radio_caps, module_data[strings::kRadioControlData]); } - if (IsMember(module_data, kClimateControlData) && - rc_capabilities.keyExists(strings::kclimateControlCapabilities)) { + if (IsMember(module_data, kClimateControlData)) { + if (!rc_capabilities.keyExists(strings::kclimateControlCapabilities)) { + LOG4CXX_DEBUG(logger_, " Climate control capabilities not present"); + return false; + } const smart_objects::SmartObject& climate_caps = rc_capabilities[strings::kclimateControlCapabilities]; is_climate_data_valid = CheckControlDataByCapabilities( -- cgit v1.2.1 From d4e987941c4cc190ae5b37781698e410590f9289 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 14 Aug 2017 16:20:46 +0300 Subject: Fixes missing expectation for happy path of ListFiles request --- .../test/commands/mobile/list_files_request_test.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/application_manager/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/test/commands/mobile/list_files_request_test.cc index 19accbd125..ae0e523832 100644 --- a/src/components/application_manager/test/commands/mobile/list_files_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/list_files_request_test.cc @@ -61,7 +61,12 @@ using am::commands::ListFilesRequest; using am::commands::MessageSharedPtr; class ListFilesRequestTest - : public CommandRequestTest {}; + : public CommandRequestTest { + public: + ListFilesRequestTest() : kStoragePath_("storage"), kResponseSize_(1) {} + const std::string kStoragePath_; + const uint32_t kResponseSize_; +}; TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) { SharedPtr command(CreateCommand()); @@ -104,9 +109,18 @@ TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) { TEST_F(ListFilesRequestTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); SharedPtr command(CreateCommand()); + EXPECT_CALL(app_mngr_, get_settings()) - .WillOnce(ReturnRef(app_mngr_settings_)); + .WillRepeatedly(ReturnRef(app_mngr_settings_)); + + ON_CALL(app_mngr_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kStoragePath_)); + + ON_CALL(app_mngr_settings_, list_files_response_size()) + .WillByDefault(ReturnRef(kResponseSize_)); + ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app)); + ON_CALL(*app, hmi_level()) .WillByDefault(Return(mobile_apis::HMILevel::HMI_FULL)); -- cgit v1.2.1 From 8d8ba422d03b25a15a4ac61abcc98ba9525315cb Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Mon, 14 Aug 2017 18:11:07 +0300 Subject: Remove redundant OnHMIStatus notification --- src/components/application_manager/src/core_service.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index b2dacefa7d..6bb5ece4ec 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -251,7 +251,6 @@ void CoreService::SubscribeToHMINotification( void CoreService::ChangeNotifyHMILevel(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level) { application_manager_.ChangeAppsHMILevel(app->app_id(), level); - MessageHelper::SendHMIStatusNotification(*app, application_manager_); } const smart_objects::SmartObject* CoreService::GetRCCapabilities() const { -- cgit v1.2.1 From dcfcd80f4980ef2a672a9519d7f5d65e9b058dc7 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Tue, 15 Aug 2017 13:21:31 +0300 Subject: Fixes processing of OnRemoteControlSettings w/o access mode specified In case notification disabled and later on enabled RC functionality but didn't provide access mode SDL must use last known mode. --- .../include/remote_control/message_helper.h | 8 ++++++ .../remote_control/resource_allocation_manager.h | 6 ++++ .../resource_allocation_manager_impl.h | 2 ++ .../on_remote_control_settings_notification.cc | 24 ++++++++++------ .../remote_control/src/message_helper.cc | 32 ++++++++++++++++------ .../src/resource_allocation_manager_impl.cc | 5 ++++ .../include/mock_resource_allocation_manager.h | 1 + .../src/resource_allocation_manager_impl_test.cc | 20 ++++++++++++++ 8 files changed, 81 insertions(+), 17 deletions(-) diff --git a/src/components/remote_control/include/remote_control/message_helper.h b/src/components/remote_control/include/remote_control/message_helper.h index f90e621e1e..888f4537a4 100644 --- a/src/components/remote_control/include/remote_control/message_helper.h +++ b/src/components/remote_control/include/remote_control/message_helper.h @@ -114,6 +114,14 @@ class MessageHelper { static hmi_apis::Common_RCAccessMode::eType AccessModeFromString( const std::string& access_mode); + /** + * @brief AccessModeToString converts enum values to string + * @param access_mode Access mode enum value + * @return Appropriate string value + */ + static std::string AccessModeToString( + const hmi_apis::Common_RCAccessMode::eType access_mode); + private: MessageHelper(); diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager.h b/src/components/remote_control/include/remote_control/resource_allocation_manager.h index d54cdfa957..e517084872 100644 --- a/src/components/remote_control/include/remote_control/resource_allocation_manager.h +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager.h @@ -81,6 +81,12 @@ class ResourceAllocationManager { virtual void SetAccessMode( const hmi_apis::Common_RCAccessMode::eType access_mode) = 0; + /** + * @brief Get last set access mode for acquiring resource + * @param access_mode + */ + virtual hmi_apis::Common_RCAccessMode::eType GetAccessMode() const = 0; + /** * @brief Remove all information about all allocations */ diff --git a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h index 716f2eadbb..b9c0d22e17 100644 --- a/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h +++ b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h @@ -26,6 +26,8 @@ class ResourceAllocationManagerImpl : public ResourceAllocationManager { void SetAccessMode( const hmi_apis::Common_RCAccessMode::eType access_mode) FINAL; + hmi_apis::Common_RCAccessMode::eType GetAccessMode() const FINAL; + void ForceAcquireResource(const std::string& module_type, const uint32_t app_id) OVERRIDE FINAL; diff --git a/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc index e507a3f67f..f18180aa21 100644 --- a/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc +++ b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc @@ -93,15 +93,23 @@ void OnRemoteControlSettingsNotification::Execute() { rc_module_.resource_allocation_manager(); const bool is_allowed = value[message_params::kAllowed].asBool(); if (is_allowed) { + hmi_apis::Common_RCAccessMode::eType access_mode = + hmi_apis::Common_RCAccessMode::INVALID_ENUM; LOG4CXX_DEBUG(logger_, "Allowing RC Functionality"); - const std::string access_mode = - value.get(message_params::kAccessMode, enums_value::kAutoAllow) - .asString(); - - const hmi_apis::Common_RCAccessMode::eType access_mode_ = - MessageHelper::AccessModeFromString(access_mode); - LOG4CXX_DEBUG(logger_, "Setting up access mode : " << access_mode); - allocation_manager.SetAccessMode(access_mode_); + if (value.isMember(message_params::kAccessMode)) { + const std::string access_mode_str = + value.get(message_params::kAccessMode, enums_value::kAutoAllow) + .asString(); + + access_mode = MessageHelper::AccessModeFromString(access_mode_str); + LOG4CXX_DEBUG(logger_, "Setting up access mode : " << access_mode_str); + } else { + access_mode = allocation_manager.GetAccessMode(); + LOG4CXX_DEBUG(logger_, + "No access mode received. Using last known: " + << MessageHelper::AccessModeToString(access_mode)); + } + allocation_manager.SetAccessMode(access_mode); } else { LOG4CXX_DEBUG(logger_, "Disallowing RC Functionality"); DisallowRCFunctionality(); diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc index a15219775c..577a824d01 100644 --- a/src/components/remote_control/src/message_helper.cc +++ b/src/components/remote_control/src/message_helper.cc @@ -52,6 +52,11 @@ std::map GenerateAPINames() { RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSettingd")); return result; } + +std::map access_modes{ + {enums_value::kAutoAllow, hmi_apis::Common_RCAccessMode::AUTO_ALLOW}, + {enums_value::kAutoDeny, hmi_apis::Common_RCAccessMode::AUTO_DENY}, + {enums_value::kAskDriver, hmi_apis::Common_RCAccessMode::ASK_DRIVER}}; } uint32_t MessageHelper::next_correlation_id_ = 1; @@ -138,16 +143,25 @@ application_manager::MessagePtr MessageHelper::CreateHmiRequest( hmi_apis::Common_RCAccessMode::eType MessageHelper::AccessModeFromString( const std::string& access_mode) { - if (enums_value::kAutoAllow == access_mode) { - return hmi_apis::Common_RCAccessMode::AUTO_ALLOW; - } - if (enums_value::kAutoDeny == access_mode) { - return hmi_apis::Common_RCAccessMode::AUTO_DENY; - } - if (enums_value::kAskDriver == access_mode) { - return hmi_apis::Common_RCAccessMode::ASK_DRIVER; + std::map::const_iterator + mode = access_modes.find(access_mode); + return access_modes.end() != mode + ? mode->second + : hmi_apis::Common_RCAccessMode::INVALID_ENUM; +} + +std::string MessageHelper::AccessModeToString( + const hmi_apis::Common_RCAccessMode::eType access_mode) { + std::map::const_iterator + it = access_modes.begin(); + for (; access_modes.end() != it; ++it) { + if (access_mode == it->second) { + return it->first; + } } - return hmi_apis::Common_RCAccessMode::INVALID_ENUM; + const std::string error = "UNKNOW_ACCESS_MODE"; + DCHECK_OR_RETURN(false, error); + return error; } } // namespace remote_control diff --git a/src/components/remote_control/src/resource_allocation_manager_impl.cc b/src/components/remote_control/src/resource_allocation_manager_impl.cc index f45a719c09..a0a601b6a1 100644 --- a/src/components/remote_control/src/resource_allocation_manager_impl.cc +++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc @@ -144,6 +144,11 @@ void ResourceAllocationManagerImpl::SetAccessMode( current_access_mode_ = access_mode; } +hmi_apis::Common_RCAccessMode::eType +ResourceAllocationManagerImpl::GetAccessMode() const { + return current_access_mode_; +} + void ResourceAllocationManagerImpl::ForceAcquireResource( const std::string& module_type, const uint32_t app_id) { LOG4CXX_DEBUG(logger_, "Force " << app_id << " acquiring " << module_type); diff --git a/src/components/remote_control/test/include/mock_resource_allocation_manager.h b/src/components/remote_control/test/include/mock_resource_allocation_manager.h index 260fb7e924..c9818f909b 100644 --- a/src/components/remote_control/test/include/mock_resource_allocation_manager.h +++ b/src/components/remote_control/test/include/mock_resource_allocation_manager.h @@ -20,6 +20,7 @@ class MockResourceAllocationManager void(const std::string& module_type, const uint32_t app_id)); MOCK_METHOD1(SetAccessMode, void(const hmi_apis::Common_RCAccessMode::eType access_mode)); + MOCK_CONST_METHOD0(GetAccessMode, hmi_apis::Common_RCAccessMode::eType()); MOCK_METHOD3(SetResourceState, void(const std::string& module_type, const uint32_t app_id, diff --git a/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc index d239272acf..0d8612bb4b 100644 --- a/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc +++ b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc @@ -254,4 +254,24 @@ TEST_F(RAManagerTest, ra_manager.AcquireResource(kModuleType1, kAppId2)); } +TEST_F(RAManagerTest, GetAccessMode_ExpectedSameAsHadSet) { + ResourceAllocationManagerImpl ra_manager(mock_module_); + + ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_DENY); + EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_DENY, + ra_manager.GetAccessMode()); + + ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER); + EXPECT_EQ(hmi_apis::Common_RCAccessMode::ASK_DRIVER, + ra_manager.GetAccessMode()); + + ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::AUTO_ALLOW); + EXPECT_EQ(hmi_apis::Common_RCAccessMode::AUTO_ALLOW, + ra_manager.GetAccessMode()); + + ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::INVALID_ENUM); + EXPECT_EQ(hmi_apis::Common_RCAccessMode::INVALID_ENUM, + ra_manager.GetAccessMode()); +} + } // namespace remote_control -- cgit v1.2.1 From df2a2ff289e95cc2a2f4332199da920eea5562c9 Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Tue, 15 Aug 2017 18:08:32 +0300 Subject: Fix process RPCs in case when HMI RC.GetCapabilities response was without remoteControlCapability parameter --- .../src/commands/hmi/rc_get_capabilities_response.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc index 649a91939c..3ff6edd125 100644 --- a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc @@ -46,10 +46,8 @@ void RCGetCapabilitiesResponse::Run() { HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); - if ((*message_)[strings::msg_params].keyExists(strings::rc_capability)) { - hmi_capabilities.set_rc_capability( - (*message_)[strings::msg_params][strings::rc_capability]); - } + hmi_capabilities.set_rc_capability( + (*message_)[strings::msg_params][strings::rc_capability]); } } // namespace commands -- cgit v1.2.1 From d1ea5c8333ee3b846fe3b3f6bda50e73d6985190 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Thu, 17 Aug 2017 10:01:21 +0300 Subject: Fixes after rebasing on develop --- src/3rd_party/FindBSON.cmake | 8 - src/appMain/hmi_capabilities.json | 229 +-------------------- .../mobile/get_system_capability_request.cc | 4 +- .../src/hmi_capabilities_impl.cc | 19 +- .../application_manager/test/hmi_capabilities.json | 214 ++++++++++++++----- .../include/application_manager/hmi_capabilities.h | 6 - .../application_manager/mock_application_manager.h | 3 + src/components/interfaces/MOBILE_API.xml | 1 + .../remote_control/test/include/mock_application.h | 3 + 9 files changed, 182 insertions(+), 305 deletions(-) diff --git a/src/3rd_party/FindBSON.cmake b/src/3rd_party/FindBSON.cmake index a319687eda..91d53624f1 100644 --- a/src/3rd_party/FindBSON.cmake +++ b/src/3rd_party/FindBSON.cmake @@ -10,11 +10,7 @@ find_library(BSON_LIB find_path(EMHASHMAP_INCLUDE_DIRECTORY emhashmap.h PATHS ${INCLUDE_PATH} -<<<<<<< 5fc2b1752f96e15ebd7433fab1d0d1a602273580 PATH_SUFFIXES emhashmap) -======= - PATH_SUFIXES emhashmap) ->>>>>>> Fix instalation of bson to avoid root access find_library(EMHASHMAP_LIB NAMES emhashmap @@ -23,12 +19,8 @@ find_library(EMHASHMAP_LIB include(FindPackageHandleStandardArgs) -<<<<<<< 5fc2b1752f96e15ebd7433fab1d0d1a602273580 find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_LIB EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB) -======= -find_package_handle_standard_args(BSON DEFAULT_MSG BSON_INCLUDE_DIRECTORY BSON_INCLUDE_DIRECTORY) ->>>>>>> Fix instalation of bson to avoid root access mark_as_advanced(BSON_INCLUDE_DIRECTORY BSON_LIB) mark_as_advanced(EMHASHMAP_INCLUDE_DIRECTORY EMHASHMAP_LIB) diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index 46a94f2af5..5bcd3e7170 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -492,82 +492,6 @@ "upDownAvailable": false } ] - } - }, - "mediaClockFormats": [ - "CLOCK1", - "CLOCK2", - "CLOCK3", - "CLOCKTEXT1", - "CLOCKTEXT2", - "CLOCKTEXT3", - "CLOCKTEXT4" - ], - "graphicSupported": true, - "templatesAvailable": [ - "DEFAULT", - "MEDIA", - "NON-MEDIA", - "ONSCREEN_PRESETS", - "NAV_FULLSCREEN_MAP", - "NAV_KEYBOARD", - "GRAPHIC_WITH_TEXT", - "TEXT_WITH_GRAPHIC", - "TILES_ONLY", - "TEXTBUTTONS_ONLY", - "GRAPHIC_WITH_TILES", - "TILES_WITH_GRAPHIC", - "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", - "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC", - "GRAPHIC_WITH_TEXTBUTTONS", - "TEXTBUTTONS_WITH_GRAPHIC", - "LARGE_GRAPHIC_WITH_SOFTBUTTONS", - "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS", - "LARGE_GRAPHIC_ONLY" - ], - "screenParams": { - "resolution": { - "resolutionWidth": 800, - "resolutionHeight": 350 - }, - "touchEventAvailable": { - "pressAvailable": true, - "multiTouchAvailable": false, - "doublePressAvailable": false - } - }, - "numCustomPresetsAvailable": 8, - "imageCapabilities": [ - "DYNAMIC", - "STATIC" - ] - }, - "audioPassThruCapabilities": { - "samplingRate": "44KHZ", - "bitsPerSample": "RATE_8_BIT", - "audioType": "PCM" - }, - "pcmStreamCapabilities": { - "samplingRate": "16KHZ", - "bitsPerSample": "RATE_16_BIT", - "audioType": "PCM" - }, - "hmiZoneCapabilities": "FRONT", - "softButtonCapabilities": [ - { - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": true, - "imageSupported": true - } - ], - "systemCapabilities": { - "navigationCapability": { - "sendLocationEnabled": true, - "getWayPointsEnabled": true - }, - "phoneCapability": { - "dialNumberEnabled": true }, "videoStreamingCapability": { "preferredResolution": { @@ -579,157 +503,6 @@ { "protocol": "RAW", "codec": "H264" - } - ], - "remoteControlCapability": { - "climateControlCapabilities": [ - { - "moduleName": "primary_climate", - "fanSpeedAvailable": true, - "desiredTemperatureAvailable": true, - "acEnableAvailable": true, - "acMaxEnableAvailable": true, - "circulateAirEnableAvailable": true, - "autoModeEnableAvailable": true, - "dualModeEnableAvailable": true, - "defrostZoneAvailable": true, - "ventilationModeAvailable": true, - "defrostZone": [ - "FRONT", - "REAR", - "ALL", - "NONE" - ], - "ventilationMode": [ - "UPPER", - "LOWER", - "BOTH", - "NONE" - ] - } - ], - "radioControlCapabilities": [ - { - "moduleName": "radio", - "radioEnableAvailable": true, - "radioBandAvailable": true, - "radioFrequencyAvailable": true, - "hdChannelAvailable": true, - "rdsDataAvailable": true, - "availableHDsAvailable": true, - "stateAvailable": true, - "signalStrengthAvailable": true, - "signalChangeThresholdAvailable": true - } - ], - "buttonCapabilities": [ - { - "name": "AC_MAX", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "AC", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "RECIRCULATE", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "FAN_UP", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "FAN_DOWN", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "TEMP_UP", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "TEMP_DOWN", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "DEFROST_MAX", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "DEFROST", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "DEFROST_REAR", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "UPPER_VENT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "LOWER_VENT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "VOLUME_UP", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "VOLUME_DOWN", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "EJECT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "SOURCE", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "SHUFFLE", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false - }, - { - "name": "REPEAT", - "shortPressAvailable": true, - "longPressAvailable": true, - "upDownAvailable": false } ] } @@ -902,4 +675,4 @@ "majorVersion": 3, "minorVersion": 0 } -} \ No newline at end of file +} diff --git a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc index af4acbea13..800e7fffe7 100644 --- a/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_system_capability_request.cc @@ -78,8 +78,6 @@ void GetSystemCapabilityRequest::Run() { SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE); return; } - SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); - return; break; case mobile_apis::SystemCapabilityType::AUDIO_STREAMING: SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); @@ -98,4 +96,4 @@ void GetSystemCapabilityRequest::on_event(const event_engine::Event& event) { } // namespace commands -} // namespace application_manager \ No newline at end of file +} // namespace application_manager diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index 35a48a740d..1c6e439ee8 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -674,6 +674,8 @@ void HMICapabilitiesImpl::set_video_streaming_capability( } video_streaming_capability_ = new smart_objects::SmartObject(video_streaming_capability); +} + void HMICapabilitiesImpl::set_rc_capability( const smart_objects::SmartObject& rc_capability) { if (rc_capability_) { @@ -814,8 +816,9 @@ const smart_objects::SmartObject* HMICapabilitiesImpl::phone_capability() const smart_objects::SmartObject* HMICapabilitiesImpl::video_streaming_capability() const { return video_streaming_capability_; +} - const smart_objects::SmartObject* HMICapabilitiesImpl::rc_capability() const { +const smart_objects::SmartObject* HMICapabilitiesImpl::rc_capability() const { return rc_capability_; } @@ -1131,13 +1134,13 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { set_video_streaming_capability(vs_capability_so); } if (check_existing_json_member(system_capabilities, - "remoteControlCapability")) { - Json::Value rc_capability = - system_capabilities.get("remoteControlCapability", ""); - smart_objects::SmartObject rc_capability_so; - Formatters::CFormatterJsonBase::jsonValueToObj(rc_capability, - rc_capability_so); - set_rc_capability(rc_capability_so); + "remoteControlCapability")) { + Json::Value rc_capability = + system_capabilities.get("remoteControlCapability", ""); + smart_objects::SmartObject rc_capability_so; + Formatters::CFormatterJsonBase::jsonValueToObj(rc_capability, + rc_capability_so); + set_rc_capability(rc_capability_so); } } } // UI end diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 5e3c6204ab..15640b2f31 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -1,15 +1,49 @@ { - "UI": - { + "UI": { "language":"EN_US", "languages":[ - "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO","NL_BE","EL_GR","HU_HU","FI_FI","SK_SK","EN_IN","TH_TH","EN_SA","HE_IL", -"RO_RO","UK_UA","ID_ID","VI_VN","MS_MY","HI_IN" + "EN_US", + "ES_MX", + "FR_CA", + "DE_DE", + "ES_ES", + "EN_GB", + "RU_RU", + "TR_TR", + "PL_PL", + "FR_FR", + "IT_IT", + "SV_SE", + "PT_PT", + "NL_NL", + "ZH_TW", + "JA_JP", + "AR_SA", + "KO_KR", + "PT_BR", + "CS_CZ", + "DA_DK", + "NO_NO", + "NL_BE", + "EL_GR", + "HU_HU", + "FI_FI", + "SK_SK", + "EN_IN", + "TH_TH", + "EN_SA", + "HE_IL", + "RO_RO", + "UK_UA", + "ID_ID", + "VI_VN", + "MS_MY", + "HI_IN" ], "displayCapabilities": { "displayType": "GEN2_8_DMA", - "textFields": [{ + "textFields": [ + { "name": "mainField1", "characterSet": "TYPE2SET", "width": 500, @@ -178,7 +212,8 @@ "rows": 1 } ], - "imageFields": [{ + "imageFields": [ + { "name": "softButtonImage", "imageTypeSupported": [], "imageResolution": { @@ -228,9 +263,7 @@ }, { "name": "graphic", - "imageTypeSupported": [ - - ], + "imageTypeSupported": [], "imageResolution": { "resolutionWidth": 35, "resolutionHeight": 35 @@ -249,17 +282,36 @@ ], "mediaClockFormats": [ - "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4" + "CLOCK1", + "CLOCK2", + "CLOCK3", + "CLOCKTEXT1", + "CLOCKTEXT2", + "CLOCKTEXT3", + "CLOCKTEXT4" ], "graphicSupported": true, "templatesAvailable": [ - "DEFAULT", "MEDIA", "NON-MEDIA", "ONSCREEN_PRESETS", "NAV_FULLSCREEN_MAP", "NAV_KEYBOARD", - "GRAPHIC_WITH_TEXT", "TEXT_WITH_GRAPHIC", "TILES_ONLY", "TEXTBUTTONS_ONLY", - "GRAPHIC_WITH_TILES", "TILES_WITH_GRAPHIC", "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", - "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC", "GRAPHIC_WITH_TEXTBUTTONS", - "TEXTBUTTONS_WITH_GRAPHIC", "LARGE_GRAPHIC_WITH_SOFTBUTTONS", - "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS", "LARGE_GRAPHIC_ONLY" + "DEFAULT", + "MEDIA", + "NON-MEDIA", + "ONSCREEN_PRESETS", + "NAV_FULLSCREEN_MAP", + "NAV_KEYBOARD", + "GRAPHIC_WITH_TEXT", + "TEXT_WITH_GRAPHIC", + "TILES_ONLY", + "TEXTBUTTONS_ONLY", + "GRAPHIC_WITH_TILES", + "TILES_WITH_GRAPHIC", + "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", + "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC", + "GRAPHIC_WITH_TEXTBUTTONS", + "TEXTBUTTONS_WITH_GRAPHIC", + "LARGE_GRAPHIC_WITH_SOFTBUTTONS", + "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS", + "LARGE_GRAPHIC_ONLY" ], "screenParams": { "resolution": { @@ -289,12 +341,14 @@ "audioType": "PCM" }, "hmiZoneCapabilities": "FRONT", - "softButtonCapabilities": [{ + "softButtonCapabilities": [ + { "shortPressAvailable": true, "longPressAvailable": true, "upDownAvailable": true, "imageSupported": true - }], + } + ], "systemCapabilities": { "navigationCapability": { "sendLocationEnabled": true, @@ -303,23 +357,10 @@ "phoneCapability": { "dialNumberEnabled": true }, - "videoStreamingCapability": { - "preferredResolution": { - "resolutionWidth": 800, - "resolutionHeight": 350 - }, - "maxBitrate": 10000, - "supportedFormats": [{ - "protocol": "RAW", - "codec": "H264" - }, - { - "protocol": "RTP", - "codec": "Theora" - }]}, "remoteControlCapability":{ - "climateControlCapabilities": [{ + "climateControlCapabilities": [ + { "moduleName": "primary_climate", "fanSpeedAvailable": true, "desiredTemperatureAvailable": true, @@ -330,17 +371,22 @@ "dualModeEnableAvailable": true, "defrostZoneAvailable": true, "ventilationModeAvailable": true, - "defrostZone": ["FRONT", + "defrostZone": [ + "FRONT", "REAR", "ALL", - "NONE"], - "ventilationMode": ["UPPER", + "NONE" + ], + "ventilationMode": [ + "UPPER", "LOWER", "BOTH", - "NONE"] - }], - - "radioControlCapabilities": [{ + "NONE" + ] + } + ], + "radioControlCapabilities": [ + { "moduleName": "radio", "radioEnableAvailable": true, "radioBandAvailable": true, @@ -351,9 +397,10 @@ "stateAvailable": true, "signalStrengthAvailable": true, "signalChangeThresholdAvailable": true - }], - - "buttonCapabilities": [{ + } + ], + "buttonCapabilities": [ + { "name": "AC_MAX", "shortPressAvailable": true, "longPressAvailable": true, @@ -460,28 +507,91 @@ "shortPressAvailable": true, "longPressAvailable": true, "upDownAvailable": false - }] + } + ] + }, + "videoStreamingCapability": { + "preferredResolution": { + "resolutionWidth": 800, + "resolutionHeight": 350 + }, + "maxBitrate": 10000, + "supportedFormats": [ + { + "protocol": "RAW", + "codec": "H264" + }, + { + "protocol": "RTP", + "codec": "Theora" + } + ] } } }, "VR": { - "capabilities": ["TEXT"], + "capabilities": [ + "TEXT" + ], "language": "ES_MX", "languages": [ - "AR_SA", "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "ZH_TW", - "JA_JP", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO" + "AR_SA", + "EN_US", + "ES_MX", + "FR_CA", + "DE_DE", + "ES_ES", + "EN_GB", + "RU_RU", + "TR_TR", + "PL_PL", + "FR_FR", + "IT_IT", + "SV_SE", + "PT_PT", + "NL_NL", + "ZH_TW", + "JA_JP", + "KO_KR", + "PT_BR", + "CS_CZ", + "DA_DK", + "NO_NO" ] }, "TTS": { - "capabilities": ["TEXT"], + "capabilities": [ + "TEXT" + ], "language": "DE_DE", "languages": [ - "DA_DK", "CS_CZ", "KO_KR", "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "ZH_TW", - "JA_JP", "AR_SA", "PT_BR", "NO_NO" + "DA_DK", + "CS_CZ", + "KO_KR", + "EN_US", + "ES_MX", + "FR_CA", + "DE_DE", + "ES_ES", + "EN_GB", + "RU_RU", + "TR_TR", + "PL_PL", + "FR_FR", + "IT_IT", + "SV_SE", + "PT_PT", + "NL_NL", + "ZH_TW", + "JA_JP", + "AR_SA", + "PT_BR", + "NO_NO" ] }, "Buttons": { - "capabilities": [{ + "capabilities": [ + { "name": "PRESET_0", "shortPressAvailable": true, "longPressAvailable": true, diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h index 5856f2aff5..99e755e59b 100644 --- a/src/components/include/application_manager/hmi_capabilities.h +++ b/src/components/include/application_manager/hmi_capabilities.h @@ -412,7 +412,6 @@ class HMICapabilities { */ virtual bool phone_call_supported() const = 0; -<<<<<<< e8f4b4fef6ccb7106fe0a0c4e2b4e828e20ee926 /* * @brief Interface to store whether HMI supports video streaming * @@ -434,8 +433,6 @@ class HMICapabilities { * @param navigation_capability contains information related * to the navigation system capability. */ -======= ->>>>>>> Implementation of system capabilities virtual void set_navigation_capability( const smart_objects::SmartObject& navigation_capability) = 0; @@ -446,7 +443,6 @@ class HMICapabilities { virtual const smart_objects::SmartObject* phone_capability() const = 0; -<<<<<<< e8f4b4fef6ccb7106fe0a0c4e2b4e828e20ee926 /* * @brief Sets HMI's video streaming related capability information * @@ -462,12 +458,10 @@ class HMICapabilities { */ virtual const smart_objects::SmartObject* video_streaming_capability() const = 0; -======= virtual void set_rc_capability( const smart_objects::SmartObject& rc_capability) = 0; virtual const smart_objects::SmartObject* rc_capability() const = 0; ->>>>>>> Implementation of system capabilities virtual void Init(resumption::LastState* last_state) = 0; diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index e4500fb602..139efbf1ee 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -291,6 +291,9 @@ class MockApplicationManager : public application_manager::ApplicationManager { protocol_handler::ServiceType service_type, bool result, std::vector& rejected_params)); + MOCK_METHOD1(ValidateMessageBySchema, + application_manager::MessageValidationResult( + const application_manager::Message& message)); }; } // namespace application_manager_test diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 6ec12befad..561a517a97 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2888,6 +2888,7 @@ + diff --git a/src/components/remote_control/test/include/mock_application.h b/src/components/remote_control/test/include/mock_application.h index 5c4e5eab8d..2c4ce641ee 100644 --- a/src/components/remote_control/test/include/mock_application.h +++ b/src/components/remote_control/test/include/mock_application.h @@ -78,6 +78,9 @@ class MockApplication : public ::application_manager::Application { MOCK_CONST_METHOD0(audio_streaming_allowed, bool()); MOCK_METHOD1(set_audio_streaming_allowed, void(bool state)); MOCK_CONST_METHOD0(is_audio, bool()); + MOCK_METHOD2(SetVideoConfig, + bool(protocol_handler::ServiceType service_type, + const smart_objects::SmartObject& params)); MOCK_METHOD1(StartStreaming, void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type)); -- cgit v1.2.1 From 06e124fca7ca23cb19b7586f5cd8e14c6878b9d9 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Thu, 17 Aug 2017 13:17:16 +0300 Subject: Removes unused parameters from .ini file and obsolete unit tests --- src/appMain/smartDeviceLink.ini | 4 +--- .../functional_module/test/src/settings_test.cc | 20 -------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini index 64772ebfd6..f177018641 100644 --- a/src/appMain/smartDeviceLink.ini +++ b/src/appMain/smartDeviceLink.ini @@ -273,7 +273,5 @@ WaitTimeBetweenApps = 4000 EnableAppLaunchIOS = true [Remote Control] -InteriorVDCapabilitiesFile = ./plugins/InteriorVehicleDataCapabilities.json -address = 127.0.0.1 -port = 8092 +; Timeout to wait for HMI response for RC APIs coming from mobile timeout_period_seconds = 10 diff --git a/src/components/functional_module/test/src/settings_test.cc b/src/components/functional_module/test/src/settings_test.cc index ad7324c350..dac3a2669c 100644 --- a/src/components/functional_module/test/src/settings_test.cc +++ b/src/components/functional_module/test/src/settings_test.cc @@ -51,26 +51,6 @@ TEST(Settings, ReadParamBoolWithSectionFail) { ASSERT_TRUE(launch); } -TEST(Settings, ReadParamStringWithSectionSuccess) { - Settings set; - set.ChangeConfigFile("test.ini"); - std::string file_path; - bool result = set.ReadParameter( - "Remote Control", "InteriorVDCapabilitiesFile", &file_path); - ASSERT_TRUE(result); - ASSERT_EQ("./plugins/InteriorVehicleDataCapabilities.json", file_path); -} - -TEST(Settings, ReadParamStringWithSectionFail) { - Settings set; - set.ChangeConfigFile("test.ini"); - std::string file_path; - bool result = - set.ReadParameter("Remote Control", "InteriorVDCFile", &file_path); - ASSERT_FALSE(result); - ASSERT_EQ("", file_path); -} - TEST(Settings, ReadParamStringNoSectionSuccess) { Settings set; set.ChangeConfigFile("test.ini"); -- cgit v1.2.1 From c03f1aeea948623306d954f3202d0f54d6f8ee01 Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Thu, 17 Aug 2017 11:29:18 -0400 Subject: - changing Show Request metadata but no data warning result code from IGNORED to WARNINGS --- src/components/application_manager/src/commands/mobile/show_request.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc index 00cdc2a603..7664df602e 100644 --- a/src/components/application_manager/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_request.cc @@ -74,7 +74,7 @@ void ShowRequest::HandleMetadata(const char* field_id, << field_id << ", ignoring with warning"); // tag provided with no item, ignore with warning if (mobile_apis::Result::INVALID_ENUM == core_result_code_) { - core_result_code_ = mobile_apis::Result::IGNORED; + core_result_code_ = mobile_apis::Result::WARNINGS; core_response_info_ = "Metadata tag was provided for a field with no data."; } -- cgit v1.2.1 From 5ac94cb84735c9e58681bcbf300b700b931be360 Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Thu, 17 Aug 2017 11:53:17 -0400 Subject: - performed renamings suggested in smartdevicelink/sdl_evolution#239 --- .../application_manager/smart_object_keys.h | 2 +- .../src/commands/mobile/show_request.cc | 13 ++++++------ .../application_manager/src/smart_object_keys.cc | 2 +- .../test/commands/mobile/show_test.cc | 24 +++++++++++----------- src/components/interfaces/HMI_API.xml | 4 ++-- src/components/interfaces/MOBILE_API.xml | 16 +++++++-------- 6 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 88a904764b..3d8849fb73 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -90,7 +90,7 @@ extern const char* main_field_1; extern const char* main_field_2; extern const char* main_field_3; extern const char* main_field_4; -extern const char* text_field_metadata; +extern const char* metadata_tags; extern const char* eta; extern const char* time_to_destination; extern const char* total_distance; diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc index 7664df602e..5b8e98d7ea 100644 --- a/src/components/application_manager/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_request.cc @@ -53,18 +53,18 @@ ShowRequest::~ShowRequest() {} void ShowRequest::HandleMetadata(const char* field_id, int32_t field_index, smart_objects::SmartObject& msg_params) { - smart_objects::SmartObject& metadata_struct = - (*message_)[strings::msg_params][strings::text_field_metadata]; + smart_objects::SmartObject& metadata_tags = + (*message_)[strings::msg_params][strings::metadata_tags]; - if (metadata_struct.keyExists(field_id)) { + if (metadata_tags.keyExists(field_id)) { if (field_index != -1) { msg_params[hmi_request::show_strings][field_index] [hmi_request::field_types] = smart_objects::SmartObject(smart_objects::SmartType_Array); - const size_t num_tags = metadata_struct[field_id].length(); + const size_t num_tags = metadata_tags[field_id].length(); for (size_t i = 0; i < num_tags; ++i) { - const int32_t current_tag = metadata_struct[field_id][i].asInt(); + const int32_t current_tag = metadata_tags[field_id][i].asInt(); msg_params[hmi_request::show_strings][field_index] [hmi_request::field_types][i] = current_tag; } @@ -201,8 +201,7 @@ void ShowRequest::Run() { ++index; } - if ((*message_)[strings::msg_params].keyExists( - strings::text_field_metadata)) { + if ((*message_)[strings::msg_params].keyExists(strings::metadata_tags)) { HandleMetadata(strings::main_field_1, main_field_1_index, msg_params); HandleMetadata(strings::main_field_2, main_field_2_index, msg_params); HandleMetadata(strings::main_field_3, main_field_3_index, msg_params); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index cafb7f7388..d0a8d42df7 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -57,7 +57,7 @@ const char* main_field_1 = "mainField1"; const char* main_field_2 = "mainField2"; const char* main_field_3 = "mainField3"; const char* main_field_4 = "mainField4"; -const char* text_field_metadata = "textFieldMetadata"; +const char* metadata_tags = "metadataTags"; const char* eta = "eta"; const char* time_to_destination = "timeToDestination"; const char* total_distance = "totalDistance"; diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc index b1e6d93b39..01d4c8105f 100644 --- a/src/components/application_manager/test/commands/mobile/show_test.cc +++ b/src/components/application_manager/test/commands/mobile/show_test.cc @@ -161,11 +161,11 @@ class ShowRequestTest : public CommandRequestTest { (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; (*msg)[am::strings::params][am::strings::function_id] = kFunctionID; msg_params[field] = text_field_; - msg_params[am::strings::text_field_metadata][field] = + msg_params[am::strings::metadata_tags][field] = smart_objects::SmartObject(smart_objects::SmartType_Array); for (size_t i = 0; i < num_tags; ++i) { const int32_t current_tag = field_tags[i]; - msg_params[am::strings::text_field_metadata][field][i] = current_tag; + msg_params[am::strings::metadata_tags][field][i] = current_tag; } (*msg)[am::strings::msg_params] = msg_params; @@ -176,7 +176,7 @@ class ShowRequestTest : public CommandRequestTest { EXPECT_CALL(*mock_app_, app_id()).WillOnce(Return(kAppId)); msg_params.erase(field); - msg_params.erase(am::strings::text_field_metadata); + msg_params.erase(am::strings::metadata_tags); msg_params[am::strings::app_id] = kAppId; msg_params[am::hmi_request::show_strings] = @@ -643,7 +643,7 @@ TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) { text_field_ = "Main_Field_1"; const size_t num_tags = 1; - int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaArtist}; + int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist}; TestSetupHelperWithMetadata(msg, hmi_apis::Common_TextFieldName::mainField1, am::strings::main_field_1, @@ -659,11 +659,11 @@ TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) { text_field_ = "Main_Field_1"; const size_t num_tags = 5; - int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaTitle, - hmi_apis::Common_TextFieldType::mediaArtist, - hmi_apis::Common_TextFieldType::rating, - hmi_apis::Common_TextFieldType::humidity, - hmi_apis::Common_TextFieldType::currentTemperature}; + int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaTitle, + hmi_apis::Common_MetadataType::mediaArtist, + hmi_apis::Common_MetadataType::rating, + hmi_apis::Common_MetadataType::humidity, + hmi_apis::Common_MetadataType::currentTemperature}; TestSetupHelperWithMetadata(msg, hmi_apis::Common_TextFieldName::mainField1, am::strings::main_field_1, @@ -679,7 +679,7 @@ TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) { text_field_ = "Main_Field_2"; const size_t num_tags = 1; - int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaArtist}; + int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist}; TestSetupHelperWithMetadata(msg, hmi_apis::Common_TextFieldName::mainField2, am::strings::main_field_2, @@ -695,7 +695,7 @@ TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) { text_field_ = "Main_Field_3"; const size_t num_tags = 1; - int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaArtist}; + int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist}; TestSetupHelperWithMetadata(msg, hmi_apis::Common_TextFieldName::mainField3, am::strings::main_field_3, @@ -711,7 +711,7 @@ TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) { text_field_ = "Main_Field_4"; const size_t num_tags = 1; - int32_t tags[num_tags] = {hmi_apis::Common_TextFieldType::mediaArtist}; + int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist}; TestSetupHelperWithMetadata(msg, hmi_apis::Common_TextFieldName::mainField4, am::strings::main_field_4, diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index d813f27ed1..d92455a90b 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -503,7 +503,7 @@ - + The data in this field contains the title of the currently playing audio track. @@ -1686,7 +1686,7 @@ The text itself. - + The type of data contained in the field. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 861ebc7a5d..e9689edb83 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -701,7 +701,7 @@ - + The data in this field contains the title of the currently playing audio track. @@ -880,17 +880,17 @@ - - + + The type of data contained in the "mainField1" text field. - + The type of data contained in the "mainField2" text field. - + The type of data contained in the "mainField3" text field. - + The type of data contained in the "mainField4" text field. @@ -3342,9 +3342,9 @@ - + - App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4. + App defined metadata information. See MetadataTags. Uses mainField1, mainField2, mainField3, mainField4. If omitted on supported displays, the currently set metadata tags will not change. If any text field contains no tags, the metadata tag for that textfield should be removed. -- cgit v1.2.1 From 15ca281d0932d5916a10100456da2ffa4429d995 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Thu, 17 Aug 2017 20:39:38 +0300 Subject: Adds and fixes methods descriptions, adds missing typedef --- src/appMain/sdl_preloaded_pt.json | 4 --- .../include/application_manager/application.h | 36 ++++++++++++++++++++++ .../include/application_manager/core_service.h | 32 +++++++++++++++++-- .../include/application_manager/message_helper.h | 11 +++++-- .../application_manager/policies/policy_handler.h | 2 +- .../src/application_manager_impl.cc | 2 ++ 6 files changed, 78 insertions(+), 9 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index f952b081d1..e2dda24f4a 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -2375,10 +2375,6 @@ "steal_focus": false, "priority": "NONE", "default_hmi": "NONE", - "moduleType": [ - "RADIO", - "CLIMATE" - ], "groups": ["DataConsent-2"] }, "pre_DataConsent": { diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 01b305e876..6a6072da2e 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -787,16 +787,31 @@ class Application : public virtual InitialApplicationData, virtual uint32_t GetAvailableDiskSpace() = 0; #ifdef SDL_REMOTE_CONTROL + /** + * @brief set_system_context Set system context for application + * @param system_context Current context + */ virtual void set_system_context( const mobile_api::SystemContext::eType& system_context) = 0; + + /** + * @brief set_audio_streaming_state Set audio streaming state for application + * @param state Current audio streaming state + */ virtual void set_audio_streaming_state( const mobile_api::AudioStreamingState::eType& state) = 0; + virtual bool IsSubscribedToInteriorVehicleData( smart_objects::SmartObject module) = 0; virtual bool SubscribeToInteriorVehicleData( smart_objects::SmartObject module) = 0; virtual bool UnsubscribeFromInteriorVehicleData( smart_objects::SmartObject module) = 0; + + /** + * @brief set_hmi_level Set HMI level for application + * @param hmi_level Current HMI level + */ virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0; /** @@ -805,9 +820,30 @@ class Application : public virtual InitialApplicationData, * @return Pointer to extension, if extension was initialized, otherwise NULL */ virtual AppExtensionPtr QueryInterface(AppExtensionUID uid) = 0; + + /** + * @brief Add extension to application + * @param extension pointer to extension + * @return true if success, false if extension already initialized + */ virtual bool AddExtension(AppExtensionPtr extention) = 0; + + /** + * @brief Remove extension from application + * @param uid uid of extension + * @return true if success, false if extension is not present + */ virtual bool RemoveExtension(AppExtensionUID uid) = 0; + + /** + * @brief Removes all extensions + */ virtual void RemoveExtensions() = 0; + + /** + * @brief Get list of subscriptions to vehicle info notifications + * @return list of subscriptions to vehicle info notifications + */ virtual const std::set& SubscribesIVI() const = 0; #endif // SDL_REMOTE_CONTROL diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index a1c806c3ba..112d63a8ff 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -104,8 +104,8 @@ class CoreService : public Service { bool allowed) FINAL; /** - * Resets access by group name for all applications - * @param group_name group name + * @brief ResetAccess Resets access by application id + * @param app_id Application id */ void ResetAccess(const ApplicationId& app_id) FINAL; @@ -236,14 +236,42 @@ class CoreService : public Service { bool GetModuleTypes(const std::string& policy_app_id, std::vector* modules) const FINAL; + /** + * @brief ValidateMessageBySchema Checks whether message is valid according + * to API + * @param message Message to check + * @return Check result + */ MessageValidationResult ValidateMessageBySchema( const Message& message) OVERRIDE; private: + /** + * @brief AreParametersAllowed Checks message parameters across current policy + * permissions + * @param msg Message having parameters + * @param params Parameters sorted by permissions + * @return True if allowed, otherwise - false + */ bool AreParametersAllowed(MessagePtr msg, const CommandParametersPermissions& params); + + /** + * @brief CheckParams Checks object params with allowed parameters received + * from policy + * @param object Message object + * @param allowed_params Parameters allowed by policy + * @return True if all parameters allowed, otherwise - false + */ bool CheckParams(const Json::Value& object, const policy::RPCParams& allowed_params); + + /** + * @brief IsAllowed Checks particular parameter among allowed list + * @param name Parameter name + * @param allowed_params List of allowed parameters + * @return True if found, otherwise - false + */ bool IsAllowed(const std::string& name, const policy::RPCParams& allowed_params); diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h index 45a1215531..29629e091f 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -716,14 +716,21 @@ class MessageHelper { #ifdef SDL_REMOTE_CONTROL /** * @brief Sends HMI status notification to mobile - * * @param application_impl application with changed HMI status - * **/ static void SendHMIStatusNotification( const Application& application_impl, ApplicationManager& application_manager); + /** + * @brief SendActivateAppToHMI Sends BasicCommunication.ActivateApp request to + * HMI + * @param app_id Application id + * @param application_manager Application manager + * @param level Application HMI level + * @param send_policy_priority Defines whether to send "priority" field with + * request + */ static void SendActivateAppToHMI( uint32_t const app_id, ApplicationManager& application_manager, diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 3dd2bb76e0..352c9826a5 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -186,7 +186,7 @@ class PolicyHandler : public PolicyHandlerInterface, void ResetAccess(const PTString& device_id, const PTString& app_id) OVERRIDE; /** - * Resets access by group name for all applications + * Resets access by module name for all applications * @param module type */ void ResetAccess(const std::string& module) OVERRIDE; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 965efa4226..3501cd90b4 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -725,9 +725,11 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() { hmi_apis::FunctionID::VehicleInfo_IsReady, *this)); ManageHMICommand(is_ivi_ready); +#ifdef SDL_REMOTE_CONTROL utils::SharedPtr is_rc_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady, *this)); +#endif ManageHMICommand(is_rc_ready); utils::SharedPtr button_capabilities( -- cgit v1.2.1 From 9df5e02922703f00c9cfeaf7606de71d85f6345f Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Fri, 18 Aug 2017 15:27:12 -0400 Subject: Fix version negotiation for pre-v5 apps The previous expected behavior was to send the maximum protocol version supported by Core in the first StartSessionACK. Now a hard limit of `PROTOCOL_VERSION_4` is set if the proxy doesn't support version 5, as v5 involves a change to the payload structure. --- .../protocol_handler/src/protocol_handler_impl.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index a4d263a00c..125e033147 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -243,6 +243,17 @@ void ProtocolHandlerImpl::SendStartSessionAck( uint8_t maxProtocolVersion = SupportedSDLProtocolVersion(); + const bool proxy_supports_v5_protocol = + protocol_version >= PROTOCOL_VERSION_5 || + (ServiceTypeFromByte(service_type) == kRpc && + full_version.majorVersion >= PROTOCOL_VERSION_5); + + // We can't send a V5+ packet if the proxy doesn't support it, + // so we manually set a maximum of V4 in that case + if (!proxy_supports_v5_protocol && maxProtocolVersion >= PROTOCOL_VERSION_5) { + maxProtocolVersion = PROTOCOL_VERSION_4; + } + ProtocolFramePtr ptr( new protocol_handler::ProtocolPacket(connection_id, maxProtocolVersion, @@ -254,13 +265,8 @@ void ProtocolHandlerImpl::SendStartSessionAck( 0u, message_counters_[session_id]++)); - const bool proxy_supports_v5_protocol = - protocol_version >= PROTOCOL_VERSION_5 || - (ServiceTypeFromByte(service_type) == kRpc && - full_version.majorVersion >= PROTOCOL_VERSION_5); - // Cannot include a constructed payload if either side doesn't support it - if (proxy_supports_v5_protocol && maxProtocolVersion >= PROTOCOL_VERSION_5) { + if (maxProtocolVersion >= PROTOCOL_VERSION_5) { ServiceType serviceTypeValue = ServiceTypeFromByte(service_type); bson_object_put_int64( -- cgit v1.2.1 From 20bd1f7c2117a8884b6814311aded62c581d9be6 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 20 Aug 2017 18:19:30 +0300 Subject: Remove not actual TODOs --- .../include/application_manager/application.h | 14 ++-- .../include/application_manager/core_service.h | 6 +- .../src/application_manager_impl.cc | 2 - .../src/message_helper/message_helper.cc | 4 - .../include/functional_module/plugin_manager.h | 1 - .../functional_module/src/plugin_manager.cc | 19 ++--- .../commands/base_command_notification.h | 2 - .../remote_control/commands/base_command_request.h | 2 - .../include/remote_control/message_helper.h | 7 -- .../include/remote_control/module_helper.h | 62 -------------- .../remote_control/remote_plugin_interface.h | 1 - .../src/commands/base_command_request.cc | 1 - .../remote_control/src/message_helper.cc | 8 -- src/components/remote_control/src/module_helper.cc | 97 ---------------------- 14 files changed, 15 insertions(+), 211 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 6a6072da2e..4d859adb92 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -793,14 +793,14 @@ class Application : public virtual InitialApplicationData, */ virtual void set_system_context( const mobile_api::SystemContext::eType& system_context) = 0; - + /** * @brief set_audio_streaming_state Set audio streaming state for application * @param state Current audio streaming state */ virtual void set_audio_streaming_state( const mobile_api::AudioStreamingState::eType& state) = 0; - + virtual bool IsSubscribedToInteriorVehicleData( smart_objects::SmartObject module) = 0; virtual bool SubscribeToInteriorVehicleData( @@ -811,7 +811,7 @@ class Application : public virtual InitialApplicationData, /** * @brief set_hmi_level Set HMI level for application * @param hmi_level Current HMI level - */ + */ virtual void set_hmi_level(const mobile_api::HMILevel::eType& hmi_level) = 0; /** @@ -820,26 +820,26 @@ class Application : public virtual InitialApplicationData, * @return Pointer to extension, if extension was initialized, otherwise NULL */ virtual AppExtensionPtr QueryInterface(AppExtensionUID uid) = 0; - + /** * @brief Add extension to application * @param extension pointer to extension * @return true if success, false if extension already initialized */ virtual bool AddExtension(AppExtensionPtr extention) = 0; - + /** * @brief Remove extension from application * @param uid uid of extension * @return true if success, false if extension is not present */ virtual bool RemoveExtension(AppExtensionUID uid) = 0; - + /** * @brief Removes all extensions */ virtual void RemoveExtensions() = 0; - + /** * @brief Get list of subscriptions to vehicle info notifications * @return list of subscriptions to vehicle info notifications diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index 112d63a8ff..c5dcc975df 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -255,9 +255,9 @@ class CoreService : public Service { */ bool AreParametersAllowed(MessagePtr msg, const CommandParametersPermissions& params); - + /** - * @brief CheckParams Checks object params with allowed parameters received + * @brief CheckParams Checks object params with allowed parameters received * from policy * @param object Message object * @param allowed_params Parameters allowed by policy @@ -265,7 +265,7 @@ class CoreService : public Service { */ bool CheckParams(const Json::Value& object, const policy::RPCParams& allowed_params); - + /** * @brief IsAllowed Checks particular parameter among allowed list * @param name Parameter name diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 3501cd90b4..8fbd4cb5b5 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -2173,8 +2173,6 @@ bool ApplicationManagerImpl::ConvertMessageToSO( break; } default: - // TODO(PV): - // removed NOTREACHED() because some app can still have vesion 1. LOG4CXX_WARN(logger_, "Application used unsupported protocol :" << message.protocol_version() << "."); diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 1ceadbdc6e..3991173892 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -512,8 +512,6 @@ void MessageHelper::SendActivateAppToHMI( if (send_policy_priority) { std::string priority; - // TODO(KKolodiy): need remove method policy_manager - application_manager.GetPolicyHandler().GetPriority(app->policy_app_id(), &priority); // According SDLAQ-CRS-2794 @@ -1547,8 +1545,6 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( if (send_policy_priority) { std::string priority; - // TODO(KKolodiy): need remove method policy_manager - policy_handler.GetPriority(app->policy_app_id(), &priority); // According SDLAQ-CRS-2794 // SDL have to send ActivateApp without "proirity" parameter to HMI. diff --git a/src/components/functional_module/include/functional_module/plugin_manager.h b/src/components/functional_module/include/functional_module/plugin_manager.h index 38368ab01a..76efc516fc 100644 --- a/src/components/functional_module/include/functional_module/plugin_manager.h +++ b/src/components/functional_module/include/functional_module/plugin_manager.h @@ -56,7 +56,6 @@ class PluginManager : public ModuleObserver { bool IsMessageForPlugin(application_manager::MessagePtr msg); bool IsHMIMessageForPlugin(application_manager::MessagePtr msg); void OnServiceStateChanged(ServiceState state); - void OnHMIResponse(application_manager::MessagePtr msg); void OnError(ModuleObserver::Errors error, ModuleID module_id); /** diff --git a/src/components/functional_module/src/plugin_manager.cc b/src/components/functional_module/src/plugin_manager.cc index 53c31471fc..f49fcf5962 100644 --- a/src/components/functional_module/src/plugin_manager.cc +++ b/src/components/functional_module/src/plugin_manager.cc @@ -52,7 +52,6 @@ PluginManager::PluginManager() : service_() { } PluginManager::~PluginManager() { - // TODO(PV): unsubscribe plugins from functions mobile_subscribers_.clear(); hmi_subscribers_.clear(); UnloadPlugins(); @@ -138,9 +137,6 @@ void PluginManager::UnloadPlugins() { dlls_.clear(); } -// TODO(VS): Optimize similar code in ProcessMessage, IsMessageForPlugin, -// ProcessHMIMessage, IsHMIMessageForPlugin methods -// (also we have similar code in can module) void PluginManager::ProcessMessage(application_manager::MessagePtr msg) { DCHECK(msg); if (!msg) { @@ -278,10 +274,6 @@ void PluginManager::OnServiceStateChanged(ServiceState state) { } } -void PluginManager::OnHMIResponse(application_manager::MessagePtr msg) { - // TODO(PV) -} - void PluginManager::OnError(ModuleObserver::Errors error, ModuleID module_id) { std::string error_string; switch (error) { @@ -291,13 +283,12 @@ void PluginManager::OnError(ModuleObserver::Errors error, ModuleID module_id) { case ModuleObserver::Errors::FS_FAILURE: error_string = "Plugin failed to run file system operation."; break; - default: - break; + default: { + LOG4CXX_ERROR(logger_, + "Error " << error_string << " was received from module " + << module_id); + } break; } - LOG4CXX_ERROR(logger_, - "Error " << error_string << " was received from module " - << module_id); - // TODO(PV) } void PluginManager::RemoveAppExtension(uint32_t app_id) { diff --git a/src/components/remote_control/include/remote_control/commands/base_command_notification.h b/src/components/remote_control/include/remote_control/commands/base_command_notification.h index 7e695d68c7..35b8d3f6c2 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_notification.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_notification.h @@ -71,7 +71,6 @@ class BaseCommandNotification : public Command { */ virtual void OnTimeout() {} - // TODO(KKolodiy): need rename to Execute void Run(); protected: @@ -86,7 +85,6 @@ class BaseCommandNotification : public Command { /** * @brief executes specific logic of children classes */ - // TODO(KKolodiy): need rename to Run virtual void Execute() = 0; /** diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h index 9949f00fd5..120fff6f2f 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_request.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h @@ -76,7 +76,6 @@ class BaseCommandRequest */ virtual void OnTimeout(); - // TODO(KKolodiy): need rename to Execute void Run(); void on_event(const rc_event_engine::Event& event); @@ -206,7 +205,6 @@ class BaseCommandRequest /** * @brief executes specific logic of children classes */ - // TODO(KKolodiy): need rename to Run void virtual Execute() = 0; /** diff --git a/src/components/remote_control/include/remote_control/message_helper.h b/src/components/remote_control/include/remote_control/message_helper.h index 888f4537a4..49d1d07a11 100644 --- a/src/components/remote_control/include/remote_control/message_helper.h +++ b/src/components/remote_control/include/remote_control/message_helper.h @@ -78,13 +78,6 @@ class MessageHelper { */ static Json::Value StringToValue(const std::string& string); - /** - * Validates structure DeviceInfo - * @param value json of DeviceInfo - * @return true if json is valid - */ - static bool ValidateDeviceInfo(const Json::Value& value); - /** * Validates structure InteriorZone * @param value json of InteriorZone diff --git a/src/components/remote_control/include/remote_control/module_helper.h b/src/components/remote_control/include/remote_control/module_helper.h index a964fe1422..e69de29bb2 100644 --- a/src/components/remote_control/include/remote_control/module_helper.h +++ b/src/components/remote_control/include/remote_control/module_helper.h @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - */ - -#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MODULE_HELPER_H_ -#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MODULE_HELPER_H_ - -#include "functional_module/generic_module.h" -#include "json/json.h" -#include "interfaces/HMI_API.h" -#include "remote_control/remote_plugin_interface.h" - -namespace remote_control { - -/** - * @brief ModuleHelper class - **/ -class ModuleHelper { - public: - static void ProccessOnReverseAppsDisallowed(RemotePluginInterface& rc_module); - - private: - ModuleHelper(); - - static application_manager::MessagePtr ResponseToHMI( - unsigned int id, - hmi_apis::Common_Result::eType result_code, - const std::string& method_name); - DISALLOW_COPY_AND_ASSIGN(ModuleHelper); -}; - -} // namespace remote_control - -#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MODULE_HELPER_H_ diff --git a/src/components/remote_control/include/remote_control/remote_plugin_interface.h b/src/components/remote_control/include/remote_control/remote_plugin_interface.h index 31e894db99..670d8e1548 100644 --- a/src/components/remote_control/include/remote_control/remote_plugin_interface.h +++ b/src/components/remote_control/include/remote_control/remote_plugin_interface.h @@ -126,7 +126,6 @@ class RemotePluginInterface : public functional_modules::GenericModule { */ virtual void RemoveAppExtensions() = 0; - // TODO(VS): must be uid static const functional_modules::ModuleID kCANModuleID = 153; }; diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index 51291f8aed..c67bd68340 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -338,7 +338,6 @@ void BaseCommandRequest::Run() { // send response to mobile or // send additional request to HMI to ask driver consent } - // TODO : send error in case if policy permissions failed } bool BaseCommandRequest::CheckPolicyPermissions() { diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc index 577a824d01..15adf2510a 100644 --- a/src/components/remote_control/src/message_helper.cc +++ b/src/components/remote_control/src/message_helper.cc @@ -99,14 +99,6 @@ bool IsMember(const Json::Value& value, const std::string& key) { return value.isMember(key); } -// TODO(KKolodiy): after creating commands for notification from HMI -// this validate methods may move to commands -bool MessageHelper::ValidateDeviceInfo(const Json::Value& value) { - return value.isObject() && value.isMember(json_keys::kId) && - value.isMember(message_params::kName) && - value[message_params::kName].isString(); -} - application_manager::MessagePtr MessageHelper::CreateHmiRequest( const char* function_id, const uint32_t hmi_app_id, diff --git a/src/components/remote_control/src/module_helper.cc b/src/components/remote_control/src/module_helper.cc index 8b194b9b5f..e69de29bb2 100644 --- a/src/components/remote_control/src/module_helper.cc +++ b/src/components/remote_control/src/module_helper.cc @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - */ - -#include "remote_control/module_helper.h" -#include "remote_control/remote_control_plugin.h" -#include "remote_control/rc_module_constants.h" -#include "remote_control/rc_app_extension.h" -#include "application_manager/message.h" -#include "remote_control/message_helper.h" - -namespace remote_control { - -using functional_modules::ProcessResult; -using application_manager::AppExtensionPtr; - -application_manager::MessagePtr ModuleHelper::ResponseToHMI( - unsigned int id, - hmi_apis::Common_Result::eType result_code, - const std::string& method_name) { - Json::Value msg; - msg[json_keys::kId] = id; - msg[json_keys::kJsonrpc] = "2.0"; - - if (hmi_apis::Common_Result::eType::SUCCESS == result_code) { - msg[json_keys::kResult] = Json::Value(Json::ValueType::objectValue); - msg[json_keys::kResult][json_keys::kCode] = result_code; - msg[json_keys::kResult][json_keys::kMethod] = method_name; - } else { - msg[json_keys::kError] = Json::Value(Json::ValueType::objectValue); - msg[json_keys::kError][json_keys::kCode] = result_code; - msg[json_keys::kError][json_keys::kData] = - Json::Value(Json::ValueType::objectValue); - msg[json_keys::kError][json_keys::kData][json_keys::kMethod] = method_name; - } - - application_manager::MessagePtr message(new application_manager::Message( - protocol_handler::MessagePriority::kDefault)); - message->set_protocol_version( - protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI); - message->set_correlation_id(msg[json_keys::kId].asInt()); - Json::FastWriter writer; - std::string json_msg = writer.write(msg); - message->set_json_message(json_msg); - message->set_message_type(application_manager::MessageType::kResponse); - return message; -} - -// (TODO)VS: Replace this functions for separate OnReverseAppsDisallowed -// notiifcation -void ModuleHelper::ProccessOnReverseAppsDisallowed( - RemotePluginInterface& rc_module) { - std::vector applications = - rc_module.service()->GetApplications(rc_module.GetModuleID()); - - for (uint32_t i = 0; i < applications.size(); ++i) { - application_manager::AppExtensionPtr app_extension = - applications[i]->QueryInterface(rc_module.GetModuleID()); - if (app_extension) { - RCAppExtensionPtr rc_app_extension = - application_manager::AppExtensionPtr::static_pointer_cast< - RCAppExtension>(app_extension); - if (!rc_app_extension->is_on_driver_device()) { - } - } - } -} - -} // namespace remote_control -- cgit v1.2.1 From d8b30633f94311d2bd2ef09a7167c126393ab055 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 20 Aug 2017 19:55:04 +0300 Subject: Add some DCHECK according to review --- .../include/application_manager/application_manager_impl.h | 1 + src/components/functional_module/src/plugin_manager.cc | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index f0afbc78b2..d8f02a1f2f 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -315,6 +315,7 @@ class ApplicationManagerImpl bool IsVideoStreamingAllowed(uint32_t connection_key) const OVERRIDE; void Erase(ApplicationSharedPtr app_to_remove) { + DCHECK(app_to_remove); app_to_remove->RemoveExtensions(); applications_.erase(app_to_remove); } diff --git a/src/components/functional_module/src/plugin_manager.cc b/src/components/functional_module/src/plugin_manager.cc index 53c31471fc..24c5b46862 100644 --- a/src/components/functional_module/src/plugin_manager.cc +++ b/src/components/functional_module/src/plugin_manager.cc @@ -322,6 +322,7 @@ bool PluginManager::IsAppForPlugins( bool PluginManager::IsAppForPlugin( application_manager::ApplicationSharedPtr app, ModuleID module_id) const { + DCHECK_OR_RETURN(app, false); Modules::const_iterator i = plugins_.find(module_id); return i != plugins_.end() ? i->second->IsAppForPlugin(app) : false; } @@ -329,10 +330,7 @@ bool PluginManager::IsAppForPlugin( void PluginManager::OnAppHMILevelChanged( application_manager::ApplicationSharedPtr app, mobile_apis::HMILevel::eType old_level) { - DCHECK(app); - if (!app) { - return; - } + DCHECK_OR_RETURN_VOID(app); for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) { if (it->second->IsAppForPlugin(app)) { LOG4CXX_DEBUG(logger_, @@ -348,10 +346,7 @@ void PluginManager::OnAppHMILevelChanged( bool PluginManager::CanAppChangeHMILevel( application_manager::ApplicationSharedPtr app, mobile_apis::HMILevel::eType new_level) { - DCHECK(app); - if (!app) { - return false; - } + DCHECK_OR_RETURN(app, false); bool result = true; for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) { if (it->second->IsAppForPlugin(app)) { -- cgit v1.2.1 From 31d41e6935dfceb9c374d67ab44cf5b7b26930a1 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Sun, 20 Aug 2017 20:30:52 +0300 Subject: Remove redundant dependency of media_manager tests from plugin_manager --- src/components/media_manager/test/CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/media_manager/test/CMakeLists.txt b/src/components/media_manager/test/CMakeLists.txt index d2cbced369..f5d596f681 100644 --- a/src/components/media_manager/test/CMakeLists.txt +++ b/src/components/media_manager/test/CMakeLists.txt @@ -62,13 +62,6 @@ set(LIBRARIES ${SecurityManagerLibrary} ) -if(REMOTE_CONTROL) - SET (LIBRARIES - ${LIBRARIES} - FunctionalModule - ) -endif(REMOTE_CONTROL) - if(EXTENDED_MEDIA_MODE) list(APPEND LIBRARIES ${GSTREAMER_gstreamer_LIBRARY}) -- cgit v1.2.1 From 95cd13ab779dea195ee06e1f423f73003514c7b9 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Fri, 18 Aug 2017 10:04:26 +0300 Subject: Removes 'country_consent_passengerRC' support --- src/appMain/sdl_preloaded_pt.json | 1 - .../include/policy/policy_table/types.h | 1 - .../policy_external/src/access_remote_impl.cc | 11 ++------- .../policy_external/src/policy_manager_impl.cc | 27 ++++----------------- .../policy_external/src/policy_table/types.cc | 17 ------------- .../policy/policy_external/src/sql_pt_queries.cc | 8 +++---- .../policy_external/src/sql_pt_representation.cc | 5 ---- .../test/sql_pt_ext_representation_test.cc | 1 - .../test/sql_pt_representation_test.cc | 2 -- .../include/policy/access_remote_impl.h | 1 - .../include/policy/policy_table/types.h | 1 - .../policy_regular/src/access_remote_impl.cc | 11 ++------- .../policy_regular/src/policy_manager_impl.cc | 28 ++++------------------ .../policy_regular/src/policy_table/types.cc | 17 ------------- .../policy/policy_regular/src/sql_pt_queries.cc | 7 +++--- .../policy_regular/src/sql_pt_representation.cc | 5 ---- .../policy_regular/test/access_remote_impl_test.cc | 6 ----- src/components/remote_control/remote_sdl_pt.json | 1 - 18 files changed, 18 insertions(+), 132 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index e2dda24f4a..3fcd52490e 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -1,7 +1,6 @@ { "policy_table": { "module_config": { - "country_consent_passengersRC": true, "equipment": {}, "preloaded_pt": true, "exchange_after_x_ignition_cycles": 100, diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index a5121ec021..0dddcd5402 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -310,7 +310,6 @@ struct ModuleConfig : CompositeType { Optional preloaded_pt; #ifdef SDL_REMOTE_CONTROL Optional user_consent_passengersRC; - Optional country_consent_passengersRC; #endif // SDL_REMOTE_CONTROL public: diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index 929d9eb1d8..789e12feda 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -121,8 +121,7 @@ void AccessRemoteImpl::Init() { DCHECK(cache_->pt_); policy_table::ModuleConfig& config = cache_->pt_->policy_table.module_config; - enabled_ = country_consent() && - (!config.user_consent_passengersRC.is_initialized() || + enabled_ = (!config.user_consent_passengersRC.is_initialized() || *config.user_consent_passengersRC); } @@ -257,17 +256,11 @@ void AccessRemoteImpl::Disable() { } void AccessRemoteImpl::set_enabled(bool value) { - enabled_ = country_consent() && value; + enabled_ = value; *cache_->pt_->policy_table.module_config.user_consent_passengersRC = value; cache_->Backup(); } -bool AccessRemoteImpl::country_consent() const { - policy_table::ModuleConfig& config = cache_->pt_->policy_table.module_config; - return !config.country_consent_passengersRC.is_initialized() || - *config.country_consent_passengersRC; -} - bool AccessRemoteImpl::IsEnabled() const { LOG4CXX_AUTO_TRACE(logger_); return enabled_; diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index d968912725..82ef7b8e6c 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -2189,30 +2189,11 @@ bool PolicyManagerImpl::CheckPTURemoteCtrlChange( const utils::SharedPtr snapshot) { LOG4CXX_AUTO_TRACE(logger_); - rpc::Optional& new_consent = - pt_update->policy_table.module_config.country_consent_passengersRC; - rpc::Optional& old_consent = - snapshot->policy_table.module_config.country_consent_passengersRC; + // TODO: Rework - if (!new_consent.is_initialized() && !old_consent.is_initialized()) { - return false; - } - - bool result = false; - if (new_consent.is_initialized() && old_consent.is_initialized()) { - result = (*new_consent != *old_consent); - } else { - bool not_changed_consent1 = !new_consent.is_initialized() && *old_consent; - bool not_changed_consent2 = !old_consent.is_initialized() && *new_consent; - - result = !(not_changed_consent1 || not_changed_consent2); - } - - if (result) { - listener()->OnRemoteAllowedChanged(result); - } - - return result; + const bool is_allowed = true; + listener()->OnRemoteAllowedChanged(is_allowed); + return is_allowed; } void PolicyManagerImpl::CheckRemoteGroupsChange( diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index 5c962cc4da..5d41e626fd 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -605,8 +605,6 @@ ModuleConfig::ModuleConfig(const Json::Value* value__) #ifdef SDL_REMOTE_CONTROL , user_consent_passengersRC( impl::ValueMember(value__, "user_consent_passengersRC")) - , country_consent_passengersRC( - impl::ValueMember(value__, "country_consent_passengersRC")) #endif // SDL_REMOTE_CONTROL { } @@ -628,8 +626,6 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { vehicle_year.assign_if_valid(from.vehicle_year); #ifdef SDL_REMOTE_CONTROL user_consent_passengersRC.assign_if_valid(from.user_consent_passengersRC); - country_consent_passengersRC.assign_if_valid( - from.country_consent_passengersRC); #endif // SDL_REMOTE_CONTROL } @@ -660,8 +656,6 @@ Json::Value ModuleConfig::ToJsonValue() const { #ifdef SDL_REMOTE_CONTROL impl::WriteJsonField( "user_consent_passengersRC", user_consent_passengersRC, &result__); - impl::WriteJsonField( - "country_consent_passengersRC", country_consent_passengersRC, &result__); #endif // SDL_REMOTE_CONTROL return result__; } @@ -713,9 +707,6 @@ bool ModuleConfig::is_valid() const { if (!user_consent_passengersRC.is_valid()) { return false; } - if (!country_consent_passengersRC.is_valid()) { - return false; - } #endif // SDL_REMOTE_CONTROL return Validate(); } @@ -770,9 +761,6 @@ bool ModuleConfig::struct_empty() const { if (user_consent_passengersRC.is_initialized()) { return false; } - if (country_consent_passengersRC.is_initialized()) { - return false; - } #endif // SDL_REMOTE_CONTROL return true; } @@ -828,10 +816,6 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { user_consent_passengersRC.ReportErrors( &report__->ReportSubobject("user_consent_passengersRC")); } - if (!country_consent_passengersRC.is_valid()) { - country_consent_passengersRC.ReportErrors( - &report__->ReportSubobject("country_consent_passengersRC")); - } #endif // SDL_REMOTE_CONTROL const std::string validation_info = omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType()); @@ -893,7 +877,6 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) { vehicle_year.SetPolicyTableType(pt_type); #ifdef SDL_REMOTE_CONTROL user_consent_passengersRC.SetPolicyTableType(pt_type); - country_consent_passengersRC.SetPolicyTableType(pt_type); #endif // SDL_REMOTE_CONTROL } diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc index 6b3acd44ec..e71eb2e220 100644 --- a/src/components/policy/policy_external/src/sql_pt_queries.cc +++ b/src/components/policy/policy_external/src/sql_pt_queries.cc @@ -77,8 +77,7 @@ const std::string kCreateSchema = " `vehicle_year` VARCHAR(4), " " `preloaded_date` VARCHAR (10), " " `certificate` VARCHAR (45), " - " `user_consent_passengersRC` BOOL, " - " `country_consent_passengersRC` BOOL " + " `user_consent_passengersRC` BOOL " "); " "CREATE TABLE IF NOT EXISTS `functional_group`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -742,8 +741,7 @@ const std::string kUpdateModuleConfig = " `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, " " `timeout_after_x_seconds` = ?, `vehicle_make` = ?, " " `vehicle_model` = ?, `vehicle_year` = ?, `preloaded_date` = ?, " - "`certificate` = ?, `user_consent_passengersRC` = ?, " - "`country_consent_passengersRC` = ?"; + "`certificate` = ?, `user_consent_passengersRC` = ? "; const std::string kInsertEndpoint = "INSERT INTO `endpoint` (`service`, `url`, `application_id`) " @@ -795,7 +793,7 @@ const std::string kSelectModuleConfig = " `exchange_after_x_kilometers`, `exchange_after_x_days`, " " `timeout_after_x_seconds`, `vehicle_make`," " `vehicle_model`, `vehicle_year`, `preloaded_date`, `certificate`, " - " `user_consent_passengersRC` , `country_consent_passengersRC` " + " `user_consent_passengersRC` " " FROM `module_config`"; const std::string kSelectEndpoints = diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 1960fb6e03..5a67028d5f 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -555,8 +555,6 @@ void SQLPTRepresentation::GatherModuleConfig( #ifdef SDL_REMOTE_CONTROL *config->user_consent_passengersRC = query.IsNull(8) ? true : query.GetBoolean(10); - *config->country_consent_passengersRC = - query.IsNull(9) ? true : query.GetBoolean(11); #endif // SDL_REMOTE_CONTROL } @@ -1256,9 +1254,6 @@ bool SQLPTRepresentation::SaveModuleConfig( config.user_consent_passengersRC.is_initialized() ? query.Bind(10, *(config.user_consent_passengersRC)) : query.Bind(10); - config.country_consent_passengersRC.is_initialized() - ? query.Bind(11, *(config.country_consent_passengersRC)) - : query.Bind(11); #endif // SDL_REMOTE_CONTROL if (!query.Exec()) { diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc index 1ece673711..3b214fef89 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc @@ -323,7 +323,6 @@ TEST_F(SQLPTExtRepresentationTest, module_config["vehicle_model"] = Json::Value("ModelT"); module_config["vehicle_year"] = Json::Value("2014"); module_config["certificate"] = Json::Value("my_cert"); - module_config["country_consent_passengersRC"] = Json::Value(false); module_config["user_consent_passengersRC"] = Json::Value(false); Json::Value& functional_groupings = policy_table["functional_groupings"]; diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index d835a5c389..11810632d1 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -1607,8 +1607,6 @@ TEST_F(SQLPTRepresentationTest, table["policy_table"]["device_data"] = Json::Value(Json::objectValue); table["policy_table"]["module_meta"] = Json::Value(Json::objectValue); table["policy_table"]["module_config"]["preloaded_pt"] = Json::Value(false); - table["policy_table"]["module_config"]["country_consent_passengersRC"] = - Json::Value(false); table["policy_table"]["module_config"]["user_consent_passengersRC"] = Json::Value(false); policy_table::Table expected(&table); diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h index 03427d2501..2faf635f24 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h @@ -81,7 +81,6 @@ class AccessRemoteImpl : public AccessRemote { private: inline void set_enabled(bool value); - inline bool country_consent() const; const policy_table::AppHMITypes& HmiTypes(const Subject& who); void GetGroupsIds(const std::string& device_id, const std::string& app_id, diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index d9d2ad34eb..c7df2fde40 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -249,7 +249,6 @@ struct ModuleConfig : CompositeType { Optional > certificate; #ifdef SDL_REMOTE_CONTROL Optional user_consent_passengersRC; - Optional country_consent_passengersRC; #endif // SDL_REMOTE_CONTROL public: diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index 9ae76fc19a..2ddbc603dd 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -121,8 +121,7 @@ void AccessRemoteImpl::Init() { DCHECK(cache_->pt()); policy_table::ModuleConfig& config = cache_->pt()->policy_table.module_config; - enabled_ = country_consent() && - (!config.user_consent_passengersRC.is_initialized() || + enabled_ = (!config.user_consent_passengersRC.is_initialized() || *config.user_consent_passengersRC); } @@ -257,17 +256,11 @@ void AccessRemoteImpl::Disable() { } void AccessRemoteImpl::set_enabled(bool value) { - enabled_ = country_consent() && value; + enabled_ = value; *cache_->pt()->policy_table.module_config.user_consent_passengersRC = value; cache_->Backup(); } -bool AccessRemoteImpl::country_consent() const { - policy_table::ModuleConfig& config = cache_->pt()->policy_table.module_config; - return !config.country_consent_passengersRC.is_initialized() || - *config.country_consent_passengersRC; -} - bool AccessRemoteImpl::IsEnabled() const { LOG4CXX_AUTO_TRACE(logger_); return enabled_; diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 562539eb0c..e2cdbbf1c4 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -1420,31 +1420,11 @@ bool PolicyManagerImpl::CheckPTURemoteCtrlChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot) { LOG4CXX_AUTO_TRACE(logger_); + const bool is_allowed = true; - rpc::Optional& new_consent = - pt_update->policy_table.module_config.country_consent_passengersRC; - rpc::Optional& old_consent = - snapshot->policy_table.module_config.country_consent_passengersRC; - - if (!new_consent.is_initialized() && !old_consent.is_initialized()) { - return false; - } - - bool result = false; - if (new_consent.is_initialized() && old_consent.is_initialized()) { - result = (*new_consent != *old_consent); - } else { - bool not_changed_consent1 = !new_consent.is_initialized() && *old_consent; - bool not_changed_consent2 = !old_consent.is_initialized() && *new_consent; - - result = !(not_changed_consent1 || not_changed_consent2); - } - - if (result) { - listener()->OnRemoteAllowedChanged(result); - } - - return result; + // TODO: Rework + listener()->OnRemoteAllowedChanged(is_allowed); + return is_allowed; } void PolicyManagerImpl::CheckRemoteGroupsChange( diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index 2c445d4bff..599c21e498 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -486,8 +486,6 @@ ModuleConfig::ModuleConfig(const Json::Value* value__) #ifdef SDL_REMOTE_CONTROL , user_consent_passengersRC( impl::ValueMember(value__, "user_consent_passengersRC")) - , country_consent_passengersRC( - impl::ValueMember(value__, "country_consent_passengersRC")) #endif // SDL_REMOTE_CONTROL { } @@ -510,8 +508,6 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { certificate.assign_if_valid(from.certificate); #ifdef SDL_REMOTE_CONTROL user_consent_passengersRC.assign_if_valid(from.user_consent_passengersRC); - country_consent_passengersRC.assign_if_valid( - from.country_consent_passengersRC); #endif // SDL_REMOTE_CONTROL } @@ -541,8 +537,6 @@ Json::Value ModuleConfig::ToJsonValue() const { #ifdef SDL_REMOTE_CONTROL impl::WriteJsonField( "user_consent_passengersRC", user_consent_passengersRC, &result__); - impl::WriteJsonField( - "country_consent_passengersRC", country_consent_passengersRC, &result__); #endif // SDL_REMOTE_CONTROL return result__; } @@ -590,9 +584,6 @@ bool ModuleConfig::is_valid() const { if (!user_consent_passengersRC.is_valid()) { return false; } - if (!country_consent_passengersRC.is_valid()) { - return false; - } #endif // SDL_REMOTE_CONTROL return Validate(); } @@ -642,9 +633,6 @@ bool ModuleConfig::struct_empty() const { if (user_consent_passengersRC.is_initialized()) { return false; } - if (country_consent_passengersRC.is_initialized()) { - return false; - } #endif // SDL_REMOTE_CONTROL return true; } @@ -700,10 +688,6 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { user_consent_passengersRC.ReportErrors( &report__->ReportSubobject("user_consent_passengersRC")); } - if (!country_consent_passengersRC.is_valid()) { - country_consent_passengersRC.ReportErrors( - &report__->ReportSubobject("country_consent_passengersRC")); - } #endif // SDL_REMOTE_CONTROL if (PT_PRELOADED == GetPolicyTableType()) { std::string validation_info = @@ -746,7 +730,6 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) { vehicle_year.SetPolicyTableType(pt_type); #ifdef SDL_REMOTE_CONTROL user_consent_passengersRC.SetPolicyTableType(pt_type); - country_consent_passengersRC.SetPolicyTableType(pt_type); #endif // SDL_REMOTE_CONTROL } diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc index d573e79816..1598601665 100644 --- a/src/components/policy/policy_regular/src/sql_pt_queries.cc +++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc @@ -72,8 +72,7 @@ const std::string kCreateSchema = " `vehicle_make` VARCHAR(45), " " `vehicle_model` VARCHAR(45), " " `vehicle_year` VARCHAR(4), " - " `user_consent_passengersRC` BOOL, " - " `country_consent_passengersRC` BOOL " + " `user_consent_passengersRC` BOOL " "); " "CREATE TABLE IF NOT EXISTS `functional_group`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -691,7 +690,7 @@ const std::string kUpdateModuleConfig = " `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, " " `timeout_after_x_seconds` = ?, `certificate` = ?, `vehicle_make` = ?, " " `vehicle_model` = ?, `vehicle_year` = ?, " - " `user_consent_passengersRC` = ?, `country_consent_passengersRC` = ?"; + " `user_consent_passengersRC` = ? "; const std::string kInsertEndpoint = "INSERT INTO `endpoint` (`service`, `url`, `application_id`) " @@ -732,7 +731,7 @@ const std::string kSelectModuleConfig = " `exchange_after_x_kilometers`, `exchange_after_x_days`, " " `timeout_after_x_seconds`, `certificate`, `vehicle_make`," " `vehicle_model`, `vehicle_year`, " - " `user_consent_passengersRC` , `country_consent_passengersRC` " + " `user_consent_passengersRC` " " FROM `module_config`"; const std::string kSelectEndpoints = diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 854b6e4804..0af743a90e 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -529,8 +529,6 @@ void SQLPTRepresentation::GatherModuleConfig( #ifdef SDL_REMOTE_CONTROL *config->user_consent_passengersRC = query.IsNull(8) ? true : query.GetBoolean(8); - *config->country_consent_passengersRC = - query.IsNull(9) ? true : query.GetBoolean(9); #endif // SDL_REMOTE_CONTROL } @@ -1166,9 +1164,6 @@ bool SQLPTRepresentation::SaveModuleConfig( config.user_consent_passengersRC.is_initialized() ? query.Bind(9, *(config.user_consent_passengersRC)) : query.Bind(9); - config.country_consent_passengersRC.is_initialized() - ? query.Bind(10, *(config.country_consent_passengersRC)) - : query.Bind(10); #endif // SDL_REMOTE_CONTROL if (!query.Exec()) { LOG4CXX_WARN(logger_, "Incorrect update module config"); diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index 4b2a9b02eb..e558d371eb 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -183,28 +183,22 @@ TEST(AccessRemoteImplTest, EnableDisable) { // Country is enabled access_remote.enabled_ = true; - *config.country_consent_passengersRC = true; access_remote.Enable(); EXPECT_TRUE(*config.user_consent_passengersRC); - EXPECT_TRUE(*config.country_consent_passengersRC); EXPECT_TRUE(access_remote.IsEnabled()); access_remote.Disable(); EXPECT_FALSE(*config.user_consent_passengersRC); - EXPECT_TRUE(*config.country_consent_passengersRC); EXPECT_FALSE(access_remote.IsEnabled()); // Country is disabled access_remote.enabled_ = false; - *config.country_consent_passengersRC = false; access_remote.Enable(); EXPECT_TRUE(*config.user_consent_passengersRC); - EXPECT_FALSE(*config.country_consent_passengersRC); EXPECT_FALSE(access_remote.IsEnabled()); access_remote.Disable(); EXPECT_FALSE(*config.user_consent_passengersRC); - EXPECT_FALSE(*config.country_consent_passengersRC); EXPECT_FALSE(access_remote.IsEnabled()); } diff --git a/src/components/remote_control/remote_sdl_pt.json b/src/components/remote_control/remote_sdl_pt.json index 54543335c8..bf9afb1f7b 100644 --- a/src/components/remote_control/remote_sdl_pt.json +++ b/src/components/remote_control/remote_sdl_pt.json @@ -4,7 +4,6 @@ "equipment": { }, "preloaded_pt": true, - "country_consent_passengersRC": true, "exchange_after_x_ignition_cycles": 100, "exchange_after_x_kilometers": 1800, "exchange_after_x_days": 30, -- cgit v1.2.1 From 522a5a261bb0cc98d6460f121db4d7a0ff5f7def Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Fri, 18 Aug 2017 11:55:24 +0300 Subject: Removes 'user_consent_passengerRC' support --- .../include/policy/policy_table/types.h | 3 -- .../policy_external/src/access_remote_impl.cc | 7 ++-- .../policy_external/src/policy_table/types.cc | 41 +--------------------- .../policy/policy_external/src/sql_pt_queries.cc | 8 ++--- .../policy_external/src/sql_pt_representation.cc | 9 ----- .../test/sql_pt_ext_representation_test.cc | 1 - .../test/sql_pt_representation_test.cc | 2 -- .../include/policy/policy_table/types.h | 3 -- .../policy_regular/src/access_remote_impl.cc | 7 ++-- .../policy_regular/src/policy_table/types.cc | 41 +--------------------- .../policy/policy_regular/src/sql_pt_queries.cc | 9 ++--- .../policy_regular/src/sql_pt_representation.cc | 9 ----- .../policy_regular/test/access_remote_impl_test.cc | 6 ---- 13 files changed, 14 insertions(+), 132 deletions(-) diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index 0dddcd5402..d2d124cd65 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -308,9 +308,6 @@ struct ModuleConfig : CompositeType { Optional > preloaded_date; Optional > certificate; Optional preloaded_pt; -#ifdef SDL_REMOTE_CONTROL - Optional user_consent_passengersRC; -#endif // SDL_REMOTE_CONTROL public: ModuleConfig(); diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index 789e12feda..b8b1e3378b 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -120,9 +120,9 @@ void AccessRemoteImpl::Init() { LOG4CXX_AUTO_TRACE(logger_); DCHECK(cache_->pt_); - policy_table::ModuleConfig& config = cache_->pt_->policy_table.module_config; - enabled_ = (!config.user_consent_passengersRC.is_initialized() || - *config.user_consent_passengersRC); + // TODO: Rework + + enabled_ = true; } bool AccessRemoteImpl::IsPrimaryDevice(const PTString& dev_id) const { @@ -257,7 +257,6 @@ void AccessRemoteImpl::Disable() { void AccessRemoteImpl::set_enabled(bool value) { enabled_ = value; - *cache_->pt_->policy_table.module_config.user_consent_passengersRC = value; cache_->Backup(); } diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index 5d41e626fd..d5915558a1 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -601,13 +601,7 @@ ModuleConfig::ModuleConfig(const Json::Value* value__) , vehicle_year(impl::ValueMember(value__, "vehicle_year")) , preloaded_date(impl::ValueMember(value__, "preloaded_date")) , certificate(impl::ValueMember(value__, "certificate")) - , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) -#ifdef SDL_REMOTE_CONTROL - , user_consent_passengersRC( - impl::ValueMember(value__, "user_consent_passengersRC")) -#endif // SDL_REMOTE_CONTROL -{ -} + , preloaded_pt(impl::ValueMember(value__, "preloaded_pt")) {} void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { exchange_after_x_days = from.exchange_after_x_days; @@ -624,9 +618,6 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { vehicle_make.assign_if_valid(from.vehicle_make); vehicle_model.assign_if_valid(from.vehicle_model); vehicle_year.assign_if_valid(from.vehicle_year); -#ifdef SDL_REMOTE_CONTROL - user_consent_passengersRC.assign_if_valid(from.user_consent_passengersRC); -#endif // SDL_REMOTE_CONTROL } Json::Value ModuleConfig::ToJsonValue() const { @@ -653,10 +644,6 @@ Json::Value ModuleConfig::ToJsonValue() const { impl::WriteJsonField("vehicle_year", vehicle_year, &result__); impl::WriteJsonField("certificate", certificate, &result__); impl::WriteJsonField("preloaded_date", preloaded_date, &result__); -#ifdef SDL_REMOTE_CONTROL - impl::WriteJsonField( - "user_consent_passengersRC", user_consent_passengersRC, &result__); -#endif // SDL_REMOTE_CONTROL return result__; } @@ -703,11 +690,6 @@ bool ModuleConfig::is_valid() const { if (!preloaded_date.is_valid()) { return false; } -#ifdef SDL_REMOTE_CONTROL - if (!user_consent_passengersRC.is_valid()) { - return false; - } -#endif // SDL_REMOTE_CONTROL return Validate(); } @@ -757,11 +739,6 @@ bool ModuleConfig::struct_empty() const { if (vehicle_year.is_initialized()) { return false; } -#ifdef SDL_REMOTE_CONTROL - if (user_consent_passengersRC.is_initialized()) { - return false; - } -#endif // SDL_REMOTE_CONTROL return true; } @@ -811,12 +788,6 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { if (!vehicle_year.is_valid()) { vehicle_year.ReportErrors(&report__->ReportSubobject("vehicle_year")); } -#ifdef SDL_REMOTE_CONTROL - if (!user_consent_passengersRC.is_valid()) { - user_consent_passengersRC.ReportErrors( - &report__->ReportSubobject("user_consent_passengersRC")); - } -#endif // SDL_REMOTE_CONTROL const std::string validation_info = omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType()); @@ -835,13 +806,6 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { omitted_field_report = &report__->ReportSubobject("vehicle_model"); omitted_field_report->set_validation_info(validation_info); } -#ifdef SDL_REMOTE_CONTROL - if (user_consent_passengersRC.is_initialized()) { - omitted_field_report = - &report__->ReportSubobject("user_consent_passengersRC"); - omitted_field_report->set_validation_info(validation_info); - } -#endif // SDL_REMOTE_CONTROL break; } case PT_UPDATE: { @@ -875,9 +839,6 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) { vehicle_make.SetPolicyTableType(pt_type); vehicle_model.SetPolicyTableType(pt_type); vehicle_year.SetPolicyTableType(pt_type); -#ifdef SDL_REMOTE_CONTROL - user_consent_passengersRC.SetPolicyTableType(pt_type); -#endif // SDL_REMOTE_CONTROL } // MessageString methods diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc index e71eb2e220..9f38b9aeaf 100644 --- a/src/components/policy/policy_external/src/sql_pt_queries.cc +++ b/src/components/policy/policy_external/src/sql_pt_queries.cc @@ -76,8 +76,7 @@ const std::string kCreateSchema = " `vehicle_model` VARCHAR(45), " " `vehicle_year` VARCHAR(4), " " `preloaded_date` VARCHAR (10), " - " `certificate` VARCHAR (45), " - " `user_consent_passengersRC` BOOL " + " `certificate` VARCHAR (45) " "); " "CREATE TABLE IF NOT EXISTS `functional_group`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -741,7 +740,7 @@ const std::string kUpdateModuleConfig = " `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, " " `timeout_after_x_seconds` = ?, `vehicle_make` = ?, " " `vehicle_model` = ?, `vehicle_year` = ?, `preloaded_date` = ?, " - "`certificate` = ?, `user_consent_passengersRC` = ? "; + " `certificate` = ? "; const std::string kInsertEndpoint = "INSERT INTO `endpoint` (`service`, `url`, `application_id`) " @@ -792,8 +791,7 @@ const std::string kSelectModuleConfig = "SELECT `preloaded_pt`, `exchange_after_x_ignition_cycles`, " " `exchange_after_x_kilometers`, `exchange_after_x_days`, " " `timeout_after_x_seconds`, `vehicle_make`," - " `vehicle_model`, `vehicle_year`, `preloaded_date`, `certificate`, " - " `user_consent_passengersRC` " + " `vehicle_model`, `vehicle_year`, `preloaded_date`, `certificate` " " FROM `module_config`"; const std::string kSelectEndpoints = diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 5a67028d5f..a65103dbc4 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -552,10 +552,6 @@ void SQLPTRepresentation::GatherModuleConfig( *config->vehicle_year = query.GetString(7); *config->preloaded_date = query.GetString(8); *config->certificate = query.GetString(9); -#ifdef SDL_REMOTE_CONTROL - *config->user_consent_passengersRC = - query.IsNull(8) ? true : query.GetBoolean(10); -#endif // SDL_REMOTE_CONTROL } utils::dbms::SQLQuery endpoints(db()); @@ -1250,11 +1246,6 @@ bool SQLPTRepresentation::SaveModuleConfig( : query.Bind(8); config.certificate.is_initialized() ? query.Bind(9, *(config.certificate)) : query.Bind(9); -#ifdef SDL_REMOTE_CONTROL - config.user_consent_passengersRC.is_initialized() - ? query.Bind(10, *(config.user_consent_passengersRC)) - : query.Bind(10); -#endif // SDL_REMOTE_CONTROL if (!query.Exec()) { LOG4CXX_WARN(logger_, "Incorrect update module config"); diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc index 3b214fef89..92525c646d 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc @@ -323,7 +323,6 @@ TEST_F(SQLPTExtRepresentationTest, module_config["vehicle_model"] = Json::Value("ModelT"); module_config["vehicle_year"] = Json::Value("2014"); module_config["certificate"] = Json::Value("my_cert"); - module_config["user_consent_passengersRC"] = Json::Value(false); Json::Value& functional_groupings = policy_table["functional_groupings"]; functional_groupings["default"] = Json::Value(Json::objectValue); diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index 11810632d1..d4df658bd2 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -1607,8 +1607,6 @@ TEST_F(SQLPTRepresentationTest, table["policy_table"]["device_data"] = Json::Value(Json::objectValue); table["policy_table"]["module_meta"] = Json::Value(Json::objectValue); table["policy_table"]["module_config"]["preloaded_pt"] = Json::Value(false); - table["policy_table"]["module_config"]["user_consent_passengersRC"] = - Json::Value(false); policy_table::Table expected(&table); Json::StyledWriter writer; // Checks diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index c7df2fde40..417630dd20 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -247,9 +247,6 @@ struct ModuleConfig : CompositeType { Optional > vehicle_year; Optional > preloaded_date; Optional > certificate; -#ifdef SDL_REMOTE_CONTROL - Optional user_consent_passengersRC; -#endif // SDL_REMOTE_CONTROL public: ModuleConfig(); diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index 2ddbc603dd..3924044f7a 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -120,9 +120,9 @@ void AccessRemoteImpl::Init() { LOG4CXX_AUTO_TRACE(logger_); DCHECK(cache_->pt()); - policy_table::ModuleConfig& config = cache_->pt()->policy_table.module_config; - enabled_ = (!config.user_consent_passengersRC.is_initialized() || - *config.user_consent_passengersRC); + // TODO: Rework + + enabled_ = true; } bool AccessRemoteImpl::IsPrimaryDevice(const PTString& dev_id) const { @@ -257,7 +257,6 @@ void AccessRemoteImpl::Disable() { void AccessRemoteImpl::set_enabled(bool value) { enabled_ = value; - *cache_->pt()->policy_table.module_config.user_consent_passengersRC = value; cache_->Backup(); } diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index 599c21e498..cbfb8bd199 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -482,13 +482,7 @@ ModuleConfig::ModuleConfig(const Json::Value* value__) , vehicle_model(impl::ValueMember(value__, "vehicle_model")) , vehicle_year(impl::ValueMember(value__, "vehicle_year")) , preloaded_date(impl::ValueMember(value__, "preloaded_date")) - , certificate(impl::ValueMember(value__, "certificate")) -#ifdef SDL_REMOTE_CONTROL - , user_consent_passengersRC( - impl::ValueMember(value__, "user_consent_passengersRC")) -#endif // SDL_REMOTE_CONTROL -{ -} + , certificate(impl::ValueMember(value__, "certificate")) {} void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { // device_certificates = from.device_certificates; // According to the @@ -506,9 +500,6 @@ void ModuleConfig::SafeCopyFrom(const ModuleConfig& from) { vehicle_model.assign_if_valid(from.vehicle_model); vehicle_year.assign_if_valid(from.vehicle_year); certificate.assign_if_valid(from.certificate); -#ifdef SDL_REMOTE_CONTROL - user_consent_passengersRC.assign_if_valid(from.user_consent_passengersRC); -#endif // SDL_REMOTE_CONTROL } Json::Value ModuleConfig::ToJsonValue() const { @@ -534,10 +525,6 @@ Json::Value ModuleConfig::ToJsonValue() const { impl::WriteJsonField("vehicle_year", vehicle_year, &result__); impl::WriteJsonField("certificate", certificate, &result__); impl::WriteJsonField("preloaded_date", preloaded_date, &result__); -#ifdef SDL_REMOTE_CONTROL - impl::WriteJsonField( - "user_consent_passengersRC", user_consent_passengersRC, &result__); -#endif // SDL_REMOTE_CONTROL return result__; } bool ModuleConfig::is_valid() const { @@ -580,11 +567,6 @@ bool ModuleConfig::is_valid() const { if (!preloaded_date.is_valid()) { return false; } -#ifdef SDL_REMOTE_CONTROL - if (!user_consent_passengersRC.is_valid()) { - return false; - } -#endif // SDL_REMOTE_CONTROL return Validate(); } bool ModuleConfig::is_initialized() const { @@ -629,11 +611,6 @@ bool ModuleConfig::struct_empty() const { if (vehicle_year.is_initialized()) { return false; } -#ifdef SDL_REMOTE_CONTROL - if (user_consent_passengersRC.is_initialized()) { - return false; - } -#endif // SDL_REMOTE_CONTROL return true; } void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { @@ -683,12 +660,6 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { if (!vehicle_year.is_valid()) { vehicle_year.ReportErrors(&report__->ReportSubobject("vehicle_year")); } -#ifdef SDL_REMOTE_CONTROL - if (!user_consent_passengersRC.is_valid()) { - user_consent_passengersRC.ReportErrors( - &report__->ReportSubobject("user_consent_passengersRC")); - } -#endif // SDL_REMOTE_CONTROL if (PT_PRELOADED == GetPolicyTableType()) { std::string validation_info = omitted_validation_info + PolicyTableTypeToString(GetPolicyTableType()); @@ -705,13 +676,6 @@ void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const { omitted_field_report = &report__->ReportSubobject("vehicle_model"); omitted_field_report->set_validation_info(validation_info); } -#ifdef SDL_REMOTE_CONTROL - if (user_consent_passengersRC.is_initialized()) { - omitted_field_report = - &report__->ReportSubobject("user_consent_passengersRC"); - omitted_field_report->set_validation_info(validation_info); - } -#endif // SDL_REMOTE_CONTROL } } @@ -728,9 +692,6 @@ void ModuleConfig::SetPolicyTableType(PolicyTableType pt_type) { vehicle_make.SetPolicyTableType(pt_type); vehicle_model.SetPolicyTableType(pt_type); vehicle_year.SetPolicyTableType(pt_type); -#ifdef SDL_REMOTE_CONTROL - user_consent_passengersRC.SetPolicyTableType(pt_type); -#endif // SDL_REMOTE_CONTROL } // MessageString methods diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc index 1598601665..1d64d50a9a 100644 --- a/src/components/policy/policy_regular/src/sql_pt_queries.cc +++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc @@ -71,8 +71,7 @@ const std::string kCreateSchema = " `certificate` TEXT, " " `vehicle_make` VARCHAR(45), " " `vehicle_model` VARCHAR(45), " - " `vehicle_year` VARCHAR(4), " - " `user_consent_passengersRC` BOOL " + " `vehicle_year` VARCHAR(4) " "); " "CREATE TABLE IF NOT EXISTS `functional_group`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -689,8 +688,7 @@ const std::string kUpdateModuleConfig = " `exchange_after_x_ignition_cycles` = ?," " `exchange_after_x_kilometers` = ?, `exchange_after_x_days` = ?, " " `timeout_after_x_seconds` = ?, `certificate` = ?, `vehicle_make` = ?, " - " `vehicle_model` = ?, `vehicle_year` = ?, " - " `user_consent_passengersRC` = ? "; + " `vehicle_model` = ?, `vehicle_year` = ? "; const std::string kInsertEndpoint = "INSERT INTO `endpoint` (`service`, `url`, `application_id`) " @@ -730,8 +728,7 @@ const std::string kSelectModuleConfig = "SELECT `preloaded_pt`, `exchange_after_x_ignition_cycles`, " " `exchange_after_x_kilometers`, `exchange_after_x_days`, " " `timeout_after_x_seconds`, `certificate`, `vehicle_make`," - " `vehicle_model`, `vehicle_year`, " - " `user_consent_passengersRC` " + " `vehicle_model`, `vehicle_year` " " FROM `module_config`"; const std::string kSelectEndpoints = diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 0af743a90e..04cc110275 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -526,10 +526,6 @@ void SQLPTRepresentation::GatherModuleConfig( *config->vehicle_model = query.GetString(7); *config->vehicle_year = query.GetString(8); *config->preloaded_date = query.GetString(9); -#ifdef SDL_REMOTE_CONTROL - *config->user_consent_passengersRC = - query.IsNull(8) ? true : query.GetBoolean(8); -#endif // SDL_REMOTE_CONTROL } utils::dbms::SQLQuery endpoints(db()); @@ -1160,11 +1156,6 @@ bool SQLPTRepresentation::SaveModuleConfig( : query.Bind(7); config.vehicle_year.is_initialized() ? query.Bind(8, *(config.vehicle_year)) : query.Bind(8); -#ifdef SDL_REMOTE_CONTROL - config.user_consent_passengersRC.is_initialized() - ? query.Bind(9, *(config.user_consent_passengersRC)) - : query.Bind(9); -#endif // SDL_REMOTE_CONTROL if (!query.Exec()) { LOG4CXX_WARN(logger_, "Incorrect update module config"); return false; diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index e558d371eb..63690e2af9 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -178,27 +178,21 @@ TEST(AccessRemoteImplTest, CheckModuleType) { TEST(AccessRemoteImplTest, EnableDisable) { AccessRemoteImpl access_remote; access_remote.cache_->pt_ = new policy_table::Table(); - policy_table::ModuleConfig& config = - access_remote.cache_->pt_->policy_table.module_config; // Country is enabled access_remote.enabled_ = true; access_remote.Enable(); - EXPECT_TRUE(*config.user_consent_passengersRC); EXPECT_TRUE(access_remote.IsEnabled()); access_remote.Disable(); - EXPECT_FALSE(*config.user_consent_passengersRC); EXPECT_FALSE(access_remote.IsEnabled()); // Country is disabled access_remote.enabled_ = false; access_remote.Enable(); - EXPECT_TRUE(*config.user_consent_passengersRC); EXPECT_FALSE(access_remote.IsEnabled()); access_remote.Disable(); - EXPECT_FALSE(*config.user_consent_passengersRC); EXPECT_FALSE(access_remote.IsEnabled()); } -- cgit v1.2.1 From 0ae8b29b2d6d42964f39ebe1e5a4e3767a7d118f Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Fri, 18 Aug 2017 13:15:57 +0300 Subject: Removes 'groups_nonPrimaryRC' support --- src/appMain/sdl_preloaded_pt.json | 4 ---- .../policy_external/include/policy/policy_table/types.h | 1 - .../policy/policy_external/src/access_remote_impl.cc | 3 --- src/components/policy/policy_external/src/policy_helper.cc | 6 ------ .../policy/policy_external/src/policy_table/types.cc | 13 ------------- .../policy/policy_external/src/sql_pt_representation.cc | 6 ------ .../policy_regular/include/policy/policy_table/types.h | 1 - .../policy/policy_regular/src/access_remote_impl.cc | 4 ---- src/components/policy/policy_regular/src/policy_helper.cc | 6 ------ .../policy/policy_regular/src/policy_table/types.cc | 13 ------------- .../policy/policy_regular/src/sql_pt_representation.cc | 6 ------ .../policy/policy_regular/test/access_remote_impl_test.cc | 1 - src/components/remote_control/remote_sdl_pt.json | 3 +-- 13 files changed, 1 insertion(+), 66 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index 3fcd52490e..18bfe69e6d 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -2356,10 +2356,6 @@ "priority": "NONE", "default_hmi": "NONE", "groups": ["Base-4"], - "groups_nonPrimaryRC": [ - "Notifications-RC", - "RemoteControl" - ], "groups_primaryRC": [ "Base-4", "RemoteControl" diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index d2d124cd65..22cb071d04 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -177,7 +177,6 @@ struct ApplicationParams : PolicyBase { Optional > heart_beat_timeout_ms; #ifdef SDL_REMOTE_CONTROL Optional groups_primaryRC; - Optional groups_nonPrimaryRC; mutable Optional moduleType; #endif // SDL_REMOTE_CONTROL diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index b8b1e3378b..115b207799 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -293,9 +293,6 @@ const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { if (IsPrimaryDevice(who.dev_id)) { return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] .groups_primaryRC; - } else if (IsEnabled()) { - return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] - .groups_nonPrimaryRC; } else { return cache_->GetGroups(kPreConsentPassengersRC); } diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index f9c69f58d3..9652541c7d 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -904,12 +904,6 @@ void ProccessAppGroups::operator()( pm_->OnPrimaryGroupsChanged(app.first); } - if (HaveGroupsChanged(i->second.groups_nonPrimaryRC, - app.second.groups_nonPrimaryRC)) { - LOG4CXX_DEBUG(logger_, - "Non-primary groups for " << app.first << " have changed"); - pm_->OnNonPrimaryGroupsChanged(app.first); - } } } diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index d5915558a1..dd77ed2141 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -242,7 +242,6 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) #ifdef SDL_REMOTE_CONTROL , groups_primaryRC(impl::ValueMember(value__, "groups_primaryRC")) - , groups_nonPrimaryRC(impl::ValueMember(value__, "groups_nonPrimaryRC")) , moduleType(impl::ValueMember(value__, "moduleType")) #endif // SDL_REMOTE_CONTROL { @@ -258,7 +257,6 @@ Json::Value ApplicationParams::ToJsonValue() const { "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); #ifdef SDL_REMOTE_CONTROL impl::WriteJsonField("groups_primaryRC", groups_primaryRC, &result__); - impl::WriteJsonField("groups_nonPrimaryRC", groups_nonPrimaryRC, &result__); impl::WriteJsonField("moduleType", moduleType, &result__); #endif // SDL_REMOTE_CONTROL return result__; @@ -286,9 +284,6 @@ bool ApplicationParams::is_valid() const { if (!groups_primaryRC.is_valid()) { return false; } - if (!groups_nonPrimaryRC.is_valid()) { - return false; - } if (!moduleType.is_valid()) { return false; } @@ -323,9 +318,6 @@ bool ApplicationParams::struct_empty() const { if (groups_primaryRC.is_initialized()) { return false; } - if (groups_nonPrimaryRC.is_initialized()) { - return false; - } if (moduleType.is_initialized()) { return false; } @@ -378,10 +370,6 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { groups_primaryRC.ReportErrors( &report__->ReportSubobject("groups_primaryRC")); } - if (!groups_nonPrimaryRC.is_valid()) { - groups_nonPrimaryRC.ReportErrors( - &report__->ReportSubobject("groups_nonPrimaryRC")); - } if (!moduleType.is_valid()) { moduleType.ReportErrors(&report__->ReportSubobject("moduleType")); } @@ -396,7 +384,6 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { heart_beat_timeout_ms.SetPolicyTableType(pt_type); #ifdef SDL_REMOTE_CONTROL groups_primaryRC.SetPolicyTableType(pt_type); - groups_nonPrimaryRC.SetPolicyTableType(pt_type); moduleType.SetPolicyTableType(pt_type); #endif // SDL_REMOTE_CONTROL } diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index a65103dbc4..1f208d830e 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -769,9 +769,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( if (!GatherAppGroupPrimary(app_id, &*params.groups_primaryRC)) { return false; } - if (!GatherAppGroupNonPrimary(app_id, &*params.groups_nonPrimaryRC)) { - return false; - } bool denied = false; if (!GatherRemoteControlDenied(app_id, &denied)) { return false; @@ -1073,9 +1070,6 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( if (!SaveAppGroupPrimary(app.first, *app.second.groups_primaryRC)) { return false; } - if (!SaveAppGroupNonPrimary(app.first, *app.second.groups_nonPrimaryRC)) { - return false; - } bool denied = !app.second.moduleType->is_initialized(); if (!SaveRemoteControlDenied(app.first, denied) || diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 417630dd20..215d7bf9cf 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -144,7 +144,6 @@ struct ApplicationParams : PolicyBase { Optional > certificate; #ifdef SDL_REMOTE_CONTROL Optional groups_primaryRC; - Optional groups_nonPrimaryRC; mutable Optional moduleType; #endif // SDL_REMOTE_CONTROL diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index 3924044f7a..8235ede280 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -295,10 +295,6 @@ const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { return *cache_->pt() ->policy_table.app_policies_section.apps[who.app_id] .groups_primaryRC; - } else if (IsEnabled()) { - return *cache_->pt() - ->policy_table.app_policies_section.apps[who.app_id] - .groups_nonPrimaryRC; } else { return cache_->GetGroups(kPreConsentPassengersRC); } diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc index 7ee8153e8b..dd094fb626 100644 --- a/src/components/policy/policy_regular/src/policy_helper.cc +++ b/src/components/policy/policy_regular/src/policy_helper.cc @@ -841,12 +841,6 @@ void ProccessAppGroups::operator()( pm_->OnPrimaryGroupsChanged(app.first); } - if (HaveGroupsChanged(i->second.groups_nonPrimaryRC, - app.second.groups_nonPrimaryRC)) { - LOG4CXX_DEBUG(logger_, - "Non-primary groups for " << app.first << " have changed"); - pm_->OnNonPrimaryGroupsChanged(app.first); - } } } diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index cbfb8bd199..83dc2ffe17 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -169,7 +169,6 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , certificate(impl::ValueMember(value__, "certificate"), "not_specified") #ifdef SDL_REMOTE_CONTROL , groups_primaryRC(impl::ValueMember(value__, "groups_primaryRC")) - , groups_nonPrimaryRC(impl::ValueMember(value__, "groups_nonPrimaryRC")) , moduleType(impl::ValueMember(value__, "moduleType")) #endif // SDL_REMOTE_CONTROL { @@ -186,7 +185,6 @@ Json::Value ApplicationParams::ToJsonValue() const { "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); #ifdef SDL_REMOTE_CONTROL impl::WriteJsonField("groups_primaryRC", groups_primaryRC, &result__); - impl::WriteJsonField("groups_nonPrimaryRC", groups_nonPrimaryRC, &result__); impl::WriteJsonField("moduleType", moduleType, &result__); #endif // SDL_REMOTE_CONTROL return result__; @@ -220,9 +218,6 @@ bool ApplicationParams::is_valid() const { if (!groups_primaryRC.is_valid()) { return false; } - if (!groups_nonPrimaryRC.is_valid()) { - return false; - } if (!moduleType.is_valid()) { return false; } @@ -263,9 +258,6 @@ bool ApplicationParams::struct_empty() const { if (groups_primaryRC.is_initialized()) { return false; } - if (groups_nonPrimaryRC.is_initialized()) { - return false; - } if (moduleType.is_initialized()) { return false; } @@ -307,10 +299,6 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { groups_primaryRC.ReportErrors( &report__->ReportSubobject("groups_primaryRC")); } - if (!groups_nonPrimaryRC.is_valid()) { - groups_nonPrimaryRC.ReportErrors( - &report__->ReportSubobject("groups_nonPrimaryRC")); - } if (!moduleType.is_valid()) { moduleType.ReportErrors(&report__->ReportSubobject("moduleType")); } @@ -327,7 +315,6 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { certificate.SetPolicyTableType(pt_type); #ifdef SDL_REMOTE_CONTROL groups_primaryRC.SetPolicyTableType(pt_type); - groups_nonPrimaryRC.SetPolicyTableType(pt_type); moduleType.SetPolicyTableType(pt_type); #endif // SDL_REMOTE_CONTROL } diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 04cc110275..50c4674b07 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -709,9 +709,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( if (!GatherAppGroupPrimary(app_id, &*params.groups_primaryRC)) { return false; } - if (!GatherAppGroupNonPrimary(app_id, &*params.groups_nonPrimaryRC)) { - return false; - } bool denied = false; if (!GatherRemoteControlDenied(app_id, &denied)) { return false; @@ -976,9 +973,6 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( if (!SaveAppGroupPrimary(app.first, *app.second.groups_primaryRC)) { return false; } - if (!SaveAppGroupNonPrimary(app.first, *app.second.groups_nonPrimaryRC)) { - return false; - } bool denied = !app.second.moduleType->is_initialized(); if (!SaveRemoteControlDenied(app.first, denied) || diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index 63690e2af9..3ccc14ded3 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -223,7 +223,6 @@ TEST(AccessRemoteImplTest, GetGroups) { policy_table::ApplicationPolicies& apps = access_remote.cache_->pt_->policy_table.app_policies_section.apps; apps["1234"].groups.push_back("group_default"); - apps["1234"].groups_nonPrimaryRC->push_back("group_non_primary"); apps["1234"].groups_primaryRC->push_back("group_primary"); apps["1234"].AppHMIType->push_back(policy_table::AHT_MEDIA); diff --git a/src/components/remote_control/remote_sdl_pt.json b/src/components/remote_control/remote_sdl_pt.json index bf9afb1f7b..7d864c3fa4 100644 --- a/src/components/remote_control/remote_sdl_pt.json +++ b/src/components/remote_control/remote_sdl_pt.json @@ -2320,8 +2320,7 @@ "default_hmi": "NONE", "moduleType": ["RADIO", "CLIMATE"], "groups": ["Base-4"], - "groups_primaryRC": ["Base-4", "RemoteControl"], - "groups_nonPrimaryRC": ["Notifications-RC", "RemoteControl"] + "groups_primaryRC": ["Base-4", "RemoteControl"] }, "pre_consent_passengersRC": { "keep_context": false, -- cgit v1.2.1 From f27c9ad0c5226152e580219dde0b0f17042c83ca Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Fri, 18 Aug 2017 13:18:06 +0300 Subject: Removes unused intefaces from application --- .../include/application_manager/application.h | 7 ------- .../include/application_manager/application_impl.h | 20 ++++-------------- .../application_manager/src/application_impl.cc | 24 ---------------------- 3 files changed, 4 insertions(+), 47 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index 4d859adb92..3a03cb5343 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -801,13 +801,6 @@ class Application : public virtual InitialApplicationData, virtual void set_audio_streaming_state( const mobile_api::AudioStreamingState::eType& state) = 0; - virtual bool IsSubscribedToInteriorVehicleData( - smart_objects::SmartObject module) = 0; - virtual bool SubscribeToInteriorVehicleData( - smart_objects::SmartObject module) = 0; - virtual bool UnsubscribeFromInteriorVehicleData( - smart_objects::SmartObject module) = 0; - /** * @brief set_hmi_level Set HMI level for application * @param hmi_level Current HMI level diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 979abe945d..dc2d8ce528 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -190,19 +190,10 @@ class ApplicationImpl : public virtual Application, DataAccessor SubscribedIVI() const OVERRIDE; inline bool IsRegistered() const OVERRIDE; -#ifdef SDL_REMOTE_CONTROL - bool SubscribeToInteriorVehicleData( - smart_objects::SmartObject module) OVERRIDE; - bool IsSubscribedToInteriorVehicleData( - smart_objects::SmartObject module) OVERRIDE; - bool UnsubscribeFromInteriorVehicleData( - smart_objects::SmartObject module) OVERRIDE; - -#endif // SDL_REMOTE_CONTROL - /** - * @brief ResetDataInNone reset data counters in NONE - */ - virtual void ResetDataInNone(); + /** + * @brief ResetDataInNone reset data counters in NONE + */ + virtual void ResetDataInNone() OVERRIDE; virtual DataAccessor SubscribedButtons() const OVERRIDE; @@ -451,9 +442,6 @@ class ApplicationImpl : public virtual Application, #ifdef SDL_REMOTE_CONTROL std::list extensions_; - - std::forward_list - subscribed_interior_vehicle_data_; #endif // SDL_REMOTE_CONTROL /** diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 08672732b7..4a752febf8 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -1045,30 +1045,6 @@ void ApplicationImpl::set_hmi_level( usage_report_.RecordHmiStateChanged(new_hmi_level); } -bool ApplicationImpl::SubscribeToInteriorVehicleData( - smart_objects::SmartObject module) { - subscribed_interior_vehicle_data_.push_front(module); - return true; -} - -bool ApplicationImpl::IsSubscribedToInteriorVehicleData( - smart_objects::SmartObject module) { - for (auto it = subscribed_interior_vehicle_data_.begin(); - it != subscribed_interior_vehicle_data_.end(); - ++it) { - if (*it == module) { - return true; - } - } - return false; -} - -bool ApplicationImpl::UnsubscribeFromInteriorVehicleData( - smart_objects::SmartObject module) { - subscribed_interior_vehicle_data_.remove(module); - return true; -} - const std::set& ApplicationImpl::SubscribesIVI() const { return subscribed_vehicle_info_; } -- cgit v1.2.1 From f836fc40f0a1174dc83eee756ca3c2e51d760879 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Fri, 18 Aug 2017 23:00:29 +0300 Subject: Removes unused functionality from CheckAccess() interface --- .../include/application_manager/core_service.h | 15 ++++-------- .../application_manager/policies/policy_handler.h | 24 ++++++++----------- .../include/application_manager/service.h | 22 ++++++++---------- .../application_manager/src/core_service.cc | 6 ++--- .../src/policies/policy_handler.cc | 11 ++------- .../test/rc_policy_handler_test.cc | 15 ++++-------- .../functional_module/test/include/mock_service.h | 6 ++--- .../policies/policy_handler_interface.h | 19 +++++++-------- .../policy/policy_external/policy/policy_manager.h | 19 +++++++-------- .../policy/policy_regular/policy/policy_manager.h | 19 +++++++-------- .../policies/mock_policy_handler_interface.h | 12 ++++------ .../policy_external/policy/mock_policy_manager.h | 6 ++--- .../policy_regular/policy/mock_policy_manager.h | 6 ++--- .../policy_external/include/policy/access_remote.h | 5 +--- .../include/policy/policy_manager_impl.h | 4 +--- .../policy_external/src/policy_manager_impl.cc | 8 +------ .../include/policy/policy_manager_impl.h | 4 +--- .../policy_regular/src/policy_manager_impl.cc | 12 ++-------- .../remote_control/commands/base_command_request.h | 2 -- .../src/commands/base_command_request.cc | 27 +--------------------- .../test/commands/button_press_request_test.cc | 4 ++-- .../get_interior_vehicle_data_request_test.cc | 2 +- .../set_interior_vehicle_data_request_test.cc | 6 ++--- 23 files changed, 81 insertions(+), 173 deletions(-) diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index c5dcc975df..9a89bf51a1 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -71,24 +71,19 @@ class CoreService : public Service { mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) FINAL; /** - * Checks access to requested equipment of vehicle + * Checks access to requested module of vehicle * @param app_id id of application * @param module type - * @param rpc name of rpc - * @param params parameters list - * @return return allowed if access exist, - * manual if need to send question to driver otherwise disallowed + * @return return allowed if module is allowed, otherwise - disallowed */ TypeAccess CheckAccess(const ApplicationId& app_id, - const std::string& module, - const std::string& rpc, - const std::vector& params) FINAL; + const std::string& module) FINAL; /** - * Checks access to module for application + * Checks if module for application is present in policy table * @param app_id id of application * @param module type - * @return true if module is allowed for application + * @return true if module is present, otherwise - false */ bool CheckModule(const ApplicationId& app_id, const std::string& module) FINAL; diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 352c9826a5..3936530d38 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -144,25 +144,21 @@ class PolicyHandler : public PolicyHandlerInterface, const std::string& hmi_level) OVERRIDE; /** - * Checks access to equipment of vehicle for application by RPC + * Checks access to module of vehicle for application * @param device_id unique identifier of device * @param app_id policy id application - * @param module type - * @param rpc name of rpc - * @param params parameters list + * @param module module name + * @return Allowed if module is allowed, otherwise disallowed */ - application_manager::TypeAccess CheckAccess( - const PTString& device_id, - const PTString& app_id, - const PTString& module, - const std::string& rpc, - const std::vector& params) OVERRIDE; + application_manager::TypeAccess CheckAccess(const PTString& device_id, + const PTString& app_id, + const PTString& module) OVERRIDE; /** - * Checks access to module for application - * @param app_id policy id application - * @param module - * @return true if module is allowed for application + * Checks if module for application is present in policy table + * @param app_id id of application + * @param module type + * @return true if module is present, otherwise - false */ bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE; diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index a1d8d58a48..9f59d58c26 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -42,7 +42,7 @@ namespace application_manager { -enum TypeAccess { kNone, kDisallowed, kAllowed, kManual }; +enum TypeAccess { kNone, kDisallowed, kAllowed }; enum MessageValidationResult { SUCCESS = 0, @@ -70,24 +70,20 @@ class Service { virtual mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) = 0; /** - * Checks access to requested equipment of vehicle - * @param app_id id of application - * @param module type - * @param rpc name of rpc - * @param params parameters list - * @return return allowed if access exist, - * manual if need to send question to driver otherwise disallowed + * Checks access to module of vehicle for application + * @param device_id unique identifier of device + * @param app_id policy id application + * @param module module name + * @return Allowed if module is allowed, otherwise disallowed */ virtual TypeAccess CheckAccess(const ApplicationId& app_id, - const std::string& module, - const std::string& rpc, - const std::vector& params) = 0; + const std::string& module) = 0; /** - * Checks access to module for application + * Checks if module for application is present in policy table * @param app_id id of application * @param module type - * @return true if module is allowed for application + * @return true if module is present, otherwise - false */ virtual bool CheckModule(const ApplicationId& app_id, const std::string& module) = 0; diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index 6bb5ece4ec..f30115443f 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -83,16 +83,14 @@ mobile_apis::Result::eType CoreService::CheckPolicyPermissions(MessagePtr msg) { } TypeAccess CoreService::CheckAccess(const ApplicationId& app_id, - const std::string& module, - const std::string& rpc, - const std::vector& params) { + const std::string& module) { #ifdef SDL_REMOTE_CONTROL ApplicationSharedPtr app = GetApplication(app_id); if (app) { std::string device_handle = MessageHelper::GetDeviceMacAddressForHandle( app->device(), application_manager_); return application_manager_.GetPolicyHandler().CheckAccess( - device_handle, app->policy_app_id(), module, rpc, params); + device_handle, app->policy_app_id(), module); } #endif // SDL_REMOTE_CONTROL return kNone; diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 49d79dd92e..c9ea98c759 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1962,9 +1962,6 @@ application_manager::TypeAccess ConvertTypeAccess(policy::TypeAccess access) { case policy::TypeAccess::kAllowed: converted = application_manager::TypeAccess::kAllowed; break; - case policy::TypeAccess::kManual: - converted = application_manager::TypeAccess::kManual; - break; case policy::TypeAccess::kDisallowed: converted = application_manager::TypeAccess::kDisallowed; break; @@ -1996,14 +1993,10 @@ void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app, } application_manager::TypeAccess PolicyHandler::CheckAccess( - const PTString& device_id, - const PTString& app_id, - const PTString& module, - const std::string& rpc, - const std::vector& params) { + const PTString& device_id, const PTString& app_id, const PTString& module) { POLICY_LIB_CHECK(application_manager::TypeAccess::kNone); policy::TypeAccess access = - policy_manager_->CheckAccess(device_id, app_id, module, rpc, params); + policy_manager_->CheckAccess(device_id, app_id, module); return ConvertTypeAccess(access); } diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index 0a50dd230f..2e2e713e1b 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -275,26 +275,21 @@ TEST_F(RCPolicyHandlerTest, CheckAccess_ValidParams_SUCCESS) { const std::vector params; EXPECT_CALL(*mock_policy_manager_, - CheckAccess(kDeviceId_, kPolicyAppId_, module, pt_rpc, _)) + CheckAccess(kDeviceId_, kPolicyAppId_, module)) .WillOnce(Return(policy::TypeAccess::kDisallowed)); EXPECT_EQ(application_manager::TypeAccess::kDisallowed, - policy_handler_.CheckAccess( - kDeviceId_, kPolicyAppId_, module, pt_rpc, params)); + policy_handler_.CheckAccess(kDeviceId_, kPolicyAppId_, module)); EXPECT_CALL(*mock_policy_manager_, - CheckAccess(kDeviceId_, kPolicyAppId_, module, pt_rpc, _)) + CheckAccess(kDeviceId_, kPolicyAppId_, module)) .WillOnce(Return(policy::TypeAccess::kAllowed)); EXPECT_EQ(application_manager::TypeAccess::kAllowed, - policy_handler_.CheckAccess( - kDeviceId_, kPolicyAppId_, module, pt_rpc, params)); + policy_handler_.CheckAccess(kDeviceId_, kPolicyAppId_, module)); EXPECT_CALL(*mock_policy_manager_, - CheckAccess(kDeviceId_, kPolicyAppId_, module, pt_rpc, _)) + CheckAccess(kDeviceId_, kPolicyAppId_, module)) .WillOnce(Return(policy::TypeAccess::kManual)); - EXPECT_EQ(application_manager::TypeAccess::kManual, - policy_handler_.CheckAccess( - kDeviceId_, kPolicyAppId_, module, pt_rpc, params)); } TEST_F(RCPolicyHandlerTest, SetAccess_ValidParams_SUCCESS) { diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index 1d97558297..b8e8c40d34 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -56,11 +56,9 @@ class MockService : public Service { void(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level)); MOCK_CONST_METHOD0(GetRCCapabilities, const smart_objects::SmartObject*()); - MOCK_METHOD4(CheckAccess, + MOCK_METHOD2(CheckAccess, TypeAccess(const ApplicationId& app_id, - const std::string& module, - const std::string& rpc, - const std::vector& params)); + const std::string& module)); MOCK_METHOD2(CheckModule, bool(const ApplicationId& app_id, const std::string& module)); MOCK_METHOD3(SetAccess, diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index 5f7b6c5833..d4a13ab542 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -449,25 +449,22 @@ class PolicyHandlerInterface { const std::string& hmi_level) = 0; /** - * Checks access to equipment of vehicle for application by RPC + * Checks access to module of vehicle for application * @param device_id unique identifier of device * @param app_id policy id application - * @param module type - * @param rpc name of rpc - * @param params parameters list + * @param module module name + * @return Allowed if module is allowed, otherwise disallowed */ virtual application_manager::TypeAccess CheckAccess( const PTString& device_id, const PTString& app_id, - const PTString& module, - const std::string& rpc, - const std::vector& params) = 0; + const PTString& module) = 0; /** - * Checks access to module for application - * @param app_id policy id application - * @param module - * @return true if module is allowed for application + * Checks if module for application is present in policy table + * @param app_id id of application + * @param module type + * @return true if module is present, otherwise - false */ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index fd3371bd06..2c5b41f410 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -522,24 +522,21 @@ class PolicyManager : public usage_statistics::StatisticsManager { std::vector* app_types) = 0; /** - * Checks access to equipment of vehicle for application by RPC + * Checks access to module of vehicle for application * @param device_id unique identifier of device * @param app_id policy id application - * @param module - * @param rpc name of rpc - * @param params parameters list + * @param module module name + * @return Allowed if module is allowed, otherwise disallowed */ virtual TypeAccess CheckAccess(const PTString& device_id, const PTString& app_id, - const PTString& module, - const PTString& rpc, - const RemoteControlParams& params) = 0; + const PTString& module) = 0; /** - * Checks access to module for application - * @param app_id policy id application - * @param module - * @return true if module is allowed for application + * Checks if module for application is present in policy table + * @param app_id id of application + * @param module type + * @return true if module is present, otherwise - false */ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index 900f076395..1e554c87b7 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -496,24 +496,21 @@ class PolicyManager : public usage_statistics::StatisticsManager { std::vector* app_types) = 0; /** - * Checks access to equipment of vehicle for application by RPC + * Checks access to module of vehicle for application * @param device_id unique identifier of device * @param app_id policy id application - * @param module - * @param rpc name of rpc - * @param params parameters list + * @param module module name + * @return Allowed if module is allowed, otherwise disallowed */ virtual TypeAccess CheckAccess(const PTString& device_id, const PTString& app_id, - const PTString& module, - const PTString& rpc, - const RemoteControlParams& params) = 0; + const PTString& module) = 0; /** - * Checks access to module for application - * @param app_id policy id application - * @param module - * @return true if module is allowed for application + * Checks if module for application is present in policy table + * @param app_id id of application + * @param module type + * @return true if module is present, otherwise - false */ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index 56c7ff9b91..d012e7bc76 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -236,13 +236,11 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { bool(const std::string& application_id, mobile_apis::AppHMIType::eType hmi, const smart_objects::SmartObject* app_types)); - MOCK_METHOD5(CheckAccess, - application_manager::TypeAccess( - const policy::PTString& device_id, - const policy::PTString& app_id, - const policy::PTString& module, - const std::string& rpc, - const std::vector& params)); + MOCK_METHOD3( + CheckAccess, + application_manager::TypeAccess(const policy::PTString& device_id, + const policy::PTString& app_id, + const policy::PTString& module)); MOCK_METHOD2(CheckModule, bool(const policy::PTString& app_id, diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 399ae51169..500026f840 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -155,12 +155,10 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(GetHMITypes, bool(const std::string& application_id, std::vector* app_types)); - MOCK_METHOD5(CheckAccess, + MOCK_METHOD3(CheckAccess, TypeAccess(const PTString& device_id, const PTString& app_id, - const PTString& module, - const PTString& rpc, - const RemoteControlParams& params)); + const PTString& module)); MOCK_METHOD2(CheckModule, bool(const PTString& app_id, const PTString& module)); MOCK_METHOD4(SetAccess, diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index a155a0b07f..eaaad2b9bf 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -154,12 +154,10 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(GetHMITypes, bool(const std::string& application_id, std::vector* app_types)); - MOCK_METHOD5(CheckAccess, + MOCK_METHOD3(CheckAccess, TypeAccess(const PTString& device_id, const PTString& app_id, - const PTString& module, - const PTString& rpc, - const RemoteControlParams& params)); + const PTString& module)); MOCK_METHOD2(CheckModule, bool(const PTString& app_id, const PTString& module)); MOCK_METHOD4(SetAccess, diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h index 07efe25682..4a98c61dbb 100644 --- a/src/components/policy/policy_external/include/policy/access_remote.h +++ b/src/components/policy/policy_external/include/policy/access_remote.h @@ -42,7 +42,7 @@ namespace policy_table = ::rpc::policy_table_interface_base; namespace policy { -enum TypeAccess { kDisallowed, kAllowed, kManual }; +enum TypeAccess { kDisallowed, kAllowed }; inline std::ostream& operator<<(std::ostream& output, TypeAccess x) { output << "Access: "; switch (x) { @@ -52,9 +52,6 @@ inline std::ostream& operator<<(std::ostream& output, TypeAccess x) { case kAllowed: output << "ALLOWED"; break; - case kManual: - output << "MANUAL"; - break; default: output << "Error: Unknown type"; } diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 952aa5d32e..03de40191d 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -391,9 +391,7 @@ class PolicyManagerImpl : public PolicyManager { Permissions* data); virtual TypeAccess CheckAccess(const PTString& device_id, const PTString& app_id, - const PTString& module, - const PTString& rpc, - const RemoteControlParams& params); + const PTString& module); virtual bool CheckModule(const PTString& app_id, const PTString& module); virtual void SetAccess(const PTString& dev_id, const PTString& app_id, diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 82ef7b8e6c..d37f43a515 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -1982,13 +1982,7 @@ TypeAccess PolicyManagerImpl::CheckAccess(const PTString& device_id, policy_table::ModuleType module_type; bool is_valid = EnumFromJsonString(module, &module_type); if (is_valid && access_remote_->CheckModuleType(app_id, module_type)) { - if (access_remote_->IsPrimaryDevice(device_id)) { - return TypeAccess::kAllowed; - } else { - Subject who = {device_id, app_id}; - Object what = {module_type}; - return CheckDriverConsent(who, what, rpc, params); - } + return TypeAccess::kAllowed; } LOG4CXX_DEBUG(logger_, TypeAccess::kDisallowed); return TypeAccess::kDisallowed; diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 868328bcb4..f43f4a4809 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -362,9 +362,7 @@ class PolicyManagerImpl : public PolicyManager { Permissions* data); virtual TypeAccess CheckAccess(const PTString& device_id, const PTString& app_id, - const PTString& module, - const PTString& rpc, - const RemoteControlParams& params); + const PTString& module); virtual bool CheckModule(const PTString& app_id, const PTString& module); virtual void SetAccess(const PTString& dev_id, const PTString& app_id, diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index e2cdbbf1c4..81f87fb73c 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -1205,22 +1205,14 @@ bool PolicyManagerImpl::GetHMITypes(const std::string& application_id, TypeAccess PolicyManagerImpl::CheckAccess(const PTString& device_id, const PTString& app_id, - const PTString& module, - const PTString& rpc, - const RemoteControlParams& params) { + const PTString& module) { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "Module type: " << module); policy_table::ModuleType module_type; bool is_valid = EnumFromJsonString(module, &module_type); if (is_valid && access_remote_->CheckModuleType(app_id, module_type)) { - if (access_remote_->IsPrimaryDevice(device_id)) { - return TypeAccess::kAllowed; - } else { - Subject who = {device_id, app_id}; - Object what = {module_type}; - return CheckDriverConsent(who, what, rpc, params); - } + return TypeAccess::kAllowed; } LOG4CXX_DEBUG(logger_, TypeAccess::kDisallowed); return TypeAccess::kDisallowed; diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h index 120fff6f2f..2ef7f19cec 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_request.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h @@ -277,8 +277,6 @@ class BaseCommandRequest */ bool AqcuireResources(); inline bool IsAutoAllowed(application_manager::TypeAccess access) const; - inline bool IsNeededDriverConsent( - application_manager::TypeAccess access) const; void SendDisallowed(application_manager::TypeAccess access); void SendGetUserConsent(const Json::Value& value); void ProcessAccessResponse( diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index c67bd68340..e3b0384e49 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -365,8 +365,7 @@ bool BaseCommandRequest::CheckPolicyPermissions() { application_manager::TypeAccess BaseCommandRequest::CheckAccess( const Json::Value& message) { const std::string& module = ModuleType(message); - return service_->CheckAccess( - app_->app_id(), module, message_->function_name(), ControlData(message)); + return service_->CheckAccess(app_->app_id(), module); } bool BaseCommandRequest::CheckDriverConsent() { @@ -385,9 +384,6 @@ bool BaseCommandRequest::CheckDriverConsent() { if (IsAutoAllowed(access)) { set_auto_allowed(true); return true; - } - if (IsNeededDriverConsent(access)) { - SendGetUserConsent(value); } else { SendDisallowed(access); } @@ -436,11 +432,6 @@ bool BaseCommandRequest::AqcuireResources() { return false; } -bool BaseCommandRequest::IsNeededDriverConsent( - application_manager::TypeAccess access) const { - return access == application_manager::kManual; -} - bool BaseCommandRequest::IsAutoAllowed( application_manager::TypeAccess access) const { return access == application_manager::kAllowed; @@ -452,7 +443,6 @@ void BaseCommandRequest::SendDisallowed( std::string info; switch (access) { case application_manager::kAllowed: - case application_manager::kManual: return; case application_manager::kDisallowed: info = disallowed_info_.empty() @@ -567,7 +557,6 @@ void BaseCommandRequest::ProcessAccessResponse( "Setting allowed access for " << app_->app_id() << " for " << module); service_->SetAccess(app_->app_id(), module, is_allowed); - CheckHMILevel(application_manager::kManual, is_succeeded); if (is_allowed) { rc_module_.resource_allocation_manager().ForceAcquireResource( @@ -605,20 +594,6 @@ void BaseCommandRequest::CheckHMILevel(application_manager::TypeAccess access, } } break; - case application_manager::kManual: { - if (user_consented) { - if (app_->hmi_level() == mobile_apis::HMILevel::eType::HMI_NONE || - app_->hmi_level() == mobile_apis::HMILevel::eType::HMI_BACKGROUND) { - LOG4CXX_DEBUG(logger_, - "User consented RSDL functionality for " - << app_->name().c_str() - << "; setting LIMITED level."); - service_->ChangeNotifyHMILevel( - app_, mobile_apis::HMILevel::eType::HMI_LIMITED); - } - } - break; - } case application_manager::kDisallowed: case application_manager::kNone: default: diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc index 4b74fb333c..4423f8cad8 100644 --- a/src/components/remote_control/test/commands/button_press_request_test.cc +++ b/src/components/remote_control/test/commands/button_press_request_test.cc @@ -199,7 +199,7 @@ TEST_F(ButtonPressRequestTest, application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + EXPECT_CALL(*mock_service_, CheckAccess(_, _)) .WillOnce(Return(application_manager::TypeAccess::kAllowed)); EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1)); @@ -255,7 +255,7 @@ TEST_F( application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + EXPECT_CALL(*mock_service_, CheckAccess(_, _)) .WillOnce(Return(application_manager::TypeAccess::kAllowed)); EXPECT_CALL(mock_allocation_manager_, IsResourceFree(_)) .WillOnce(Return(true)); diff --git a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc index 6bc24273ee..98404b441a 100644 --- a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc +++ b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc @@ -164,7 +164,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + EXPECT_CALL(*mock_service_, CheckAccess(_, _)) .WillOnce(Return(application_manager::TypeAccess::kAllowed)); EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1)); application_manager::MessagePtr result_msg; diff --git a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc index 3f48013324..b8e27a9c42 100644 --- a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc +++ b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc @@ -174,7 +174,7 @@ TEST_F(SetInteriorVehicleDataRequestTest, application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + EXPECT_CALL(*mock_service_, CheckAccess(_, _)) .WillOnce(Return(application_manager::TypeAccess::kAllowed)); EXPECT_CALL(*mock_service_, GetNextCorrelationID()) .WillOnce(Return(kCorrelationId)); @@ -242,7 +242,7 @@ TEST_F( application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + EXPECT_CALL(*mock_service_, CheckAccess(_, _)) .WillOnce(Return(application_manager::TypeAccess::kAllowed)); EXPECT_CALL(*mock_service_, GetNextCorrelationID()) .WillOnce(Return(kCorrelationId)); @@ -312,7 +312,7 @@ TEST_F(SetInteriorVehicleDataRequestTest, application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _, _, _)) + EXPECT_CALL(*mock_service_, CheckAccess(_, _)) .WillOnce(Return(application_manager::TypeAccess::kAllowed)); EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0); -- cgit v1.2.1 From 598e663556525b18ad56956d558fa3a1482091fd Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Sun, 20 Aug 2017 12:37:03 +0300 Subject: Removes 'device rank' support --- .../include/application_manager/message_helper.h | 11 -- .../application_manager/policies/policy_handler.h | 12 -- .../src/message_helper/message_helper.cc | 11 -- .../src/policies/policy_handler.cc | 43 ------ .../application_manager/src/smart_object_keys.cc | 1 - .../application_manager/mock_message_helper.h | 2 - .../test/mock_message_helper.cc | 5 - .../test/rc_policy_handler_test.cc | 64 +-------- .../functional_module/src/generic_module.cc | 3 - .../src/messagebroker_adapter.cc | 1 - .../policies/policy_handler_interface.h | 12 -- .../policy_external/policy/policy_listener.h | 11 -- .../policy/policy_regular/policy/policy_listener.h | 11 -- .../policies/mock_policy_handler_interface.h | 6 - .../policy_external/policy/mock_policy_listener.h | 5 - .../policy_regular/policy/mock_policy_listener.h | 5 - src/components/interfaces/HMI_API.xml | 9 -- src/components/interfaces/MOBILE_API.xml | 9 -- .../include/policy/policy_manager_impl.h | 1 - .../policy_external/src/policy_manager_impl.cc | 19 --- .../include/policy/policy_manager_impl.h | 1 - .../policy_regular/src/policy_manager_impl.cc | 19 --- .../include/remote_control/message_helper.h | 7 - .../include/remote_control/policy_helper.h | 3 - .../include/remote_control/rc_module_constants.h | 7 +- .../remote_control/src/message_helper.cc | 2 +- src/components/remote_control/src/policy_helper.cc | 16 --- .../remote_control/src/remote_control_plugin.cc | 12 -- .../remote_control/test/src/rc_module_test.cc | 159 --------------------- 29 files changed, 5 insertions(+), 462 deletions(-) diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h index 29629e091f..c0a3f37c34 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -129,17 +129,6 @@ class MessageHelper { static hmi_apis::Common_Result::eType HMIResultFromString( const std::string& hmi_result); -#ifdef SDL_REMOTE_CONTROL - /** - * @brief Converts string to device rank, if possible - * @param device_rank Stringified device rank - * @return Appropriate enum from device rank, or INVALID_ENUM, if conversion - * is not possible - */ - static mobile_api::DeviceRank::eType StringToDeviceRank( - const std::string& device_rank); -#endif // SDL_REMOTE_CONTROL - /** * @brief Converts mobile Result enum value to string * @param mobile_result mobile Result enum value diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 3936530d38..afc33ff440 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -239,18 +239,6 @@ class PolicyHandler : public PolicyHandlerInterface, const std::string& policy_app_id, const std::string& hmi_level) OVERRIDE; - /** - * @brief Notifies Remote apps about change in HMI status - * @param device_id Device on which app is running - * @param policy_app_id ID of application - * @param hmi_level new HMI level for this application - * @param device_rank new device rank - */ - void OnUpdateHMIStatus(const std::string& device_id, - const std::string& policy_app_id, - const std::string& hmi_level, - const std::string& device_rank) OVERRIDE; - /** * Gets all allowed module types * @param app_id unique identifier of application diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 3991173892..01d180b4b5 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -444,17 +444,6 @@ hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult( } #ifdef SDL_REMOTE_CONTROL -mobile_apis::DeviceRank::eType MessageHelper::StringToDeviceRank( - const std::string& device_rank) { - using namespace NsSmartDeviceLink::NsSmartObjects; - mobile_apis::DeviceRank::eType value; - if (EnumConversionHelper::StringToEnum( - device_rank, &value)) { - return value; - } - return mobile_apis::DeviceRank::INVALID_ENUM; -} - void MessageHelper::SendHMIStatusNotification( const Application& application_impl, ApplicationManager& application_manager) { diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index c9ea98c759..76913127f3 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -2174,49 +2174,6 @@ void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id, MessageHelper::SendHMIStatusNotification(*app, application_manager_); } -void PolicyHandler::OnUpdateHMIStatus(const std::string& device_id, - const std::string& policy_app_id, - const std::string& hmi_level, - const std::string& device_rank) { - LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(device_id, policy_app_id); - if (!app) { - LOG4CXX_WARN(logger_, - "Could not find application: " << device_id << " - " - << policy_app_id); - return; - } - mobile_apis::HMILevel::eType level = - MessageHelper::StringToHMILevel(hmi_level); - if (mobile_apis::HMILevel::INVALID_ENUM == level) { - LOG4CXX_WARN(logger_, - "Couldn't convert default hmi level " << hmi_level - << " to enum."); - return; - } - mobile_apis::DeviceRank::eType rank = - MessageHelper::StringToDeviceRank(device_rank); - if (rank == mobile_apis::DeviceRank::INVALID_ENUM) { - LOG4CXX_WARN(logger_, - "Couldn't convert device rank " << device_rank << " to enum."); - return; - } - - if (rank == mobile_apis::DeviceRank::DRIVER) { - MessageHelper::SendHMIStatusNotification(*app, application_manager_); - LOG4CXX_DEBUG(logger_, "Device rank: " << rank); - return; - } - LOG4CXX_INFO(logger_, - "Changing hmi level of application " - << app->app_id() << " to default hmi level " << level); - - // Set application hmi level - application_manager_.ChangeAppsHMILevel(app->app_id(), level); - MessageHelper::SendHMIStatusNotification(*app, application_manager_); -} - bool PolicyHandler::GetModuleTypes(const std::string& policy_app_id, std::vector* modules) const { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index f2d5a29746..f2e7e6522b 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -141,7 +141,6 @@ const char* navigation_capability = "navigationCapability"; const char* phone_capability = "phoneCapability"; const char* video_streaming_capability = "videoStreamingCapability"; const char* rc_capability = "remoteControlCapability"; -const char* device_rank = "deviceRank"; // PutFile const char* sync_file_name = "syncFileName"; diff --git a/src/components/application_manager/test/include/application_manager/mock_message_helper.h b/src/components/application_manager/test/include/application_manager/mock_message_helper.h index 04dc7e1df8..f927f6bb72 100644 --- a/src/components/application_manager/test/include/application_manager/mock_message_helper.h +++ b/src/components/application_manager/test/include/application_manager/mock_message_helper.h @@ -121,8 +121,6 @@ class MockMessageHelper { MOCK_METHOD2(SendHMIStatusNotification, void(const Application& application_impl, ApplicationManager& application_manager)); - MOCK_METHOD1(StringToDeviceRank, - mobile_api::DeviceRank::eType(const std::string& device_rank)); MOCK_METHOD4(SendPolicyUpdate, void(const std::string& file_path, const uint32_t timeout, diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc index e52a8f53ac..5f221a105b 100644 --- a/src/components/application_manager/test/mock_message_helper.cc +++ b/src/components/application_manager/test/mock_message_helper.cc @@ -246,11 +246,6 @@ void MessageHelper::SendHMIStatusNotification( application_impl, application_manager); } -mobile_api::DeviceRank::eType MessageHelper::StringToDeviceRank( - const std::string& device_rank) { - return MockMessageHelper::message_helper_mock()->StringToDeviceRank( - device_rank); -} #endif // SDL_REMOTE_CONTROL void MessageHelper::SendUpdateSDLResponse(const std::string& result, diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index 2e2e713e1b..013ec5a64a 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -512,18 +512,6 @@ TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_ValidAppAndHmiLevel_SUCCESS) { policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level); } -TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatusFourParams_InvalidApp_UNSUCCESS) { - EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr invalid_app; - EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(invalid_app)); - EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); - - const std::string hmi_level("HMI_NONE"); - const std::string device_rank("INVALID_ENUM"); - policy_handler_.OnUpdateHMIStatus( - kDeviceId_, kPolicyAppId_, hmi_level, device_rank); -} - TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatusFourParams_HmiLevelInvalidEnum_UNSUCCESS) { EnablePolicyAndPolicyManagerMock(); @@ -535,51 +523,10 @@ TEST_F(RCPolicyHandlerTest, .WillOnce(Return(mobile_apis::HMILevel::INVALID_ENUM)); EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); - const std::string device_rank("INVALID_ENUM"); - policy_handler_.OnUpdateHMIStatus( - kDeviceId_, kPolicyAppId_, hmi_level, device_rank); -} - -TEST_F(RCPolicyHandlerTest, - OnUpdateHMIStatusFourParams_DeviceRankInvalidEnum_UNSUCCESS) { - EnablePolicyAndPolicyManagerMock(); - EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) - .WillOnce(Return(mock_app_)); - - const std::string hmi_level("HMI_NONE"); - EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) - .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); - - const std::string device_rank("INVALID_ENUM"); - EXPECT_CALL(mock_message_helper_, StringToDeviceRank(device_rank)) - .WillOnce(Return(mobile_apis::DeviceRank::INVALID_ENUM)); - - EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); - policy_handler_.OnUpdateHMIStatus( - kDeviceId_, kPolicyAppId_, hmi_level, device_rank); -} - -TEST_F(RCPolicyHandlerTest, - OnUpdateHMIStatusFourParams_DeviceRankDriver_UNSUCCESS) { - EnablePolicyAndPolicyManagerMock(); - EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) - .WillOnce(Return(mock_app_)); - - const std::string hmi_level("HMI_NONE"); - EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) - .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); - - const std::string device_rank("DRIVER"); - EXPECT_CALL(mock_message_helper_, StringToDeviceRank(device_rank)) - .WillOnce(Return(mobile_apis::DeviceRank::DRIVER)); - EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _)); - - EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); - policy_handler_.OnUpdateHMIStatus( - kDeviceId_, kPolicyAppId_, hmi_level, device_rank); + policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level); } -TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatusFourParams_ValidParams_SUCCESS) { +TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_ValidParams_SUCCESS) { EnablePolicyAndPolicyManagerMock(); EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) .WillOnce(Return(mock_app_)); @@ -588,17 +535,12 @@ TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatusFourParams_ValidParams_SUCCESS) { EXPECT_CALL(mock_message_helper_, StringToHMILevel(hmi_level)) .WillOnce(Return(mobile_apis::HMILevel::HMI_NONE)); - const std::string device_rank("PASSENGER"); - EXPECT_CALL(mock_message_helper_, StringToDeviceRank(device_rank)) - .WillOnce(Return(mobile_apis::DeviceRank::PASSENGER)); - EXPECT_CALL(*mock_app_, app_id()).WillRepeatedly(Return(kAppId1_)); EXPECT_CALL(app_manager_, ChangeAppsHMILevel(kAppId1_, mobile_apis::HMILevel::HMI_NONE)); EXPECT_CALL(mock_message_helper_, SendHMIStatusNotification(_, _)); - policy_handler_.OnUpdateHMIStatus( - kDeviceId_, kPolicyAppId_, hmi_level, device_rank); + policy_handler_.OnUpdateHMIStatus(kDeviceId_, kPolicyAppId_, hmi_level); } TEST_F(RCPolicyHandlerTest, GetModuleTypes_GetModuleTypes_SUCCESS) { diff --git a/src/components/functional_module/src/generic_module.cc b/src/components/functional_module/src/generic_module.cc index eec4f7b6d3..14a083ca6a 100644 --- a/src/components/functional_module/src/generic_module.cc +++ b/src/components/functional_module/src/generic_module.cc @@ -50,9 +50,6 @@ void GenericModule::OnServiceStateChanged(ServiceState state) { // We must subscribe to necessary HMI notifications service_->SubscribeToHMINotification(hmi_api::on_interior_vehicle_data); service_->SubscribeToHMINotification(hmi_api::on_remote_control_settings); - // Disabled - // service_->SubscribeToHMINotification(hmi_api::on_reverse_apps_allowing); - // service_->SubscribeToHMINotification(hmi_api::on_device_rank_changed); } } diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc index 853b5992c6..6702b10cee 100644 --- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc +++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc @@ -136,7 +136,6 @@ void MessageBrokerAdapter::SubscribeTo() { MessageBrokerController::subscribeTo("SDL.OnDeviceStateChanged"); MessageBrokerController::subscribeTo("SDL.OnPolicyUpdate"); MessageBrokerController::subscribeTo("BasicCommunication.OnEventChanged"); - MessageBrokerController::subscribeTo("RC.OnDeviceRankChanged"); MessageBrokerController::subscribeTo("RC.OnInteriorVehicleData"); MessageBrokerController::subscribeTo("RC.OnRemoteControlSettings"); diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index d4a13ab542..5a101a8b93 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -546,18 +546,6 @@ class PolicyHandlerInterface { const std::string& policy_app_id, const std::string& hmi_level) = 0; - /** - * @brief Notifies Remote apps about change in HMI status - * @param device_id Device on which app is running - * @param policy_app_id ID of application - * @param hmi_level new HMI level for this application - * @param device_rank new device rank - */ - virtual void OnUpdateHMIStatus(const std::string& device_id, - const std::string& policy_app_id, - const std::string& hmi_level, - const std::string& device_rank) = 0; - /** * Gets all allowed module types * @param app_id unique identifier of application diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h index 4331ae4847..bac58235cb 100644 --- a/src/components/include/policy/policy_external/policy/policy_listener.h +++ b/src/components/include/policy/policy_external/policy/policy_listener.h @@ -179,17 +179,6 @@ class PolicyListener { const std::string& policy_app_id, const std::string& hmi_level) = 0; - /** - * Notifies about changing HMI status - * @param device_id unique identifier of device - * @param policy_app_id unique identifier of application in policy - * @param hmi_level default HMI level for this application - * @param device_rank device rank - */ - virtual void OnUpdateHMIStatus(const std::string& device_id, - const std::string& policy_app_id, - const std::string& hmi_level, - const std::string& device_rank) = 0; #endif // SDL_REMOTE_CONTROL }; } // namespace policy diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h index c7fc0de442..2c5bb765f0 100644 --- a/src/components/include/policy/policy_regular/policy/policy_listener.h +++ b/src/components/include/policy/policy_regular/policy/policy_listener.h @@ -154,17 +154,6 @@ class PolicyListener { const std::string& policy_app_id, const std::string& hmi_level) = 0; - /** - * Notifies about changing HMI status - * @param device_id unique identifier of device - * @param policy_app_id unique identifier of application in policy - * @param hmi_level default HMI level for this application - * @param device_rank device rank - */ - virtual void OnUpdateHMIStatus(const std::string& device_id, - const std::string& policy_app_id, - const std::string& hmi_level, - const std::string& device_rank) = 0; #endif // SDL_REMOTE_CONTROL }; } // namespace policy diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index d012e7bc76..a8953b1838 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -278,12 +278,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { void(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level)); - - MOCK_METHOD4(OnUpdateHMIStatus, - void(const std::string& device_id, - const std::string& policy_app_id, - const std::string& hmi_level, - const std::string& device_rank)); MOCK_CONST_METHOD2(GetModuleTypes, bool(const std::string& policy_app_id, std::vector* modules)); diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h index eba2bc45c0..2508fdbc95 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_listener.h @@ -101,11 +101,6 @@ class MockPolicyListener : public ::policy::PolicyListener { void(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level)); - MOCK_METHOD4(OnUpdateHMIStatus, - void(const std::string& device_id, - const std::string& policy_app_id, - const std::string& hmi_level, - const std::string& device_rank)); #endif // SDL_REMOTE_CONTROL }; diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h index 91d93908a2..3d31712709 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h @@ -94,11 +94,6 @@ class MockPolicyListener : public ::policy::PolicyListener { void(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level)); - MOCK_METHOD4(OnUpdateHMIStatus, - void(const std::string& device_id, - const std::string& policy_app_id, - const std::string& hmi_level, - const std::string& device_rank)); #endif // SDL_REMOTE_CONTROL }; diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 72bcde37dd..23c896ec46 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1687,15 +1687,6 @@ - - - The device is ranked as driver's - - - The device is ranked as passenger's - - - Enumeration that describes possible remote control access mode the application might be in on HU. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 561a517a97..b3d7859a64 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1718,15 +1718,6 @@ - - - The device is ranked as driver's - - - The device is ranked as passenger's - - - diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 03de40191d..e7ce18177c 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -208,7 +208,6 @@ class PolicyManagerImpl : public PolicyManager { const utils::SharedPtr snapshot); void SendHMILevelChanged(const Subject& who); - void UpdateDeviceRank(const Subject& who, const std::string& rank); void OnPrimaryGroupsChanged(const std::string& application_id); void OnNonPrimaryGroupsChanged(const std::string& application_id); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index d37f43a515..befa33513e 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -785,9 +785,6 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( #ifdef SDL_REMOTE_CONTROL const Subject who = {device_id, application_id}; if (access_remote_->IsAppRemoteControl(who)) { - const std::string rank = - access_remote_->IsPrimaryDevice(who.dev_id) ? "DRIVER" : "PASSENGER"; - UpdateDeviceRank(who, rank); listener()->OnPermissionsUpdated(application_id, notification_data); return; } @@ -2088,9 +2085,6 @@ void PolicyManagerImpl::OnChangedPrimaryDevice( return; } - const std::string rank = - access_remote_->IsPrimaryDevice(who.dev_id) ? "DRIVER" : "PASSENGER"; - UpdateDeviceRank(who, rank); SendAppPermissionsChanged(who.dev_id, who.app_id); } @@ -2115,19 +2109,6 @@ void PolicyManagerImpl::OnChangedRemoteControl( SendAppPermissionsChanged(who.dev_id, who.app_id); } -void PolicyManagerImpl::UpdateDeviceRank(const Subject& who, - const std::string& rank) { - std::string default_hmi("NONE"); - if (GetDefaultHmi(who.app_id, &default_hmi)) { - access_remote_->Reset(who); - listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi, rank); - } else { - LOG4CXX_WARN(logger_, - "Couldn't get default HMI level for application " - << who.app_id); - } -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index f43f4a4809..c53d4bd877 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -208,7 +208,6 @@ class PolicyManagerImpl : public PolicyManager { const utils::SharedPtr snapshot); void SendHMILevelChanged(const Subject& who); - void UpdateDeviceRank(const Subject& who, const std::string& rank); void OnPrimaryGroupsChanged(const std::string& application_id); void OnNonPrimaryGroupsChanged(const std::string& application_id); diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 81f87fb73c..58853ad7e5 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -461,9 +461,6 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( #ifdef SDL_REMOTE_CONTROL const Subject who = {device_id, application_id}; if (access_remote_->IsAppRemoteControl(who)) { - const std::string rank = - access_remote_->IsPrimaryDevice(who.dev_id) ? "DRIVER" : "PASSENGER"; - UpdateDeviceRank(who, rank); listener()->OnPermissionsUpdated(application_id, notification_data); return; } @@ -1318,9 +1315,6 @@ void PolicyManagerImpl::OnChangedPrimaryDevice( return; } - const std::string rank = - access_remote_->IsPrimaryDevice(who.dev_id) ? "DRIVER" : "PASSENGER"; - UpdateDeviceRank(who, rank); SendAppPermissionsChanged(who.dev_id, who.app_id); } @@ -1345,19 +1339,6 @@ void PolicyManagerImpl::OnChangedRemoteControl( SendAppPermissionsChanged(who.dev_id, who.app_id); } -void PolicyManagerImpl::UpdateDeviceRank(const Subject& who, - const std::string& rank) { - std::string default_hmi("NONE"); - if (GetDefaultHmi(who.app_id, &default_hmi)) { - access_remote_->Reset(who); - listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi, rank); - } else { - LOG4CXX_WARN(logger_, - "Couldn't get default HMI level for application " - << who.app_id); - } -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { diff --git a/src/components/remote_control/include/remote_control/message_helper.h b/src/components/remote_control/include/remote_control/message_helper.h index 49d1d07a11..0c99022e4b 100644 --- a/src/components/remote_control/include/remote_control/message_helper.h +++ b/src/components/remote_control/include/remote_control/message_helper.h @@ -78,13 +78,6 @@ class MessageHelper { */ static Json::Value StringToValue(const std::string& string); - /** - * Validates structure InteriorZone - * @param value json of InteriorZone - * @return true if json is valid - */ - static bool ValidateInteriorZone(const Json::Value& value); - /** * Creates hmi request * @param function_id - API function we create request for diff --git a/src/components/remote_control/include/remote_control/policy_helper.h b/src/components/remote_control/include/remote_control/policy_helper.h index 92be79775a..1ca578c8aa 100644 --- a/src/components/remote_control/include/remote_control/policy_helper.h +++ b/src/components/remote_control/include/remote_control/policy_helper.h @@ -43,9 +43,6 @@ class PolicyHelper { public: static void OnRSDLFunctionalityAllowing(bool allowed, RemotePluginInterface& rc_module); - static void ChangeDeviceRank(const uint32_t device_handle, - const std::string& rank, - RemotePluginInterface& rc_module); static void SetIsAppOnPrimaryDevice( application_manager::ApplicationSharedPtr app, RemotePluginInterface& rc_module); diff --git a/src/components/remote_control/include/remote_control/rc_module_constants.h b/src/components/remote_control/include/remote_control/rc_module_constants.h index 36fb7281f2..e1d56b20ff 100644 --- a/src/components/remote_control/include/remote_control/rc_module_constants.h +++ b/src/components/remote_control/include/remote_control/rc_module_constants.h @@ -89,6 +89,7 @@ const char kCode[] = "code"; } // json_keys namespace message_params { +const char kName[] = "name"; /* const char kCustomPresets[] = "customPresets"; const char kRadioStation[] = "radioStation"; @@ -181,12 +182,6 @@ const char kAccessMode[] = "accessMode"; const char kAllowed[] = "allowed"; // OnRemoteControlSettings notification -// RC.OnDriverRankChanged notification -const char kDevice[] = "device"; -const char kName[] = "name"; -const char kRank[] = "deviceRank"; -// RC.OnDriverRankChanged notification - // ButtonPress request const char kModuleType[] = "moduleType"; const char kButtonName[] = "buttonName"; diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc index 15adf2510a..665ac42f88 100644 --- a/src/components/remote_control/src/message_helper.cc +++ b/src/components/remote_control/src/message_helper.cc @@ -49,7 +49,7 @@ std::map GenerateAPINames() { result.insert(std::make_pair( RCFunctionID::ON_INTERIOR_VEHICLE_DATA, "OnInteriorVehicleData")); result.insert(std::make_pair( - RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSettingd")); + RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSetting")); return result; } diff --git a/src/components/remote_control/src/policy_helper.cc b/src/components/remote_control/src/policy_helper.cc index 5ef0b780fb..dadb84bd3e 100644 --- a/src/components/remote_control/src/policy_helper.cc +++ b/src/components/remote_control/src/policy_helper.cc @@ -44,22 +44,6 @@ void PolicyHelper::OnRSDLFunctionalityAllowing( rc_module.service()->SetRemoteControl(allowed); } -void PolicyHelper::ChangeDeviceRank(const uint32_t device_handle, - const std::string& rank, - RemotePluginInterface& rc_module) { - if (rank == "DRIVER") { - rc_module.service()->SetPrimaryDevice(device_handle); - // MarkApplications(device_handle); - } else if (rank == "PASSENGER") { - if (rc_module.service()->PrimaryDevice() == device_handle) { - rc_module.service()->ResetPrimaryDevice(); - // MarkApplications(0); - } - } else { - LOG4CXX_WARN(logger_, "Unknown device rank"); - } -} - void PolicyHelper::SetIsAppOnPrimaryDevice( application_manager::ApplicationSharedPtr app, RemotePluginInterface& rc_module) { diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc index 77dc69746a..7df615b592 100644 --- a/src/components/remote_control/src/remote_control_plugin.cc +++ b/src/components/remote_control/src/remote_control_plugin.cc @@ -230,18 +230,6 @@ void RemoteControlPlugin::SendHmiStatusNotification( msg_params["systemContext"] = static_cast(app->system_context()); - application_manager::AppExtensionPtr app_extension = - app->QueryInterface(GetModuleID()); - RCAppExtensionPtr rc_app_extension = - application_manager::AppExtensionPtr::static_pointer_cast( - app_extension); - - if (rc_app_extension->is_on_driver_device()) { - msg_params[message_params::kRank] = "DRIVER"; - } else { - msg_params[message_params::kRank] = "PASSENGER"; - } - msg->set_json_message(MessageHelper::ValueToString(msg_params)); service()->SendMessageToMobile(msg); diff --git a/src/components/remote_control/test/src/rc_module_test.cc b/src/components/remote_control/test/src/rc_module_test.cc index a994c55b37..ffbceb04fd 100644 --- a/src/components/remote_control/test/src/rc_module_test.cc +++ b/src/components/remote_control/test/src/rc_module_test.cc @@ -290,165 +290,6 @@ TEST_F(RCModuleTest, SetDriverDeviceOnRegisterFail) { ASSERT_FALSE(rc_app_extention_->is_on_driver_device()); } -// TODO(ILytvynenko): Uncomment after CANModule::HandleMessage implementtion -// TEST_F(RCModuleTest, ChangeDriverDevice) { -// Json::Value value(Json::ValueType::objectValue); -// value[json_keys::kMethod] = -// functional_modules::hmi_api::on_device_rank_changed; -// value[json_keys::kParams] = Json::Value(Json::ValueType::objectValue); -// value[json_keys::kParams][message_params::kDevice] = -// Json::Value(Json::ValueType::objectValue); -// value[json_keys::kParams][message_params::kDevice][json_keys::kId] = -// kDeviceId; -// value[json_keys::kParams][message_params::kDevice][message_params::kName] = -// kDeviceName; -// value[json_keys::kParams][message_params::kRank] = "DRIVER"; -// Json::FastWriter writer; -// std::string json_str = writer.write(value); - -// message_->set_function_name( -// functional_modules::hmi_api::on_device_rank_changed); -// message_->set_json_message(json_str); - -// apps_.push_back(app0_); - -// mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL; -// EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); -// EXPECT_CALL(*app0_, device()).WillRepeatedly(Return(1)); -// EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) -// .WillRepeatedly(Return(rc_app_extention_)); -// EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) -// .WillOnce(Return(apps_)); -// EXPECT_CALL(*mock_service_, GetDeviceHandlerById(kDeviceId)) -// .WillRepeatedly(Return(kDeviceHandle)); -// EXPECT_CALL(*mock_service_, SetPrimaryDevice(kDeviceHandle)).Times(1); -// EXPECT_CALL(*mock_service_, ResetPrimaryDevice()).Times(0); - -// RCModuleTest::HandleMessage(); -// ASSERT_TRUE(rc_app_extention_->is_on_driver_device()); -//} - -// TEST_F(RCModuleTest, ChangeDriverDeviceOnOther) { -// Json::Value value(Json::ValueType::objectValue); -// value[json_keys::kMethod] = -// functional_modules::hmi_api::on_device_rank_changed; -// value[json_keys::kParams] = Json::Value(Json::ValueType::objectValue); -// value[json_keys::kParams][message_params::kDevice] = -// Json::Value(Json::ValueType::objectValue); -// value[json_keys::kParams][message_params::kDevice][json_keys::kId] = -// kDeviceId; -// value[json_keys::kParams][message_params::kDevice][message_params::kName] = -// kDeviceName; -// value[json_keys::kParams][message_params::kRank] = "DRIVER"; -// Json::FastWriter writer; -// std::string json_str = writer.write(value); - -// message_->set_function_name( -// functional_modules::hmi_api::on_device_rank_changed); -// message_->set_message_type(MessageType::kNotification); -// message_->set_json_message(json_str); - -// apps_.push_back(app0_); -// apps_.push_back(app1_); - -// rc_app_extention_->set_is_on_driver_device(true); -// EXPECT_TRUE(rc_app_extention_->is_on_driver_device()); -// utils::SharedPtr ext = -// utils::MakeShared(module_.GetModuleID()); -// EXPECT_FALSE(ext->is_on_driver_device()); - -// EXPECT_CALL(*app0_, device()).WillOnce(Return(1)); -// EXPECT_CALL(*app1_, device()).WillOnce(Return(2)); -// EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) -// .WillOnce(Return(rc_app_extention_)); -// EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) -// .WillRepeatedly(Return(apps_)); -// EXPECT_CALL(*mock_service_, GetDeviceHandlerById(kDeviceId)) -// .WillRepeatedly(Return(kDeviceHandle)); -// EXPECT_CALL(*mock_service_, SetPrimaryDevice(kDeviceHandle)).Times(1); -// EXPECT_CALL(*mock_service_, ResetPrimaryDevice()).Times(0); - -// RCModuleTest::HandleMessage(); -// ASSERT_TRUE(rc_app_extention_->is_on_driver_device()); -// ASSERT_FALSE(ext->is_on_driver_device()); -//} - -// TEST_F(RCModuleTest, ChangeDriverDeviceToPassenger) { -// Json::Value value(Json::ValueType::objectValue); -// value[json_keys::kMethod] = -// functional_modules::hmi_api::on_device_rank_changed; -// value[json_keys::kParams] = Json::Value(Json::ValueType::objectValue); -// value[json_keys::kParams][message_params::kDevice] = -// Json::Value(Json::ValueType::objectValue); -// value[json_keys::kParams][message_params::kDevice][json_keys::kId] = -// kDeviceId; -// value[json_keys::kParams][message_params::kDevice][message_params::kName] = -// kDeviceName; -// value[json_keys::kParams][message_params::kRank] = "PASSENGER"; -// Json::FastWriter writer; -// std::string json_str = writer.write(value); - -// message_->set_function_name( -// functional_modules::hmi_api::on_device_rank_changed); -// message_->set_message_type(MessageType::kNotification); -// message_->set_json_message(json_str); - -// apps_.push_back(app0_); -// rc_app_extention_->set_is_on_driver_device(true); -// EXPECT_TRUE(rc_app_extention_->is_on_driver_device()); - -// mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL; -// EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); -// EXPECT_CALL(*app0_, device()).WillOnce(Return(1)); -// EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) -// .WillRepeatedly(Return(rc_app_extention_)); -// EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) -// .WillRepeatedly(Return(apps_)); -// EXPECT_CALL(*mock_service_, GetDeviceHandlerById(kDeviceId)) -// .WillRepeatedly(Return(kDeviceHandle)); -// EXPECT_CALL(*mock_service_, PrimaryDevice()).Times(1).WillOnce(Return(1)); -// EXPECT_CALL(*mock_service_, ResetPrimaryDevice()).Times(1); - -// RCModuleTest::HandleMessage(); -// ASSERT_FALSE(rc_app_extention_->is_on_driver_device()); -//} - -// TEST_F(RCModuleTest, ChangePassengerDeviceToPassenger) { -// Json::Value value(Json::ValueType::objectValue); -// value[json_keys::kMethod] = -// functional_modules::hmi_api::on_device_rank_changed; -// value[json_keys::kParams] = Json::Value(Json::ValueType::objectValue); -// value[json_keys::kParams][message_params::kDevice] = -// Json::Value(Json::ValueType::objectValue); -// value[json_keys::kParams][message_params::kDevice][json_keys::kId] = -// kDeviceId; -// value[json_keys::kParams][message_params::kDevice][message_params::kName] = -// kDeviceName; -// value[json_keys::kParams][message_params::kRank] = "PASSENGER"; -// Json::FastWriter writer; -// std::string json_str = writer.write(value); - -// message_->set_function_name( -// functional_modules::hmi_api::on_device_rank_changed); -// message_->set_message_type(MessageType::kNotification); -// message_->set_json_message(json_str); - -// apps_.push_back(app0_); -// rc_app_extention_->set_is_on_driver_device(false); -// EXPECT_FALSE(rc_app_extention_->is_on_driver_device()); - -// EXPECT_CALL(*app0_, device()).WillOnce(Return(1)); -// EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) -// .WillRepeatedly(Return(rc_app_extention_)); -// EXPECT_CALL(*mock_service_, GetApplications(module_.GetModuleID())) -// .WillRepeatedly(Return(apps_)); -// EXPECT_CALL(*mock_service_, PrimaryDevice()).Times(1).WillOnce(Return(2)); -// EXPECT_CALL(*mock_service_, ResetPrimaryDevice()).Times(0); - -// RCModuleTest::HandleMessage(); -// ASSERT_FALSE(rc_app_extention_->is_on_driver_device()); -//} - TEST_F(RCModuleTest, CanAppChangeHMILevelPrimary) { apps_.push_back(app0_); -- cgit v1.2.1 From f97787a3299b1b83ab871aed55e3e5a01e9b392a Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Sun, 20 Aug 2017 13:11:13 +0300 Subject: Removes non-primary RC groups processing from policy --- .../include/policy/policy_manager_impl.h | 1 - .../include/policy/sql_pt_queries.h | 4 -- .../include/policy/sql_pt_representation.h | 4 -- .../policy_external/src/policy_manager_impl.cc | 16 ------ .../policy/policy_external/src/sql_pt_queries.cc | 45 ---------------- .../policy_external/src/sql_pt_representation.cc | 61 ---------------------- .../include/policy/policy_manager_impl.h | 1 - .../policy_regular/include/policy/sql_pt_queries.h | 4 -- .../include/policy/sql_pt_representation.h | 4 -- .../policy_regular/src/policy_manager_impl.cc | 16 ------ .../policy/policy_regular/src/sql_pt_queries.cc | 45 ---------------- .../policy_regular/src/sql_pt_representation.cc | 61 ---------------------- .../policy_regular/test/access_remote_impl_test.cc | 4 -- 13 files changed, 266 deletions(-) diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index e7ce18177c..6e3b98503d 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -210,7 +210,6 @@ class PolicyManagerImpl : public PolicyManager { void SendHMILevelChanged(const Subject& who); void OnPrimaryGroupsChanged(const std::string& application_id); - void OnNonPrimaryGroupsChanged(const std::string& application_id); #endif // SDL_REMOTE_CONTROL virtual void RemoveAppConsentForGroup(const std::string& app_id, diff --git a/src/components/policy/policy_external/include/policy/sql_pt_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_queries.h index a4832aab26..5d75649c62 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_queries.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_queries.h @@ -118,13 +118,10 @@ extern const std::string kUpdatePreloaded; extern const std::string kUpdateRemoteControlDenied; extern const std::string kSelectRemoteControlDenied; extern const std::string kDeleteAppGroupPrimaryByApplicationId; -extern const std::string kDeleteAppGroupNonPrimaryByApplicationId; extern const std::string kCollectFriendlyMsg; extern const std::string kSelectAppGroupsPrimary; -extern const std::string kSelectAppGroupsNonPrimary; extern const std::string kSelectModuleTypes; extern const std::string kInsertAppGroupPrimary; -extern const std::string kInsertAppGroupNonPrimary; extern const std::string kInsertModuleType; extern const std::string kInsertAccessModule; extern const std::string kSelectAccessModules; @@ -133,7 +130,6 @@ extern const std::string kInsertRemoteRpc; extern const std::string kSelectRemoteRpcs; extern const std::string kDeleteRemoteRpc; extern const std::string kDeleteAppGroupPrimary; -extern const std::string kDeleteAppGroupNonPrimary; extern const std::string kDeleteModuleTypes; extern const std::string kDeleteAllDevices; extern const std::string kSelectDBVersion; diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h index 424769fb41..fc7f71e575 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h @@ -102,8 +102,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { enum TypeAccess { kAllowed, kManual }; bool GatherAppGroupPrimary(const std::string& app_id, policy_table::Strings* app_groups) const; - bool GatherAppGroupNonPrimary(const std::string& app_id, - policy_table::Strings* app_groups) const; bool GatherModuleType(const std::string& app_id, policy_table::ModuleTypes* module_types) const; bool GatherRemoteControlDenied(const std::string& app_id, bool* denied) const; @@ -112,8 +110,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const; bool SaveAppGroupPrimary(const std::string& app_id, const policy_table::Strings& app_groups); - bool SaveAppGroupNonPrimary(const std::string& app_id, - const policy_table::Strings& app_groups); bool SaveModuleType(const std::string& app_id, const policy_table::ModuleTypes& types); bool SaveRemoteControlDenied(const std::string& app_id, bool deny); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index befa33513e..93521b61b1 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -2199,22 +2199,6 @@ void PolicyManagerImpl::OnPrimaryGroupsChanged( } } -void PolicyManagerImpl::OnNonPrimaryGroupsChanged( - const std::string& application_id) { - const std::vector devices = - listener()->GetDevicesIds(application_id); - for (std::vector::const_iterator i = devices.begin(); - i != devices.end(); - ++i) { - const Subject who = {*i, application_id}; - if (access_remote_->IsAppRemoteControl(who) && - !access_remote_->IsPrimaryDevice(who.dev_id) && - access_remote_->IsEnabled()) { - SendAppPermissionsChanged(who.dev_id, who.app_id); - } - } -} - bool PolicyManagerImpl::GetModuleTypes( const std::string& application_id, std::vector* modules) const { diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc index 9f38b9aeaf..7919202cd1 100644 --- a/src/components/policy/policy_external/src/sql_pt_queries.cc +++ b/src/components/policy/policy_external/src/sql_pt_queries.cc @@ -370,26 +370,6 @@ const std::string kCreateSchema = "`app_group_primary.fk_application_has_functional_group_application1_idx` " " ON `app_group_primary`(`application_id`); " - "CREATE TABLE IF NOT EXISTS `app_group_non_primary`( " - " `application_id` VARCHAR(45) NOT NULL, " - " `functional_group_id` INTEGER NOT NULL, " - " PRIMARY KEY(`application_id`,`functional_group_id`), " - " CONSTRAINT `fk_application_has_functional_group_application1` " - " FOREIGN KEY(`application_id`) " - " REFERENCES `application`(`id`), " - " CONSTRAINT `fk_application_has_functional_group_functional_group1` " - " FOREIGN KEY(`functional_group_id`) " - " REFERENCES `functional_group`(`id`) " - "); " - "CREATE INDEX IF NOT EXISTS " - "`app_group_non_primary.fk_application_has_functional_group_functional_" - "group1_idx` " - " ON `app_group_non_primary`(`functional_group_id`); " - "CREATE INDEX IF NOT EXISTS " - "`app_group_non_primary.fk_application_has_functional_group_application1_" - "idx` " - " ON `app_group_non_primary`(`application_id`); " - /* access_module */ "CREATE TABLE `access_module`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -467,9 +447,6 @@ const std::string kInsertInitData = const std::string kDeleteAppGroupPrimary = "DELETE FROM `app_group_primary`"; -const std::string kDeleteAppGroupNonPrimary = - "DELETE FROM `app_group_non_primary`"; - const std::string kDeleteModuleTypes = "DELETE FROM `module_type`"; const std::string kDeleteAllDevices = "DELETE FROM `device`;"; @@ -480,12 +457,6 @@ const std::string kSelectAppGroupsPrimary = " ON (`f`.`id` = `a`.`functional_group_id`)" " WHERE `a`.`application_id` = ?"; -const std::string kSelectAppGroupsNonPrimary = - "SELECT `f`.`name` FROM `app_group_non_primary` AS `a`" - " LEFT JOIN `functional_group` AS `f` " - " ON (`f`.`id` = `a`.`functional_group_id`)" - " WHERE `a`.`application_id` = ?"; - const std::string kSelectRemoteControlDenied = "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1"; @@ -493,11 +464,6 @@ const std::string kInsertAppGroupPrimary = "INSERT INTO `app_group_primary` (`application_id`, `functional_group_id`)" " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1"; -const std::string kInsertAppGroupNonPrimary = - "INSERT INTO `app_group_non_primary` (`application_id`, " - "`functional_group_id`)" - " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1"; - const std::string kUpdateRemoteControlDenied = "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?"; @@ -512,9 +478,6 @@ const std::string kInsertAccessModule = const std::string kDeleteAppGroupPrimaryByApplicationId = "DELETE FROM `app_group_primary` WHERE `application_id` = ?"; -const std::string kDeleteAppGroupNonPrimaryByApplicationId = - "DELETE FROM `app_group_non_primary` WHERE `application_id` = ?"; - const std::string kSelectAccessModules = "SELECT `id`, `name` FROM `access_module` " " WHERE `user_consent_needed` = ?"; @@ -579,13 +542,6 @@ const std::string kDropSchema = "`app_group_primary.fk_application_has_functional_group_functional_group1_" "idx`; " "DROP TABLE IF EXISTS `app_group_primary`; " - "DROP INDEX IF EXISTS " - "`app_group_non_primary.fk_application_has_functional_group_application1_" - "idx`; " - "DROP INDEX IF EXISTS " - "`app_group_non_primary.fk_application_has_functional_group_functional_" - "group1_idx`; " - "DROP TABLE IF EXISTS `app_group_non_primary`; " "DROP TABLE IF EXISTS `access_module`; " "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; " "DROP INDEX IF EXISTS " @@ -638,7 +594,6 @@ const std::string kDeleteData = "DELETE FROM `application`; " "DELETE FROM `rpc`; " "DELETE FROM `app_group_primary`; " - "DELETE FROM `app_group_non_primary`; " "DELETE FROM `access_module`; " "DELETE FROM `version`; " "DELETE FROM `message_type`; " diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 1f208d830e..8dbf113fbc 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -975,10 +975,6 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection( LOG4CXX_WARN(logger_, "Incorrect delete from app_group_primary."); return false; } - if (!query_delete.Exec(sql_pt::kDeleteAppGroupNonPrimary)) { - LOG4CXX_WARN(logger_, "Incorrect delete from app_group_non_primary."); - return false; - } if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) { LOG4CXX_WARN(logger_, "Incorrect delete from module_type."); return false; @@ -1657,22 +1653,6 @@ bool SQLPTRepresentation::GatherAppGroupPrimary( return true; } -bool SQLPTRepresentation::GatherAppGroupNonPrimary( - const std::string& app_id, policy_table::Strings* app_groups) const { - dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kSelectAppGroupsNonPrimary)) { - LOG4CXX_WARN(logger_, - "Incorrect select from app groups for non primary RC"); - return false; - } - - query.Bind(0, app_id); - while (query.Next()) { - app_groups->push_back(query.GetString(0)); - } - return true; -} - bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id, bool* denied) const { LOG4CXX_AUTO_TRACE(logger_); @@ -1734,32 +1714,6 @@ bool SQLPTRepresentation::SaveAppGroupPrimary( return true; } -bool SQLPTRepresentation::SaveAppGroupNonPrimary( - const std::string& app_id, const policy_table::Strings& app_groups) { - LOG4CXX_AUTO_TRACE(logger_); - dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kInsertAppGroupNonPrimary)) { - LOG4CXX_WARN(logger_, - "Incorrect insert statement for app group non primary"); - return false; - } - policy_table::Strings::const_iterator it; - for (it = app_groups.begin(); it != app_groups.end(); ++it) { - std::string ssss = *it; - LOG4CXX_INFO(logger_, "Group: " << ssss); - query.Bind(0, app_id); - query.Bind(1, *it); - if (!query.Exec() || !query.Reset()) { - LOG4CXX_WARN(logger_, - "Incorrect insert into app group non primary." - << query.LastError().text()); - return false; - } - } - - return true; -} - bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id, bool deny) { LOG4CXX_AUTO_TRACE(logger_); @@ -2012,18 +1966,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { LOG4CXX_ERROR(logger_, "Failed deleting from app_group_primary."); return false; } - - dbms::SQLQuery query_np(db()); - if (!query_np.Prepare(sql_pt::kDeleteAppGroupNonPrimaryByApplicationId)) { - LOG4CXX_ERROR(logger_, - "Incorrect statement to delete from app_group_non_primary."); - return false; - } - query_np.Bind(0, app_id); - if (!query_np.Exec()) { - LOG4CXX_ERROR(logger_, "Failed deleting from app_group_non_primary."); - return false; - } #endif // SDL_REMOTE_CONTROL if (!CopyApplication(kDefaultId, app_id)) { @@ -2050,9 +1992,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { policy_table::Strings groups_primary; ret = ret && (GatherAppGroupPrimary(kDefaultId, &groups_primary) && SaveAppGroupPrimary(app_id, groups_primary)); - policy_table::Strings groups_non_primary; - ret = ret && (GatherAppGroupNonPrimary(kDefaultId, &groups_non_primary) && - SaveAppGroupNonPrimary(app_id, groups_non_primary)); #endif // SDL_REMOTE_CONTROL if (ret) { diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index c53d4bd877..65b186e939 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -210,7 +210,6 @@ class PolicyManagerImpl : public PolicyManager { void SendHMILevelChanged(const Subject& who); void OnPrimaryGroupsChanged(const std::string& application_id); - void OnNonPrimaryGroupsChanged(const std::string& application_id); #endif // SDL_REMOTE_CONTROL virtual void RemoveAppConsentForGroup(const std::string& app_id, diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h index 20f5d5aed4..97b52ecf05 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h @@ -117,13 +117,10 @@ extern const std::string kUpdatePreloaded; extern const std::string kUpdateRemoteControlDenied; extern const std::string kSelectRemoteControlDenied; extern const std::string kDeleteAppGroupPrimaryByApplicationId; -extern const std::string kDeleteAppGroupNonPrimaryByApplicationId; extern const std::string kCollectFriendlyMsg; extern const std::string kSelectAppGroupsPrimary; -extern const std::string kSelectAppGroupsNonPrimary; extern const std::string kSelectModuleTypes; extern const std::string kInsertAppGroupPrimary; -extern const std::string kInsertAppGroupNonPrimary; extern const std::string kInsertModuleType; extern const std::string kInsertAccessModule; extern const std::string kSelectAccessModules; @@ -132,7 +129,6 @@ extern const std::string kInsertRemoteRpc; extern const std::string kSelectRemoteRpcs; extern const std::string kDeleteRemoteRpc; extern const std::string kDeleteAppGroupPrimary; -extern const std::string kDeleteAppGroupNonPrimary; extern const std::string kDeleteModuleTypes; extern const std::string kDeleteAllDevices; extern const std::string kSelectDBVersion; diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h index e152c040b1..8c3f0ea1c5 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h @@ -101,8 +101,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { enum TypeAccess { kAllowed, kManual }; bool GatherAppGroupPrimary(const std::string& app_id, policy_table::Strings* app_groups) const; - bool GatherAppGroupNonPrimary(const std::string& app_id, - policy_table::Strings* app_groups) const; bool GatherModuleType(const std::string& app_id, policy_table::ModuleTypes* module_types) const; bool GatherRemoteControlDenied(const std::string& app_id, bool* denied) const; @@ -111,8 +109,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const; bool SaveAppGroupPrimary(const std::string& app_id, const policy_table::Strings& app_groups); - bool SaveAppGroupNonPrimary(const std::string& app_id, - const policy_table::Strings& app_groups); bool SaveModuleType(const std::string& app_id, const policy_table::ModuleTypes& types); bool SaveRemoteControlDenied(const std::string& app_id, bool deny); diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 58853ad7e5..f2c768adc9 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -1428,22 +1428,6 @@ void PolicyManagerImpl::OnPrimaryGroupsChanged( } } -void PolicyManagerImpl::OnNonPrimaryGroupsChanged( - const std::string& application_id) { - const std::vector devices = - listener()->GetDevicesIds(application_id); - for (std::vector::const_iterator i = devices.begin(); - i != devices.end(); - ++i) { - const Subject who = {*i, application_id}; - if (access_remote_->IsAppRemoteControl(who) && - !access_remote_->IsPrimaryDevice(who.dev_id) && - access_remote_->IsEnabled()) { - SendAppPermissionsChanged(who.dev_id, who.app_id); - } - } -} - bool PolicyManagerImpl::GetModuleTypes( const std::string& application_id, std::vector* modules) const { diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc index 1d64d50a9a..f0a3c2f160 100644 --- a/src/components/policy/policy_regular/src/sql_pt_queries.cc +++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc @@ -337,26 +337,6 @@ const std::string kCreateSchema = "`app_group_primary.fk_application_has_functional_group_application1_idx` " " ON `app_group_primary`(`application_id`); " - "CREATE TABLE IF NOT EXISTS `app_group_non_primary`( " - " `application_id` VARCHAR(45) NOT NULL, " - " `functional_group_id` INTEGER NOT NULL, " - " PRIMARY KEY(`application_id`,`functional_group_id`), " - " CONSTRAINT `fk_application_has_functional_group_application1` " - " FOREIGN KEY(`application_id`) " - " REFERENCES `application`(`id`), " - " CONSTRAINT `fk_application_has_functional_group_functional_group1` " - " FOREIGN KEY(`functional_group_id`) " - " REFERENCES `functional_group`(`id`) " - "); " - "CREATE INDEX IF NOT EXISTS " - "`app_group_non_primary.fk_application_has_functional_group_functional_" - "group1_idx` " - " ON `app_group_non_primary`(`functional_group_id`); " - "CREATE INDEX IF NOT EXISTS " - "`app_group_non_primary.fk_application_has_functional_group_application1_" - "idx` " - " ON `app_group_non_primary`(`application_id`); " - /* access_module */ "CREATE TABLE `access_module`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -428,9 +408,6 @@ const std::string kInsertInitData = const std::string kDeleteAppGroupPrimary = "DELETE FROM `app_group_primary`"; -const std::string kDeleteAppGroupNonPrimary = - "DELETE FROM `app_group_non_primary`"; - const std::string kDeleteModuleTypes = "DELETE FROM `module_type`"; const std::string kDeleteAllDevices = "DELETE FROM `device`;"; @@ -441,12 +418,6 @@ const std::string kSelectAppGroupsPrimary = " ON (`f`.`id` = `a`.`functional_group_id`)" " WHERE `a`.`application_id` = ?"; -const std::string kSelectAppGroupsNonPrimary = - "SELECT `f`.`name` FROM `app_group_non_primary` AS `a`" - " LEFT JOIN `functional_group` AS `f` " - " ON (`f`.`id` = `a`.`functional_group_id`)" - " WHERE `a`.`application_id` = ?"; - const std::string kSelectRemoteControlDenied = "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1"; @@ -454,11 +425,6 @@ const std::string kInsertAppGroupPrimary = "INSERT INTO `app_group_primary` (`application_id`, `functional_group_id`)" " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1"; -const std::string kInsertAppGroupNonPrimary = - "INSERT INTO `app_group_non_primary` (`application_id`, " - "`functional_group_id`)" - " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1"; - const std::string kUpdateRemoteControlDenied = "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?"; @@ -473,9 +439,6 @@ const std::string kInsertAccessModule = const std::string kDeleteAppGroupPrimaryByApplicationId = "DELETE FROM `app_group_primary` WHERE `application_id` = ?"; -const std::string kDeleteAppGroupNonPrimaryByApplicationId = - "DELETE FROM `app_group_non_primary` WHERE `application_id` = ?"; - const std::string kSelectAccessModules = "SELECT `id`, `name` FROM `access_module` " " WHERE `user_consent_needed` = ?"; @@ -537,13 +500,6 @@ const std::string kDropSchema = "`app_group_primary.fk_application_has_functional_group_functional_group1_" "idx`; " "DROP TABLE IF EXISTS `app_group_primary`; " - "DROP INDEX IF EXISTS " - "`app_group_non_primary.fk_application_has_functional_group_application1_" - "idx`; " - "DROP INDEX IF EXISTS " - "`app_group_non_primary.fk_application_has_functional_group_functional_" - "group1_idx`; " - "DROP TABLE IF EXISTS `app_group_non_primary`; " "DROP TABLE IF EXISTS `access_module`; " "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; " "DROP INDEX IF EXISTS " @@ -593,7 +549,6 @@ const std::string kDeleteData = "DELETE FROM `application`; " "DELETE FROM `rpc`; " "DELETE FROM `app_group_primary`; " - "DELETE FROM `app_group_non_primary`; " "DELETE FROM `access_module`; " "DELETE FROM `version`; " "DELETE FROM `message_type`; " diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 50c4674b07..682c74d0bf 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -878,10 +878,6 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection( LOG4CXX_WARN(logger_, "Incorrect delete from app_group_primary."); return false; } - if (!query_delete.Exec(sql_pt::kDeleteAppGroupNonPrimary)) { - LOG4CXX_WARN(logger_, "Incorrect delete from app_group_non_primary."); - return false; - } if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) { LOG4CXX_WARN(logger_, "Incorrect delete from module_type."); return false; @@ -1560,22 +1556,6 @@ bool SQLPTRepresentation::GatherAppGroupPrimary( return true; } -bool SQLPTRepresentation::GatherAppGroupNonPrimary( - const std::string& app_id, policy_table::Strings* app_groups) const { - utils::dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kSelectAppGroupsNonPrimary)) { - LOG4CXX_WARN(logger_, - "Incorrect select from app groups for non primary RC"); - return false; - } - - query.Bind(0, app_id); - while (query.Next()) { - app_groups->push_back(query.GetString(0)); - } - return true; -} - bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id, bool* denied) const { LOG4CXX_AUTO_TRACE(logger_); @@ -1637,32 +1617,6 @@ bool SQLPTRepresentation::SaveAppGroupPrimary( return true; } -bool SQLPTRepresentation::SaveAppGroupNonPrimary( - const std::string& app_id, const policy_table::Strings& app_groups) { - LOG4CXX_AUTO_TRACE(logger_); - utils::dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kInsertAppGroupNonPrimary)) { - LOG4CXX_WARN(logger_, - "Incorrect insert statement for app group non primary"); - return false; - } - policy_table::Strings::const_iterator it; - for (it = app_groups.begin(); it != app_groups.end(); ++it) { - std::string ssss = *it; - LOG4CXX_INFO(logger_, "Group: " << ssss); - query.Bind(0, app_id); - query.Bind(1, *it); - if (!query.Exec() || !query.Reset()) { - LOG4CXX_WARN(logger_, - "Incorrect insert into app group non primary." - << query.LastError().text()); - return false; - } - } - - return true; -} - bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id, bool deny) { LOG4CXX_AUTO_TRACE(logger_); @@ -1914,18 +1868,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { LOG4CXX_ERROR(logger_, "Failed deleting from app_group_primary."); return false; } - - utils::dbms::SQLQuery query_np(db()); - if (!query_np.Prepare(sql_pt::kDeleteAppGroupNonPrimaryByApplicationId)) { - LOG4CXX_ERROR(logger_, - "Incorrect statement to delete from app_group_non_primary."); - return false; - } - query_np.Bind(0, app_id); - if (!query_np.Exec()) { - LOG4CXX_ERROR(logger_, "Failed deleting from app_group_non_primary."); - return false; - } #endif // SDL_REMOTE_CONTROL if (!CopyApplication(kDefaultId, app_id)) { @@ -1956,9 +1898,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { policy_table::Strings groups_primary; ret = ret && (GatherAppGroupPrimary(kDefaultId, &groups_primary) && SaveAppGroupPrimary(app_id, groups_primary)); - policy_table::Strings groups_non_primary; - ret = ret && (GatherAppGroupNonPrimary(kDefaultId, &groups_non_primary) && - SaveAppGroupNonPrimary(app_id, groups_non_primary)); #endif // SDL_REMOTE_CONTROL if (ret) { diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index 3ccc14ded3..58b2b28787 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -235,12 +235,8 @@ TEST(AccessRemoteImplTest, GetGroups) { const policy_table::Strings& groups2 = access_remote.GetGroups(who); EXPECT_EQ(std::string("group_primary"), std::string(groups2[0])); - // Non primary groups apps["1234"].set_to_string(policy::kDefaultId); Subject who2 = {"dev2", "1234"}; - access_remote.hmi_types_[who2].push_back(policy_table::AHT_REMOTE_CONTROL); - const policy_table::Strings& groups3 = access_remote.GetGroups(who2); - EXPECT_EQ(std::string("group_non_primary"), std::string(groups3[0])); // Empty groups access_remote.enabled_ = false; -- cgit v1.2.1 From 16a5d05781d5c59a0f5180b706e7ae27bd0a8ef7 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Sun, 20 Aug 2017 14:12:03 +0300 Subject: Removes passenger-related logic from policy --- src/appMain/sdl_preloaded_pt.json | 9 ------ .../application_manager/policies/policy_handler.h | 6 ---- .../src/policies/policy_handler.cc | 24 --------------- .../test/rc_policy_handler_test.cc | 3 -- .../policies/policy_handler_interface.h | 6 ---- .../policy/policy_external/policy/policy_manager.h | 8 ----- .../policy/policy_regular/policy/policy_listener.h | 5 ---- .../policy/policy_regular/policy/policy_manager.h | 8 ----- .../policies/mock_policy_handler_interface.h | 2 -- .../policy_external/policy/mock_policy_manager.h | 3 -- .../policy_regular/policy/mock_policy_manager.h | 3 -- .../include/policy/policy_manager_impl.h | 5 ---- .../policy_external/include/policy/policy_types.h | 1 - .../policy_external/src/access_remote_impl.cc | 2 -- .../policy_external/src/policy_manager_impl.cc | 34 ---------------------- .../include/policy/policy_manager_impl.h | 5 ---- .../policy_regular/include/policy/policy_types.h | 1 - .../policy_regular/src/access_remote_impl.cc | 2 -- .../policy_regular/src/policy_manager_impl.cc | 33 --------------------- .../test/policy_manager_impl_test.cc | 9 ------ src/components/remote_control/remote_sdl_pt.json | 7 ----- .../remote_control/test/src/rc_module_test.cc | 17 ----------- 22 files changed, 193 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index 18bfe69e6d..ebf38b42b3 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -2378,15 +2378,6 @@ "priority": "NONE", "default_hmi": "NONE", "groups": ["BaseBeforeDataConsent"] - }, - "pre_consent_passengersRC": { - "default_hmi": "NONE", - "groups": [ - "pre_BaseRC-1" - ], - "keep_context": false, - "priority": "NONE", - "steal_focus": false } } } diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index afc33ff440..be7fe3e5f2 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -215,12 +215,6 @@ class PolicyHandler : public PolicyHandlerInterface, */ bool GetRemoteControl() const OVERRIDE; - /** - * @brief Notifies passengers' apps about change - * @param new_consent New value of remote permission - */ - void OnRemoteAllowedChanged(bool new_consent) OVERRIDE; - /** * @brief Notifies Remote apps about change in permissions * @param device_id Device on which app is running diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 76913127f3..ad1bb499da 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -2108,8 +2108,6 @@ uint32_t PolicyHandler::PrimaryDevice() const { void PolicyHandler::SetRemoteControl(bool enabled) { POLICY_LIB_CHECK_VOID(); policy_manager_->SetRemoteControl(enabled); - - OnRemoteAllowedChanged(enabled); } bool PolicyHandler::GetRemoteControl() const { @@ -2117,28 +2115,6 @@ bool PolicyHandler::GetRemoteControl() const { return policy_manager_->GetRemoteControl(); } -void PolicyHandler::OnRemoteAllowedChanged(bool /*new_consent*/) { - POLICY_LIB_CHECK_VOID(); - connection_handler::DeviceHandle device_handle = PrimaryDevice(); - - DataAccessor accessor = application_manager_.applications(); - for (ApplicationSetConstIt i = accessor.GetData().begin(); - i != accessor.GetData().end(); - ++i) { - const ApplicationSharedPtr app = *i; - LOG4CXX_DEBUG(logger_, - "Item: " << app->device() << " - " << app->policy_app_id()); - if (app->device() != device_handle) { - LOG4CXX_DEBUG(logger_, - "Send notify " << app->device() << " - " - << app->policy_app_id()); - std::string mac = MessageHelper::GetDeviceMacAddressForHandle( - app->device(), application_manager_); - policy_manager_->OnChangedRemoteControl(mac, app->policy_app_id()); - } - } -} - void PolicyHandler::OnRemoteAppPermissionsChanged( const std::string& device_id, const std::string& application_id) { POLICY_LIB_CHECK_VOID(); diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index 013ec5a64a..6e44e4a0d6 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -455,9 +455,6 @@ TEST_F(RCPolicyHandlerTest, SetRemoteControl_SUCCESS) { GetDeviceMacAddressForHandle(app_device_handle, _)) .WillOnce(Return(kMacAddr_)); - EXPECT_CALL(*mock_policy_manager_, - OnChangedRemoteControl(kMacAddr_, kPolicyAppId_)); - policy_handler_.SetRemoteControl(enabled); } diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index 5a101a8b93..cb49f23b48 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -522,12 +522,6 @@ class PolicyHandlerInterface { */ virtual bool GetRemoteControl() const = 0; - /** - * @brief Notifies passengers' apps about change - * @param new_consent New value of remote permission - */ - virtual void OnRemoteAllowedChanged(bool new_consent) = 0; - /** * @brief Notifies Remote apps about change in permissions * @param device_id Device on which app is running diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 2c5b41f410..6bdf707f46 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -602,14 +602,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { virtual void OnChangedPrimaryDevice(const std::string& device_id, const std::string& application_id) = 0; - /** - * Handles changed remote control event for a application - * @param device_id Device on which app is running - * @param application_id ID application - */ - virtual void OnChangedRemoteControl(const std::string& device_id, - const std::string& application_id) = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/policy/policy_regular/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h index 2c5bb765f0..5091d5b33e 100644 --- a/src/components/include/policy/policy_regular/policy/policy_listener.h +++ b/src/components/include/policy/policy_regular/policy/policy_listener.h @@ -130,11 +130,6 @@ class PolicyListener { virtual void OnUpdateHMILevel(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level) = 0; - /** - * @brief Signal that country_consent field was updated during PTU - * @param new_consent New value of country_consent - */ - virtual void OnRemoteAllowedChanged(bool new_consent) = 0; /** * @brief Notifies Remote apps about change in permissions diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index 1e554c87b7..d1dc7c7bb2 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -576,14 +576,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { virtual void OnChangedPrimaryDevice(const std::string& device_id, const std::string& application_id) = 0; - /** - * Handles changed remote control event for a application - * @param device_id Device on which app is running - * @param application_id ID application - */ - virtual void OnChangedRemoteControl(const std::string& device_id, - const std::string& application_id) = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index a8953b1838..00682372f5 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -268,8 +268,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { MOCK_CONST_METHOD0(GetRemoteControl, bool()); - MOCK_METHOD1(OnRemoteAllowedChanged, void(bool new_consent)); - MOCK_METHOD2(OnRemoteAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 500026f840..4718e22c1b 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -178,9 +178,6 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(OnChangedPrimaryDevice, void(const std::string& device_id, const std::string& application_id)); - MOCK_METHOD2(OnChangedRemoteControl, - void(const std::string& device_id, - const std::string& application_id)); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index eaaad2b9bf..dbbebef13b 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -177,9 +177,6 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(OnChangedPrimaryDevice, void(const std::string& device_id, const std::string& application_id)); - MOCK_METHOD2(OnChangedRemoteControl, - void(const std::string& device_id, - const std::string& application_id)); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 6e3b98503d..95d654bc18 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -199,9 +199,6 @@ class PolicyManagerImpl : public PolicyManager { void CheckPTUUpdatesChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot); - bool CheckPTURemoteCtrlChange( - const utils::SharedPtr pt_update, - const utils::SharedPtr snapshot); void CheckRemoteGroupsChange( const utils::SharedPtr pt_update, @@ -404,8 +401,6 @@ class PolicyManagerImpl : public PolicyManager { virtual bool GetRemoteControl() const; virtual void OnChangedPrimaryDevice(const std::string& device_id, const std::string& application_id); - virtual void OnChangedRemoteControl(const std::string& device_id, - const std::string& application_id); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h index 375d4b4b59..ab95659917 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -56,7 +56,6 @@ const std::string kDefaultDeviceConnectionType = "UNKNOWN"; */ const std::string kPreDataConsentId = "pre_DataConsent"; const std::string kDefaultId = "default"; -const std::string kPreConsentPassengersRC = "pre_consent_passengersRC"; const std::string kDeviceId = "device"; const std::string kPrimary = "rc_primaryDevice"; diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index 115b207799..4e6b49c2dd 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -293,8 +293,6 @@ const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { if (IsPrimaryDevice(who.dev_id)) { return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] .groups_primaryRC; - } else { - return cache_->GetGroups(kPreConsentPassengersRC); } } return cache_->GetGroups(who.app_id); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 93521b61b1..3e6cb62ecc 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -2088,27 +2088,6 @@ void PolicyManagerImpl::OnChangedPrimaryDevice( SendAppPermissionsChanged(who.dev_id, who.app_id); } -void PolicyManagerImpl::OnChangedRemoteControl( - const std::string& device_id, const std::string& application_id) { - LOG4CXX_AUTO_TRACE(logger_); - Subject who = {device_id, application_id}; - if (!access_remote_->IsAppRemoteControl(who)) { - LOG4CXX_INFO(logger_, "Application " << who << " isn't remote"); - return; - } - - if (access_remote_->IsPrimaryDevice(who.dev_id)) { - LOG4CXX_INFO(logger_, "Device " << who.dev_id << " is primary"); - return; - } - - if (!access_remote_->IsEnabled()) { - SendHMILevelChanged(who); - } - - SendAppPermissionsChanged(who.dev_id, who.app_id); -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { @@ -2155,22 +2134,9 @@ void PolicyManagerImpl::SendAppPermissionsChanged( void PolicyManagerImpl::CheckPTUUpdatesChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot) { - CheckPTURemoteCtrlChange(pt_update, snapshot); CheckRemoteGroupsChange(pt_update, snapshot); } -bool PolicyManagerImpl::CheckPTURemoteCtrlChange( - const utils::SharedPtr pt_update, - const utils::SharedPtr snapshot) { - LOG4CXX_AUTO_TRACE(logger_); - - // TODO: Rework - - const bool is_allowed = true; - listener()->OnRemoteAllowedChanged(is_allowed); - return is_allowed; -} - void PolicyManagerImpl::CheckRemoteGroupsChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot) { diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 65b186e939..74dbeff3c9 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -199,9 +199,6 @@ class PolicyManagerImpl : public PolicyManager { void CheckPTUUpdatesChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot); - bool CheckPTURemoteCtrlChange( - const utils::SharedPtr pt_update, - const utils::SharedPtr snapshot); void CheckRemoteGroupsChange( const utils::SharedPtr pt_update, @@ -375,8 +372,6 @@ class PolicyManagerImpl : public PolicyManager { virtual bool GetRemoteControl() const; virtual void OnChangedPrimaryDevice(const std::string& device_id, const std::string& application_id); - virtual void OnChangedRemoteControl(const std::string& device_id, - const std::string& application_id); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h index 09df043197..25aa126a03 100644 --- a/src/components/policy/policy_regular/include/policy/policy_types.h +++ b/src/components/policy/policy_regular/include/policy/policy_types.h @@ -56,7 +56,6 @@ const std::string kDefaultDeviceConnectionType = "UNKNOWN"; */ const std::string kPreDataConsentId = "pre_DataConsent"; const std::string kDefaultId = "default"; -const std::string kPreConsentPassengersRC = "pre_consent_passengersRC"; const std::string kDeviceId = "device"; /* diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index 8235ede280..a501cf05fa 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -295,8 +295,6 @@ const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { return *cache_->pt() ->policy_table.app_policies_section.apps[who.app_id] .groups_primaryRC; - } else { - return cache_->GetGroups(kPreConsentPassengersRC); } } return cache_->GetGroups(who.app_id); diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index f2c768adc9..f2ce3a0e5d 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -1318,27 +1318,6 @@ void PolicyManagerImpl::OnChangedPrimaryDevice( SendAppPermissionsChanged(who.dev_id, who.app_id); } -void PolicyManagerImpl::OnChangedRemoteControl( - const std::string& device_id, const std::string& application_id) { - LOG4CXX_AUTO_TRACE(logger_); - Subject who = {device_id, application_id}; - if (!access_remote_->IsAppRemoteControl(who)) { - LOG4CXX_INFO(logger_, "Application " << who << " isn't remote"); - return; - } - - if (access_remote_->IsPrimaryDevice(who.dev_id)) { - LOG4CXX_INFO(logger_, "Device " << who.dev_id << " is primary"); - return; - } - - if (!access_remote_->IsEnabled()) { - SendHMILevelChanged(who); - } - - SendAppPermissionsChanged(who.dev_id, who.app_id); -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { @@ -1385,21 +1364,9 @@ void PolicyManagerImpl::SendAppPermissionsChanged( void PolicyManagerImpl::CheckPTUUpdatesChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot) { - CheckPTURemoteCtrlChange(pt_update, snapshot); CheckRemoteGroupsChange(pt_update, snapshot); } -bool PolicyManagerImpl::CheckPTURemoteCtrlChange( - const utils::SharedPtr pt_update, - const utils::SharedPtr snapshot) { - LOG4CXX_AUTO_TRACE(logger_); - const bool is_allowed = true; - - // TODO: Rework - listener()->OnRemoteAllowedChanged(is_allowed); - return is_allowed; -} - void PolicyManagerImpl::CheckRemoteGroupsChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot) { diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc index 799b6c2999..f76e856cd0 100644 --- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc @@ -175,15 +175,6 @@ class PolicyManagerImplTest : public ::testing::Test { return ::testing::AssertionFailure() << ::rpc::PrettyFormat(report); } } - -#ifdef SDL_REMOTE_CONTROL - public: - bool CheckPTURemoteCtrlChange( - const utils::SharedPtr pt_update, - const utils::SharedPtr snapshot) { - return manager->CheckPTURemoteCtrlChange(pt_update, snapshot); - } -#endif // SDL_REMOTE_CONTROL }; class PolicyManagerImplTest2 : public ::testing::Test { diff --git a/src/components/remote_control/remote_sdl_pt.json b/src/components/remote_control/remote_sdl_pt.json index 7d864c3fa4..fc766bc0a9 100644 --- a/src/components/remote_control/remote_sdl_pt.json +++ b/src/components/remote_control/remote_sdl_pt.json @@ -2322,13 +2322,6 @@ "groups": ["Base-4"], "groups_primaryRC": ["Base-4", "RemoteControl"] }, - "pre_consent_passengersRC": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi":"NONE", - "groups": ["pre_BaseRC-1"] - }, "device": { "keep_context": false, "steal_focus": false, diff --git a/src/components/remote_control/test/src/rc_module_test.cc b/src/components/remote_control/test/src/rc_module_test.cc index ffbceb04fd..556bcd018c 100644 --- a/src/components/remote_control/test/src/rc_module_test.cc +++ b/src/components/remote_control/test/src/rc_module_test.cc @@ -308,21 +308,4 @@ TEST_F(RCModuleTest, CanAppChangeHMILevelPrimary) { app0_, mobile_apis::HMILevel::eType::HMI_NONE)); } -TEST_F(RCModuleTest, CanAppChangeHMILevelPassenger) { - apps_.push_back(app0_); - - rc_app_extention_->set_is_on_driver_device(false); - - EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) - .WillRepeatedly(Return(rc_app_extention_)); - - ASSERT_FALSE(module_.CanAppChangeHMILevel( - app0_, mobile_apis::HMILevel::eType::HMI_FULL)); - ASSERT_FALSE(module_.CanAppChangeHMILevel( - app0_, mobile_apis::HMILevel::eType::HMI_LIMITED)); - ASSERT_TRUE(module_.CanAppChangeHMILevel( - app0_, mobile_apis::HMILevel::eType::HMI_BACKGROUND)); - ASSERT_TRUE(module_.CanAppChangeHMILevel( - app0_, mobile_apis::HMILevel::eType::HMI_NONE)); -} } // namespace remote_control -- cgit v1.2.1 From 23ba6379252184a134830ea7afbd3fe552de6d7f Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Sun, 20 Aug 2017 14:20:01 +0300 Subject: Removes unused ModuleHelper class --- src/components/remote_control/src/remote_control_plugin.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc index 7df615b592..449379f4bc 100644 --- a/src/components/remote_control/src/remote_control_plugin.cc +++ b/src/components/remote_control/src/remote_control_plugin.cc @@ -37,7 +37,6 @@ #include "remote_control/rc_app_extension.h" #include "remote_control/message_helper.h" #include "remote_control/policy_helper.h" -#include "remote_control/module_helper.h" #include "utils/logger.h" #include "interfaces/MOBILE_API.h" #include "utils/macro.h" -- cgit v1.2.1 From b0b3b2fc4fb65d65ba7aa87a28bb0aa107a06498 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Sun, 20 Aug 2017 17:07:41 +0300 Subject: Removes primary device handling logic --- .../include/application_manager/core_service.h | 16 ---- .../application_manager/policies/policy_handler.h | 16 ---- .../include/application_manager/service.h | 16 ---- .../application_manager/src/core_service.cc | 21 ----- .../src/policies/policy_handler.cc | 80 ------------------- .../test/rc_policy_handler_test.cc | 93 ---------------------- .../include/functional_module/generic_module.h | 18 ----- .../include/functional_module/plugin_manager.h | 15 ---- .../functional_module/src/plugin_manager.cc | 35 -------- .../test/include/driver_generic_module_test.h | 2 - .../functional_module/test/include/mock_service.h | 3 - .../test/plugins/mock_generic_module.h | 5 -- .../test/src/plugin_manager_test.cc | 53 ------------ .../policies/policy_handler_interface.h | 16 ---- .../policy/policy_external/policy/policy_manager.h | 25 ------ .../policy/policy_regular/policy/policy_manager.h | 25 ------ .../policies/mock_policy_handler_interface.h | 6 -- .../policy_external/policy/mock_policy_manager.h | 7 -- .../policy_regular/policy/mock_policy_manager.h | 7 -- .../policy_external/include/policy/access_remote.h | 19 ----- .../include/policy/access_remote_impl.h | 5 -- .../include/policy/policy_manager_impl.h | 5 -- .../policy_external/include/policy/policy_types.h | 1 - .../policy_external/src/access_remote_impl.cc | 24 +----- .../policy_external/src/policy_manager_impl.cc | 30 +------ .../test/include/policy/mock_access_remote.h | 3 - .../policy_regular/include/policy/access_remote.h | 19 ----- .../include/policy/access_remote_impl.h | 5 -- .../include/policy/policy_manager_impl.h | 5 -- .../policy_regular/src/access_remote_impl.cc | 26 ++---- .../policy_regular/src/policy_manager_impl.cc | 30 +------ .../policy_regular/test/access_remote_impl_test.cc | 1 - .../test/include/policy/mock_access_remote.h | 4 - .../remote_control/commands/base_command_request.h | 3 - .../include/remote_control/policy_helper.h | 11 --- .../include/remote_control/rc_app_extension.h | 8 -- .../include/remote_control/remote_control_plugin.h | 15 ---- .../remote_control/remote_plugin_interface.h | 16 ---- .../src/commands/base_command_request.cc | 21 ----- src/components/remote_control/src/policy_helper.cc | 30 ------- .../remote_control/src/remote_control_plugin.cc | 29 ------- .../test/include/mock_remote_control_plugin.h | 5 -- .../test/src/rc_app_extension_test.cc | 8 -- .../remote_control/test/src/rc_module_test.cc | 59 -------------- 44 files changed, 11 insertions(+), 830 deletions(-) diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index 9a89bf51a1..2ff5a8ed79 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -117,22 +117,6 @@ class CoreService : public Service { */ uint32_t GetDeviceHandlerById(const std::string& device_id) FINAL; - /** - * Sets device as primary device - * @param dev_id ID device - */ - void SetPrimaryDevice(const uint32_t dev_id) FINAL; - - /** - * Resets driver's device - */ - void ResetPrimaryDevice() FINAL; - - /** - * Return id of primary device - */ - uint32_t PrimaryDevice() const FINAL; - /** * Sets mode of remote control (on/off) * @param enabled true if remote control is turned on diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index be7fe3e5f2..0b1445039a 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -187,22 +187,6 @@ class PolicyHandler : public PolicyHandlerInterface, */ void ResetAccess(const std::string& module) OVERRIDE; - /** - * Sets device as primary device - * @param dev_id ID device - */ - void SetPrimaryDevice(const PTString& dev_id) OVERRIDE; - - /** - * Resets driver's device - */ - void ResetPrimaryDevice() OVERRIDE; - - /** - * Return id of primary device - */ - uint32_t PrimaryDevice() const OVERRIDE; - /** * Sets mode of remote control (on/off) * @param enabled true if remote control is turned on diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index 9f59d58c26..c1666554be 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -117,22 +117,6 @@ class Service { */ virtual uint32_t GetDeviceHandlerById(const std::string& device_id) = 0; - /** - * Sets device as primary device - * @param dev_id ID device - */ - virtual void SetPrimaryDevice(const uint32_t dev_id) = 0; - - /** - * Resets driver's device - */ - virtual void ResetPrimaryDevice() = 0; - - /** - * Return id of primary device - */ - virtual uint32_t PrimaryDevice() const = 0; - /** * Sets mode of remote control (on/off) * @param enabled true if remote control is turned on diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index f30115443f..dd37484591 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -147,27 +147,6 @@ uint32_t CoreService::GetDeviceHandlerById(const std::string& device_id) { return device_handle; } -void CoreService::SetPrimaryDevice(const uint32_t dev_id) { -#ifdef SDL_REMOTE_CONTROL - std::string device_handle = - MessageHelper::GetDeviceMacAddressForHandle(dev_id, application_manager_); - application_manager_.GetPolicyHandler().SetPrimaryDevice(device_handle); -#endif // SDL_REMOTE_CONTROL -} - -void CoreService::ResetPrimaryDevice() { -#ifdef SDL_REMOTE_CONTROL - application_manager_.GetPolicyHandler().ResetPrimaryDevice(); -#endif // SDL_REMOTE_CONTROL -} - -uint32_t CoreService::PrimaryDevice() const { -#ifdef SDL_REMOTE_CONTROL - return application_manager_.GetPolicyHandler().PrimaryDevice(); -#endif // SDL_REMOTE_CONTROL - return 0; -} - void CoreService::SetRemoteControl(bool enabled) { #ifdef SDL_REMOTE_CONTROL application_manager_.GetPolicyHandler().SetRemoteControl(enabled); diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index ad1bb499da..bf5d19eed6 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -2025,86 +2025,6 @@ void PolicyHandler::ResetAccess(const std::string& module) { policy_manager_->ResetAccess(module); } -void PolicyHandler::SetPrimaryDevice(const PTString& dev_id) { - using namespace application_manager; - POLICY_LIB_CHECK_VOID(); - PTString old_dev_id = policy_manager_->PrimaryDevice(); - if (dev_id == old_dev_id) { - LOG4CXX_INFO(logger_, "Driver's device has not changed."); - return; - } - policy_manager_->SetPrimaryDevice(dev_id); - - connection_handler::DeviceHandle old_device_handle; - application_manager_.connection_handler().GetDeviceID(old_dev_id, - &old_device_handle); - - connection_handler::DeviceHandle device_handle; - application_manager_.connection_handler().GetDeviceID(dev_id, &device_handle); - - LOG4CXX_DEBUG(logger_, - "Old: " << old_dev_id << "(" << old_device_handle << ")" - << "New: " << dev_id << "(" << device_handle << ")"); - std::map devices; - devices[device_handle] = dev_id; - devices[old_device_handle] = old_dev_id; - DataAccessor accessor = application_manager_.applications(); - for (ApplicationSetConstIt i = accessor.GetData().begin(); - i != accessor.GetData().end(); - ++i) { - const ApplicationSharedPtr app = *i; - LOG4CXX_DEBUG(logger_, - "Item: " << app->device() << " - " << app->policy_app_id()); - if (devices.find(app->device()) != devices.end()) { - LOG4CXX_DEBUG(logger_, - "Send notify " << app->device() << " - " - << app->policy_app_id()); - policy_manager_->OnChangedPrimaryDevice(devices[app->device()], - app->policy_app_id()); - } - } -} - -void PolicyHandler::ResetPrimaryDevice() { - POLICY_LIB_CHECK_VOID(); - PTString old_dev_id = policy_manager_->PrimaryDevice(); - policy_manager_->ResetPrimaryDevice(); - - connection_handler::DeviceHandle old_device_handle; - application_manager_.connection_handler().GetDeviceID(old_dev_id, - &old_device_handle); - - LOG4CXX_DEBUG(logger_, - "Old: " << old_dev_id << "(" << old_device_handle << ")"); - - DataAccessor accessor = application_manager_.applications(); - for (ApplicationSetConstIt i = accessor.GetData().begin(); - i != accessor.GetData().end(); - ++i) { - const ApplicationSharedPtr app = *i; - LOG4CXX_DEBUG(logger_, - "Item: " << app->device() << " - " << app->policy_app_id()); - if (app->device() == old_device_handle) { - LOG4CXX_DEBUG(logger_, - "Send notify " << app->device() << " - " - << app->policy_app_id()); - policy_manager_->OnChangedPrimaryDevice(old_dev_id, app->policy_app_id()); - } - } -} - -uint32_t PolicyHandler::PrimaryDevice() const { - POLICY_LIB_CHECK(0); - PTString device_id = policy_manager_->PrimaryDevice(); - connection_handler::DeviceHandle device_handle; - if (application_manager_.connection_handler().GetDeviceID(device_id, - &device_handle)) { - return device_handle; - } else { - return 0; - } -} - void PolicyHandler::SetRemoteControl(bool enabled) { POLICY_LIB_CHECK_VOID(); policy_manager_->SetRemoteControl(enabled); diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index 6e44e4a0d6..7c24b84acb 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -330,100 +330,10 @@ TEST_F(RCPolicyHandlerTest, CheckModule_SUCCESS) { EXPECT_TRUE(policy_handler_.CheckModule(kPolicyAppId_, module)); } -TEST_F(RCPolicyHandlerTest, SetPrimaryDevice_EqualDeviceId_UNSUCCESS) { - EnablePolicyAndPolicyManagerMock(); - - EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) - .WillOnce(Return(kDeviceId_)); - - policy_handler_.SetPrimaryDevice(kDeviceId_); -} - ACTION_P(SetDeviceHandle, handle) { *arg1 = handle; } -TEST_F(RCPolicyHandlerTest, SetPrimaryDevice_DifferentSUCCESS) { - EnablePolicyAndPolicyManagerMock(); - const PTString old_device_id("00:00:00:00:00:01"); - - EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) - .WillOnce(Return(old_device_id)); - EXPECT_CALL(*mock_policy_manager_, SetPrimaryDevice(kDeviceId_)); - - connection_handler::DeviceHandle old_device_handle(1u); - EXPECT_CALL(conn_handler, GetDeviceID(old_device_id, _)) - .WillOnce(DoAll(SetDeviceHandle(old_device_handle), Return(true))); - - connection_handler::DeviceHandle device_handle(2u); - EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) - .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(true))); - - test_app.insert(mock_app_); - EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set)); - - EXPECT_CALL(*mock_app_, device()) - .WillOnce(Return(device_handle)) - .WillOnce(Return(device_handle)); - EXPECT_CALL(*mock_app_, policy_app_id()) - .WillRepeatedly(Return(kPolicyAppId_)); - - EXPECT_CALL(*mock_policy_manager_, - OnChangedPrimaryDevice(kDeviceId_, kPolicyAppId_)); - - policy_handler_.SetPrimaryDevice(kDeviceId_); -} - -TEST_F(RCPolicyHandlerTest, ResetPrimaryDevice_DifferenrDevIds_SUCCESS) { - EnablePolicyAndPolicyManagerMock(); - - EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) - .WillOnce(Return(kMacAddr_)); - EXPECT_CALL(*mock_policy_manager_, ResetPrimaryDevice()); - - connection_handler::DeviceHandle old_device_handle(1u); - EXPECT_CALL(conn_handler, GetDeviceID(kMacAddr_, _)) - .WillOnce(DoAll(SetDeviceHandle(old_device_handle), Return(true))); - - test_app.insert(mock_app_); - EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set)); - - EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(old_device_handle)); - EXPECT_CALL(*mock_app_, policy_app_id()) - .WillRepeatedly(Return(kPolicyAppId_)); - - EXPECT_CALL(*mock_policy_manager_, - OnChangedPrimaryDevice(kMacAddr_, kPolicyAppId_)); - - policy_handler_.ResetPrimaryDevice(); -} - -TEST_F(RCPolicyHandlerTest, PrimaryDevice_ValidDeviceHandle_SUCCESS) { - EnablePolicyAndPolicyManagerMock(); - - EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) - .WillOnce(Return(kDeviceId_)); - - connection_handler::DeviceHandle device_handle(1u); - EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) - .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(true))); - - EXPECT_EQ(device_handle, policy_handler_.PrimaryDevice()); -} - -TEST_F(RCPolicyHandlerTest, PrimaryDevice_GetDeviceIdFalse_UNSUCCESS) { - EnablePolicyAndPolicyManagerMock(); - - EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) - .WillOnce(Return(kDeviceId_)); - - connection_handler::DeviceHandle device_handle(1u); - EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) - .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(false))); - - EXPECT_EQ(0u, policy_handler_.PrimaryDevice()); -} - TEST_F(RCPolicyHandlerTest, GetRemoteControl_SUCCESS) { EnablePolicyAndPolicyManagerMock(); EXPECT_CALL(*mock_policy_manager_, GetRemoteControl()).WillOnce(Return(true)); @@ -436,9 +346,6 @@ TEST_F(RCPolicyHandlerTest, SetRemoteControl_SUCCESS) { const bool enabled(true); EXPECT_CALL(*mock_policy_manager_, SetRemoteControl(enabled)); - EXPECT_CALL(*mock_policy_manager_, PrimaryDevice()) - .WillOnce(Return(kDeviceId_)); - connection_handler::DeviceHandle device_handle(1u); EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(true))); diff --git a/src/components/functional_module/include/functional_module/generic_module.h b/src/components/functional_module/include/functional_module/generic_module.h index 9d003f4e28..212ec32185 100644 --- a/src/components/functional_module/include/functional_module/generic_module.h +++ b/src/components/functional_module/include/functional_module/generic_module.h @@ -126,24 +126,6 @@ class GenericModule { application_manager::ApplicationSharedPtr app, mobile_apis::HMILevel::eType old_level) = 0; - /** - * @brief Checks if plugin hasn't put restrictions on app's HMI Level - * @param app App with old HMILevel - * @param new_level HMILevel which is about to be set to app - */ - virtual bool CanAppChangeHMILevel( - application_manager::ApplicationSharedPtr app, - mobile_apis::HMILevel::eType new_level) { - return true; - } - - /** - * Handles removing (disconnecting) device - * @param device removed - */ - virtual void OnDeviceRemoved( - const connection_handler::DeviceHandle& device) = 0; - /** * @brief OnUnregisterApplication handles application unregistering event * @param app_id application id which was unregistered diff --git a/src/components/functional_module/include/functional_module/plugin_manager.h b/src/components/functional_module/include/functional_module/plugin_manager.h index 76efc516fc..ebf0b033c4 100644 --- a/src/components/functional_module/include/functional_module/plugin_manager.h +++ b/src/components/functional_module/include/functional_module/plugin_manager.h @@ -89,21 +89,6 @@ class PluginManager : public ModuleObserver { void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr app, mobile_apis::HMILevel::eType old_level); - /** - * @brief Checks if plugin hasn't put restrictions on app's HMI Level - * @param app App with old HMILevel - * @param new_level HMILevel which is about to be set to app - * @return false if any of the plugins returns false. - */ - bool CanAppChangeHMILevel(application_manager::ApplicationSharedPtr app, - mobile_apis::HMILevel::eType new_level); - - /** - * Handles removing (disconnecting) device - * @param device removed - */ - void OnDeviceRemoved(const connection_handler::DeviceHandle& device); - /** * @brief OnUnregisterApplication handles application unregistering event * @param app_id application id which was unregistered diff --git a/src/components/functional_module/src/plugin_manager.cc b/src/components/functional_module/src/plugin_manager.cc index b74a948f5b..7ebafc3d09 100644 --- a/src/components/functional_module/src/plugin_manager.cc +++ b/src/components/functional_module/src/plugin_manager.cc @@ -334,42 +334,7 @@ void PluginManager::OnAppHMILevelChanged( } } -bool PluginManager::CanAppChangeHMILevel( - application_manager::ApplicationSharedPtr app, - mobile_apis::HMILevel::eType new_level) { - DCHECK_OR_RETURN(app, false); - bool result = true; - for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) { - if (it->second->IsAppForPlugin(app)) { - result = result && it->second->CanAppChangeHMILevel(app, new_level); - LOG4CXX_DEBUG(logger_, - "Application " << app->name().AsMBString() << " of plugin " - << it->second->GetModuleID() << " is " - << (result ? "allowed" : "not allowed") - << " to change level to " << new_level); - } - } - return result; -} - typedef std::map::value_type PluginsValueType; -struct HandleDeviceRemoved { - private: - const connection_handler::DeviceHandle& device_; - - public: - explicit HandleDeviceRemoved(const connection_handler::DeviceHandle& device) - : device_(device) {} - void operator()(PluginsValueType& x) { - x.second->OnDeviceRemoved(device_); - } -}; - -void PluginManager::OnDeviceRemoved( - const connection_handler::DeviceHandle& device) { - LOG4CXX_AUTO_TRACE(logger_); - std::for_each(plugins_.begin(), plugins_.end(), HandleDeviceRemoved(device)); -} struct HandleApplicationUnregistered { private: diff --git a/src/components/functional_module/test/include/driver_generic_module_test.h b/src/components/functional_module/test/include/driver_generic_module_test.h index f41a274055..3e607226c6 100644 --- a/src/components/functional_module/test/include/driver_generic_module_test.h +++ b/src/components/functional_module/test/include/driver_generic_module_test.h @@ -67,8 +67,6 @@ class DriverGenericModuleTest : public GenericModule { return observers_; } - void OnDeviceRemoved(const connection_handler::DeviceHandle&) {} - void OnUnregisterApplication(const uint32_t app_id) {} }; diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index b8e8c40d34..0297855246 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -68,9 +68,6 @@ class MockService : public Service { MOCK_METHOD1(ResetAccess, void(const ApplicationId& app_id)); MOCK_METHOD1(ResetAccess, void(const std::string& module)); MOCK_METHOD1(GetDeviceHandlerById, uint32_t(const std::string& device_id)); - MOCK_METHOD1(SetPrimaryDevice, void(const uint32_t dev_id)); - MOCK_METHOD0(ResetPrimaryDevice, void()); - MOCK_CONST_METHOD0(PrimaryDevice, uint32_t()); MOCK_METHOD1(SetRemoteControl, void(bool enabled)); MOCK_METHOD1(RemoveHMIFakeParameters, void(application_manager::MessagePtr& message)); diff --git a/src/components/functional_module/test/plugins/mock_generic_module.h b/src/components/functional_module/test/plugins/mock_generic_module.h index aef0a68f19..fd9ec7b3ef 100644 --- a/src/components/functional_module/test/plugins/mock_generic_module.h +++ b/src/components/functional_module/test/plugins/mock_generic_module.h @@ -60,12 +60,7 @@ class MockGenericModule : public GenericModule { MOCK_METHOD2(OnAppHMILevelChanged, void(application_manager::ApplicationSharedPtr app, mobile_apis::HMILevel::eType old_level)); - MOCK_METHOD1(OnDeviceRemoved, - void(const connection_handler::DeviceHandle& device)); MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id)); - MOCK_METHOD2(CanAppChangeHMILevel, - bool(application_manager::ApplicationSharedPtr app, - mobile_apis::HMILevel::eType new_level)); MOCK_METHOD0(RemoveAppExtensions, void()); }; diff --git a/src/components/functional_module/test/src/plugin_manager_test.cc b/src/components/functional_module/test/src/plugin_manager_test.cc index 0868c66323..1692e2f06c 100644 --- a/src/components/functional_module/test/src/plugin_manager_test.cc +++ b/src/components/functional_module/test/src/plugin_manager_test.cc @@ -150,57 +150,4 @@ TEST_F(PluginManagerTest, OnAppHMILevelChanged) { mobile_apis::HMILevel::eType::HMI_FULL); } -TEST_F(PluginManagerTest, CanAppChangeHMILevel) { - using test::components::application_manager_test::MockApplication; - NiceMock* app = new NiceMock(); - application_manager::ApplicationSharedPtr app_ptr(app); - - const application_manager::custom_str::CustomString name("name"); - ON_CALL(*app, name()).WillByDefault(ReturnRef(name)); - - Expectation is_for_plugin = - EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(true)); - EXPECT_CALL(*module, CanAppChangeHMILevel(app_ptr, _)) - .Times(1) - .After(is_for_plugin) - .WillOnce(Return(true)); - ASSERT_TRUE(manager->CanAppChangeHMILevel( - app_ptr, mobile_apis::HMILevel::eType::HMI_FULL)); -} - -TEST_F(PluginManagerTest, CanAppChangeHMILevelNegative) { - using test::components::application_manager_test::MockApplication; - NiceMock* app = new NiceMock(); - application_manager::ApplicationSharedPtr app_ptr(app); - - const application_manager::custom_str::CustomString name("name"); - ON_CALL(*app, name()).WillByDefault(ReturnRef(name)); - - Expectation is_for_plugin = - EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(true)); - EXPECT_CALL(*module, CanAppChangeHMILevel(app_ptr, _)) - .Times(1) - .After(is_for_plugin) - .WillOnce(Return(false)); - ASSERT_FALSE(manager->CanAppChangeHMILevel( - app_ptr, mobile_apis::HMILevel::eType::HMI_BACKGROUND)); -} - -TEST_F(PluginManagerTest, CanAppChangeHMILevelNotForPlugin) { - using test::components::application_manager_test::MockApplication; - NiceMock* app = new NiceMock(); - application_manager::ApplicationSharedPtr app_ptr(app); - - const application_manager::custom_str::CustomString name("name"); - ON_CALL(*app, name()).WillByDefault(ReturnRef(name)); - - Expectation is_for_plugin = - EXPECT_CALL(*module, IsAppForPlugin(app_ptr)).WillOnce(Return(false)); - EXPECT_CALL(*module, CanAppChangeHMILevel(app_ptr, _)) - .Times(0) - .After(is_for_plugin); - ASSERT_TRUE(manager->CanAppChangeHMILevel( - app_ptr, mobile_apis::HMILevel::eType::HMI_BACKGROUND)); -} - } // namespace functional_modules diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index cb49f23b48..e49d86290c 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -494,22 +494,6 @@ class PolicyHandlerInterface { */ virtual void ResetAccess(const std::string& module) = 0; - /** - * Sets device as primary device - * @param dev_id ID device - */ - virtual void SetPrimaryDevice(const PTString& dev_id) = 0; - - /** - * Resets driver's device - */ - virtual void ResetPrimaryDevice() = 0; - - /** - * Return id of primary device - */ - virtual uint32_t PrimaryDevice() const = 0; - /** * Sets mode of remote control (on/off) * @param enabled true if remote control is turned on diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 6bdf707f46..f6d1396be8 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -565,23 +565,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual void ResetAccess(const PTString& module) = 0; - /** - * Sets driver as primary device - * @param dev_id ID device - */ - virtual void SetPrimaryDevice(const PTString& dev_id) = 0; - - /** - * Resets driver's device - */ - virtual void ResetPrimaryDevice() = 0; - - /** - * Gets current primary device - * @return ID device - */ - virtual PTString PrimaryDevice() const = 0; - /** * Sets mode of remote control (on/off) * @param enabled true if remote control is turned on @@ -594,14 +577,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual bool GetRemoteControl() const = 0; - /** - * Handles changed primary device event for a application - * @param device_id Device on which app is running - * @param application_id ID application - */ - virtual void OnChangedPrimaryDevice(const std::string& device_id, - const std::string& application_id) = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index d1dc7c7bb2..da59af08d8 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -539,23 +539,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual void ResetAccess(const PTString& module) = 0; - /** - * Sets driver as primary device - * @param dev_id ID device - */ - virtual void SetPrimaryDevice(const PTString& dev_id) = 0; - - /** - * Resets driver's device - */ - virtual void ResetPrimaryDevice() = 0; - - /** - * Gets current primary device - * @return ID device - */ - virtual PTString PrimaryDevice() const = 0; - /** * Sets mode of remote control (on/off) * @param enabled true if remote control is turned on @@ -568,14 +551,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual bool GetRemoteControl() const = 0; - /** - * Handles changed primary device event for a application - * @param device_id Device on which app is running - * @param application_id ID application - */ - virtual void OnChangedPrimaryDevice(const std::string& device_id, - const std::string& application_id) = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index 00682372f5..2acbb16032 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -258,12 +258,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { MOCK_METHOD1(ResetAccess, void(const std::string& module)); - MOCK_METHOD1(SetPrimaryDevice, void(const policy::PTString& dev_id)); - - MOCK_METHOD0(ResetPrimaryDevice, void()); - - MOCK_CONST_METHOD0(PrimaryDevice, uint32_t()); - MOCK_METHOD1(SetRemoteControl, void(bool enabled)); MOCK_CONST_METHOD0(GetRemoteControl, bool()); diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 4718e22c1b..3739d96caf 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -169,15 +169,8 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(ResetAccess, void(const PTString& dev_id, const PTString& app_id)); MOCK_METHOD1(ResetAccess, void(const PTString& module)); - MOCK_METHOD1(SetPrimaryDevice, void(const PTString& dev_id)); - MOCK_METHOD0(ResetPrimaryDevice, void()); - MOCK_CONST_METHOD0(PrimaryDevice, PTString()); - MOCK_METHOD1(SetRemoteControl, void(bool enabled)); MOCK_CONST_METHOD0(GetRemoteControl, bool()); - MOCK_METHOD2(OnChangedPrimaryDevice, - void(const std::string& device_id, - const std::string& application_id)); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index dbbebef13b..551b711ea0 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -168,15 +168,8 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(ResetAccess, void(const PTString& dev_id, const PTString& app_id)); MOCK_METHOD1(ResetAccess, void(const PTString& module)); - MOCK_METHOD1(SetPrimaryDevice, void(const PTString& dev_id)); - MOCK_METHOD0(ResetPrimaryDevice, void()); - MOCK_CONST_METHOD0(PrimaryDevice, PTString()); - MOCK_METHOD1(SetRemoteControl, void(bool enabled)); MOCK_CONST_METHOD0(GetRemoteControl, bool()); - MOCK_METHOD2(OnChangedPrimaryDevice, - void(const std::string& device_id, - const std::string& application_id)); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h index 4a98c61dbb..33524bf229 100644 --- a/src/components/policy/policy_external/include/policy/access_remote.h +++ b/src/components/policy/policy_external/include/policy/access_remote.h @@ -114,25 +114,6 @@ class AccessRemote { */ virtual bool IsEnabled() const = 0; - /** - * Checks whether device is driver's device - * @param dev_id unique device id - * @return true if device is have driver - */ - virtual bool IsPrimaryDevice(const PTString& dev_id) const = 0; - - /** - * Sets device as driver's device - * @param dev_id ID device - */ - virtual void SetPrimaryDevice(const PTString& dev_id) = 0; - - /** - * Gets current primary device - * @return ID device - */ - virtual PTString PrimaryDevice() const = 0; - /** * Allows access subject to object * @param who subject is dev_id and app_id diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h index 72223dccab..749edd6ce2 100644 --- a/src/components/policy/policy_external/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h @@ -53,10 +53,6 @@ class AccessRemoteImpl : public AccessRemote { virtual void Disable(); virtual bool IsEnabled() const; - virtual bool IsPrimaryDevice(const PTString& dev_id) const; - virtual void SetPrimaryDevice(const PTString& dev_id); - virtual PTString PrimaryDevice() const; - virtual void Allow(const Subject& who, const Object& what); virtual void Deny(const Subject& who, const Object& what); virtual void Reset(const Subject& who); @@ -92,7 +88,6 @@ class AccessRemoteImpl : public AccessRemote { bool CompareParameters(const policy_table::Strings& parameters, RemoteControlParams* input) const; utils::SharedPtr cache_; - PTString primary_device_; bool enabled_; AccessControlList acl_; HMIList hmi_types_; diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 95d654bc18..653dbf5281 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -394,13 +394,8 @@ class PolicyManagerImpl : public PolicyManager { bool allowed); virtual void ResetAccess(const PTString& dev_id, const PTString& app_id); virtual void ResetAccess(const PTString& module); - virtual void SetPrimaryDevice(const PTString& dev_id); - virtual void ResetPrimaryDevice(); - virtual PTString PrimaryDevice() const; virtual void SetRemoteControl(bool enabled); virtual bool GetRemoteControl() const; - virtual void OnChangedPrimaryDevice(const std::string& device_id, - const std::string& application_id); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h index ab95659917..9ba1a1cfff 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -57,7 +57,6 @@ const std::string kDefaultDeviceConnectionType = "UNKNOWN"; const std::string kPreDataConsentId = "pre_DataConsent"; const std::string kDefaultId = "default"; const std::string kDeviceId = "device"; -const std::string kPrimary = "rc_primaryDevice"; /* *@brief Policy Services specifies Users of Updates diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index 4e6b49c2dd..cbed4aeb5c 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -111,10 +111,10 @@ struct ToModuleType { }; AccessRemoteImpl::AccessRemoteImpl() - : cache_(new CacheManager()), primary_device_(), enabled_(true), acl_() {} + : cache_(new CacheManager()), enabled_(true), acl_() {} AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) - : cache_(cache), primary_device_(), enabled_(true), acl_() {} + : cache_(cache), enabled_(true), acl_() {} void AccessRemoteImpl::Init() { LOG4CXX_AUTO_TRACE(logger_); @@ -125,11 +125,6 @@ void AccessRemoteImpl::Init() { enabled_ = true; } -bool AccessRemoteImpl::IsPrimaryDevice(const PTString& dev_id) const { - LOG4CXX_AUTO_TRACE(logger_); - return primary_device_ == dev_id; -} - TypeAccess AccessRemoteImpl::Check(const Subject& who, const Object& what) const { LOG4CXX_AUTO_TRACE(logger_); @@ -236,15 +231,6 @@ void AccessRemoteImpl::Reset() { acl_.clear(); } -void AccessRemoteImpl::SetPrimaryDevice(const PTString& dev_id) { - LOG4CXX_AUTO_TRACE(logger_); - primary_device_ = dev_id; -} - -PTString AccessRemoteImpl::PrimaryDevice() const { - return primary_device_; -} - void AccessRemoteImpl::Enable() { LOG4CXX_AUTO_TRACE(logger_); set_enabled(true); @@ -290,10 +276,8 @@ const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes( const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { LOG4CXX_AUTO_TRACE(logger_); if (IsAppRemoteControl(who)) { - if (IsPrimaryDevice(who.dev_id)) { - return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] - .groups_primaryRC; - } + return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] + .groups_primaryRC; } return cache_->GetGroups(who.app_id); } diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 3e6cb62ecc..ec618859cd 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -2048,21 +2048,6 @@ void PolicyManagerImpl::ResetAccess(const PTString& module) { access_remote_->Reset(what); } -void PolicyManagerImpl::SetPrimaryDevice(const PTString& dev_id) { - LOG4CXX_AUTO_TRACE(logger_); - access_remote_->SetPrimaryDevice(dev_id); -} - -void PolicyManagerImpl::ResetPrimaryDevice() { - LOG4CXX_AUTO_TRACE(logger_); - access_remote_->SetPrimaryDevice(""); -} - -PTString PolicyManagerImpl::PrimaryDevice() const { - LOG4CXX_AUTO_TRACE(logger_); - return access_remote_->PrimaryDevice(); -} - void PolicyManagerImpl::SetRemoteControl(bool enabled) { LOG4CXX_AUTO_TRACE(logger_); if (enabled) { @@ -2076,18 +2061,6 @@ bool PolicyManagerImpl::GetRemoteControl() const { return access_remote_->IsEnabled(); } -void PolicyManagerImpl::OnChangedPrimaryDevice( - const std::string& device_id, const std::string& application_id) { - LOG4CXX_AUTO_TRACE(logger_); - Subject who = {device_id, application_id}; - if (!access_remote_->IsAppRemoteControl(who)) { - LOG4CXX_INFO(logger_, "Application " << who << " isn't remote"); - return; - } - - SendAppPermissionsChanged(who.dev_id, who.app_id); -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { @@ -2158,8 +2131,7 @@ void PolicyManagerImpl::OnPrimaryGroupsChanged( i != devices.end(); ++i) { const Subject who = {*i, application_id}; - if (access_remote_->IsAppRemoteControl(who) && - access_remote_->IsPrimaryDevice(who.dev_id)) { + if (access_remote_->IsAppRemoteControl(who)) { SendAppPermissionsChanged(who.dev_id, who.app_id); } } diff --git a/src/components/policy/policy_external/test/include/policy/mock_access_remote.h b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h index 01e48805b6..a0cb60fa9a 100644 --- a/src/components/policy/policy_external/test/include/policy/mock_access_remote.h +++ b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h @@ -53,9 +53,6 @@ class MockAccessRemote : public policy::AccessRemote { MOCK_METHOD0(Enable, void()); MOCK_METHOD0(Disable, void()); MOCK_CONST_METHOD0(IsEnabled, bool()); - MOCK_CONST_METHOD1(IsPrimaryDevice, bool(const policy::PTString& dev_id)); - MOCK_METHOD1(SetPrimaryDevice, void(const policy::PTString& dev_id)); - MOCK_CONST_METHOD0(PrimaryDevice, policy::PTString()); MOCK_METHOD2(Allow, void(const policy::Subject& who, const policy::Object& what)); diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h index b9fd8862e9..e0d02f6f36 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote.h +++ b/src/components/policy/policy_regular/include/policy/access_remote.h @@ -117,25 +117,6 @@ class AccessRemote { */ virtual bool IsEnabled() const = 0; - /** - * Checks whether device is driver's device - * @param dev_id unique device id - * @return true if device is have driver - */ - virtual bool IsPrimaryDevice(const PTString& dev_id) const = 0; - - /** - * Sets device as driver's device - * @param dev_id ID device - */ - virtual void SetPrimaryDevice(const PTString& dev_id) = 0; - - /** - * Gets current primary device - * @return ID device - */ - virtual PTString PrimaryDevice() const = 0; - /** * Allows access subject to object * @param who subject is dev_id and app_id diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h index 2faf635f24..d15b707cca 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h @@ -57,10 +57,6 @@ class AccessRemoteImpl : public AccessRemote { virtual void Disable(); virtual bool IsEnabled() const; - virtual bool IsPrimaryDevice(const PTString& dev_id) const; - virtual void SetPrimaryDevice(const PTString& dev_id); - virtual PTString PrimaryDevice() const; - virtual void Allow(const Subject& who, const Object& what); virtual void Deny(const Subject& who, const Object& what); virtual void Reset(const Subject& who); @@ -92,7 +88,6 @@ class AccessRemoteImpl : public AccessRemote { bool CompareParameters(const policy_table::Strings& parameters, RemoteControlParams* input) const; utils::SharedPtr cache_; - PTString primary_device_; bool enabled_; AccessControlList acl_; HMIList hmi_types_; diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 74dbeff3c9..73286414be 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -365,13 +365,8 @@ class PolicyManagerImpl : public PolicyManager { bool allowed); virtual void ResetAccess(const PTString& dev_id, const PTString& app_id); virtual void ResetAccess(const PTString& module); - virtual void SetPrimaryDevice(const PTString& dev_id); - virtual void ResetPrimaryDevice(); - virtual PTString PrimaryDevice() const; virtual void SetRemoteControl(bool enabled); virtual bool GetRemoteControl() const; - virtual void OnChangedPrimaryDevice(const std::string& device_id, - const std::string& application_id); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index a501cf05fa..8d076fbb5b 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -111,10 +111,10 @@ struct ToModuleType { }; AccessRemoteImpl::AccessRemoteImpl() - : cache_(new CacheManager()), primary_device_(), enabled_(true), acl_() {} + : cache_(new CacheManager()), enabled_(true), acl_() {} AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) - : cache_(cache), primary_device_(), enabled_(true), acl_() {} + : cache_(cache), enabled_(true), acl_() {} void AccessRemoteImpl::Init() { LOG4CXX_AUTO_TRACE(logger_); @@ -125,11 +125,6 @@ void AccessRemoteImpl::Init() { enabled_ = true; } -bool AccessRemoteImpl::IsPrimaryDevice(const PTString& dev_id) const { - LOG4CXX_AUTO_TRACE(logger_); - return primary_device_ == dev_id; -} - TypeAccess AccessRemoteImpl::Check(const Subject& who, const Object& what) const { LOG4CXX_AUTO_TRACE(logger_); @@ -236,15 +231,6 @@ void AccessRemoteImpl::Reset() { acl_.clear(); } -void AccessRemoteImpl::SetPrimaryDevice(const PTString& dev_id) { - LOG4CXX_AUTO_TRACE(logger_); - primary_device_ = dev_id; -} - -PTString AccessRemoteImpl::PrimaryDevice() const { - return primary_device_; -} - void AccessRemoteImpl::Enable() { LOG4CXX_AUTO_TRACE(logger_); set_enabled(true); @@ -291,11 +277,9 @@ const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes( const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { LOG4CXX_AUTO_TRACE(logger_); if (IsAppRemoteControl(who)) { - if (IsPrimaryDevice(who.dev_id)) { - return *cache_->pt() - ->policy_table.app_policies_section.apps[who.app_id] - .groups_primaryRC; - } + return *cache_->pt() + ->policy_table.app_policies_section.apps[who.app_id] + .groups_primaryRC; } return cache_->GetGroups(who.app_id); } diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index f2ce3a0e5d..7ca4c5f3ac 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -1278,21 +1278,6 @@ void PolicyManagerImpl::ResetAccess(const PTString& module) { access_remote_->Reset(what); } -void PolicyManagerImpl::SetPrimaryDevice(const PTString& dev_id) { - LOG4CXX_AUTO_TRACE(logger_); - access_remote_->SetPrimaryDevice(dev_id); -} - -void PolicyManagerImpl::ResetPrimaryDevice() { - LOG4CXX_AUTO_TRACE(logger_); - access_remote_->SetPrimaryDevice(""); -} - -PTString PolicyManagerImpl::PrimaryDevice() const { - LOG4CXX_AUTO_TRACE(logger_); - return access_remote_->PrimaryDevice(); -} - void PolicyManagerImpl::SetRemoteControl(bool enabled) { LOG4CXX_AUTO_TRACE(logger_); if (enabled) { @@ -1306,18 +1291,6 @@ bool PolicyManagerImpl::GetRemoteControl() const { return access_remote_->IsEnabled(); } -void PolicyManagerImpl::OnChangedPrimaryDevice( - const std::string& device_id, const std::string& application_id) { - LOG4CXX_AUTO_TRACE(logger_); - Subject who = {device_id, application_id}; - if (!access_remote_->IsAppRemoteControl(who)) { - LOG4CXX_INFO(logger_, "Application " << who << " isn't remote"); - return; - } - - SendAppPermissionsChanged(who.dev_id, who.app_id); -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { @@ -1388,8 +1361,7 @@ void PolicyManagerImpl::OnPrimaryGroupsChanged( i != devices.end(); ++i) { const Subject who = {*i, application_id}; - if (access_remote_->IsAppRemoteControl(who) && - access_remote_->IsPrimaryDevice(who.dev_id)) { + if (access_remote_->IsAppRemoteControl(who)) { SendAppPermissionsChanged(who.dev_id, who.app_id); } } diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index 58b2b28787..ef4151adfa 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -214,7 +214,6 @@ TEST(AccessRemoteImplTest, SetDefaultHmiTypes) { TEST(AccessRemoteImplTest, GetGroups) { AccessRemoteImpl access_remote; - access_remote.primary_device_ = "dev1"; access_remote.enabled_ = true; Subject who = {"dev1", "1234"}; access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL); diff --git a/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h index 8c5bf75ba5..ffd0c5eba0 100644 --- a/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h +++ b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h @@ -53,10 +53,6 @@ class MockAccessRemote : public policy::AccessRemote { MOCK_METHOD0(Enable, void()); MOCK_METHOD0(Disable, void()); MOCK_CONST_METHOD0(IsEnabled, bool()); - MOCK_CONST_METHOD1(IsPrimaryDevice, bool(const policy::PTString& dev_id)); - MOCK_METHOD1(SetPrimaryDevice, void(const policy::PTString& dev_id)); - MOCK_CONST_METHOD0(PrimaryDevice, policy::PTString()); - MOCK_METHOD2(Allow, void(const policy::Subject& who, const policy::Object& what)); MOCK_METHOD2(Deny, diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h index 2ef7f19cec..315acfd6c2 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_request.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h @@ -251,9 +251,6 @@ class BaseCommandRequest private: void CheckHMILevel(application_manager::TypeAccess access, bool hmi_consented = false); - void UpdateHMILevel( - const rc_event_engine::Event& event); /** * @brief CheckPolicyPermissions checks RPC permissions defined in policy diff --git a/src/components/remote_control/include/remote_control/policy_helper.h b/src/components/remote_control/include/remote_control/policy_helper.h index 1ca578c8aa..8d1fcc184b 100644 --- a/src/components/remote_control/include/remote_control/policy_helper.h +++ b/src/components/remote_control/include/remote_control/policy_helper.h @@ -43,17 +43,6 @@ class PolicyHelper { public: static void OnRSDLFunctionalityAllowing(bool allowed, RemotePluginInterface& rc_module); - static void SetIsAppOnPrimaryDevice( - application_manager::ApplicationSharedPtr app, - RemotePluginInterface& rc_module); - - private: - static void MarkApplications(const uint32_t device_handle, - RemotePluginInterface& rc_module); - static void MarkAppOnPrimaryDevice( - application_manager::ApplicationSharedPtr app, - const uint32_t device_handle, - RemotePluginInterface& rc_module); }; } // namespace remote_control diff --git a/src/components/remote_control/include/remote_control/rc_app_extension.h b/src/components/remote_control/include/remote_control/rc_app_extension.h index 07a8eecb67..f9d0cfa84d 100644 --- a/src/components/remote_control/include/remote_control/rc_app_extension.h +++ b/src/components/remote_control/include/remote_control/rc_app_extension.h @@ -59,14 +59,6 @@ class RCAppExtension : public application_manager::AppExtension { */ void GiveControl(bool is_control_given); - bool is_on_driver_device() const { - return is_on_driver_device_; - } - - void set_is_on_driver_device(bool is_driver_dev) { - is_on_driver_device_ = is_driver_dev; - } - /** * @brief Subscribe to OnInteriorVehicleDataNotification * @param module interior data specification(zone, data type) diff --git a/src/components/remote_control/include/remote_control/remote_control_plugin.h b/src/components/remote_control/include/remote_control/remote_control_plugin.h index 9875723f43..85df1d51d1 100644 --- a/src/components/remote_control/include/remote_control/remote_control_plugin.h +++ b/src/components/remote_control/include/remote_control/remote_control_plugin.h @@ -91,21 +91,6 @@ class RemoteControlPlugin : public RemotePluginInterface { void OnAppHMILevelChanged(application_manager::ApplicationSharedPtr app, mobile_apis::HMILevel::eType old_level); - /** - * @brief Checks if plugin hasn't put restrictions on app's HMI Level - * @param app App with old HMILevel - * @param new_level HMILevel which is about to be set to app - */ - virtual bool CanAppChangeHMILevel( - application_manager::ApplicationSharedPtr app, - mobile_apis::HMILevel::eType new_level); - - /** - * Handles removing (disconnecting) device - * @param device removed - */ - void OnDeviceRemoved(const connection_handler::DeviceHandle& device) OVERRIDE; - /** * @brief OnUnregisterApplication handles application unregistering event * @param app_id application id which was unregistered diff --git a/src/components/remote_control/include/remote_control/remote_plugin_interface.h b/src/components/remote_control/include/remote_control/remote_plugin_interface.h index 670d8e1548..64aa7208a5 100644 --- a/src/components/remote_control/include/remote_control/remote_plugin_interface.h +++ b/src/components/remote_control/include/remote_control/remote_plugin_interface.h @@ -94,22 +94,6 @@ class RemotePluginInterface : public functional_modules::GenericModule { application_manager::ApplicationSharedPtr app, mobile_apis::HMILevel::eType old_level) = 0; - /** - * @brief Checks if plugin hasn't put restrictions on app's HMI Level - * @param app App with old HMILevel - * @param new_level HMILevel which is about to be set to app - */ - virtual bool CanAppChangeHMILevel( - application_manager::ApplicationSharedPtr app, - mobile_apis::HMILevel::eType new_level) = 0; - - /** - * Handles removing (disconnecting) device - * @param device removed - */ - virtual void OnDeviceRemoved( - const connection_handler::DeviceHandle& device) = 0; - virtual void SendHmiStatusNotification( application_manager::ApplicationSharedPtr app) = 0; diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index e3b0384e49..32a12ed8fd 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -487,31 +487,10 @@ void BaseCommandRequest::on_event( if (event.id() == functional_modules::hmi_api::get_user_consent) { ProcessAccessResponse(event); } else { - if (auto_allowed()) { - UpdateHMILevel(event); - } OnEvent(event); // run child's logic } } -void BaseCommandRequest::UpdateHMILevel( - const rc_event_engine::Event& - event) { - LOG4CXX_AUTO_TRACE(logger_); - RCAppExtensionPtr extension = GetAppExtension(app_); - if (!extension) { - return; - } - if (!extension->is_on_driver_device()) { - Json::Value value = - MessageHelper::StringToValue(event.event_message()->json_message()); - std::string result_code; - std::string info; - bool success = ParseResultCode(value, result_code, info); - CheckHMILevel(application_manager::kAllowed, success); - } -} - void BaseCommandRequest::ProcessAccessResponse( const rc_event_engine::Event& event) { diff --git a/src/components/remote_control/src/policy_helper.cc b/src/components/remote_control/src/policy_helper.cc index dadb84bd3e..e50233fe2b 100644 --- a/src/components/remote_control/src/policy_helper.cc +++ b/src/components/remote_control/src/policy_helper.cc @@ -44,34 +44,4 @@ void PolicyHelper::OnRSDLFunctionalityAllowing( rc_module.service()->SetRemoteControl(allowed); } -void PolicyHelper::SetIsAppOnPrimaryDevice( - application_manager::ApplicationSharedPtr app, - RemotePluginInterface& rc_module) { - MarkAppOnPrimaryDevice(app, rc_module.service()->PrimaryDevice(), rc_module); -} - -void PolicyHelper::MarkAppOnPrimaryDevice( - application_manager::ApplicationSharedPtr app, - const uint32_t device_handle, - RemotePluginInterface& rc_module) { - application_manager::AppExtensionUID module_id = rc_module.GetModuleID(); - RCAppExtensionPtr extension = - application_manager::AppExtensionPtr::static_pointer_cast( - app->QueryInterface(module_id)); - DCHECK(extension); - bool is_driver = (app->device() == device_handle); - extension->set_is_on_driver_device(is_driver); -} - -void PolicyHelper::MarkApplications(const uint32_t device_handle, - RemotePluginInterface& rc_module) { - application_manager::AppExtensionUID module_id = rc_module.GetModuleID(); - std::vector applications = - rc_module.service()->GetApplications(module_id); - - for (size_t i = 0; i < applications.size(); ++i) { - MarkAppOnPrimaryDevice(applications[i], device_handle, rc_module); - } -} - } // namespace remote_control diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc index 449379f4bc..5ecc587cfd 100644 --- a/src/components/remote_control/src/remote_control_plugin.cc +++ b/src/components/remote_control/src/remote_control_plugin.cc @@ -296,8 +296,6 @@ bool RemoteControlPlugin::IsAppForPlugin( RCAppExtensionPtr rc_app_extension = new RCAppExtension(GetModuleID()); app->AddExtension(rc_app_extension); service()->NotifyHMIAboutHMILevel(app, app->hmi_level()); - service()->SetPrimaryDevice(app->device()); - PolicyHelper::SetIsAppOnPrimaryDevice(app, *this); return true; } return false; @@ -313,33 +311,6 @@ void RemoteControlPlugin::OnAppHMILevelChanged( service()->NotifyHMIAboutHMILevel(app, app->hmi_level()); } -bool RemoteControlPlugin::CanAppChangeHMILevel( - application_manager::ApplicationSharedPtr app, - mobile_apis::HMILevel::eType new_level) { - application_manager::AppExtensionPtr app_extension = - app->QueryInterface(GetModuleID()); - if (!app_extension) { - return true; - } - RCAppExtensionPtr rc_app_extension = - application_manager::AppExtensionPtr::static_pointer_cast( - app_extension); - if (new_level == mobile_apis::HMILevel::eType::HMI_FULL || - new_level == mobile_apis::HMILevel::eType::HMI_LIMITED) { - return rc_app_extension->is_on_driver_device(); - } - return true; -} - -void RemoteControlPlugin::OnDeviceRemoved( - const connection_handler::DeviceHandle& device) { - LOG4CXX_AUTO_TRACE(logger_); - bool is_driver = service()->PrimaryDevice() == device; - if (is_driver) { - service()->ResetPrimaryDevice(); - } -} - void RemoteControlPlugin::OnUnregisterApplication(const uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); resource_allocation_manager_.OnUnregisterApplication(app_id); diff --git a/src/components/remote_control/test/include/mock_remote_control_plugin.h b/src/components/remote_control/test/include/mock_remote_control_plugin.h index fccaac2828..cae623af14 100644 --- a/src/components/remote_control/test/include/mock_remote_control_plugin.h +++ b/src/components/remote_control/test/include/mock_remote_control_plugin.h @@ -32,11 +32,6 @@ class MockRemotePluginInterface : public remote_control::RemotePluginInterface { MOCK_METHOD2(OnAppHMILevelChanged, void(application_manager::ApplicationSharedPtr app, mobile_apis::HMILevel::eType old_level)); - MOCK_METHOD2(CanAppChangeHMILevel, - bool(application_manager::ApplicationSharedPtr app, - mobile_apis::HMILevel::eType new_level)); - MOCK_METHOD1(OnDeviceRemoved, - void(const connection_handler::DeviceHandle& device)); MOCK_METHOD1(OnUnregisterApplication, void(const uint32_t app_id)); MOCK_METHOD1(SendHmiStatusNotification, void(application_manager::ApplicationSharedPtr app)); diff --git a/src/components/remote_control/test/src/rc_app_extension_test.cc b/src/components/remote_control/test/src/rc_app_extension_test.cc index 5022853e30..163d09b9d0 100644 --- a/src/components/remote_control/test/src/rc_app_extension_test.cc +++ b/src/components/remote_control/test/src/rc_app_extension_test.cc @@ -48,12 +48,4 @@ TEST(CanAppExtensionTest, Control) { ASSERT_TRUE(extension.IsControlGiven()); } -TEST(CanAppExtensionTest, DriverDevice) { - RCAppExtension extension(5); - ASSERT_EQ(5, extension.uid()); - ASSERT_FALSE(extension.is_on_driver_device()); - extension.set_is_on_driver_device(true); - ASSERT_TRUE(extension.is_on_driver_device()); -} - } // namespace remote_control diff --git a/src/components/remote_control/test/src/rc_module_test.cc b/src/components/remote_control/test/src/rc_module_test.cc index 556bcd018c..59e9159f48 100644 --- a/src/components/remote_control/test/src/rc_module_test.cc +++ b/src/components/remote_control/test/src/rc_module_test.cc @@ -216,7 +216,6 @@ TEST_F(RCModuleTest, IsAppForPluginSuccess) { EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); ON_CALL(*app0_, device()).WillByDefault(Return(1)); EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)); - EXPECT_CALL(*mock_service_, PrimaryDevice()); EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_))) .WillOnce(Return(true)); ASSERT_TRUE(module_.IsAppForPlugin(app0_)); @@ -250,62 +249,4 @@ TEST_F(RCModuleTest, OnAppHMILevelChanged) { module_.OnAppHMILevelChanged(app0_, mobile_apis::HMILevel::eType::HMI_FULL); } -TEST_F(RCModuleTest, SetDriverDeviceOnRegister) { - application_manager::AppExtensionPtr invalid_ext; - EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) - .Times(2) - .WillOnce(Return(invalid_ext)) - .WillRepeatedly(Return(rc_app_extention_)); - EXPECT_CALL(*app0_, AddExtension(_)).WillOnce(Return(true)); - ON_CALL(*app0_, device()).WillByDefault(Return(12)); - mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_NONE; - EXPECT_CALL(*app0_, hmi_level()).Times(1).WillRepeatedly(Return(hmi)); - EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)).Times(1); - EXPECT_CALL(*mock_service_, PrimaryDevice()).Times(1).WillOnce(Return(12)); - EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_))) - .Times(1) - .WillOnce(Return(true)); - - ASSERT_TRUE(module_.IsAppForPlugin(app0_)); - ASSERT_TRUE(rc_app_extention_->is_on_driver_device()); -} - -TEST_F(RCModuleTest, SetDriverDeviceOnRegisterFail) { - application_manager::AppExtensionPtr invalid_ext; - EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) - .Times(2) - .WillOnce(Return(invalid_ext)) - .WillRepeatedly(Return(rc_app_extention_)); - EXPECT_CALL(*app0_, AddExtension(_)).WillOnce(Return(true)); - mobile_apis::HMILevel::eType hmi = mobile_apis::HMILevel::eType::HMI_FULL; - EXPECT_CALL(*app0_, hmi_level()).WillRepeatedly(Return(hmi)); - ON_CALL(*app0_, device()).WillByDefault(Return(12)); - EXPECT_CALL(*mock_service_, NotifyHMIAboutHMILevel(Eq(app0_), _)).Times(1); - EXPECT_CALL(*mock_service_, PrimaryDevice()).Times(1).WillOnce(Return(3)); - EXPECT_CALL(*mock_service_, IsRemoteControlApplication(Eq(app0_))) - .Times(1) - .WillOnce(Return(true)); - - ASSERT_TRUE(module_.IsAppForPlugin(app0_)); - ASSERT_FALSE(rc_app_extention_->is_on_driver_device()); -} - -TEST_F(RCModuleTest, CanAppChangeHMILevelPrimary) { - apps_.push_back(app0_); - - rc_app_extention_->set_is_on_driver_device(true); - - EXPECT_CALL(*app0_, QueryInterface(module_.GetModuleID())) - .WillRepeatedly(Return(rc_app_extention_)); - - ASSERT_TRUE(module_.CanAppChangeHMILevel( - app0_, mobile_apis::HMILevel::eType::HMI_FULL)); - ASSERT_TRUE(module_.CanAppChangeHMILevel( - app0_, mobile_apis::HMILevel::eType::HMI_LIMITED)); - ASSERT_TRUE(module_.CanAppChangeHMILevel( - app0_, mobile_apis::HMILevel::eType::HMI_BACKGROUND)); - ASSERT_TRUE(module_.CanAppChangeHMILevel( - app0_, mobile_apis::HMILevel::eType::HMI_NONE)); -} - } // namespace remote_control -- cgit v1.2.1 From 8f546b0a662d3cf3f40c014c7abc2bbdcab056be Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Sun, 20 Aug 2017 18:39:16 +0300 Subject: Fixes AM and RC unit test after removal, drops obsolete code --- .../test/rc_policy_handler_test.cc | 20 -------------- .../policy_external/src/access_remote_impl.cc | 2 +- .../policy_regular/include/policy/access_remote.h | 5 +--- .../policy_regular/src/access_remote_impl.cc | 2 +- .../policy_regular/test/access_remote_impl_test.cc | 31 +--------------------- .../test/sql_pt_representation_test.cc | 3 ++- 6 files changed, 6 insertions(+), 57 deletions(-) diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index 7c24b84acb..78d4f5a359 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -286,10 +286,6 @@ TEST_F(RCPolicyHandlerTest, CheckAccess_ValidParams_SUCCESS) { EXPECT_EQ(application_manager::TypeAccess::kAllowed, policy_handler_.CheckAccess(kDeviceId_, kPolicyAppId_, module)); - - EXPECT_CALL(*mock_policy_manager_, - CheckAccess(kDeviceId_, kPolicyAppId_, module)) - .WillOnce(Return(policy::TypeAccess::kManual)); } TEST_F(RCPolicyHandlerTest, SetAccess_ValidParams_SUCCESS) { @@ -346,22 +342,6 @@ TEST_F(RCPolicyHandlerTest, SetRemoteControl_SUCCESS) { const bool enabled(true); EXPECT_CALL(*mock_policy_manager_, SetRemoteControl(enabled)); - connection_handler::DeviceHandle device_handle(1u); - EXPECT_CALL(conn_handler, GetDeviceID(kDeviceId_, _)) - .WillOnce(DoAll(SetDeviceHandle(device_handle), Return(true))); - - test_app.insert(mock_app_); - EXPECT_CALL(app_manager_, applications()).WillOnce(Return(app_set)); - - connection_handler::DeviceHandle app_device_handle(2u); - EXPECT_CALL(*mock_app_, device()).WillRepeatedly(Return(app_device_handle)); - EXPECT_CALL(*mock_app_, policy_app_id()) - .WillRepeatedly(Return(kPolicyAppId_)); - - EXPECT_CALL(mock_message_helper_, - GetDeviceMacAddressForHandle(app_device_handle, _)) - .WillOnce(Return(kMacAddr_)); - policy_handler_.SetRemoteControl(enabled); } diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index cbed4aeb5c..da18f26119 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -141,7 +141,7 @@ TypeAccess AccessRemoteImpl::Check(const Subject& who, return ret; } } - return TypeAccess::kManual; + return TypeAccess::kAllowed; } bool AccessRemoteImpl::CheckModuleType(const PTString& app_id, diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h index e0d02f6f36..77555a54a7 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote.h +++ b/src/components/policy/policy_regular/include/policy/access_remote.h @@ -42,7 +42,7 @@ namespace policy_table = ::rpc::policy_table_interface_base; namespace policy { -enum TypeAccess { kDisallowed, kAllowed, kManual }; +enum TypeAccess { kDisallowed, kAllowed }; inline std::ostream& operator<<(std::ostream& output, TypeAccess x) { output << "Access: "; switch (x) { @@ -52,9 +52,6 @@ inline std::ostream& operator<<(std::ostream& output, TypeAccess x) { case kAllowed: output << "ALLOWED"; break; - case kManual: - output << "MANUAL"; - break; default: output << "Error: Unknown type"; } diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index 8d076fbb5b..e73184664f 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -141,7 +141,7 @@ TypeAccess AccessRemoteImpl::Check(const Subject& who, return ret; } } - return TypeAccess::kManual; + return TypeAccess::kAllowed; } bool AccessRemoteImpl::CheckModuleType(const PTString& app_id, diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index ef4151adfa..5b88a8ba42 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -131,25 +131,13 @@ TEST(AccessRemoteImplTest, CheckDisallowed) { Object what = {policy_table::MT_RADIO}; access_remote.Allow(who, what); - EXPECT_EQ(TypeAccess::kManual, access_remote.Check(who1, what)); + EXPECT_EQ(TypeAccess::kAllowed, access_remote.Check(who1, what)); access_remote.Reset(who); access_remote.Deny(who1, what); EXPECT_EQ(TypeAccess::kDisallowed, access_remote.Check(who1, what)); } -TEST(AccessRemoteImplTest, CheckManual) { - AccessRemoteImpl access_remote; - Subject who = {"dev1", "12345"}; - Subject who1 = {"dev1", "123456"}; - Object what = {policy_table::MT_RADIO}; - - EXPECT_EQ(TypeAccess::kManual, access_remote.Check(who, what)); - - access_remote.Deny(who1, what); - EXPECT_EQ(TypeAccess::kManual, access_remote.Check(who, what)); -} - TEST(AccessRemoteImplTest, CheckModuleType) { AccessRemoteImpl access_remote; access_remote.cache_->pt_ = new policy_table::Table(); @@ -186,14 +174,6 @@ TEST(AccessRemoteImplTest, EnableDisable) { access_remote.Disable(); EXPECT_FALSE(access_remote.IsEnabled()); - - // Country is disabled - access_remote.enabled_ = false; - access_remote.Enable(); - EXPECT_FALSE(access_remote.IsEnabled()); - - access_remote.Disable(); - EXPECT_FALSE(access_remote.IsEnabled()); } TEST(AccessRemoteImplTest, SetDefaultHmiTypes) { @@ -233,15 +213,6 @@ TEST(AccessRemoteImplTest, GetGroups) { apps["1234"].set_to_string(policy::kDefaultId); const policy_table::Strings& groups2 = access_remote.GetGroups(who); EXPECT_EQ(std::string("group_primary"), std::string(groups2[0])); - - apps["1234"].set_to_string(policy::kDefaultId); - Subject who2 = {"dev2", "1234"}; - - // Empty groups - access_remote.enabled_ = false; - apps["1234"].set_to_string(policy::kDefaultId); - const policy_table::Strings& groups4 = access_remote.GetGroups(who2); - EXPECT_TRUE(groups4.empty()); } } // namespace policy diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index cef5cdeb38..cbde0ca00f 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -420,7 +420,8 @@ TEST_F(SQLPTRepresentationTest, ASSERT_EQ(0, dbms->FetchOneInt(query_select)); ASSERT_TRUE(reps->RefreshDB()); // Check PT structure destroyed and tables number is 0 - ASSERT_EQ(30, dbms->FetchOneInt(query_select)); + const int32_t total_tables_number = 29; + ASSERT_EQ(total_tables_number, dbms->FetchOneInt(query_select)); const char* query_select_count_of_iap_buffer_full = "SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`"; const char* query_select_count_sync_out_of_memory = -- cgit v1.2.1 From 6fa778daef5b67589c84d3ca6b9b83db35243595 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 21 Aug 2017 10:15:52 +0300 Subject: Removes obsolete enable/disable interfaces from RC --- .../include/application_manager/core_service.h | 11 ----- .../application_manager/policies/policy_handler.h | 12 ------ .../include/application_manager/service.h | 11 ----- .../application_manager/src/core_service.cc | 13 ------ .../src/policies/policy_handler.cc | 10 ----- .../test/rc_policy_handler_test.cc | 15 ------- .../functional_module/test/include/mock_service.h | 3 -- .../policies/policy_handler_interface.h | 12 ------ .../policy/policy_external/policy/policy_manager.h | 12 ------ .../policy/policy_regular/policy/policy_manager.h | 12 ------ .../policies/mock_policy_handler_interface.h | 4 -- .../policy_external/policy/mock_policy_manager.h | 2 - .../policy_regular/policy/mock_policy_manager.h | 2 - .../policy_external/include/policy/access_remote.h | 21 --------- .../include/policy/access_remote_impl.h | 5 --- .../include/policy/policy_manager_impl.h | 2 - .../policy_external/src/access_remote_impl.cc | 34 +-------------- .../policy_external/src/policy_manager_impl.cc | 20 --------- .../policy_regular/include/policy/access_remote.h | 22 ---------- .../include/policy/access_remote_impl.h | 7 --- .../include/policy/policy_manager_impl.h | 2 - .../policy_regular/src/access_remote_impl.cc | 33 +------------- .../policy_regular/src/policy_manager_impl.cc | 20 --------- .../policy_regular/test/access_remote_impl_test.cc | 14 ------ .../include/remote_control/policy_helper.h | 50 ---------------------- src/components/remote_control/src/policy_helper.cc | 47 -------------------- .../remote_control/src/remote_control_plugin.cc | 1 - 27 files changed, 4 insertions(+), 393 deletions(-) delete mode 100644 src/components/remote_control/include/remote_control/policy_helper.h delete mode 100644 src/components/remote_control/src/policy_helper.cc diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index 2ff5a8ed79..0ea1dbc344 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -117,17 +117,6 @@ class CoreService : public Service { */ uint32_t GetDeviceHandlerById(const std::string& device_id) FINAL; - /** - * Sets mode of remote control (on/off) - * @param enabled true if remote control is turned on - */ - void SetRemoteControl(bool enabled) FINAL; - - /** - * @brief Is Remote Control allowed by Policy and User - */ - bool IsRemoteControlAllowed() const FINAL; - /** * Checks if application has remote control functions * @param app application diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 0b1445039a..3125997b33 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -187,18 +187,6 @@ class PolicyHandler : public PolicyHandlerInterface, */ void ResetAccess(const std::string& module) OVERRIDE; - /** - * Sets mode of remote control (on/off) - * @param enabled true if remote control is turned on - */ - void SetRemoteControl(bool enabled) OVERRIDE; - - /** - * @brief If remote control is enabled - * by User and by Policy - */ - bool GetRemoteControl() const OVERRIDE; - /** * @brief Notifies Remote apps about change in permissions * @param device_id Device on which app is running diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index c1666554be..33a41c272d 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -117,17 +117,6 @@ class Service { */ virtual uint32_t GetDeviceHandlerById(const std::string& device_id) = 0; - /** - * Sets mode of remote control (on/off) - * @param enabled true if remote control is turned on - */ - virtual void SetRemoteControl(bool enabled) = 0; - - /** - * @brief Is Remote Control allowed by Policy and User - */ - virtual bool IsRemoteControlAllowed() const = 0; - /** * @brief Get pointer to application by application id * @param app_id application id diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index dd37484591..2e50503582 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -147,19 +147,6 @@ uint32_t CoreService::GetDeviceHandlerById(const std::string& device_id) { return device_handle; } -void CoreService::SetRemoteControl(bool enabled) { -#ifdef SDL_REMOTE_CONTROL - application_manager_.GetPolicyHandler().SetRemoteControl(enabled); -#endif // SDL_REMOTE_CONTROL -} - -bool CoreService::IsRemoteControlAllowed() const { -#ifdef SDL_REMOTE_CONTROL - return application_manager_.GetPolicyHandler().GetRemoteControl(); -#endif // SDL_REMOTE_CONTROL - return false; -} - bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const { #ifdef SDL_REMOTE_CONTROL return application_manager_.GetPolicyHandler().CheckHMIType( diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index bf5d19eed6..49fd31f564 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -2025,16 +2025,6 @@ void PolicyHandler::ResetAccess(const std::string& module) { policy_manager_->ResetAccess(module); } -void PolicyHandler::SetRemoteControl(bool enabled) { - POLICY_LIB_CHECK_VOID(); - policy_manager_->SetRemoteControl(enabled); -} - -bool PolicyHandler::GetRemoteControl() const { - POLICY_LIB_CHECK(false); - return policy_manager_->GetRemoteControl(); -} - void PolicyHandler::OnRemoteAppPermissionsChanged( const std::string& device_id, const std::string& application_id) { POLICY_LIB_CHECK_VOID(); diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index 78d4f5a359..bd6d0a7ad8 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -330,21 +330,6 @@ ACTION_P(SetDeviceHandle, handle) { *arg1 = handle; } -TEST_F(RCPolicyHandlerTest, GetRemoteControl_SUCCESS) { - EnablePolicyAndPolicyManagerMock(); - EXPECT_CALL(*mock_policy_manager_, GetRemoteControl()).WillOnce(Return(true)); - - EXPECT_TRUE(policy_handler_.GetRemoteControl()); -} - -TEST_F(RCPolicyHandlerTest, SetRemoteControl_SUCCESS) { - EnablePolicyAndPolicyManagerMock(); - const bool enabled(true); - EXPECT_CALL(*mock_policy_manager_, SetRemoteControl(enabled)); - - policy_handler_.SetRemoteControl(enabled); -} - TEST_F(RCPolicyHandlerTest, OnRemoteAppPermissionsChanged_DifferentDeviceHandle_SUCCESS) { EnablePolicyAndPolicyManagerMock(); diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index 0297855246..a4cd769022 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -68,11 +68,8 @@ class MockService : public Service { MOCK_METHOD1(ResetAccess, void(const ApplicationId& app_id)); MOCK_METHOD1(ResetAccess, void(const std::string& module)); MOCK_METHOD1(GetDeviceHandlerById, uint32_t(const std::string& device_id)); - MOCK_METHOD1(SetRemoteControl, void(bool enabled)); MOCK_METHOD1(RemoveHMIFakeParameters, void(application_manager::MessagePtr& message)); - MOCK_CONST_METHOD0(IsRemoteControlAllowed, bool()); - MOCK_CONST_METHOD1(IsRemoteControlApplication, bool(ApplicationSharedPtr app)); MOCK_CONST_METHOD1(IsInterfaceAvailable, diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index e49d86290c..47036340d1 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -494,18 +494,6 @@ class PolicyHandlerInterface { */ virtual void ResetAccess(const std::string& module) = 0; - /** - * Sets mode of remote control (on/off) - * @param enabled true if remote control is turned on - */ - virtual void SetRemoteControl(bool enabled) = 0; - - /** - * @brief If remote control is enabled - * by User and by Policy - */ - virtual bool GetRemoteControl() const = 0; - /** * @brief Notifies Remote apps about change in permissions * @param device_id Device on which app is running diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index f6d1396be8..626bd36167 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -565,18 +565,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual void ResetAccess(const PTString& module) = 0; - /** - * Sets mode of remote control (on/off) - * @param enabled true if remote control is turned on - */ - virtual void SetRemoteControl(bool enabled) = 0; - - /* - * @brief If remote control is enabled - * by User and by Policy - */ - virtual bool GetRemoteControl() const = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index da59af08d8..a1e31d9244 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -539,18 +539,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual void ResetAccess(const PTString& module) = 0; - /** - * Sets mode of remote control (on/off) - * @param enabled true if remote control is turned on - */ - virtual void SetRemoteControl(bool enabled) = 0; - - /* - * @brief If remote control is enabled - * by User and by Policy - */ - virtual bool GetRemoteControl() const = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index 2acbb16032..eb1ba6d84e 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -258,10 +258,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { MOCK_METHOD1(ResetAccess, void(const std::string& module)); - MOCK_METHOD1(SetRemoteControl, void(bool enabled)); - - MOCK_CONST_METHOD0(GetRemoteControl, bool()); - MOCK_METHOD2(OnRemoteAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 3739d96caf..9b26afa71d 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -169,8 +169,6 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(ResetAccess, void(const PTString& dev_id, const PTString& app_id)); MOCK_METHOD1(ResetAccess, void(const PTString& module)); - MOCK_METHOD1(SetRemoteControl, void(bool enabled)); - MOCK_CONST_METHOD0(GetRemoteControl, bool()); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index 551b711ea0..d24b39632c 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -168,8 +168,6 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(ResetAccess, void(const PTString& dev_id, const PTString& app_id)); MOCK_METHOD1(ResetAccess, void(const PTString& module)); - MOCK_METHOD1(SetRemoteControl, void(bool enabled)); - MOCK_CONST_METHOD0(GetRemoteControl, bool()); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h index 33524bf229..6fc2141dbd 100644 --- a/src/components/policy/policy_external/include/policy/access_remote.h +++ b/src/components/policy/policy_external/include/policy/access_remote.h @@ -93,27 +93,6 @@ class AccessRemote { public: virtual ~AccessRemote() {} - /** - * Initializes oneself - */ - virtual void Init() = 0; - - /** - * Enables remote control - */ - virtual void Enable() = 0; - - /** - * Disables remote control - */ - virtual void Disable() = 0; - - /** - * Checks if remote control is enabled - * @return true if enabled - */ - virtual bool IsEnabled() const = 0; - /** * Allows access subject to object * @param who subject is dev_id and app_id diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h index 749edd6ce2..1822b6b3ae 100644 --- a/src/components/policy/policy_external/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h @@ -48,11 +48,6 @@ class AccessRemoteImpl : public AccessRemote { AccessRemoteImpl(); explicit AccessRemoteImpl(utils::SharedPtr cache); - virtual void Init(); - virtual void Enable(); - virtual void Disable(); - virtual bool IsEnabled() const; - virtual void Allow(const Subject& who, const Object& what); virtual void Deny(const Subject& who, const Object& what); virtual void Reset(const Subject& who); diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 653dbf5281..3e6d08c2c4 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -394,8 +394,6 @@ class PolicyManagerImpl : public PolicyManager { bool allowed); virtual void ResetAccess(const PTString& dev_id, const PTString& app_id); virtual void ResetAccess(const PTString& module); - virtual void SetRemoteControl(bool enabled); - virtual bool GetRemoteControl() const; virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index da18f26119..a5628c5790 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -110,20 +110,10 @@ struct ToModuleType { } }; -AccessRemoteImpl::AccessRemoteImpl() - : cache_(new CacheManager()), enabled_(true), acl_() {} +AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()), acl_() {} AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) - : cache_(cache), enabled_(true), acl_() {} - -void AccessRemoteImpl::Init() { - LOG4CXX_AUTO_TRACE(logger_); - DCHECK(cache_->pt_); - - // TODO: Rework - - enabled_ = true; -} + : cache_(cache), acl_() {} TypeAccess AccessRemoteImpl::Check(const Subject& who, const Object& what) const { @@ -231,26 +221,6 @@ void AccessRemoteImpl::Reset() { acl_.clear(); } -void AccessRemoteImpl::Enable() { - LOG4CXX_AUTO_TRACE(logger_); - set_enabled(true); -} - -void AccessRemoteImpl::Disable() { - LOG4CXX_AUTO_TRACE(logger_); - set_enabled(false); -} - -void AccessRemoteImpl::set_enabled(bool value) { - enabled_ = value; - cache_->Backup(); -} - -bool AccessRemoteImpl::IsEnabled() const { - LOG4CXX_AUTO_TRACE(logger_); - return enabled_; -} - void AccessRemoteImpl::SetDefaultHmiTypes(const Subject& who, const std::vector& hmi_types) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index ec618859cd..2daf70654f 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -341,7 +341,6 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, listener_->OnCertificateUpdated( *(pt_update->policy_table.module_config.certificate)); #ifdef SDL_REMOTE_CONTROL - access_remote_->Init(); CheckPTUUpdatesChange(pt_update, policy_table_snapshot); #endif // SDL_REMOTE_CONTROL @@ -1906,9 +1905,6 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name, if (ret) { RefreshRetrySequence(); update_status_manager_.OnPolicyInit(cache_->UpdateRequired()); -#ifdef SDL_REMOTE_CONTROL - access_remote_->Init(); -#endif // SDL_REMOTE_CONTROL } return ret; } @@ -1999,9 +1995,6 @@ TypeAccess PolicyManagerImpl::CheckDriverConsent( const std::string& rpc, const RemoteControlParams& params) { LOG4CXX_AUTO_TRACE(logger_); - if (!access_remote_->IsEnabled()) { - return TypeAccess::kDisallowed; - } return access_remote_->Check(who, what); } @@ -2048,19 +2041,6 @@ void PolicyManagerImpl::ResetAccess(const PTString& module) { access_remote_->Reset(what); } -void PolicyManagerImpl::SetRemoteControl(bool enabled) { - LOG4CXX_AUTO_TRACE(logger_); - if (enabled) { - access_remote_->Enable(); - } else { - access_remote_->Disable(); - } -} - -bool PolicyManagerImpl::GetRemoteControl() const { - return access_remote_->IsEnabled(); -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h index 77555a54a7..dd0cbb0ce5 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote.h +++ b/src/components/policy/policy_regular/include/policy/access_remote.h @@ -92,28 +92,6 @@ typedef std::vector RemoteControlParams; class AccessRemote { public: virtual ~AccessRemote() {} - - /** - * Initializes oneself - */ - virtual void Init() = 0; - - /** - * Enables remote control - */ - virtual void Enable() = 0; - - /** - * Disables remote control - */ - virtual void Disable() = 0; - - /** - * Checks if remote control is enabled - * @return true if enabled - */ - virtual bool IsEnabled() const = 0; - /** * Allows access subject to object * @param who subject is dev_id and app_id diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h index d15b707cca..8b89a42744 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h @@ -52,11 +52,6 @@ class AccessRemoteImpl : public AccessRemote { AccessRemoteImpl(); explicit AccessRemoteImpl(utils::SharedPtr cache); - virtual void Init(); - virtual void Enable(); - virtual void Disable(); - virtual bool IsEnabled() const; - virtual void Allow(const Subject& who, const Object& what); virtual void Deny(const Subject& who, const Object& what); virtual void Reset(const Subject& who); @@ -76,7 +71,6 @@ class AccessRemoteImpl : public AccessRemote { std::vector* modules); private: - inline void set_enabled(bool value); const policy_table::AppHMITypes& HmiTypes(const Subject& who); void GetGroupsIds(const std::string& device_id, const std::string& app_id, @@ -88,7 +82,6 @@ class AccessRemoteImpl : public AccessRemote { bool CompareParameters(const policy_table::Strings& parameters, RemoteControlParams* input) const; utils::SharedPtr cache_; - bool enabled_; AccessControlList acl_; HMIList hmi_types_; diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 73286414be..91e45efd0e 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -365,8 +365,6 @@ class PolicyManagerImpl : public PolicyManager { bool allowed); virtual void ResetAccess(const PTString& dev_id, const PTString& app_id); virtual void ResetAccess(const PTString& module); - virtual void SetRemoteControl(bool enabled); - virtual bool GetRemoteControl() const; virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index e73184664f..1d7190d70c 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -111,19 +111,10 @@ struct ToModuleType { }; AccessRemoteImpl::AccessRemoteImpl() - : cache_(new CacheManager()), enabled_(true), acl_() {} + : cache_(new CacheManager()), acl_() {} AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) - : cache_(cache), enabled_(true), acl_() {} - -void AccessRemoteImpl::Init() { - LOG4CXX_AUTO_TRACE(logger_); - DCHECK(cache_->pt()); - - // TODO: Rework - - enabled_ = true; -} + : cache_(cache), acl_() {} TypeAccess AccessRemoteImpl::Check(const Subject& who, const Object& what) const { @@ -231,26 +222,6 @@ void AccessRemoteImpl::Reset() { acl_.clear(); } -void AccessRemoteImpl::Enable() { - LOG4CXX_AUTO_TRACE(logger_); - set_enabled(true); -} - -void AccessRemoteImpl::Disable() { - LOG4CXX_AUTO_TRACE(logger_); - set_enabled(false); -} - -void AccessRemoteImpl::set_enabled(bool value) { - enabled_ = value; - cache_->Backup(); -} - -bool AccessRemoteImpl::IsEnabled() const { - LOG4CXX_AUTO_TRACE(logger_); - return enabled_; -} - void AccessRemoteImpl::SetDefaultHmiTypes(const Subject& who, const std::vector& hmi_types) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 7ca4c5f3ac..780874c43a 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -215,7 +215,6 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, *(pt_update->policy_table.module_config.certificate)); } #ifdef SDL_REMOTE_CONTROL - access_remote_->Init(); CheckPTUUpdatesChange(pt_update, policy_table_snapshot); #endif // SDL_REMOTE_CONTROL @@ -1131,9 +1130,6 @@ bool PolicyManagerImpl::InitPT(const std::string& file_name, if (ret) { RefreshRetrySequence(); update_status_manager_.OnPolicyInit(cache_->UpdateRequired()); -#ifdef SDL_REMOTE_CONTROL - access_remote_->Init(); -#endif // SDL_REMOTE_CONTROL } return ret; } @@ -1229,9 +1225,6 @@ TypeAccess PolicyManagerImpl::CheckDriverConsent( const std::string& rpc, const RemoteControlParams& params) { LOG4CXX_AUTO_TRACE(logger_); - if (!access_remote_->IsEnabled()) { - return TypeAccess::kDisallowed; - } return access_remote_->Check(who, what); } @@ -1278,19 +1271,6 @@ void PolicyManagerImpl::ResetAccess(const PTString& module) { access_remote_->Reset(what); } -void PolicyManagerImpl::SetRemoteControl(bool enabled) { - LOG4CXX_AUTO_TRACE(logger_); - if (enabled) { - access_remote_->Enable(); - } else { - access_remote_->Disable(); - } -} - -bool PolicyManagerImpl::GetRemoteControl() const { - return access_remote_->IsEnabled(); -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index 5b88a8ba42..0b6e2aa1fc 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -163,19 +163,6 @@ TEST(AccessRemoteImplTest, CheckModuleType) { EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_CLIMATE)); } -TEST(AccessRemoteImplTest, EnableDisable) { - AccessRemoteImpl access_remote; - access_remote.cache_->pt_ = new policy_table::Table(); - - // Country is enabled - access_remote.enabled_ = true; - access_remote.Enable(); - EXPECT_TRUE(access_remote.IsEnabled()); - - access_remote.Disable(); - EXPECT_FALSE(access_remote.IsEnabled()); -} - TEST(AccessRemoteImplTest, SetDefaultHmiTypes) { AccessRemoteImpl access_remote; @@ -194,7 +181,6 @@ TEST(AccessRemoteImplTest, SetDefaultHmiTypes) { TEST(AccessRemoteImplTest, GetGroups) { AccessRemoteImpl access_remote; - access_remote.enabled_ = true; Subject who = {"dev1", "1234"}; access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL); diff --git a/src/components/remote_control/include/remote_control/policy_helper.h b/src/components/remote_control/include/remote_control/policy_helper.h deleted file mode 100644 index 8d1fcc184b..0000000000 --- a/src/components/remote_control/include/remote_control/policy_helper.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - */ - -#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_ -#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_ - -#include -#include "application_manager/application.h" -#include "remote_control/remote_plugin_interface.h" - -namespace remote_control { - -class PolicyHelper { - public: - static void OnRSDLFunctionalityAllowing(bool allowed, - RemotePluginInterface& rc_module); -}; - -} // namespace remote_control - -#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_POLICY_HELPER_H_ diff --git a/src/components/remote_control/src/policy_helper.cc b/src/components/remote_control/src/policy_helper.cc deleted file mode 100644 index e50233fe2b..0000000000 --- a/src/components/remote_control/src/policy_helper.cc +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 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. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. - */ - -#include "remote_control/policy_helper.h" -#include "remote_control/remote_control_plugin.h" -#include "remote_control/rc_app_extension.h" -#include "utils/logger.h" - -CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControl") - -namespace remote_control { - -void PolicyHelper::OnRSDLFunctionalityAllowing( - bool allowed, RemotePluginInterface& rc_module) { - rc_module.service()->SetRemoteControl(allowed); -} - -} // namespace remote_control diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc index 5ecc587cfd..cd0f123ba8 100644 --- a/src/components/remote_control/src/remote_control_plugin.cc +++ b/src/components/remote_control/src/remote_control_plugin.cc @@ -36,7 +36,6 @@ #include "remote_control/rc_module_constants.h" #include "remote_control/rc_app_extension.h" #include "remote_control/message_helper.h" -#include "remote_control/policy_helper.h" #include "utils/logger.h" #include "interfaces/MOBILE_API.h" #include "utils/macro.h" -- cgit v1.2.1 From b09c800caaf92bbecd66b40b2fc2d2fa15cb413d Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 21 Aug 2017 11:31:50 +0300 Subject: Removes unused intefaces from Service class --- .../include/application_manager/core_service.h | 19 ---------------- .../application_manager/policies/policy_handler.h | 13 ----------- .../include/application_manager/service.h | 19 ---------------- .../application_manager/src/core_service.cc | 25 ---------------------- .../src/policies/policy_handler.cc | 11 ---------- .../test/rc_policy_handler_test.cc | 17 --------------- .../functional_module/test/include/mock_service.h | 3 --- .../policies/policy_handler_interface.h | 14 ------------ .../policy/policy_external/policy/policy_manager.h | 13 ----------- .../policy/policy_regular/policy/policy_manager.h | 13 ----------- .../policies/mock_policy_handler_interface.h | 6 ------ .../policy_external/policy/mock_policy_manager.h | 3 --- .../policy_regular/policy/mock_policy_manager.h | 3 --- .../include/policy/policy_manager_impl.h | 2 -- .../policy_external/src/policy_manager_impl.cc | 19 ---------------- .../include/policy/policy_manager_impl.h | 2 -- .../policy_regular/src/access_remote_impl.cc | 3 +-- .../policy_regular/src/policy_manager_impl.cc | 19 ---------------- 18 files changed, 1 insertion(+), 203 deletions(-) diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index 0ea1dbc344..29af7454b9 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -98,25 +98,6 @@ class CoreService : public Service { const std::string& module, bool allowed) FINAL; - /** - * @brief ResetAccess Resets access by application id - * @param app_id Application id - */ - void ResetAccess(const ApplicationId& app_id) FINAL; - - /** - * Resets access by module type for all applications - * @param module type - */ - void ResetAccess(const std::string& module) FINAL; - - /** - * Gets device handler for device with certain ID - * @param device_id the ID of the connected device - * @return device handler if device with requested ID was found - */ - uint32_t GetDeviceHandlerById(const std::string& device_id) FINAL; - /** * Checks if application has remote control functions * @param app application diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 3125997b33..bce7484fdf 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -174,19 +174,6 @@ class PolicyHandler : public PolicyHandlerInterface, const PTString& module, bool allowed) OVERRIDE; - /** - * Resets access application to all resources - * @param device_id unique identifier of device - * @param app_id policy id application - */ - void ResetAccess(const PTString& device_id, const PTString& app_id) OVERRIDE; - - /** - * Resets access by module name for all applications - * @param module type - */ - void ResetAccess(const std::string& module) OVERRIDE; - /** * @brief Notifies Remote apps about change in permissions * @param device_id Device on which app is running diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index 33a41c272d..a4eddc5447 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -98,25 +98,6 @@ class Service { const std::string& module, bool allowed) = 0; - /** - * Resets access application to all resources - * @param app_id ID application - */ - virtual void ResetAccess(const ApplicationId& app_id) = 0; - - /** - * Resets access by module and interior zone for all applications - * @param module type - */ - virtual void ResetAccess(const std::string& module) = 0; - - /** - * Gets device handler for device with certain ID - * @param device_id the ID of the connected device - * @return device handler if device with requested ID was found - */ - virtual uint32_t GetDeviceHandlerById(const std::string& device_id) = 0; - /** * @brief Get pointer to application by application id * @param app_id application id diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index 2e50503582..43a63b7d8d 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -122,31 +122,6 @@ void CoreService::SetAccess(const ApplicationId& app_id, #endif // SDL_REMOTE_CONTROL } -void CoreService::ResetAccess(const ApplicationId& app_id) { -#ifdef SDL_REMOTE_CONTROL - ApplicationSharedPtr app = GetApplication(app_id); - if (app) { - std::string device_handle = MessageHelper::GetDeviceMacAddressForHandle( - app->device(), application_manager_); - application_manager_.GetPolicyHandler().ResetAccess(device_handle, - app->policy_app_id()); - } -#endif // SDL_REMOTE_CONTROL -} - -void CoreService::ResetAccess(const std::string& module) { -#ifdef SDL_REMOTE_CONTROL - application_manager_.GetPolicyHandler().ResetAccess(module); -#endif // SDL_REMOTE_CONTROL -} - -uint32_t CoreService::GetDeviceHandlerById(const std::string& device_id) { - uint32_t device_handle = 0; - application_manager_.connection_handler().GetDeviceID(device_id, - &device_handle); - return device_handle; -} - bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const { #ifdef SDL_REMOTE_CONTROL return application_manager_.GetPolicyHandler().CheckHMIType( diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 49fd31f564..574f362e42 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -2014,17 +2014,6 @@ void PolicyHandler::SetAccess(const PTString& device_id, policy_manager_->SetAccess(device_id, app_id, module, allowed); } -void PolicyHandler::ResetAccess(const PTString& device_id, - const PTString& app_id) { - POLICY_LIB_CHECK_VOID(); - policy_manager_->ResetAccess(device_id, app_id); -} - -void PolicyHandler::ResetAccess(const std::string& module) { - POLICY_LIB_CHECK_VOID(); - policy_manager_->ResetAccess(module); -} - void PolicyHandler::OnRemoteAppPermissionsChanged( const std::string& device_id, const std::string& application_id) { POLICY_LIB_CHECK_VOID(); diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index bd6d0a7ad8..760500af95 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -299,23 +299,6 @@ TEST_F(RCPolicyHandlerTest, SetAccess_ValidParams_SUCCESS) { policy_handler_.SetAccess(kDeviceId_, kPolicyAppId_, module, allowed); } -TEST_F(RCPolicyHandlerTest, ResetAccess_ValidParams_SUCCESS) { - EnablePolicyAndPolicyManagerMock(); - - EXPECT_CALL(*mock_policy_manager_, ResetAccess(kDeviceId_, kPolicyAppId_)); - - policy_handler_.ResetAccess(kDeviceId_, kPolicyAppId_); -} - -TEST_F(RCPolicyHandlerTest, ResetAccess_SUCCESS) { - EnablePolicyAndPolicyManagerMock(); - - const PTString module("module"); - EXPECT_CALL(*mock_policy_manager_, ResetAccess(module)); - - policy_handler_.ResetAccess(module); -} - TEST_F(RCPolicyHandlerTest, CheckModule_SUCCESS) { EnablePolicyAndPolicyManagerMock(); diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index a4cd769022..576c82542b 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -65,9 +65,6 @@ class MockService : public Service { void(const ApplicationId& app_id, const std::string& module, bool allowed)); - MOCK_METHOD1(ResetAccess, void(const ApplicationId& app_id)); - MOCK_METHOD1(ResetAccess, void(const std::string& module)); - MOCK_METHOD1(GetDeviceHandlerById, uint32_t(const std::string& device_id)); MOCK_METHOD1(RemoveHMIFakeParameters, void(application_manager::MessagePtr& message)); MOCK_CONST_METHOD1(IsRemoteControlApplication, diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index 47036340d1..7c4d53936e 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -480,20 +480,6 @@ class PolicyHandlerInterface { const PTString& module, bool allowed) = 0; - /** - * Resets access application to all resources - * @param device_id unique identifier of device - * @param app_id policy id application - */ - virtual void ResetAccess(const PTString& device_id, - const PTString& app_id) = 0; - - /** - * Resets access by group name for all applications - * @param module type - */ - virtual void ResetAccess(const std::string& module) = 0; - /** * @brief Notifies Remote apps about change in permissions * @param device_id Device on which app is running diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 626bd36167..51dfa427a2 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -552,19 +552,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { const PTString& module, bool allowed) = 0; - /** - * Resets access application to all resources - * @param dev_id unique identifier of device - * @param app_id policy id application - */ - virtual void ResetAccess(const PTString& dev_id, const PTString& app_id) = 0; - - /** - * Resets access by functional group for all applications - * @param module type - */ - virtual void ResetAccess(const PTString& module) = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index a1e31d9244..c4d957f7c3 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -526,19 +526,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { const PTString& module, bool allowed) = 0; - /** - * Resets access application to all resources - * @param dev_id unique identifier of device - * @param app_id policy id application - */ - virtual void ResetAccess(const PTString& dev_id, const PTString& app_id) = 0; - - /** - * Resets access by functional group for all applications - * @param module type - */ - virtual void ResetAccess(const PTString& module) = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index eb1ba6d84e..8a9223c97d 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -252,12 +252,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { const policy::PTString& module, bool allowed)); - MOCK_METHOD2(ResetAccess, - void(const policy::PTString& device_id, - const policy::PTString& app_id)); - - MOCK_METHOD1(ResetAccess, void(const std::string& module)); - MOCK_METHOD2(OnRemoteAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 9b26afa71d..11f2b0cdaf 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -166,9 +166,6 @@ class MockPolicyManager : public PolicyManager { const PTString& app_id, const PTString& module, bool allowed)); - MOCK_METHOD2(ResetAccess, - void(const PTString& dev_id, const PTString& app_id)); - MOCK_METHOD1(ResetAccess, void(const PTString& module)); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index d24b39632c..735915304a 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -165,9 +165,6 @@ class MockPolicyManager : public PolicyManager { const PTString& app_id, const PTString& module, bool allowed)); - MOCK_METHOD2(ResetAccess, - void(const PTString& dev_id, const PTString& app_id)); - MOCK_METHOD1(ResetAccess, void(const PTString& module)); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 3e6d08c2c4..4257ef4372 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -392,8 +392,6 @@ class PolicyManagerImpl : public PolicyManager { const PTString& app_id, const PTString& module, bool allowed); - virtual void ResetAccess(const PTString& dev_id, const PTString& app_id); - virtual void ResetAccess(const PTString& module); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 2daf70654f..8d3c7c2ebc 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -2022,25 +2022,6 @@ void PolicyManagerImpl::SetAccess(const PTString& dev_id, } } -void PolicyManagerImpl::ResetAccess(const PTString& dev_id, - const PTString& app_id) { - LOG4CXX_AUTO_TRACE(logger_); - Subject who = {dev_id, app_id}; - access_remote_->Reset(who); -} - -void PolicyManagerImpl::ResetAccess(const PTString& module) { - LOG4CXX_AUTO_TRACE(logger_); - policy_table::ModuleType module_type; - bool is_valid = EnumFromJsonString(module, &module_type); - if (!is_valid) { - return; - } - - Object what = {module_type}; - access_remote_->Reset(what); -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 91e45efd0e..0f1a298875 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -363,8 +363,6 @@ class PolicyManagerImpl : public PolicyManager { const PTString& app_id, const PTString& module, bool allowed); - virtual void ResetAccess(const PTString& dev_id, const PTString& app_id); - virtual void ResetAccess(const PTString& module); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index 1d7190d70c..5f7959ebee 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -110,8 +110,7 @@ struct ToModuleType { } }; -AccessRemoteImpl::AccessRemoteImpl() - : cache_(new CacheManager()), acl_() {} +AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()), acl_() {} AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) : cache_(cache), acl_() {} diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 780874c43a..7075d5fc82 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -1252,25 +1252,6 @@ void PolicyManagerImpl::SetAccess(const PTString& dev_id, } } -void PolicyManagerImpl::ResetAccess(const PTString& dev_id, - const PTString& app_id) { - LOG4CXX_AUTO_TRACE(logger_); - Subject who = {dev_id, app_id}; - access_remote_->Reset(who); -} - -void PolicyManagerImpl::ResetAccess(const PTString& module) { - LOG4CXX_AUTO_TRACE(logger_); - policy_table::ModuleType module_type; - bool is_valid = EnumFromJsonString(module, &module_type); - if (!is_valid) { - return; - } - - Object what = {module_type}; - access_remote_->Reset(what); -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { -- cgit v1.2.1 From 838822011847919b673a88ced85104ccd824b3ed Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 21 Aug 2017 11:42:16 +0300 Subject: Removes unused intefaces from RCAppExtention class --- .../include/remote_control/rc_app_extension.h | 14 -------------- src/components/remote_control/src/rc_app_extension.cc | 12 +----------- .../remote_control/test/src/rc_app_extension_test.cc | 8 -------- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/components/remote_control/include/remote_control/rc_app_extension.h b/src/components/remote_control/include/remote_control/rc_app_extension.h index f9d0cfa84d..aa47624713 100644 --- a/src/components/remote_control/include/remote_control/rc_app_extension.h +++ b/src/components/remote_control/include/remote_control/rc_app_extension.h @@ -47,18 +47,6 @@ class RCAppExtension : public application_manager::AppExtension { explicit RCAppExtension(application_manager::AppExtensionUID uid); ~RCAppExtension(); - /** - * @brief Checks is application has access to a radio tune control - * @return true if control given - */ - bool IsControlGiven() const; - - /** - * @brief Give radio tune control to application - * @param is_control_given true - give control, false - cancel control - */ - void GiveControl(bool is_control_given); - /** * @brief Subscribe to OnInteriorVehicleDataNotification * @param module interior data specification(zone, data type) @@ -78,8 +66,6 @@ class RCAppExtension : public application_manager::AppExtension { bool IsSubscibedToInteriorVehicleData(const Json::Value& module_type); private: - bool is_control_given_; - bool is_on_driver_device_; std::set subscribed_interior_vehicle_data_; }; diff --git a/src/components/remote_control/src/rc_app_extension.cc b/src/components/remote_control/src/rc_app_extension.cc index ded3a15775..c5b0584dcd 100644 --- a/src/components/remote_control/src/rc_app_extension.cc +++ b/src/components/remote_control/src/rc_app_extension.cc @@ -34,17 +34,7 @@ namespace remote_control { RCAppExtension::RCAppExtension(application_manager::AppExtensionUID uid) - : AppExtension(uid) - , is_control_given_(false) - , is_on_driver_device_(false) {} - -bool RCAppExtension::IsControlGiven() const { - return is_control_given_; -} - -void RCAppExtension::GiveControl(bool is_control_given) { - is_control_given_ = is_control_given; -} + : AppExtension(uid) {} void RCAppExtension::SubscribeToInteriorVehicleData( const Json::Value& module_type) { diff --git a/src/components/remote_control/test/src/rc_app_extension_test.cc b/src/components/remote_control/test/src/rc_app_extension_test.cc index 163d09b9d0..78388ccbf1 100644 --- a/src/components/remote_control/test/src/rc_app_extension_test.cc +++ b/src/components/remote_control/test/src/rc_app_extension_test.cc @@ -40,12 +40,4 @@ TEST(CanAppExtensionTest, Create) { ASSERT_TRUE(extension.uid() == 7); } -TEST(CanAppExtensionTest, Control) { - RCAppExtension extension(3); - ASSERT_EQ(3, extension.uid()); - ASSERT_FALSE(extension.IsControlGiven()); - extension.GiveControl(true); - ASSERT_TRUE(extension.IsControlGiven()); -} - } // namespace remote_control -- cgit v1.2.1 From 7c32476774c2c0166505e9c79e61615cee20baf9 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 21 Aug 2017 11:57:31 +0300 Subject: Removes unused interfaces from RC MessageHelper --- .../remote_control/include/remote_control/message_helper.h | 7 ------- src/components/remote_control/src/message_helper.cc | 5 ----- 2 files changed, 12 deletions(-) diff --git a/src/components/remote_control/include/remote_control/message_helper.h b/src/components/remote_control/include/remote_control/message_helper.h index 0c99022e4b..2a632c3c50 100644 --- a/src/components/remote_control/include/remote_control/message_helper.h +++ b/src/components/remote_control/include/remote_control/message_helper.h @@ -51,12 +51,6 @@ namespace remote_control { **/ class MessageHelper { public: - /** - * @brief Returns unique correlation ID for next CAN request - * - * @return Unique correlation ID - */ - static uint32_t GetNextRCCorrelationID(); static const std::string GetMobileAPIName( functional_modules::RCFunctionID func_id); @@ -111,7 +105,6 @@ class MessageHelper { private: MessageHelper(); - static uint32_t next_correlation_id_; static const std::map kMobileAPINames; DISALLOW_COPY_AND_ASSIGN(MessageHelper); diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc index 665ac42f88..5fdcde218c 100644 --- a/src/components/remote_control/src/message_helper.cc +++ b/src/components/remote_control/src/message_helper.cc @@ -59,14 +59,9 @@ std::map access_modes{ {enums_value::kAskDriver, hmi_apis::Common_RCAccessMode::ASK_DRIVER}}; } -uint32_t MessageHelper::next_correlation_id_ = 1; const std::map MessageHelper::kMobileAPINames = GenerateAPINames(); -uint32_t MessageHelper::GetNextRCCorrelationID() { - return next_correlation_id_++; -} - const std::string MessageHelper::GetMobileAPIName(RCFunctionID func_id) { std::map::const_iterator it = kMobileAPINames.find(func_id); -- cgit v1.2.1 From 829b726b535638b33528fa3da5c593360300954d Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 21 Aug 2017 12:02:02 +0300 Subject: Removes commented code from RC constants --- .../include/remote_control/rc_module_constants.h | 78 ---------------------- 1 file changed, 78 deletions(-) diff --git a/src/components/remote_control/include/remote_control/rc_module_constants.h b/src/components/remote_control/include/remote_control/rc_module_constants.h index e1d56b20ff..dc9e39021d 100644 --- a/src/components/remote_control/include/remote_control/rc_module_constants.h +++ b/src/components/remote_control/include/remote_control/rc_module_constants.h @@ -90,93 +90,19 @@ const char kCode[] = "code"; namespace message_params { const char kName[] = "name"; -/* -const char kCustomPresets[] = "customPresets"; -const char kRadioStation[] = "radioStation"; -const char kSongInfo[] = "songInfo"; -const char kEvent[] = "event"; -const char kAdvertisement[] = "advertisement"; -const char kActivity[] = "activity"; -const char kTriggerSource[] = "triggerSource"; - -// RadioStation struct -const char kFrequency[] = "frequency"; -const char kFraction[] = "fraction"; -const char kAvailableHDs[] = "availableHDs"; -const char kCurrentHD[] = "currentHD"; -// RadioStation struct - -// Time struct -const char kHours[] = "hours"; -const char kMinutes[] = "minutes"; -const char kSeconds[] = "seconds"; -const char kYear[] = "year"; -const char kMonth[] = "month"; -const char kDay[] = "day"; -const char kTZD[] = "TZD"; -// Time struct - -// Address struct -const char kState[] = "state"; -const char kZipCode[] = "zipcode"; -const char kCity[] = "city"; -const char kStreet[] = "street"; -// Address struct - -// Location struct -const char kGPSCoordinates[] = "gpsCoordinates"; -const char kAddress[] = "address"; -// Location struct - -// SongInfo struct -const char kArtist[] = "artist"; -const char kGenre[] = "genre"; -const char kAlbum[] = "album"; -const char kSongYear[] = "year"; -const char kDuration[] = "duration"; -// SongInfo struct - -// Advertisement struct -const char kProductName[] = "productName"; -const char kCompanyName[] = "companyName"; -const char kPhoneNumber[] = "phoneNumber"; -const char kLocation[] = "location"; -// Advertisement struct - -// EventDetails struct -const char kEventName[] = "eventName"; -// const char kPhoneNumber[] = "phoneNumber"; -const char kPrice[] = "price"; -const char kEventTime[] = "eventTime"; -// EventDetails struct - -// WebActivity struct -const char kURL[] = "url"; -const char kActionCode[] = "actionCode"; -// WebActivity struct -*/ // SetInteriorVehicleData request const char kModuleData[] = "moduleData"; // SetInteriorVehicleData request -// SetInteriorVehicleData response -// const char kModuleData[] = "moduleData"; -// SetInteriorVehicleData response - // GetInteriorVehicleData request const char kSubscribe[] = "subscribe"; // GetInteriorVehicleData request // GetInteriorVehicleData response -// const char kModuleData[] = "moduleData"; const char kIsSubscribed[] = "isSubscribed"; // GetInteriorVehicleData response -// OnInteriorVehicleData notification -// const char kModuleData[] = "moduleData"; -// OnInteriorVehicleData notification - // OnRemoteControlSettings notification const char kAccessMode[] = "accessMode"; const char kAllowed[] = "allowed"; @@ -238,10 +164,6 @@ const char kAudioState[] = "audioStreamingState"; } // namespace message_params namespace enums_value { -// TriggerSource enum -// const char kMenu[] = "MENU"; -// const char kVR[] = "VR"; -// TriggerSource enum // ModuleType enum const char kClimate[] = "CLIMATE"; -- cgit v1.2.1 From 08789ae20c7105cbac527c4b044fb2fff9284d07 Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 21 Aug 2017 13:54:39 +0300 Subject: Removes unused interfaces from AccessRemote class --- .../include/application_manager/core_service.h | 10 -- .../application_manager/policies/policy_handler.h | 12 --- .../include/application_manager/service.h | 10 -- .../application_manager/src/core_service.cc | 14 --- .../src/policies/policy_handler.cc | 8 -- .../test/rc_policy_handler_test.cc | 11 --- .../functional_module/test/include/mock_service.h | 4 - .../policies/policy_handler_interface.h | 12 --- .../policy/policy_external/policy/policy_manager.h | 12 --- .../policy/policy_regular/policy/policy_manager.h | 12 --- .../policies/mock_policy_handler_interface.h | 6 -- .../policy_external/policy/mock_policy_manager.h | 5 - .../policy_regular/policy/mock_policy_manager.h | 5 - .../policy_external/include/policy/access_remote.h | 41 -------- .../include/policy/access_remote_impl.h | 7 -- .../include/policy/policy_manager_impl.h | 8 -- .../policy_external/src/policy_manager_impl.cc | 34 ------- .../policy_regular/include/policy/access_remote.h | 40 -------- .../include/policy/access_remote_impl.h | 8 -- .../include/policy/policy_manager_impl.h | 9 +- .../policy_regular/src/access_remote_impl.cc | 47 +--------- .../policy_regular/src/policy_manager_impl.cc | 34 ------- .../policy_regular/test/access_remote_impl_test.cc | 103 --------------------- .../src/commands/base_command_request.cc | 4 +- 24 files changed, 4 insertions(+), 452 deletions(-) diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index 29af7454b9..56d135efcb 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -88,16 +88,6 @@ class CoreService : public Service { bool CheckModule(const ApplicationId& app_id, const std::string& module) FINAL; - /** - * Sets access to functional group which contains given RPC for application - * @param app_id id of application - * @param module type - * @param allowed true if driver has given access - */ - void SetAccess(const ApplicationId& app_id, - const std::string& module, - bool allowed) FINAL; - /** * Checks if application has remote control functions * @param app application diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index bce7484fdf..f451c19813 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -162,18 +162,6 @@ class PolicyHandler : public PolicyHandlerInterface, */ bool CheckModule(const PTString& app_id, const PTString& module) OVERRIDE; - /** - * Sets access to equipment of vehicle for application by RPC - * @param device_id unique identifier of device - * @param app_id policy id application - * @param module type - * @param allowed true if access is allowed - */ - void SetAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module, - bool allowed) OVERRIDE; - /** * @brief Notifies Remote apps about change in permissions * @param device_id Device on which app is running diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index a4eddc5447..be2570db3e 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -88,16 +88,6 @@ class Service { virtual bool CheckModule(const ApplicationId& app_id, const std::string& module) = 0; - /** - * Sets access to functional group which contains given RPC for application - * @param app_id id of application - * @param module type - * @param allowed true if driver has given access - */ - virtual void SetAccess(const ApplicationId& app_id, - const std::string& module, - bool allowed) = 0; - /** * @brief Get pointer to application by application id * @param app_id application id diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index 43a63b7d8d..4e41744e27 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -108,20 +108,6 @@ bool CoreService::CheckModule(const ApplicationId& app_id, return false; } -void CoreService::SetAccess(const ApplicationId& app_id, - const std::string& module, - bool allowed) { -#ifdef SDL_REMOTE_CONTROL - ApplicationSharedPtr app = GetApplication(app_id); - if (app) { - std::string device_handle = MessageHelper::GetDeviceMacAddressForHandle( - app->device(), application_manager_); - application_manager_.GetPolicyHandler().SetAccess( - device_handle, app->policy_app_id(), module, allowed); - } -#endif // SDL_REMOTE_CONTROL -} - bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const { #ifdef SDL_REMOTE_CONTROL return application_manager_.GetPolicyHandler().CheckHMIType( diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 574f362e42..ae4fb033e9 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -2006,14 +2006,6 @@ bool PolicyHandler::CheckModule(const PTString& app_id, return policy_manager_->CheckModule(app_id, module); } -void PolicyHandler::SetAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module, - bool allowed) { - POLICY_LIB_CHECK_VOID(); - policy_manager_->SetAccess(device_id, app_id, module, allowed); -} - void PolicyHandler::OnRemoteAppPermissionsChanged( const std::string& device_id, const std::string& application_id) { POLICY_LIB_CHECK_VOID(); diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index 760500af95..efc3f5d46d 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -288,17 +288,6 @@ TEST_F(RCPolicyHandlerTest, CheckAccess_ValidParams_SUCCESS) { policy_handler_.CheckAccess(kDeviceId_, kPolicyAppId_, module)); } -TEST_F(RCPolicyHandlerTest, SetAccess_ValidParams_SUCCESS) { - EnablePolicyAndPolicyManagerMock(); - - const PTString module("module"); - const bool allowed(true); - EXPECT_CALL(*mock_policy_manager_, - SetAccess(kDeviceId_, kPolicyAppId_, module, allowed)); - - policy_handler_.SetAccess(kDeviceId_, kPolicyAppId_, module, allowed); -} - TEST_F(RCPolicyHandlerTest, CheckModule_SUCCESS) { EnablePolicyAndPolicyManagerMock(); diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index 576c82542b..c9f2d91dfb 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -61,10 +61,6 @@ class MockService : public Service { const std::string& module)); MOCK_METHOD2(CheckModule, bool(const ApplicationId& app_id, const std::string& module)); - MOCK_METHOD3(SetAccess, - void(const ApplicationId& app_id, - const std::string& module, - bool allowed)); MOCK_METHOD1(RemoveHMIFakeParameters, void(application_manager::MessagePtr& message)); MOCK_CONST_METHOD1(IsRemoteControlApplication, diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index 7c4d53936e..1b27ee7e94 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -468,18 +468,6 @@ class PolicyHandlerInterface { */ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; - /** - * Sets access to equipment of vehicle for application by RPC - * @param device_id unique identifier of device - * @param app_id policy id application - * @param module type - * @param allowed true if access is allowed - */ - virtual void SetAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module, - bool allowed) = 0; - /** * @brief Notifies Remote apps about change in permissions * @param device_id Device on which app is running diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 51dfa427a2..2642f600cc 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -540,18 +540,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; - /** - * Sets access to equipment of vehicle for application by RPC - * @param dev_id unique identifier of device - * @param app_id policy id application - * @param module type - * @param allowed true if access is allowed - */ - virtual void SetAccess(const PTString& dev_id, - const PTString& app_id, - const PTString& module, - bool allowed) = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index c4d957f7c3..4d8ed65628 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -514,18 +514,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { */ virtual bool CheckModule(const PTString& app_id, const PTString& module) = 0; - /** - * Sets access to equipment of vehicle for application by RPC - * @param dev_id unique identifier of device - * @param app_id policy id application - * @param module type - * @param allowed true if access is allowed - */ - virtual void SetAccess(const PTString& dev_id, - const PTString& app_id, - const PTString& module, - bool allowed) = 0; - /* * Send OnPermissionsChange notification to mobile app * when it's permissions are changed. diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index 8a9223c97d..60420d1f5f 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -246,12 +246,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { bool(const policy::PTString& app_id, const policy::PTString& module)); - MOCK_METHOD4(SetAccess, - void(const policy::PTString& device_id, - const policy::PTString& app_id, - const policy::PTString& module, - bool allowed)); - MOCK_METHOD2(OnRemoteAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 11f2b0cdaf..7892de65f3 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -161,11 +161,6 @@ class MockPolicyManager : public PolicyManager { const PTString& module)); MOCK_METHOD2(CheckModule, bool(const PTString& app_id, const PTString& module)); - MOCK_METHOD4(SetAccess, - void(const PTString& dev_id, - const PTString& app_id, - const PTString& module, - bool allowed)); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index 735915304a..a3f93511c9 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -160,11 +160,6 @@ class MockPolicyManager : public PolicyManager { const PTString& module)); MOCK_METHOD2(CheckModule, bool(const PTString& app_id, const PTString& module)); - MOCK_METHOD4(SetAccess, - void(const PTString& dev_id, - const PTString& app_id, - const PTString& module, - bool allowed)); MOCK_METHOD2(SendAppPermissionsChanged, void(const std::string& device_id, const std::string& application_id)); diff --git a/src/components/policy/policy_external/include/policy/access_remote.h b/src/components/policy/policy_external/include/policy/access_remote.h index 6fc2141dbd..bf8dc608e6 100644 --- a/src/components/policy/policy_external/include/policy/access_remote.h +++ b/src/components/policy/policy_external/include/policy/access_remote.h @@ -92,47 +92,6 @@ typedef std::vector RemoteControlParams; class AccessRemote { public: virtual ~AccessRemote() {} - - /** - * Allows access subject to object - * @param who subject is dev_id and app_id - * @param what object is group_id - */ - virtual void Allow(const Subject& who, const Object& what) = 0; - - /** - * Denies access subject to object - * @param who subject is dev_id and app_id - * @param what object is group_id - */ - virtual void Deny(const Subject& who, const Object& what) = 0; - - /** - * Resets access subject to all object - * @param who subject is dev_id and app_id - */ - virtual void Reset(const Subject& who) = 0; - - /** - * Resets access to object for all subjects - * @param what object is group - */ - virtual void Reset(const Object& what) = 0; - - /* - * Resets all stored consents - */ - virtual void Reset() = 0; - - /** - * Checks access subject to object - * @param who subject is dev_id and app_id - * @param what object is group_id - * @return allowed if access was given, disallowed if access was denied - * manual if need to ask driver - */ - virtual TypeAccess Check(const Subject& who, const Object& what) const = 0; - /** * Checks permissions for module * @param app_id application ID diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h index 1822b6b3ae..f1518e052c 100644 --- a/src/components/policy/policy_external/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h @@ -47,13 +47,6 @@ class AccessRemoteImpl : public AccessRemote { public: AccessRemoteImpl(); explicit AccessRemoteImpl(utils::SharedPtr cache); - - virtual void Allow(const Subject& who, const Object& what); - virtual void Deny(const Subject& who, const Object& what); - virtual void Reset(const Subject& who); - virtual void Reset(const Object& what); - virtual void Reset(); - virtual TypeAccess Check(const Subject& who, const Object& what) const; virtual bool CheckModuleType(const PTString& app_id, policy_table::ModuleType module) const; virtual void SetDefaultHmiTypes(const Subject& who, diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 4257ef4372..93cd07349e 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -192,10 +192,6 @@ class PolicyManagerImpl : public PolicyManager { virtual bool GetHMITypes(const std::string& application_id, std::vector* app_types) OVERRIDE; virtual void set_access_remote(utils::SharedPtr access_remote); - TypeAccess CheckDriverConsent(const Subject& who, - const Object& what, - const std::string& rpc, - const RemoteControlParams& params); void CheckPTUUpdatesChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot); @@ -388,10 +384,6 @@ class PolicyManagerImpl : public PolicyManager { const PTString& app_id, const PTString& module); virtual bool CheckModule(const PTString& app_id, const PTString& module); - virtual void SetAccess(const PTString& dev_id, - const PTString& app_id, - const PTString& module, - bool allowed); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 8d3c7c2ebc..779933906a 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -1989,43 +1989,9 @@ bool PolicyManagerImpl::CheckModule(const PTString& app_id, access_remote_->CheckModuleType(app_id, module_type); } -TypeAccess PolicyManagerImpl::CheckDriverConsent( - const Subject& who, - const Object& what, - const std::string& rpc, - const RemoteControlParams& params) { - LOG4CXX_AUTO_TRACE(logger_); - - return access_remote_->Check(who, what); -} - -void PolicyManagerImpl::SetAccess(const PTString& dev_id, - const PTString& app_id, - const PTString& module, - bool allowed) { - LOG4CXX_AUTO_TRACE(logger_); - policy_table::ModuleType module_type; - bool is_valid = EnumFromJsonString(module, &module_type); - if (!is_valid) { - return; - } - - Subject who = {dev_id, app_id}; - Object what = {module_type}; - LOG4CXX_DEBUG(logger_, - "Driver's consent: " << who << ", " << what << " is " - << std::boolalpha << allowed); - if (allowed) { - access_remote_->Allow(who, what); - } else { - access_remote_->Deny(who, what); - } -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { - access_remote_->Reset(who); listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi); } else { LOG4CXX_WARN(logger_, diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h index dd0cbb0ce5..0097b3d5c7 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote.h +++ b/src/components/policy/policy_regular/include/policy/access_remote.h @@ -92,46 +92,6 @@ typedef std::vector RemoteControlParams; class AccessRemote { public: virtual ~AccessRemote() {} - /** - * Allows access subject to object - * @param who subject is dev_id and app_id - * @param what object is group_id - */ - virtual void Allow(const Subject& who, const Object& what) = 0; - - /** - * Denies access subject to object - * @param who subject is dev_id and app_id - * @param what object is group_id - */ - virtual void Deny(const Subject& who, const Object& what) = 0; - - /** - * Resets access subject to all object - * @param who subject is dev_id and app_id - */ - virtual void Reset(const Subject& who) = 0; - - /** - * Resets access to object for all subjects - * @param what object is group - */ - virtual void Reset(const Object& what) = 0; - - /* - * Resets all stored consents - */ - virtual void Reset() = 0; - - /** - * Checks access subject to object - * @param who subject is dev_id and app_id - * @param what object is group_id - * @return allowed if access was given, disallowed if access was denied - * manual if need to ask driver - */ - virtual TypeAccess Check(const Subject& who, const Object& what) const = 0; - /** * Checks permissions for module * @param app_id application ID diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h index 8b89a42744..bf9d8e1d36 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h @@ -51,13 +51,6 @@ class AccessRemoteImpl : public AccessRemote { AccessRemoteImpl(); explicit AccessRemoteImpl(utils::SharedPtr cache); - - virtual void Allow(const Subject& who, const Object& what); - virtual void Deny(const Subject& who, const Object& what); - virtual void Reset(const Subject& who); - virtual void Reset(const Object& what); - virtual void Reset(); - virtual TypeAccess Check(const Subject& who, const Object& what) const; virtual bool CheckModuleType(const PTString& app_id, policy_table::ModuleType module) const; virtual void SetDefaultHmiTypes(const Subject& who, @@ -82,7 +75,6 @@ class AccessRemoteImpl : public AccessRemote { bool CompareParameters(const policy_table::Strings& parameters, RemoteControlParams* input) const; utils::SharedPtr cache_; - AccessControlList acl_; HMIList hmi_types_; #ifdef BUILD_TESTS diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 0f1a298875..648fd85db6 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -192,10 +192,7 @@ class PolicyManagerImpl : public PolicyManager { virtual bool GetHMITypes(const std::string& application_id, std::vector* app_types) OVERRIDE; virtual void set_access_remote(utils::SharedPtr access_remote); - TypeAccess CheckDriverConsent(const Subject& who, - const Object& what, - const std::string& rpc, - const RemoteControlParams& params); + void CheckPTUUpdatesChange( const utils::SharedPtr pt_update, const utils::SharedPtr snapshot); @@ -359,10 +356,6 @@ class PolicyManagerImpl : public PolicyManager { const PTString& app_id, const PTString& module); virtual bool CheckModule(const PTString& app_id, const PTString& module); - virtual void SetAccess(const PTString& dev_id, - const PTString& app_id, - const PTString& module, - bool allowed); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); virtual bool GetModuleTypes(const std::string& policy_app_id, diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index 5f7959ebee..dfdb6ab579 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -110,29 +110,10 @@ struct ToModuleType { } }; -AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()), acl_() {} +AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {} AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) - : cache_(cache), acl_() {} - -TypeAccess AccessRemoteImpl::Check(const Subject& who, - const Object& what) const { - LOG4CXX_AUTO_TRACE(logger_); - AccessControlList::const_iterator i = acl_.find(what); - if (i != acl_.end()) { - const AccessControlRow& row = i->second; - AccessControlRow::const_iterator j = row.find(who); - if (j != row.end()) { - // who has permissions - TypeAccess ret = j->second; - LOG4CXX_TRACE(logger_, - "Subject " << who << " has permissions " << ret - << " to object " << what); - return ret; - } - } - return TypeAccess::kAllowed; -} + : cache_(cache) {} bool AccessRemoteImpl::CheckModuleType(const PTString& app_id, policy_table::ModuleType module) const { @@ -197,30 +178,6 @@ bool AccessRemoteImpl::CompareParameters( return input->empty(); } -void AccessRemoteImpl::Allow(const Subject& who, const Object& what) { - LOG4CXX_AUTO_TRACE(logger_); - acl_[what][who] = TypeAccess::kAllowed; -} - -void AccessRemoteImpl::Deny(const Subject& who, const Object& what) { - LOG4CXX_AUTO_TRACE(logger_); - acl_[what][who] = TypeAccess::kDisallowed; -} - -void AccessRemoteImpl::Reset(const Subject& who) { - LOG4CXX_AUTO_TRACE(logger_); - std::for_each(acl_.begin(), acl_.end(), Erase(who)); -} - -void AccessRemoteImpl::Reset(const Object& what) { - LOG4CXX_AUTO_TRACE(logger_); - acl_.erase(what); -} - -void AccessRemoteImpl::Reset() { - acl_.clear(); -} - void AccessRemoteImpl::SetDefaultHmiTypes(const Subject& who, const std::vector& hmi_types) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index 7075d5fc82..db076e3108 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -1219,43 +1219,9 @@ bool PolicyManagerImpl::CheckModule(const PTString& app_id, access_remote_->CheckModuleType(app_id, module_type); } -TypeAccess PolicyManagerImpl::CheckDriverConsent( - const Subject& who, - const Object& what, - const std::string& rpc, - const RemoteControlParams& params) { - LOG4CXX_AUTO_TRACE(logger_); - - return access_remote_->Check(who, what); -} - -void PolicyManagerImpl::SetAccess(const PTString& dev_id, - const PTString& app_id, - const PTString& module, - bool allowed) { - LOG4CXX_AUTO_TRACE(logger_); - policy_table::ModuleType module_type; - bool is_valid = EnumFromJsonString(module, &module_type); - if (!is_valid) { - return; - } - - Subject who = {dev_id, app_id}; - Object what = {module_type}; - LOG4CXX_DEBUG(logger_, - "Driver's consent: " << who << ", " << what << " is " - << std::boolalpha << allowed); - if (allowed) { - access_remote_->Allow(who, what); - } else { - access_remote_->Deny(who, what); - } -} - void PolicyManagerImpl::SendHMILevelChanged(const Subject& who) { std::string default_hmi("NONE"); if (GetDefaultHmi(who.app_id, &default_hmi)) { - access_remote_->Reset(who); listener()->OnUpdateHMIStatus(who.dev_id, who.app_id, default_hmi); } else { LOG4CXX_WARN(logger_, diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index 0b6e2aa1fc..65ed4fdf13 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -35,109 +35,6 @@ namespace policy { -TEST(AccessRemoteImplTest, Allow) { - AccessRemoteImpl access_remote; - Subject who = {"dev1", "12345"}; - Object what = {policy_table::MT_RADIO}; - access_remote.Allow(who, what); - AccessRemoteImpl::AccessControlList::const_iterator i = - access_remote.acl_.find(what); - ASSERT_NE(access_remote.acl_.end(), i); - AccessRemoteImpl::AccessControlRow::const_iterator j = i->second.find(who); - ASSERT_NE(i->second.end(), j); - EXPECT_EQ(TypeAccess::kAllowed, j->second); -} - -TEST(AccessRemoteImplTest, KeyMapTest) { - // Testing operator < to use as key of map - AccessRemoteImpl access_remote; - Subject who = {"dev1", "12345"}; - Object what1 = {policy_table::MT_RADIO}; - Object what2 = {policy_table::MT_CLIMATE}; - access_remote.Allow(who, what1); - access_remote.Allow(who, what2); - ASSERT_EQ(2u, access_remote.acl_.size()); -} - -TEST(AccessRemoteImplTest, Deny) { - AccessRemoteImpl access_remote; - Subject who = {"dev1", "12345"}; - Object what = {policy_table::MT_RADIO}; - access_remote.Deny(who, what); - AccessRemoteImpl::AccessControlList::const_iterator i = - access_remote.acl_.find(what); - ASSERT_NE(access_remote.acl_.end(), i); - AccessRemoteImpl::AccessControlRow::const_iterator j = i->second.find(who); - ASSERT_NE(i->second.end(), j); - EXPECT_EQ(TypeAccess::kDisallowed, j->second); -} - -TEST(AccessRemoteImplTest, ChangeAccess) { - AccessRemoteImpl access_remote; - Subject who = {"dev1", "12345"}; - Object what = {policy_table::MT_RADIO}; - access_remote.Allow(who, what); - ASSERT_EQ(TypeAccess::kAllowed, access_remote.acl_[what][who]); - access_remote.Deny(who, what); - ASSERT_EQ(TypeAccess::kDisallowed, access_remote.acl_[what][who]); - access_remote.Allow(who, what); - EXPECT_EQ(TypeAccess::kAllowed, access_remote.acl_[what][who]); -} - -TEST(AccessRemoteImplTest, ResetBySubject) { - AccessRemoteImpl access_remote; - Subject who = {"dev1", "12345"}; - Object what1 = {policy_table::MT_RADIO}; - Object what2 = {policy_table::MT_CLIMATE}; - access_remote.Allow(who, what1); - access_remote.Deny(who, what2); - ASSERT_EQ(2u, access_remote.acl_.size()); - ASSERT_EQ(1u, access_remote.acl_[what1].size()); - ASSERT_EQ(1u, access_remote.acl_[what2].size()); - - access_remote.Reset(who); - ASSERT_EQ(2u, access_remote.acl_.size()); - EXPECT_TRUE(access_remote.acl_[what1].empty()); - EXPECT_TRUE(access_remote.acl_[what2].empty()); -} - -TEST(AccessRemoteImplTest, ResetByObject) { - AccessRemoteImpl access_remote; - Subject who1 = {"dev1", "12345"}; - Subject who2 = {"dev2", "123456"}; - Object what = {policy_table::MT_RADIO}; - access_remote.Allow(who1, what); - access_remote.Deny(who2, what); - ASSERT_EQ(1u, access_remote.acl_.size()); - ASSERT_EQ(2u, access_remote.acl_[what].size()); - - access_remote.Reset(what); - EXPECT_TRUE(access_remote.acl_.empty()); -} - -TEST(AccessRemoteImplTest, CheckAllowed) { - AccessRemoteImpl access_remote; - Subject who = {"dev1", "12345"}; - Object what = {policy_table::MT_RADIO}; - access_remote.Allow(who, what); - - EXPECT_EQ(TypeAccess::kAllowed, access_remote.Check(who, what)); -} - -TEST(AccessRemoteImplTest, CheckDisallowed) { - AccessRemoteImpl access_remote; - Subject who = {"dev1", "12345"}; - Subject who1 = {"dev1", "123456"}; - Object what = {policy_table::MT_RADIO}; - - access_remote.Allow(who, what); - EXPECT_EQ(TypeAccess::kAllowed, access_remote.Check(who1, what)); - - access_remote.Reset(who); - access_remote.Deny(who1, what); - EXPECT_EQ(TypeAccess::kDisallowed, access_remote.Check(who1, what)); -} - TEST(AccessRemoteImplTest, CheckModuleType) { AccessRemoteImpl access_remote; access_remote.cache_->pt_ = new policy_table::Table(); diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index 32a12ed8fd..150d79d18b 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -368,7 +368,7 @@ application_manager::TypeAccess BaseCommandRequest::CheckAccess( return service_->CheckAccess(app_->app_id(), module); } -bool BaseCommandRequest::CheckDriverConsent() { +bool BaseCommandRequest:: CheckDriverConsent() { LOG4CXX_AUTO_TRACE(logger_); RCAppExtensionPtr extension = GetAppExtension(app_); if (!extension) { @@ -535,8 +535,6 @@ void BaseCommandRequest::ProcessAccessResponse( LOG4CXX_DEBUG(logger_, "Setting allowed access for " << app_->app_id() << " for " << module); - service_->SetAccess(app_->app_id(), module, is_allowed); - if (is_allowed) { rc_module_.resource_allocation_manager().ForceAcquireResource( module, app_->app_id()); -- cgit v1.2.1 From 029cc20b415269b002fe1905c1b692301c7226ec Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 21 Aug 2017 15:01:37 +0300 Subject: Replace CheckAccess with CheckModule for BaseCommandRequest Removed unused code after that --- .../include/application_manager/core_service.h | 9 ----- .../application_manager/policies/policy_handler.h | 11 ------ .../include/application_manager/service.h | 12 +----- .../application_manager/src/core_service.cc | 14 ------- .../src/policies/policy_handler.cc | 25 ------------ .../test/rc_policy_handler_test.cc | 21 ---------- .../functional_module/test/include/mock_service.h | 3 -- .../policies/policy_handler_interface.h | 12 ------ .../policy/policy_external/policy/policy_manager.h | 11 ------ .../policy/policy_regular/policy/policy_manager.h | 11 ------ .../policies/mock_policy_handler_interface.h | 5 --- .../policy_external/policy/mock_policy_manager.h | 4 -- .../policy_regular/policy/mock_policy_manager.h | 4 -- .../include/policy/access_remote_impl.h | 3 -- .../include/policy/policy_manager_impl.h | 3 -- .../policy_external/src/access_remote_impl.cc | 46 +--------------------- .../policy_external/src/policy_manager_impl.cc | 17 -------- .../test/include/policy/mock_access_remote.h | 15 ------- .../policy_regular/include/policy/access_remote.h | 17 -------- .../include/policy/access_remote_impl.h | 2 - .../include/policy/policy_manager_impl.h | 3 -- .../policy_regular/src/access_remote_impl.cc | 23 ----------- .../policy_regular/src/policy_manager_impl.cc | 15 ------- .../test/include/policy/mock_access_remote.h | 14 ------- .../remote_control/commands/base_command_request.h | 2 +- .../src/commands/base_command_request.cc | 14 +++---- .../test/commands/button_press_request_test.cc | 6 +-- .../get_interior_vehicle_data_request_test.cc | 3 +- .../set_interior_vehicle_data_request_test.cc | 9 ++--- 29 files changed, 16 insertions(+), 318 deletions(-) diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index 56d135efcb..e4512b1080 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -70,15 +70,6 @@ class CoreService : public Service { */ mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) FINAL; - /** - * Checks access to requested module of vehicle - * @param app_id id of application - * @param module type - * @return return allowed if module is allowed, otherwise - disallowed - */ - TypeAccess CheckAccess(const ApplicationId& app_id, - const std::string& module) FINAL; - /** * Checks if module for application is present in policy table * @param app_id id of application diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index f451c19813..4c7f6d6adc 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -143,17 +143,6 @@ class PolicyHandler : public PolicyHandlerInterface, const std::string& policy_app_id, const std::string& hmi_level) OVERRIDE; - /** - * Checks access to module of vehicle for application - * @param device_id unique identifier of device - * @param app_id policy id application - * @param module module name - * @return Allowed if module is allowed, otherwise disallowed - */ - application_manager::TypeAccess CheckAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module) OVERRIDE; - /** * Checks if module for application is present in policy table * @param app_id id of application diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index be2570db3e..1c34b06209 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -42,7 +42,7 @@ namespace application_manager { -enum TypeAccess { kNone, kDisallowed, kAllowed }; +enum TypeAccess { kDisallowed, kAllowed }; enum MessageValidationResult { SUCCESS = 0, @@ -69,16 +69,6 @@ class Service { */ virtual mobile_apis::Result::eType CheckPolicyPermissions(MessagePtr msg) = 0; - /** - * Checks access to module of vehicle for application - * @param device_id unique identifier of device - * @param app_id policy id application - * @param module module name - * @return Allowed if module is allowed, otherwise disallowed - */ - virtual TypeAccess CheckAccess(const ApplicationId& app_id, - const std::string& module) = 0; - /** * Checks if module for application is present in policy table * @param app_id id of application diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index 4e41744e27..d0e8bdd5f3 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -82,20 +82,6 @@ mobile_apis::Result::eType CoreService::CheckPolicyPermissions(MessagePtr msg) { #endif // SDL_REMOTE_CONTROL } -TypeAccess CoreService::CheckAccess(const ApplicationId& app_id, - const std::string& module) { -#ifdef SDL_REMOTE_CONTROL - ApplicationSharedPtr app = GetApplication(app_id); - if (app) { - std::string device_handle = MessageHelper::GetDeviceMacAddressForHandle( - app->device(), application_manager_); - return application_manager_.GetPolicyHandler().CheckAccess( - device_handle, app->policy_app_id(), module); - } -#endif // SDL_REMOTE_CONTROL - return kNone; -} - bool CoreService::CheckModule(const ApplicationId& app_id, const std::string& module) { #ifdef SDL_REMOTE_CONTROL diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index ae4fb033e9..10c1608b8c 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1955,23 +1955,6 @@ std::vector PolicyHandler::GetDevicesIds( return application_manager_.devices(policy_app_id); } -namespace { -application_manager::TypeAccess ConvertTypeAccess(policy::TypeAccess access) { - application_manager::TypeAccess converted; - switch (access) { - case policy::TypeAccess::kAllowed: - converted = application_manager::TypeAccess::kAllowed; - break; - case policy::TypeAccess::kDisallowed: - converted = application_manager::TypeAccess::kDisallowed; - break; - default: - converted = application_manager::TypeAccess::kNone; - } - return converted; -} -} // namespace - void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level) { LOG4CXX_AUTO_TRACE(logger_); @@ -1992,14 +1975,6 @@ void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app, } } -application_manager::TypeAccess PolicyHandler::CheckAccess( - const PTString& device_id, const PTString& app_id, const PTString& module) { - POLICY_LIB_CHECK(application_manager::TypeAccess::kNone); - policy::TypeAccess access = - policy_manager_->CheckAccess(device_id, app_id, module); - return ConvertTypeAccess(access); -} - bool PolicyHandler::CheckModule(const PTString& app_id, const PTString& module) { POLICY_LIB_CHECK(false); diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index efc3f5d46d..7faf3e36cb 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -267,27 +267,6 @@ TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_HmiLevelChanged_SUCCESS) { policy_handler_.OnUpdateHMILevel(kDeviceId_, kPolicyAppId_, hmi_level); } -TEST_F(RCPolicyHandlerTest, CheckAccess_ValidParams_SUCCESS) { - EnablePolicyAndPolicyManagerMock(); - - const PTString module("module"); - const PTString pt_rpc("rpc"); - const std::vector params; - - EXPECT_CALL(*mock_policy_manager_, - CheckAccess(kDeviceId_, kPolicyAppId_, module)) - .WillOnce(Return(policy::TypeAccess::kDisallowed)); - EXPECT_EQ(application_manager::TypeAccess::kDisallowed, - policy_handler_.CheckAccess(kDeviceId_, kPolicyAppId_, module)); - - EXPECT_CALL(*mock_policy_manager_, - CheckAccess(kDeviceId_, kPolicyAppId_, module)) - .WillOnce(Return(policy::TypeAccess::kAllowed)); - - EXPECT_EQ(application_manager::TypeAccess::kAllowed, - policy_handler_.CheckAccess(kDeviceId_, kPolicyAppId_, module)); -} - TEST_F(RCPolicyHandlerTest, CheckModule_SUCCESS) { EnablePolicyAndPolicyManagerMock(); diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index c9f2d91dfb..947896051f 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -56,9 +56,6 @@ class MockService : public Service { void(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level)); MOCK_CONST_METHOD0(GetRCCapabilities, const smart_objects::SmartObject*()); - MOCK_METHOD2(CheckAccess, - TypeAccess(const ApplicationId& app_id, - const std::string& module)); MOCK_METHOD2(CheckModule, bool(const ApplicationId& app_id, const std::string& module)); MOCK_METHOD1(RemoveHMIFakeParameters, diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index 1b27ee7e94..4d2d09b412 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -448,18 +448,6 @@ class PolicyHandlerInterface { const std::string& policy_app_id, const std::string& hmi_level) = 0; - /** - * Checks access to module of vehicle for application - * @param device_id unique identifier of device - * @param app_id policy id application - * @param module module name - * @return Allowed if module is allowed, otherwise disallowed - */ - virtual application_manager::TypeAccess CheckAccess( - const PTString& device_id, - const PTString& app_id, - const PTString& module) = 0; - /** * Checks if module for application is present in policy table * @param app_id id of application diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 2642f600cc..302f1639b7 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -521,17 +521,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { virtual bool GetHMITypes(const std::string& application_id, std::vector* app_types) = 0; - /** - * Checks access to module of vehicle for application - * @param device_id unique identifier of device - * @param app_id policy id application - * @param module module name - * @return Allowed if module is allowed, otherwise disallowed - */ - virtual TypeAccess CheckAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module) = 0; - /** * Checks if module for application is present in policy table * @param app_id id of application diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index 4d8ed65628..2acbb4c254 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -495,17 +495,6 @@ class PolicyManager : public usage_statistics::StatisticsManager { virtual bool GetHMITypes(const std::string& application_id, std::vector* app_types) = 0; - /** - * Checks access to module of vehicle for application - * @param device_id unique identifier of device - * @param app_id policy id application - * @param module module name - * @return Allowed if module is allowed, otherwise disallowed - */ - virtual TypeAccess CheckAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module) = 0; - /** * Checks if module for application is present in policy table * @param app_id id of application diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index 60420d1f5f..812df19ccd 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -236,11 +236,6 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { bool(const std::string& application_id, mobile_apis::AppHMIType::eType hmi, const smart_objects::SmartObject* app_types)); - MOCK_METHOD3( - CheckAccess, - application_manager::TypeAccess(const policy::PTString& device_id, - const policy::PTString& app_id, - const policy::PTString& module)); MOCK_METHOD2(CheckModule, bool(const policy::PTString& app_id, diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index 7892de65f3..83874b1c2f 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -155,10 +155,6 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(GetHMITypes, bool(const std::string& application_id, std::vector* app_types)); - MOCK_METHOD3(CheckAccess, - TypeAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module)); MOCK_METHOD2(CheckModule, bool(const PTString& app_id, const PTString& module)); MOCK_METHOD2(SendAppPermissionsChanged, diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index a3f93511c9..0987da4bd7 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -154,10 +154,6 @@ class MockPolicyManager : public PolicyManager { MOCK_METHOD2(GetHMITypes, bool(const std::string& application_id, std::vector* app_types)); - MOCK_METHOD3(CheckAccess, - TypeAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module)); MOCK_METHOD2(CheckModule, bool(const PTString& app_id, const PTString& module)); MOCK_METHOD2(SendAppPermissionsChanged, diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h index f1518e052c..268153f7f4 100644 --- a/src/components/policy/policy_external/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h @@ -60,8 +60,6 @@ class AccessRemoteImpl : public AccessRemote { std::vector* modules); private: - typedef std::map AccessControlRow; - typedef std::map AccessControlList; typedef std::map HMIList; inline void set_enabled(bool value); inline bool country_consent() const; @@ -77,7 +75,6 @@ class AccessRemoteImpl : public AccessRemote { RemoteControlParams* input) const; utils::SharedPtr cache_; bool enabled_; - AccessControlList acl_; HMIList hmi_types_; friend struct Erase; diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 93cd07349e..b6865b645f 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -380,9 +380,6 @@ class PolicyManagerImpl : public PolicyManager { void GetPermissions(const std::string device_id, const std::string application_id, Permissions* data); - virtual TypeAccess CheckAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module); virtual bool CheckModule(const PTString& app_id, const PTString& module); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index a5628c5790..410c5f7520 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -44,29 +44,6 @@ using rpc::policy_table_interface_base::EnumFromJsonString; namespace policy { -struct Erase { - private: - const Subject& who_; - - public: - explicit Erase(const Subject& who) : who_(who) {} - void operator()(AccessRemoteImpl::AccessControlList::value_type& row) const { - row.second.erase(who_); - } -}; - -struct IsTypeAccess { - private: - const TypeAccess& type_; - - public: - explicit IsTypeAccess(const TypeAccess& type) : type_(type) {} - bool operator()( - const AccessRemoteImpl::AccessControlRow::value_type& item) const { - return item.second == type_; - } -}; - struct ToHMIType { policy_table::AppHMITypes::value_type operator()(int item) const { policy_table::AppHMIType type = static_cast(item); @@ -110,29 +87,10 @@ struct ToModuleType { } }; -AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()), acl_() {} +AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {} AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) - : cache_(cache), acl_() {} - -TypeAccess AccessRemoteImpl::Check(const Subject& who, - const Object& what) const { - LOG4CXX_AUTO_TRACE(logger_); - AccessControlList::const_iterator i = acl_.find(what); - if (i != acl_.end()) { - const AccessControlRow& row = i->second; - AccessControlRow::const_iterator j = row.find(who); - if (j != row.end()) { - // who has permissions - TypeAccess ret = j->second; - LOG4CXX_TRACE(logger_, - "Subject " << who << " has permissions " << ret - << " to object " << what); - return ret; - } - } - return TypeAccess::kAllowed; -} + : cache_(cache) {} bool AccessRemoteImpl::CheckModuleType(const PTString& app_id, policy_table::ModuleType module) const { diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 779933906a..7e7dd2b7c1 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -1964,23 +1964,6 @@ bool PolicyManagerImpl::GetHMITypes(const std::string& application_id, return hmi_types; } -TypeAccess PolicyManagerImpl::CheckAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module, - const PTString& rpc, - const RemoteControlParams& params) { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Module type: " << module); - - policy_table::ModuleType module_type; - bool is_valid = EnumFromJsonString(module, &module_type); - if (is_valid && access_remote_->CheckModuleType(app_id, module_type)) { - return TypeAccess::kAllowed; - } - LOG4CXX_DEBUG(logger_, TypeAccess::kDisallowed); - return TypeAccess::kDisallowed; -} - bool PolicyManagerImpl::CheckModule(const PTString& app_id, const PTString& module) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/policy/policy_external/test/include/policy/mock_access_remote.h b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h index a0cb60fa9a..151958fd95 100644 --- a/src/components/policy/policy_external/test/include/policy/mock_access_remote.h +++ b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h @@ -49,20 +49,6 @@ class MockObject : public policy::Object { class MockAccessRemote : public policy::AccessRemote { public: - MOCK_METHOD0(Init, void()); - MOCK_METHOD0(Enable, void()); - MOCK_METHOD0(Disable, void()); - MOCK_CONST_METHOD0(IsEnabled, bool()); - - MOCK_METHOD2(Allow, - void(const policy::Subject& who, const policy::Object& what)); - MOCK_METHOD2(Deny, - void(const policy::Subject& who, const policy::Object& what)); - MOCK_METHOD1(Reset, void(const policy::Subject& who)); - MOCK_METHOD1(Reset, void(const policy::Object& what)); - MOCK_CONST_METHOD2(Check, - policy::TypeAccess(const policy::Subject& who, - const policy::Object& what)); MOCK_CONST_METHOD3( FindGroup, policy::PTString(const policy::Subject& who, @@ -81,7 +67,6 @@ class MockAccessRemote : public policy::AccessRemote { bool(const policy::PTString& app_id, policy_table::ModuleType module)); MOCK_METHOD1(IsAppRemoteControl, bool(const policy::Subject& who)); - MOCK_METHOD0(Reset, void()); MOCK_METHOD2(GetModuleTypes, bool(const std::string& application_id, std::vector* modules)); diff --git a/src/components/policy/policy_regular/include/policy/access_remote.h b/src/components/policy/policy_regular/include/policy/access_remote.h index 0097b3d5c7..a3d7e7dc3a 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote.h +++ b/src/components/policy/policy_regular/include/policy/access_remote.h @@ -41,23 +41,6 @@ namespace policy_table = ::rpc::policy_table_interface_base; namespace policy { - -enum TypeAccess { kDisallowed, kAllowed }; -inline std::ostream& operator<<(std::ostream& output, TypeAccess x) { - output << "Access: "; - switch (x) { - case kDisallowed: - output << "DISALLOWED"; - break; - case kAllowed: - output << "ALLOWED"; - break; - default: - output << "Error: Unknown type"; - } - return output; -} - struct Subject { PTString dev_id; PTString app_id; diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h index bf9d8e1d36..df93808776 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h @@ -45,8 +45,6 @@ namespace policy { class AccessRemoteImpl : public AccessRemote { public: - typedef std::map AccessControlRow; - typedef std::map AccessControlList; typedef std::map HMIList; AccessRemoteImpl(); diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 648fd85db6..f8362f8546 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -352,9 +352,6 @@ class PolicyManagerImpl : public PolicyManager { void GetPermissions(const std::string device_id, const std::string application_id, Permissions* data); - virtual TypeAccess CheckAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module); virtual bool CheckModule(const PTString& app_id, const PTString& module); virtual void SendAppPermissionsChanged(const std::string& device_id, const std::string& application_id); diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index dfdb6ab579..029bbfaa71 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -44,29 +44,6 @@ using rpc::policy_table_interface_base::EnumFromJsonString; namespace policy { -struct Erase { - private: - const Subject& who_; - - public: - explicit Erase(const Subject& who) : who_(who) {} - void operator()(AccessRemoteImpl::AccessControlList::value_type& row) const { - row.second.erase(who_); - } -}; - -struct IsTypeAccess { - private: - const TypeAccess& type_; - - public: - explicit IsTypeAccess(const TypeAccess& type) : type_(type) {} - bool operator()( - const AccessRemoteImpl::AccessControlRow::value_type& item) const { - return item.second == type_; - } -}; - struct ToHMIType { policy_table::AppHMITypes::value_type operator()(int item) const { policy_table::AppHMIType type = static_cast(item); diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index db076e3108..30e2be537b 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -1196,21 +1196,6 @@ bool PolicyManagerImpl::GetHMITypes(const std::string& application_id, return hmi_types; } -TypeAccess PolicyManagerImpl::CheckAccess(const PTString& device_id, - const PTString& app_id, - const PTString& module) { - LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "Module type: " << module); - - policy_table::ModuleType module_type; - bool is_valid = EnumFromJsonString(module, &module_type); - if (is_valid && access_remote_->CheckModuleType(app_id, module_type)) { - return TypeAccess::kAllowed; - } - LOG4CXX_DEBUG(logger_, TypeAccess::kDisallowed); - return TypeAccess::kDisallowed; -} - bool PolicyManagerImpl::CheckModule(const PTString& app_id, const PTString& module) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h index ffd0c5eba0..7b7191d52d 100644 --- a/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h +++ b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h @@ -49,19 +49,6 @@ class MockObject : public policy::Object { class MockAccessRemote : public policy::AccessRemote { public: - MOCK_METHOD0(Init, void()); - MOCK_METHOD0(Enable, void()); - MOCK_METHOD0(Disable, void()); - MOCK_CONST_METHOD0(IsEnabled, bool()); - MOCK_METHOD2(Allow, - void(const policy::Subject& who, const policy::Object& what)); - MOCK_METHOD2(Deny, - void(const policy::Subject& who, const policy::Object& what)); - MOCK_METHOD1(Reset, void(const policy::Subject& who)); - MOCK_METHOD1(Reset, void(const policy::Object& what)); - MOCK_CONST_METHOD2(Check, - policy::TypeAccess(const policy::Subject& who, - const policy::Object& what)); MOCK_CONST_METHOD3( FindGroup, policy::PTString(const policy::Subject& who, @@ -80,7 +67,6 @@ class MockAccessRemote : public policy::AccessRemote { bool(const policy::PTString& app_id, policy_table::ModuleType module)); MOCK_METHOD1(IsAppRemoteControl, bool(const policy::Subject& who)); - MOCK_METHOD0(Reset, void()); MOCK_METHOD2(GetModuleTypes, bool(const std::string& application_id, std::vector* modules)); diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h index 315acfd6c2..a76f972930 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_request.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h @@ -229,7 +229,7 @@ class BaseCommandRequest virtual std::string ModuleType(const Json::Value& message); virtual std::vector ControlData(const Json::Value& message); - virtual application_manager::TypeAccess CheckAccess( + virtual application_manager::TypeAccess CheckModule( const Json::Value& message); bool auto_allowed() const { diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index 150d79d18b..3961b79688 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -362,13 +362,15 @@ bool BaseCommandRequest::CheckPolicyPermissions() { return true; } -application_manager::TypeAccess BaseCommandRequest::CheckAccess( +application_manager::TypeAccess BaseCommandRequest::CheckModule( const Json::Value& message) { const std::string& module = ModuleType(message); - return service_->CheckAccess(app_->app_id(), module); + return service_->CheckModule(app_->app_id(), module) + ? application_manager::TypeAccess::kAllowed + : application_manager::TypeAccess::kDisallowed; } -bool BaseCommandRequest:: CheckDriverConsent() { +bool BaseCommandRequest::CheckDriverConsent() { LOG4CXX_AUTO_TRACE(logger_); RCAppExtensionPtr extension = GetAppExtension(app_); if (!extension) { @@ -379,7 +381,7 @@ bool BaseCommandRequest:: CheckDriverConsent() { LOG4CXX_DEBUG(logger_, "Request: " << message_->json_message()); reader.parse(message_->json_message(), value); - application_manager::TypeAccess access = CheckAccess(value); + application_manager::TypeAccess access = CheckModule(value); if (IsAutoAllowed(access)) { set_auto_allowed(true); @@ -449,9 +451,6 @@ void BaseCommandRequest::SendDisallowed( ? "The RPC is disallowed by vehicle settings" : disallowed_info_; break; - case application_manager::kNone: - info = "Internal issue"; - break; default: info = "Unknown issue"; } @@ -572,7 +571,6 @@ void BaseCommandRequest::CheckHMILevel(application_manager::TypeAccess access, } break; case application_manager::kDisallowed: - case application_manager::kNone: default: LOG4CXX_DEBUG(logger_, "No access information or disallowed: " diff --git a/src/components/remote_control/test/commands/button_press_request_test.cc b/src/components/remote_control/test/commands/button_press_request_test.cc index 4423f8cad8..063aa59b6f 100644 --- a/src/components/remote_control/test/commands/button_press_request_test.cc +++ b/src/components/remote_control/test/commands/button_press_request_test.cc @@ -199,8 +199,7 @@ TEST_F(ButtonPressRequestTest, application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _)) - .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true)); EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1)); const std::string resource = "CLIMATE"; @@ -255,8 +254,7 @@ TEST_F( application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _)) - .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true)); EXPECT_CALL(mock_allocation_manager_, IsResourceFree(_)) .WillOnce(Return(true)); EXPECT_CALL(mock_allocation_manager_, AcquireResource(_, _)) diff --git a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc index 98404b441a..5e7366f48c 100644 --- a/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc +++ b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc @@ -164,8 +164,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _)) - .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true)); EXPECT_CALL(*mock_service_, GetNextCorrelationID()).WillOnce(Return(1)); application_manager::MessagePtr result_msg; EXPECT_CALL(*mock_service_, SendMessageToHMI(_)) diff --git a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc index b8e27a9c42..ac8548dd0d 100644 --- a/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc +++ b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc @@ -174,8 +174,7 @@ TEST_F(SetInteriorVehicleDataRequestTest, application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _)) - .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true)); EXPECT_CALL(*mock_service_, GetNextCorrelationID()) .WillOnce(Return(kCorrelationId)); @@ -242,8 +241,7 @@ TEST_F( application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _)) - .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true)); EXPECT_CALL(*mock_service_, GetNextCorrelationID()) .WillOnce(Return(kCorrelationId)); @@ -312,8 +310,7 @@ TEST_F(SetInteriorVehicleDataRequestTest, application_manager::AppExtensionPtr app_extension; EXPECT_CALL(*mock_app_, AddExtension(_)) .WillOnce(DoAll(SaveArg<0>(&app_extension), Return(true))); - EXPECT_CALL(*mock_service_, CheckAccess(_, _)) - .WillOnce(Return(application_manager::TypeAccess::kAllowed)); + EXPECT_CALL(*mock_service_, CheckModule(_, _)).WillOnce(Return(true)); EXPECT_CALL(*mock_service_, SendMessageToHMI(_)).Times(0); application_manager::MessagePtr result_msg; -- cgit v1.2.1 From 2baa8d82434f6732192ff8764e52c0e43b2cf48a Mon Sep 17 00:00:00 2001 From: Andrey Oleynik Date: Mon, 21 Aug 2017 18:18:06 +0300 Subject: Fixes typo in conversion string --- src/components/remote_control/src/message_helper.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc index 5fdcde218c..734e220359 100644 --- a/src/components/remote_control/src/message_helper.cc +++ b/src/components/remote_control/src/message_helper.cc @@ -49,7 +49,7 @@ std::map GenerateAPINames() { result.insert(std::make_pair( RCFunctionID::ON_INTERIOR_VEHICLE_DATA, "OnInteriorVehicleData")); result.insert(std::make_pair( - RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSetting")); + RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSettings")); return result; } -- cgit v1.2.1 From 03752b1cf0467a960e9777081352cd2bb138875a Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Mon, 21 Aug 2017 18:56:36 +0300 Subject: Redundant interface removed --- .../application_manager/application_manager_impl.h | 6 ----- .../include/application_manager/core_service.h | 6 ----- .../include/application_manager/service.h | 7 ----- .../src/application_manager_impl.cc | 5 ---- .../application_manager/src/core_service.cc | 7 ----- .../functional_module/src/generic_module.cc | 6 ----- .../functional_module/test/include/mock_service.h | 2 -- .../test/src/generic_module_test.cc | 31 ---------------------- .../hmi_message_handler/hmi_message_adapter_impl.h | 7 ----- .../hmi_message_handler/hmi_message_handler_impl.h | 7 ----- .../hmi_message_handler/messagebroker_adapter.h | 7 ----- .../src/hmi_message_adapter_impl.cc | 6 ----- .../src/hmi_message_handler_impl.cc | 11 -------- .../src/messagebroker_adapter.cc | 6 ----- .../application_manager/application_manager.h | 3 --- .../hmi_message_handler/hmi_message_adapter.h | 9 ------- .../hmi_message_handler/hmi_message_handler.h | 9 ------- .../application_manager/mock_application_manager.h | 2 -- 18 files changed, 137 deletions(-) diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index d8f02a1f2f..7a55332220 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -298,12 +298,6 @@ class ApplicationManagerImpl */ bool MakeAppFullScreen(uint32_t app_id); - /** - * @brief Subscribes to notification from HMI - * @param hmi_notification string with notification name - */ - void SubscribeToHMINotification(const std::string& hmi_notification) OVERRIDE; - /** * @brief Checks HMI level and returns true if audio streaming is allowed */ diff --git a/src/components/application_manager/include/application_manager/core_service.h b/src/components/application_manager/include/application_manager/core_service.h index e4512b1080..a342df2314 100644 --- a/src/components/application_manager/include/application_manager/core_service.h +++ b/src/components/application_manager/include/application_manager/core_service.h @@ -133,12 +133,6 @@ class CoreService : public Service { */ std::vector GetApplications(AppExtensionUID uid) FINAL; - /** - * @brief Subscribes to notification from HMI - * @param hmi_notification string with notification name - */ - void SubscribeToHMINotification(const std::string& hmi_notification) FINAL; - /** * @brief Change hmi level of app and notify it * @param app Application to be changed and notified diff --git a/src/components/application_manager/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h index 1c34b06209..f6d8cf2efe 100644 --- a/src/components/application_manager/include/application_manager/service.h +++ b/src/components/application_manager/include/application_manager/service.h @@ -118,13 +118,6 @@ class Service { virtual std::vector GetApplications( AppExtensionUID uid) = 0; - /** - * @brief Subscribes to notification from HMI - * @param hmi_notification string with notification name - */ - virtual void SubscribeToHMINotification( - const std::string& hmi_notification) = 0; - /** * @brief Change hmi level of app and notify it * @param app Application to be changed and notified diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 8fbd4cb5b5..8fcec4ac1a 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -4105,11 +4105,6 @@ bool ApplicationManagerImpl::IsVideoStreamingAllowed( return Compare(app->hmi_level(), HMI_FULL, HMI_LIMITED); } -void ApplicationManagerImpl::SubscribeToHMINotification( - const std::string& hmi_notification) { - hmi_handler_->SubscribeToHMINotification(hmi_notification); -} - void ApplicationManagerImpl::ChangeAppsHMILevel( uint32_t app_id, mobile_apis::HMILevel::eType level) { using namespace mobile_apis::HMILevel; diff --git a/src/components/application_manager/src/core_service.cc b/src/components/application_manager/src/core_service.cc index d0e8bdd5f3..8a699d0404 100644 --- a/src/components/application_manager/src/core_service.cc +++ b/src/components/application_manager/src/core_service.cc @@ -152,13 +152,6 @@ std::vector CoreService::GetApplications( return result; } -void CoreService::SubscribeToHMINotification( - const std::string& hmi_notification) { - if (!hmi_notification.empty()) { - application_manager_.SubscribeToHMINotification(hmi_notification); - } -} - void CoreService::ChangeNotifyHMILevel(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level) { application_manager_.ChangeAppsHMILevel(app->app_id(), level); diff --git a/src/components/functional_module/src/generic_module.cc b/src/components/functional_module/src/generic_module.cc index 14a083ca6a..142b1ef58c 100644 --- a/src/components/functional_module/src/generic_module.cc +++ b/src/components/functional_module/src/generic_module.cc @@ -45,12 +45,6 @@ void GenericModule::set_service(application_manager::ServicePtr service) { void GenericModule::OnServiceStateChanged(ServiceState state) { state_ = state; - - if (HMI_ADAPTER_INITIALIZED == state_) { - // We must subscribe to necessary HMI notifications - service_->SubscribeToHMINotification(hmi_api::on_interior_vehicle_data); - service_->SubscribeToHMINotification(hmi_api::on_remote_control_settings); - } } application_manager::ServicePtr GenericModule::service() { diff --git a/src/components/functional_module/test/include/mock_service.h b/src/components/functional_module/test/include/mock_service.h index 947896051f..53ec993db3 100644 --- a/src/components/functional_module/test/include/mock_service.h +++ b/src/components/functional_module/test/include/mock_service.h @@ -47,8 +47,6 @@ class MockService : public Service { MOCK_METHOD0(GetNextCorrelationID, uint32_t()); MOCK_METHOD1(GetApplications, std::vector(AppExtensionUID)); - MOCK_METHOD1(SubscribeToHMINotification, - void(const std::string& hmi_notification)); MOCK_METHOD2(ChangeNotifyHMILevel, void(ApplicationSharedPtr app, mobile_apis::HMILevel::eType level)); diff --git a/src/components/functional_module/test/src/generic_module_test.cc b/src/components/functional_module/test/src/generic_module_test.cc index b052050cdb..71d8325f6d 100644 --- a/src/components/functional_module/test/src/generic_module_test.cc +++ b/src/components/functional_module/test/src/generic_module_test.cc @@ -24,37 +24,6 @@ TEST(GenericModuleTest, SetService) { EXPECT_EQ(exp_service.get(), out_service.get()); } -TEST(GenericModuleTest, OnServiceStateChangedFail) { - DriverGenericModuleTest module(18); - MockService* mock_service = new MockService(); - ServicePtr exp_service(mock_service); - module.set_service(exp_service); - - EXPECT_CALL(*mock_service, SubscribeToHMINotification(_)).Times(0); - - module.OnServiceStateChanged(LOWVOLTAGE); -} - -TEST(GenericModuleTest, OnServiceStateChangedPass) { - DriverGenericModuleTest module(18); - MockService* mock_service = new MockService(); - ServicePtr exp_service(mock_service); - module.set_service(exp_service); - - EXPECT_CALL(*mock_service, SubscribeToHMINotification(_)).Times(2); - - module.OnServiceStateChanged(HMI_ADAPTER_INITIALIZED); -} - -TEST(GenericModuleTest, AddObserver) { - DriverGenericModuleTest module(18); - MockModuleObserver observer; - module.AddObserver(&observer); - const DriverGenericModuleTest::Observers& full = module.observers(); - ASSERT_EQ(1u, full.size()); - EXPECT_EQ(&observer, full[0]); -} - TEST(GenericModuleTest, RemoveObserver) { DriverGenericModuleTest module(18); MockModuleObserver* observer = new MockModuleObserver(); diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h index 1a28c89bda..f2a5ce2dd8 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h @@ -53,13 +53,6 @@ class HMIMessageAdapterImpl : public HMIMessageAdapter { */ ~HMIMessageAdapterImpl(); -#ifdef SDL_REMOTE_CONTROL - /** - * @brief Subscribes to notification from HMI - * @param hmi_notification string with notification name - */ - void SubscribeToHMINotification(const std::string& hmi_notification) OVERRIDE; -#endif // SDL_REMOTE_CONTROL protected: virtual HMIMessageHandler* handler() const { return handler_; diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h index daba87e738..0d85c30fc2 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h @@ -96,13 +96,6 @@ class HMIMessageHandlerImpl : public HMIMessageHandler, void AddHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE; void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE; -#ifdef SDL_REMOTE_CONTROL - /** - * @brief Subscribes to notification from HMI - * @param hmi_notification string with notification name - */ - void SubscribeToHMINotification(const std::string& hmi_notification) OVERRIDE; -#endif // SDL_REMOTE_CONTROL const HMIMessageHandlerSettings& get_settings() const OVERRIDE; #ifdef BUILD_TESTS diff --git a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h index 8acc8fb207..f582cb2b81 100644 --- a/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h +++ b/src/components/hmi_message_handler/include/hmi_message_handler/messagebroker_adapter.h @@ -76,13 +76,6 @@ class MessageBrokerAdapter : public HMIMessageAdapterImpl, void* SubscribeAndBeginReceiverThread(void* param); -#ifdef SDL_REMOTE_CONTROL - /** - * @brief Subscribes to notification from HMI - * @param hmi_notification string with notification name - */ - void SubscribeToHMINotification(const std::string& hmi_notification) FINAL; -#endif // SDL_REMOTE_CONTROL protected: void ProcessRecievedFromMB(Json::Value& root); diff --git a/src/components/hmi_message_handler/src/hmi_message_adapter_impl.cc b/src/components/hmi_message_handler/src/hmi_message_adapter_impl.cc index e58c5a8fb6..48874618a0 100644 --- a/src/components/hmi_message_handler/src/hmi_message_adapter_impl.cc +++ b/src/components/hmi_message_handler/src/hmi_message_adapter_impl.cc @@ -40,10 +40,4 @@ HMIMessageAdapterImpl::~HMIMessageAdapterImpl() { handler_ = 0; } -#ifdef SDL_REMOTE_CONTROL -void HMIMessageAdapterImpl::SubscribeToHMINotification( - const std::string& hmi_notification) { - // TODO(SL): Find an immplementation -} -#endif // SDL_REMOTE_CONTROL } // namespace hmi_message_handler diff --git a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc index 654b67de7f..70865f7771 100644 --- a/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc +++ b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc @@ -132,16 +132,5 @@ void HMIMessageHandlerImpl::Handle(const impl::MessageToHmi message) { (*it)->SendMessageToHMI(message); } } -#ifdef SDL_REMOTE_CONTROL -void HMIMessageHandlerImpl::SubscribeToHMINotification( - const std::string& hmi_notification) { - sync_primitives::AutoLock lock(message_adapters_locker_); - for (std::set::iterator it = message_adapters_.begin(); - it != message_adapters_.end(); - ++it) { - (*it)->SubscribeToHMINotification(hmi_notification); - } -} -#endif // SDL_REMOTE_CONTROL } // namespace hmi_message_handler diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc index 6702b10cee..66c0fa3dc7 100644 --- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc +++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc @@ -141,12 +141,6 @@ void MessageBrokerAdapter::SubscribeTo() { LOG4CXX_INFO(logger_, "Subscribed to notifications."); } -#ifdef SDL_REMOTE_CONTROL -void MessageBrokerAdapter::SubscribeToHMINotification( - const std::string& hmi_notification) { - MessageBrokerController::subscribeTo(hmi_notification); -} -#endif void* MessageBrokerAdapter::SubscribeAndBeginReceiverThread(void* param) { PassToThread(threads::Thread::CurrentId()); diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index e275d67f74..6659022ee5 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -164,9 +164,6 @@ class ApplicationManager { virtual ApplicationSharedPtr application( const std::string& device_id, const std::string& policy_app_id) const = 0; - virtual void SubscribeToHMINotification( - const std::string& hmi_notification) = 0; - virtual uint32_t GetDeviceHandle(uint32_t connection_key) = 0; /** diff --git a/src/components/include/hmi_message_handler/hmi_message_adapter.h b/src/components/include/hmi_message_handler/hmi_message_adapter.h index 9423f74394..704cc619be 100644 --- a/src/components/include/hmi_message_handler/hmi_message_adapter.h +++ b/src/components/include/hmi_message_handler/hmi_message_adapter.h @@ -49,15 +49,6 @@ class HMIMessageAdapter : public HMIMessageSender { */ virtual ~HMIMessageAdapter() {} -#ifdef SDL_REMOTE_CONTROL - /** - * @brief Subscribes to notification from HMI - * @param hmi_notification string with notification name - */ - virtual void SubscribeToHMINotification( - const std::string& hmi_notification) = 0; -#endif // SDL_REMOTE_CONTROL - protected: /** * \brief Interface for subscriptions. diff --git a/src/components/include/hmi_message_handler/hmi_message_handler.h b/src/components/include/hmi_message_handler/hmi_message_handler.h index 5c4a443407..411d19fb75 100644 --- a/src/components/include/hmi_message_handler/hmi_message_handler.h +++ b/src/components/include/hmi_message_handler/hmi_message_handler.h @@ -51,15 +51,6 @@ class HMIMessageHandler : public HMIMessageObserver, public HMIMessageSender { virtual void AddHMIMessageAdapter(HMIMessageAdapter* adapter) = 0; virtual void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) = 0; -#ifdef SDL_REMOTE_CONTROL - /** - * @brief Subscribes to notification from HMI - * @param hmi_notification string with notification name - */ - virtual void SubscribeToHMINotification( - const std::string& hmi_notification) = 0; -#endif // SDL_REMOTE_CONTROL - /** * \brief Hmi message handler settings getter * \return pointer to hmi message handler settings class diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 139efbf1ee..4dde99dbfc 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -81,8 +81,6 @@ class MockApplicationManager : public application_manager::ApplicationManager { application_manager::ApplicationSharedPtr( const std::string& device_id, const std::string& policy_app_id)); - MOCK_METHOD1(SubscribeToHMINotification, - void(const std::string& hmi_notification)); MOCK_METHOD1(GetDeviceHandle, uint32_t(uint32_t connection_key)); MOCK_CONST_METHOD1(IsAudioStreamingAllowed, bool(uint32_t connection_key)); MOCK_CONST_METHOD1(IsVideoStreamingAllowed, bool(uint32_t connection_key)); -- cgit v1.2.1 From feeec44f77aeca1ae4fa438d62d9b534cb2e9f6a Mon Sep 17 00:00:00 2001 From: ChrisB-Elektrobit Date: Mon, 21 Aug 2017 16:40:52 -0400 Subject: - adding a test to cover the case where metadata tagging is provided but no accompanying field data exists; this should result in a 'WARNINGS' result code --- .../test/commands/mobile/show_test.cc | 73 ++++++++++++++++++---- 1 file changed, 61 insertions(+), 12 deletions(-) diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc index 01d4c8105f..17fbcde9dd 100644 --- a/src/components/application_manager/test/commands/mobile/show_test.cc +++ b/src/components/application_manager/test/commands/mobile/show_test.cc @@ -156,11 +156,14 @@ class ShowRequestTest : public CommandRequestTest { hmi_apis::Common_TextFieldName::eType field_name, const char* field, size_t num_tags, - int32_t* field_tags) { + int32_t* field_tags, + bool set_field_text = true) { SmartObject msg_params(smart_objects::SmartType_Map); (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; (*msg)[am::strings::params][am::strings::function_id] = kFunctionID; - msg_params[field] = text_field_; + if (set_field_text) { + msg_params[field] = text_field_; + } msg_params[am::strings::metadata_tags][field] = smart_objects::SmartObject(smart_objects::SmartType_Array); for (size_t i = 0; i < num_tags; ++i) { @@ -181,16 +184,20 @@ class ShowRequestTest : public CommandRequestTest { msg_params[am::strings::app_id] = kAppId; msg_params[am::hmi_request::show_strings] = smart_objects::SmartObject(smart_objects::SmartType_Array); - msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_name] = - static_cast(field_name); - msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_text] = - text_field_; - msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_types] = - smart_objects::SmartObject(smart_objects::SmartType_Array); - for (size_t i = 0; i < num_tags; ++i) { - const int32_t current_tag = field_tags[i]; - msg_params[am::hmi_request::show_strings][0][am::hmi_request::field_types] - [i] = current_tag; + if (set_field_text) { + msg_params[am::hmi_request::show_strings][0] + [am::hmi_request::field_name] = + static_cast(field_name); + msg_params[am::hmi_request::show_strings][0] + [am::hmi_request::field_text] = text_field_; + msg_params[am::hmi_request::show_strings][0] + [am::hmi_request::field_types] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + for (size_t i = 0; i < num_tags; ++i) { + const int32_t current_tag = field_tags[i]; + msg_params[am::hmi_request::show_strings][0] + [am::hmi_request::field_types][i] = current_tag; + } } EXPECT_CALL(app_mngr_, ManageHMICommand(_)); @@ -720,6 +727,48 @@ TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) { command->Run(); } +TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) { + MessageSharedPtr msg = CreateMsgParams(); + + SharedPtr command(CreateCommand(msg)); + + text_field_ = "Main_Field_1"; + const size_t num_tags = 1; + int32_t tags[num_tags] = {hmi_apis::Common_MetadataType::mediaArtist}; + TestSetupHelperWithMetadata(msg, + hmi_apis::Common_TextFieldName::mainField1, + am::strings::main_field_1, + num_tags, + tags, + false); + command->Run(); + + MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map); + (*ev_msg)[am::strings::params][am::hmi_response::code] = + hmi_apis::Common_Result::SUCCESS; + (*ev_msg)[am::strings::msg_params][am::strings::app_id] = kConnectionKey; + (*ev_msg)[am::strings::msg_params][am::strings::info] = ""; + + Event event(hmi_apis::FunctionID::UI_Show); + event.set_smart_object(*ev_msg); + + MessageSharedPtr ui_command_result; + EXPECT_CALL( + app_mngr_, + ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) + .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); + + command->on_event(event); + + EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success] + .asBool(), + true); + EXPECT_EQ( + (*ui_command_result)[am::strings::msg_params][am::strings::result_code] + .asInt(), + static_cast(mobile_apis::Result::WARNINGS)); +} + TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); -- cgit v1.2.1 From 79b9e2c4ab33b7bdff83245dd4ba1e93a04ae7d1 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 00:05:51 +0300 Subject: Fix UT after develop rebase --- .../test/commands/mobile/get_dtcs_request_test.cc | 8 +++++++- .../test/commands/mobile/unsubscribe_vehicle_request_test.cc | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc index 8d0363294d..822643b8c8 100644 --- a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc @@ -61,12 +61,18 @@ using am::commands::MessageSharedPtr; using am::commands::GetDTCsRequest; using am::event_engine::Event; using am::MockMessageHelper; +using testing::Mock; namespace mobile_result = mobile_apis::Result; typedef SharedPtr GetDTCsRequestPtr; class GetDTCsRequestTest - : public CommandRequestTest {}; + : public CommandRequestTest { +public: + GetDTCsRequestTest():CommandRequestTest() { + Mock::VerifyAndClearExpectations(message_helper_mock_); + } +}; TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { GetDTCsRequestPtr command(CreateCommand()); diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc index ecc2f8e8a5..6f88f249c4 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc @@ -279,9 +279,6 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataUnsubscribed_SUCCESS) { EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), HMIToMobileResult(hmi_result)).WillOnce(Return(mob_result)); - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app)); - EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); -- cgit v1.2.1 From 2075eb6d8cdc36dfeab4a4aa1534ac6b231e0de8 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 00:45:27 +0300 Subject: Fix sending multiple HMI status after develop integration --- src/components/application_manager/src/commands/command_request_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 43a90617f9..3f9a1d13b3 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -151,6 +151,7 @@ CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message, : CommandImpl(message, application_manager) , EventObserver(application_manager.event_dispatcher()) , current_state_(kAwaitingHMIResponse) + , hash_update_mode_(kSkipHashUpdate) , is_success_result_(false) {} CommandRequestImpl::~CommandRequestImpl() { @@ -158,7 +159,6 @@ CommandRequestImpl::~CommandRequestImpl() { } bool CommandRequestImpl::Init() { - hash_update_mode_ = kSkipHashUpdate; return true; } -- cgit v1.2.1 From 9b2f37ad1cc2bd7f6e2ed73e9baa5bd9569a2864 Mon Sep 17 00:00:00 2001 From: Masato Ogawa Date: Fri, 4 Aug 2017 17:22:13 +0900 Subject: Implement SendHapticData RPC HMI does not know the position of widget in Navigation template. In cases HMI manages the Haptic feedback of each widget, the Navi app should notify the HMI which elements can be focused using SendHapticData RPC. This is for discussion on proposal SDL-0075. --- src/components/application_manager/CMakeLists.txt | 2 + .../commands/hmi/ui_send_haptic_data_request.h | 73 +++++++++++++ .../commands/hmi/ui_send_haptic_data_response.h | 73 +++++++++++++ .../commands/mobile/send_haptic_data_request.h | 85 +++++++++++++++ .../commands/mobile/send_haptic_data_response.h | 73 +++++++++++++ .../application_manager/smart_object_keys.h | 1 + .../commands/hmi/ui_send_haptic_data_request.cc | 52 +++++++++ .../commands/hmi/ui_send_haptic_data_response.cc | 57 ++++++++++ .../commands/mobile/send_haptic_data_request.cc | 116 +++++++++++++++++++++ .../commands/mobile/send_haptic_data_response.cc | 53 ++++++++++ .../application_manager/src/hmi_command_factory.cc | 12 +++ .../application_manager/src/hmi_interfaces_impl.cc | 1 + .../src/mobile_command_factory.cc | 13 +++ .../application_manager/src/smart_object_keys.cc | 1 + src/components/interfaces/HMI_API.xml | 35 +++++++ src/components/interfaces/MOBILE_API.xml | 50 +++++++++ 16 files changed, 697 insertions(+) create mode 100644 src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h create mode 100644 src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h create mode 100644 src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h create mode 100644 src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h create mode 100644 src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc create mode 100644 src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc create mode 100644 src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc create mode 100644 src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index 0d532c9a5c..3c9d921fb4 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -334,6 +334,8 @@ set (HMI_COMMANDS_SOURCES ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_request.cc ${COMMANDS_SOURCE_DIR}/hmi/decrypt_certificate_response.cc ${COMMANDS_SOURCE_DIR}/hmi/ui_set_icon_request.cc + ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_request.cc + ${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_response.cc ) set (HMI_COMMANDS_SOURCES_JSON diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h new file mode 100644 index 0000000000..a2a1a0f7c8 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Xevo Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_ + +#include "application_manager/commands/hmi/request_to_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief UISendHapticDataRequest command class + **/ +class UISendHapticDataRequest : public RequestToHMI { + public: + /** + * @brief UISendHapticDataRequest class constructor + * + * @param message Incoming SmartObject message + **/ + UISendHapticDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief UISendHapticDataRequest class destructor + **/ + virtual ~UISendHapticDataRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(UISendHapticDataRequest); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h new file mode 100644 index 0000000000..8b6a01f8b8 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Xevo Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_ + +#include "application_manager/commands/hmi/response_from_hmi.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief UISendHapticDataResponse command class + **/ +class UISendHapticDataResponse : public ResponseFromHMI { + public: + /** + * @brief UISendHapticDataResponse class constructor + * + * @param message Incoming SmartObject message + **/ + UISendHapticDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief UISendHapticDataResponse class destructor + **/ + virtual ~UISendHapticDataResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(UISendHapticDataResponse); +}; + +} // namespace commands + +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UI_SEND_HAPTIC_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h new file mode 100644 index 0000000000..fcc0c16146 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Xevo Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_ + + +#include +#include "application_manager/commands/command_request_impl.h" +#include "application_manager/application_manager.h" +#include "application_manager/event_engine/event.h" +#include "smart_objects/smart_object.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief SendHapticDataRequest command class + **/ +class SendHapticDataRequest : public CommandRequestImpl { + public: + /** + * @brief SendHapticDataRequest class constructor + * + * @param message Incoming SmartObject message + **/ + SendHapticDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief SendHapticDataRequest class destructor + **/ + virtual ~SendHapticDataRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const event_engine::Event& event); + + private: + std::string processing_file_; + DISALLOW_COPY_AND_ASSIGN(SendHapticDataRequest); +}; + +} // namespace commands +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h new file mode 100644 index 0000000000..0b88daab11 --- /dev/null +++ b/src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Xevo Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_ + + +#include "application_manager/commands/command_response_impl.h" + +namespace application_manager { + +namespace commands { + +/** + * @brief SendHapticDataResponse command class + **/ +class SendHapticDataResponse : public CommandResponseImpl { + public: + /** + * @brief SendHapticDataResponse class constructor + * + * @param message Incoming SmartObject message + **/ + SendHapticDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief SendHapticDataResponse class destructor + **/ + virtual ~SendHapticDataResponse(); + + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(SendHapticDataResponse); +}; + +} // namespace commands +} // namespace application_manager + +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SEND_HAPTIC_DATA_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 78085078e0..388c4ed80d 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -173,6 +173,7 @@ extern const char* system_capabilities; extern const char* navigation_capability; extern const char* phone_capability; extern const char* video_streaming_capability; +extern const char* haptic_spatial_data; // PutFile extern const char* sync_file_name; diff --git a/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc new file mode 100644 index 0000000000..9484906a17 --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_request.cc @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Xevo Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "application_manager/commands/hmi/ui_send_haptic_data_request.h" + +namespace application_manager { + +namespace commands { + +UISendHapticDataRequest::UISendHapticDataRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} + +UISendHapticDataRequest::~UISendHapticDataRequest() {} + +void UISendHapticDataRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + SendRequest(); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc new file mode 100644 index 0000000000..03a2ce69e2 --- /dev/null +++ b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Xevo Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ +#include "application_manager/commands/hmi/ui_send_haptic_data_response.h" +#include "application_manager/event_engine/event.h" + +#include "interfaces/HMI_API.h" + +namespace application_manager { + +namespace commands { + +UISendHapticDataResponse::UISendHapticDataResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} + +UISendHapticDataResponse::~UISendHapticDataResponse() {} + +void UISendHapticDataResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + event_engine::Event event( + hmi_apis::FunctionID::UI_SendHapticData); + event.set_smart_object(*message_); + event.raise(application_manager_.event_dispatcher()); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc new file mode 100644 index 0000000000..891f103315 --- /dev/null +++ b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Xevo Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "application_manager/commands/mobile/send_haptic_data_request.h" + +#include +#include +#include +#include +#include +#include "application_manager/policies/policy_handler_interface.h" +#include "interfaces/MOBILE_API.h" +#include "utils/file_system.h" +#include "formatters/CFormatterJsonBase.h" +#include "json/json.h" +#include "utils/helpers.h" +#include "utils/custom_string.h" + +namespace application_manager { + +namespace commands { + +namespace custom_str = utils::custom_string; + +SendHapticDataRequest::SendHapticDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} + +SendHapticDataRequest::~SendHapticDataRequest() {} + +void SendHapticDataRequest::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + ApplicationSharedPtr application = + application_manager_.application(connection_key()); + + if (!(application.valid())) { + LOG4CXX_ERROR(logger_, "NULL pointer"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; + msg_params[strings::app_id] = application->hmi_app_id(); + SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, + &msg_params, + true); +} + +void SendHapticDataRequest::on_event(const event_engine::Event& event) { + LOG4CXX_AUTO_TRACE(logger_); + using namespace helpers; + + const smart_objects::SmartObject& message = event.smart_object(); + + switch (event.id()) { + case hmi_apis::FunctionID::UI_SendHapticData: { + mobile_apis::Result::eType result_code = + GetMobileResultCode(static_cast( + message[strings::params][hmi_response::code].asUInt())); + + const bool result = Compare( + result_code, + mobile_api::Result::SUCCESS, + mobile_api::Result::WARNINGS); + + ApplicationSharedPtr application = + application_manager_.application(connection_key()); + + if (!(application.valid())) { + LOG4CXX_ERROR(logger_, "NULL pointer"); + return; + } + + SendResponse(result, result_code, NULL, &(message[strings::msg_params])); + break; + } + default: { + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + return; + } + } +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc new file mode 100644 index 0000000000..cb7cd9f3ec --- /dev/null +++ b/src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the Xevo Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 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. + */ + +#include "application_manager/commands/mobile/send_haptic_data_response.h" + +namespace application_manager { + +namespace commands { + +SendHapticDataResponse::SendHapticDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} + +SendHapticDataResponse::~SendHapticDataResponse() {} + +void SendHapticDataResponse::Run() { + LOG4CXX_AUTO_TRACE(logger_); + + application_manager_.SendMessageToMobile(message_); +} + +} // namespace commands + +} // namespace application_manager diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc index d02d9060eb..46dd8dcea1 100644 --- a/src/components/application_manager/src/hmi_command_factory.cc +++ b/src/components/application_manager/src/hmi_command_factory.cc @@ -278,6 +278,8 @@ #include "application_manager/commands/hmi/on_tts_reset_timeout_notification.h" #include "application_manager/commands/hmi/dial_number_request.h" #include "application_manager/commands/hmi/dial_number_response.h" +#include "application_manager/commands/hmi/ui_send_haptic_data_request.h" +#include "application_manager/commands/hmi/ui_send_haptic_data_response.h" CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace application_manager { @@ -2264,6 +2266,16 @@ CommandSharedPtr HMICommandFactory::CreateCommand( message, application_manager)); break; } + case hmi_apis::FunctionID::UI_SendHapticData: { + if (is_response) { + command.reset(new commands::UISendHapticDataResponse( + message, application_manager)); + } else { + command.reset(new commands::UISendHapticDataRequest( + message, application_manager)); + } + break; + } } return command; } diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc index 3f05252b02..d9410e9bd5 100644 --- a/src/components/application_manager/src/hmi_interfaces_impl.cc +++ b/src/components/application_manager/src/hmi_interfaces_impl.cc @@ -155,6 +155,7 @@ generate_function_to_interface_convert_map() { convert_map[UI_IsReady] = HmiInterfaces::HMI_INTERFACE_UI; convert_map[UI_ClosePopUp] = HmiInterfaces::HMI_INTERFACE_UI; convert_map[UI_OnResetTimeout] = HmiInterfaces::HMI_INTERFACE_UI; + convert_map[UI_SendHapticData] = HmiInterfaces::HMI_INTERFACE_UI; convert_map[Navigation_IsReady] = HmiInterfaces::HMI_INTERFACE_Navigation; convert_map[Navigation_SendLocation] = HmiInterfaces::HMI_INTERFACE_Navigation; diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc index d5db849d96..f925a18217 100644 --- a/src/components/application_manager/src/mobile_command_factory.cc +++ b/src/components/application_manager/src/mobile_command_factory.cc @@ -135,6 +135,8 @@ #include "application_manager/commands/mobile/send_location_response.h" #include "application_manager/commands/mobile/dial_number_request.h" #include "application_manager/commands/mobile/dial_number_response.h" +#include "application_manager/commands/mobile/send_haptic_data_request.h" +#include "application_manager/commands/mobile/send_haptic_data_response.h" #include "interfaces/MOBILE_API.h" #include "utils/make_shared.h" @@ -702,6 +704,17 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( message, application_manager); break; } + case mobile_apis::FunctionID::SendHapticDataID: { + if ((*message)[strings::params][strings::message_type] == + static_cast(application_manager::MessageType::kResponse)) { + command.reset( + new commands::SendHapticDataResponse(message, application_manager)); + } else { + command.reset( + new commands::SendHapticDataRequest(message, application_manager)); + } + break; + } default: { (*message)[strings::params][strings::function_id] = static_cast(mobile_apis::FunctionID::GenericResponseID); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 75d324699c..355314086f 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -140,6 +140,7 @@ const char* system_capabilities = "systemCapabilities"; const char* navigation_capability = "navigationCapability"; const char* phone_capability = "phoneCapability"; const char* video_streaming_capability = "videoStreamingCapability"; +const char* haptic_spatial_data = "HapticSpatialData"; // PutFile const char* sync_file_name = "syncFileName"; diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 33dcc1225c..db20beb27f 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -2267,6 +2267,25 @@ + + + A user control's identifier. + + + + The X-coordinate of the user control + + + The Y-coordinate of the user control + + + The width of the user control's bounding rectangle + + + The height of the user control's bounding rectangle + + + @@ -3436,6 +3455,22 @@ ID of application related to this RPC. + + Send the UI spatial data from MOBILE. This data will be utilized by the HMI to determine how and when haptic events should occur + + Internal ID of the application that requested this RPC. + + + + Array of spatial data structures that represent the locations of all user controls present on the HMI. + This data should be updated if/when the application presents a new screen. + When a request is sent, if successful, it will replace all spatial data previously sent through RPC. + Avoidance of doubt, when an empty HapticSpatialData, it will be clear all spatial data previously sent through RPC. + + + + + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 0b77c0b6ca..b9d21a9fe0 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2358,6 +2358,7 @@ + @@ -5004,25 +5023,6 @@ - - Defines spatial for each user control object for video streaming application - - A user control spatial identifier - - - The X-coordinate of the user control - - - The Y-coordinate of the user control - - - The width of the user control's bounding rectangle - - - The height of the user control's bounding rectangle - - - Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. -- cgit v1.2.1 From 287a7dec6a40d5ab0b92cc480243b0d1d9a25e35 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 18:37:42 +0300 Subject: Remove Promary RC group --- .../policy_external/include/policy/policy_table/types.h | 1 - .../policy/policy_external/src/access_remote_impl.cc | 4 ---- src/components/policy/policy_external/src/policy_helper.cc | 9 --------- .../policy/policy_external/src/policy_table/types.cc | 13 ------------- .../policy/policy_external/src/sql_pt_representation.cc | 12 ------------ .../policy_regular/include/policy/policy_table/types.h | 1 - .../policy/policy_regular/src/access_remote_impl.cc | 5 ----- src/components/policy/policy_regular/src/policy_helper.cc | 9 --------- .../policy/policy_regular/src/policy_table/types.cc | 13 ------------- .../policy/policy_regular/src/sql_pt_representation.cc | 13 ------------- .../policy/policy_regular/test/access_remote_impl_test.cc | 1 - 11 files changed, 81 deletions(-) diff --git a/src/components/policy/policy_external/include/policy/policy_table/types.h b/src/components/policy/policy_external/include/policy/policy_table/types.h index 22cb071d04..a460db32db 100644 --- a/src/components/policy/policy_external/include/policy/policy_table/types.h +++ b/src/components/policy/policy_external/include/policy/policy_table/types.h @@ -176,7 +176,6 @@ struct ApplicationParams : PolicyBase { Optional > memory_kb; Optional > heart_beat_timeout_ms; #ifdef SDL_REMOTE_CONTROL - Optional groups_primaryRC; mutable Optional moduleType; #endif // SDL_REMOTE_CONTROL diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index 410c5f7520..bfb9f94c6d 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -203,10 +203,6 @@ const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes( const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { LOG4CXX_AUTO_TRACE(logger_); - if (IsAppRemoteControl(who)) { - return *cache_->pt_->policy_table.app_policies_section.apps[who.app_id] - .groups_primaryRC; - } return cache_->GetGroups(who.app_id); } diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index 9652541c7d..913a599bea 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -896,15 +896,6 @@ void ProccessAppGroups::operator()( if (i == new_apps_.end() && default_ != new_apps_.end()) { i = default_; } - if (i != new_apps_.end()) { - if (HaveGroupsChanged(i->second.groups_primaryRC, - app.second.groups_primaryRC)) { - LOG4CXX_DEBUG(logger_, - "Primary groups for " << app.first << " have changed"); - - pm_->OnPrimaryGroupsChanged(app.first); - } - } } #endif // SDL_REMOTE_CONTROL diff --git a/src/components/policy/policy_external/src/policy_table/types.cc b/src/components/policy/policy_external/src/policy_table/types.cc index dd77ed2141..e66b2cb561 100644 --- a/src/components/policy/policy_external/src/policy_table/types.cc +++ b/src/components/policy/policy_external/src/policy_table/types.cc @@ -241,7 +241,6 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , memory_kb(impl::ValueMember(value__, "memory_kb"), 0) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) #ifdef SDL_REMOTE_CONTROL - , groups_primaryRC(impl::ValueMember(value__, "groups_primaryRC")) , moduleType(impl::ValueMember(value__, "moduleType")) #endif // SDL_REMOTE_CONTROL { @@ -256,7 +255,6 @@ Json::Value ApplicationParams::ToJsonValue() const { impl::WriteJsonField( "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); #ifdef SDL_REMOTE_CONTROL - impl::WriteJsonField("groups_primaryRC", groups_primaryRC, &result__); impl::WriteJsonField("moduleType", moduleType, &result__); #endif // SDL_REMOTE_CONTROL return result__; @@ -281,9 +279,6 @@ bool ApplicationParams::is_valid() const { return false; } #ifdef SDL_REMOTE_CONTROL - if (!groups_primaryRC.is_valid()) { - return false; - } if (!moduleType.is_valid()) { return false; } @@ -315,9 +310,6 @@ bool ApplicationParams::struct_empty() const { return false; } #ifdef SDL_REMOTE_CONTROL - if (groups_primaryRC.is_initialized()) { - return false; - } if (moduleType.is_initialized()) { return false; } @@ -366,10 +358,6 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { } #ifdef SDL_REMOTE_CONTROL - if (!groups_primaryRC.is_valid()) { - groups_primaryRC.ReportErrors( - &report__->ReportSubobject("groups_primaryRC")); - } if (!moduleType.is_valid()) { moduleType.ReportErrors(&report__->ReportSubobject("moduleType")); } @@ -383,7 +371,6 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { memory_kb.SetPolicyTableType(pt_type); heart_beat_timeout_ms.SetPolicyTableType(pt_type); #ifdef SDL_REMOTE_CONTROL - groups_primaryRC.SetPolicyTableType(pt_type); moduleType.SetPolicyTableType(pt_type); #endif // SDL_REMOTE_CONTROL } diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 8dbf113fbc..b5d04be8c2 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -766,9 +766,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( } #ifdef SDL_REMOTE_CONTROL - if (!GatherAppGroupPrimary(app_id, &*params.groups_primaryRC)) { - return false; - } bool denied = false; if (!GatherRemoteControlDenied(app_id, &denied)) { return false; @@ -1063,9 +1060,6 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( } #ifdef SDL_REMOTE_CONTROL - if (!SaveAppGroupPrimary(app.first, *app.second.groups_primaryRC)) { - return false; - } bool denied = !app.second.moduleType->is_initialized(); if (!SaveRemoteControlDenied(app.first, denied) || @@ -1988,12 +1982,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { policy_table::Strings default_groups; bool ret = (GatherAppGroup(kDefaultId, &default_groups) && SaveAppGroup(app_id, default_groups)); -#ifdef SDL_REMOTE_CONTROL - policy_table::Strings groups_primary; - ret = ret && (GatherAppGroupPrimary(kDefaultId, &groups_primary) && - SaveAppGroupPrimary(app_id, groups_primary)); -#endif // SDL_REMOTE_CONTROL - if (ret) { return SetIsDefault(app_id, true); } diff --git a/src/components/policy/policy_regular/include/policy/policy_table/types.h b/src/components/policy/policy_regular/include/policy/policy_table/types.h index 215d7bf9cf..b1e9dd5401 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table/types.h +++ b/src/components/policy/policy_regular/include/policy/policy_table/types.h @@ -143,7 +143,6 @@ struct ApplicationParams : PolicyBase { Optional > heart_beat_timeout_ms; Optional > certificate; #ifdef SDL_REMOTE_CONTROL - Optional groups_primaryRC; mutable Optional moduleType; #endif // SDL_REMOTE_CONTROL diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index 029bbfaa71..f77a8e02cd 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -180,11 +180,6 @@ const policy_table::AppHMITypes& AccessRemoteImpl::HmiTypes( const policy_table::Strings& AccessRemoteImpl::GetGroups(const Subject& who) { LOG4CXX_AUTO_TRACE(logger_); - if (IsAppRemoteControl(who)) { - return *cache_->pt() - ->policy_table.app_policies_section.apps[who.app_id] - .groups_primaryRC; - } return cache_->GetGroups(who.app_id); } diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc index dd094fb626..d82d5396ca 100644 --- a/src/components/policy/policy_regular/src/policy_helper.cc +++ b/src/components/policy/policy_regular/src/policy_helper.cc @@ -833,15 +833,6 @@ void ProccessAppGroups::operator()( if (i == new_apps_.end() && default_ != new_apps_.end()) { i = default_; } - if (i != new_apps_.end()) { - if (HaveGroupsChanged(i->second.groups_primaryRC, - app.second.groups_primaryRC)) { - LOG4CXX_DEBUG(logger_, - "Primary groups for " << app.first << " have changed"); - - pm_->OnPrimaryGroupsChanged(app.first); - } - } } #endif // SDL_REMOTE_CONTROL diff --git a/src/components/policy/policy_regular/src/policy_table/types.cc b/src/components/policy/policy_regular/src/policy_table/types.cc index 83dc2ffe17..45afd91419 100644 --- a/src/components/policy/policy_regular/src/policy_table/types.cc +++ b/src/components/policy/policy_regular/src/policy_table/types.cc @@ -168,7 +168,6 @@ ApplicationParams::ApplicationParams(const Json::Value* value__) , heart_beat_timeout_ms(impl::ValueMember(value__, "heart_beat_timeout_ms")) , certificate(impl::ValueMember(value__, "certificate"), "not_specified") #ifdef SDL_REMOTE_CONTROL - , groups_primaryRC(impl::ValueMember(value__, "groups_primaryRC")) , moduleType(impl::ValueMember(value__, "moduleType")) #endif // SDL_REMOTE_CONTROL { @@ -184,7 +183,6 @@ Json::Value ApplicationParams::ToJsonValue() const { impl::WriteJsonField( "heart_beat_timeout_ms", heart_beat_timeout_ms, &result__); #ifdef SDL_REMOTE_CONTROL - impl::WriteJsonField("groups_primaryRC", groups_primaryRC, &result__); impl::WriteJsonField("moduleType", moduleType, &result__); #endif // SDL_REMOTE_CONTROL return result__; @@ -215,9 +213,6 @@ bool ApplicationParams::is_valid() const { return false; } #ifdef SDL_REMOTE_CONTROL - if (!groups_primaryRC.is_valid()) { - return false; - } if (!moduleType.is_valid()) { return false; } @@ -255,9 +250,6 @@ bool ApplicationParams::struct_empty() const { return false; } #ifdef SDL_REMOTE_CONTROL - if (groups_primaryRC.is_initialized()) { - return false; - } if (moduleType.is_initialized()) { return false; } @@ -295,10 +287,6 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const { certificate.ReportErrors(&report__->ReportSubobject("certificate")); } #ifdef SDL_REMOTE_CONTROL - if (!groups_primaryRC.is_valid()) { - groups_primaryRC.ReportErrors( - &report__->ReportSubobject("groups_primaryRC")); - } if (!moduleType.is_valid()) { moduleType.ReportErrors(&report__->ReportSubobject("moduleType")); } @@ -314,7 +302,6 @@ void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) { heart_beat_timeout_ms.SetPolicyTableType(pt_type); certificate.SetPolicyTableType(pt_type); #ifdef SDL_REMOTE_CONTROL - groups_primaryRC.SetPolicyTableType(pt_type); moduleType.SetPolicyTableType(pt_type); #endif // SDL_REMOTE_CONTROL } diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 682c74d0bf..06cbc03dfb 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -706,9 +706,6 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection( return false; } #ifdef SDL_REMOTE_CONTROL - if (!GatherAppGroupPrimary(app_id, &*params.groups_primaryRC)) { - return false; - } bool denied = false; if (!GatherRemoteControlDenied(app_id, &denied)) { return false; @@ -966,10 +963,6 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( return false; } #ifdef SDL_REMOTE_CONTROL - if (!SaveAppGroupPrimary(app.first, *app.second.groups_primaryRC)) { - return false; - } - bool denied = !app.second.moduleType->is_initialized(); if (!SaveRemoteControlDenied(app.first, denied) || !SaveModuleType(app.first, *app.second.moduleType)) { @@ -1894,12 +1887,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { bool ret = (GatherAppGroup(kDefaultId, &default_groups) && SaveAppGroup(app_id, default_groups)); -#ifdef SDL_REMOTE_CONTROL - policy_table::Strings groups_primary; - ret = ret && (GatherAppGroupPrimary(kDefaultId, &groups_primary) && - SaveAppGroupPrimary(app_id, groups_primary)); -#endif // SDL_REMOTE_CONTROL - if (ret) { return SetIsDefault(app_id, true); } diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index 65ed4fdf13..69cd6f576e 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -85,7 +85,6 @@ TEST(AccessRemoteImplTest, GetGroups) { policy_table::ApplicationPolicies& apps = access_remote.cache_->pt_->policy_table.app_policies_section.apps; apps["1234"].groups.push_back("group_default"); - apps["1234"].groups_primaryRC->push_back("group_primary"); apps["1234"].AppHMIType->push_back(policy_table::AHT_MEDIA); // Default groups -- cgit v1.2.1 From ae9c2248ec7e3ef4aa2b497ffde1a2959a93d956 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 18:41:05 +0300 Subject: Remove primary RC from preloaded --- src/appMain/sdl_preloaded_pt.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index ebf38b42b3..a04d0f5ca9 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -2356,10 +2356,6 @@ "priority": "NONE", "default_hmi": "NONE", "groups": ["Base-4"], - "groups_primaryRC": [ - "Base-4", - "RemoteControl" - ], "moduleType": [ "RADIO", "CLIMATE" -- cgit v1.2.1 From 787ba84ea541be522613eb09bfbaa6b0d4e46688 Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Tue, 22 Aug 2017 18:50:25 +0300 Subject: Fix UT after develop rebase --- .../test/commands/command_request_impl_test.cc | 6 ------ .../test/commands/mobile/add_sub_menu_request_test.cc | 2 +- .../test/commands/mobile/delete_interaction_choice_set_test.cc | 2 ++ .../test/commands/mobile/delete_sub_menu_test.cc | 1 + .../test/commands/mobile/diagnostic_message_request_test.cc | 3 --- .../test/commands/mobile/get_dtcs_request_test.cc | 8 ++++---- .../test/commands/mobile/reset_global_properties_test.cc | 5 ----- .../test/commands/mobile/subscribe_way_points_request_test.cc | 2 ++ .../test/commands/mobile/unsubscribe_button_request_test.cc | 2 +- .../test/commands/mobile/unsubscribe_vehicle_request_test.cc | 1 + .../test/commands/mobile/update_turn_list_request_test.cc | 6 ------ 11 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc index 7f1e1955b7..1948608b9f 100644 --- a/src/components/application_manager/test/commands/command_request_impl_test.cc +++ b/src/components/application_manager/test/commands/command_request_impl_test.cc @@ -466,9 +466,6 @@ TEST_F(CommandRequestImplTest, SendResponse_SUCCESS) { EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); - MockAppPtr mock_app; - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); - // Args do not affect on anything in this case; command->SendResponse(true, kMobResultSuccess, NULL, NULL); @@ -499,9 +496,6 @@ TEST_F(CommandRequestImplTest, EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); - MockAppPtr mock_app; - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); - command->SendResponse(true, kMobResultSuccess, NULL, NULL); EXPECT_EQ(RequestState::kCompleted, command->current_state()); diff --git a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc index bef00384a7..9617f91016 100644 --- a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc @@ -106,7 +106,7 @@ TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { app_mngr_, ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) .WillOnce(DoAll(SaveArg<0>(&ui_command_result), Return(true))); - + command->Init(); command->on_event(event); EXPECT_EQ((*ui_command_result)[am::strings::msg_params][am::strings::success] diff --git a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc index 036b0cfeb3..a6d9d8f50a 100644 --- a/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc @@ -211,6 +211,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, DeleteInteractionChoiceSetRequestPtr command = CreateCommand(message_); + command->Init(); command->Run(); } @@ -247,6 +248,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) { DeleteInteractionChoiceSetRequestPtr command = CreateCommand(message_); + command->Init(); command->Run(); } diff --git a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc index 82700cca5c..beff4c3584 100644 --- a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc @@ -289,6 +289,7 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) { DeleteSubMenuRequestPtr command = CreateCommand(message_); + command->Init(); command->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc index afdf5af3d2..60697446f2 100644 --- a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc @@ -189,9 +189,6 @@ TEST_F(DiagnosticMessageRequestTest, OnEvent_SUCCESS) { app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); - MockAppPtr app(CreateMockApp()); - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app)); - command->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc index 822643b8c8..dfa38a758b 100644 --- a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc @@ -68,10 +68,10 @@ typedef SharedPtr GetDTCsRequestPtr; class GetDTCsRequestTest : public CommandRequestTest { -public: - GetDTCsRequestTest():CommandRequestTest() { - Mock::VerifyAndClearExpectations(message_helper_mock_); - } + public: + GetDTCsRequestTest() : CommandRequestTest() { + Mock::VerifyAndClearExpectations(message_helper_mock_); + } }; TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { diff --git a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc index 0291de6258..e133ec9119 100644 --- a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc +++ b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc @@ -383,11 +383,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) { EXPECT_CALL(*mock_message_helper_, CreateAppVrHelp(_)) .WillOnce(Return(vr_help)); - MockAppPtr invalid_app; - EXPECT_CALL(app_mngr_, application(kConnectionKey)) - .WillOnce(Return(mock_app_)) - .WillOnce(Return(invalid_app)); - EXPECT_CALL(*mock_app_, UpdateHash()).Times(0); ResetGlobalPropertiesRequestPtr command = diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc index 66cd740bbe..4546293172 100644 --- a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc @@ -83,6 +83,7 @@ TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) { EXPECT_CALL(*app, UpdateHash()); } + command->Init(); MessageSharedPtr mobile_result_msg( CatchMobileCommandResult(CallRun(*command))); @@ -120,6 +121,7 @@ TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) { EXPECT_CALL(*app, UpdateHash()); } + command->Init(); command->on_event(event); Mock::VerifyAndClearExpectations(mock_message_helper); diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc index 4cbf98c5e1..46a1ce02eb 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc @@ -145,7 +145,7 @@ TEST_F(UnsubscribeButtonRequestTest, Run_SUCCESS) { ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); EXPECT_CALL(*mock_app, UpdateHash()); - + command->Init(); command->Run(); } diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc index 6f88f249c4..9652364646 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc @@ -235,6 +235,7 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) { EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::IGNORED), _)); + command->Init(); command->Run(); am::event_engine::Event test_event( diff --git a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc index 6b363f6aca..cab67e641c 100644 --- a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc @@ -281,9 +281,6 @@ TEST_F(UpdateTurnListRequestTest, OnEvent_UnsupportedResource_SUCCESS) { EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); - MockAppPtr mock_app(CreateMockApp()); - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); - command_->on_event(event); } @@ -306,9 +303,6 @@ TEST_F(UpdateTurnListRequestTest, EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); - MockAppPtr mock_app(CreateMockApp()); - EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app)); - command_->on_event(event); } -- cgit v1.2.1 From cccb60ec70e84e4be5dcdb53b4d19858f0470c79 Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Tue, 22 Aug 2017 18:50:41 +0300 Subject: Fix code style --- src/components/security_manager/src/crypto_manager_impl.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc index a8a77cc5a1..00fcb1385a 100644 --- a/src/components/security_manager/src/crypto_manager_impl.cc +++ b/src/components/security_manager/src/crypto_manager_impl.cc @@ -300,19 +300,22 @@ bool CryptoManagerImpl::set_certificate(const std::string& cert_data) { return false; } - BIO* bio_cert = BIO_new_mem_buf(const_cast(cert_data.c_str()), cert_data.length()); + BIO* bio_cert = + BIO_new_mem_buf(const_cast(cert_data.c_str()), cert_data.length()); utils::ScopeGuard bio_guard = utils::MakeGuard(BIO_free, bio_cert); UNUSED(bio_guard) X509* cert = NULL; - PEM_read_bio_X509(bio_cert, &cert,0, 0); + PEM_read_bio_X509(bio_cert, &cert, 0, 0); EVP_PKEY* pkey = NULL; if (1 == BIO_reset(bio_cert)) { - PEM_read_bio_PrivateKey(bio_cert, &pkey, 0,0); + PEM_read_bio_PrivateKey(bio_cert, &pkey, 0, 0); } else { - LOG4CXX_WARN(logger_, "Unabled to reset BIO in order to read private key, " << LastError()); + LOG4CXX_WARN(logger_, + "Unabled to reset BIO in order to read private key, " + << LastError()); } if (NULL == cert || NULL == pkey) { -- cgit v1.2.1 From 124a811939df303f2f76ca1e289d8b22a12cd0e3 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 19:30:38 +0300 Subject: Fix policy unit tests after removing primary --- src/components/policy/policy_regular/test/access_remote_impl_test.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index 69cd6f576e..605799d463 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -90,11 +90,6 @@ TEST(AccessRemoteImplTest, GetGroups) { // Default groups const policy_table::Strings& groups1 = access_remote.GetGroups(who); EXPECT_EQ(std::string("group_default"), std::string(groups1[0])); - - // Primary groups - apps["1234"].set_to_string(policy::kDefaultId); - const policy_table::Strings& groups2 = access_remote.GetGroups(who); - EXPECT_EQ(std::string("group_primary"), std::string(groups2[0])); } } // namespace policy -- cgit v1.2.1 From bca7dd9f538fba067212d52e4ae94d6edd732be5 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 19:54:31 +0300 Subject: Remove primary logic from sql queries --- .../include/policy/sql_pt_queries.h | 4 -- .../include/policy/sql_pt_representation.h | 2 - .../policy/policy_external/src/sql_pt_queries.cc | 41 ----------- .../policy_external/src/sql_pt_representation.cc | 82 ---------------------- .../policy_regular/include/policy/sql_pt_queries.h | 4 -- .../include/policy/sql_pt_representation.h | 2 - .../policy/policy_regular/src/sql_pt_queries.cc | 41 ----------- .../policy_regular/src/sql_pt_representation.cc | 56 --------------- .../test/sql_pt_representation_test.cc | 2 +- 9 files changed, 1 insertion(+), 233 deletions(-) diff --git a/src/components/policy/policy_external/include/policy/sql_pt_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_queries.h index 5d75649c62..a69df20cfc 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_queries.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_queries.h @@ -117,11 +117,8 @@ extern const std::string kSelectApplicationFull; extern const std::string kUpdatePreloaded; extern const std::string kUpdateRemoteControlDenied; extern const std::string kSelectRemoteControlDenied; -extern const std::string kDeleteAppGroupPrimaryByApplicationId; extern const std::string kCollectFriendlyMsg; -extern const std::string kSelectAppGroupsPrimary; extern const std::string kSelectModuleTypes; -extern const std::string kInsertAppGroupPrimary; extern const std::string kInsertModuleType; extern const std::string kInsertAccessModule; extern const std::string kSelectAccessModules; @@ -129,7 +126,6 @@ extern const std::string kDeleteAccessModules; extern const std::string kInsertRemoteRpc; extern const std::string kSelectRemoteRpcs; extern const std::string kDeleteRemoteRpc; -extern const std::string kDeleteAppGroupPrimary; extern const std::string kDeleteModuleTypes; extern const std::string kDeleteAllDevices; extern const std::string kSelectDBVersion; diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h index fc7f71e575..90dab7fa60 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h @@ -108,8 +108,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool GatherAccessModule(TypeAccess access, policy_table::AccessModules* modules) const; bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const; - bool SaveAppGroupPrimary(const std::string& app_id, - const policy_table::Strings& app_groups); bool SaveModuleType(const std::string& app_id, const policy_table::ModuleTypes& types); bool SaveRemoteControlDenied(const std::string& app_id, bool deny); diff --git a/src/components/policy/policy_external/src/sql_pt_queries.cc b/src/components/policy/policy_external/src/sql_pt_queries.cc index 7919202cd1..e3e1029692 100644 --- a/src/components/policy/policy_external/src/sql_pt_queries.cc +++ b/src/components/policy/policy_external/src/sql_pt_queries.cc @@ -351,25 +351,6 @@ const std::string kCreateSchema = " REFERENCES `message_type`(`name`) " "); " - "CREATE TABLE IF NOT EXISTS `app_group_primary`( " - " `application_id` VARCHAR(45) NOT NULL, " - " `functional_group_id` INTEGER NOT NULL, " - " PRIMARY KEY(`application_id`,`functional_group_id`), " - " CONSTRAINT `fk_application_has_functional_group_application1` " - " FOREIGN KEY(`application_id`) " - " REFERENCES `application`(`id`), " - " CONSTRAINT `fk_application_has_functional_group_functional_group1` " - " FOREIGN KEY(`functional_group_id`) " - " REFERENCES `functional_group`(`id`) " - "); " - "CREATE INDEX IF NOT EXISTS " - "`app_group_primary.fk_application_has_functional_group_functional_group1_" - "idx` " - " ON `app_group_primary`(`functional_group_id`); " - "CREATE INDEX IF NOT EXISTS " - "`app_group_primary.fk_application_has_functional_group_application1_idx` " - " ON `app_group_primary`(`application_id`); " - /* access_module */ "CREATE TABLE `access_module`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -445,25 +426,13 @@ const std::string kInsertInitData = "INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); " ""; -const std::string kDeleteAppGroupPrimary = "DELETE FROM `app_group_primary`"; - const std::string kDeleteModuleTypes = "DELETE FROM `module_type`"; const std::string kDeleteAllDevices = "DELETE FROM `device`;"; -const std::string kSelectAppGroupsPrimary = - "SELECT `f`.`name` FROM `app_group_primary` AS `a`" - " LEFT JOIN `functional_group` AS `f` " - " ON (`f`.`id` = `a`.`functional_group_id`)" - " WHERE `a`.`application_id` = ?"; - const std::string kSelectRemoteControlDenied = "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1"; -const std::string kInsertAppGroupPrimary = - "INSERT INTO `app_group_primary` (`application_id`, `functional_group_id`)" - " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1"; - const std::string kUpdateRemoteControlDenied = "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?"; @@ -475,9 +444,6 @@ const std::string kInsertAccessModule = "INSERT INTO `access_module` (`name`, `user_consent_needed`) " " VALUES(?, ?, ?)"; -const std::string kDeleteAppGroupPrimaryByApplicationId = - "DELETE FROM `app_group_primary` WHERE `application_id` = ?"; - const std::string kSelectAccessModules = "SELECT `id`, `name` FROM `access_module` " " WHERE `user_consent_needed` = ?"; @@ -536,12 +502,6 @@ const std::string kDropSchema = "`preconsented_group.fk_application_has_functional_group_functional_group2_" "idx`; " "DROP TABLE IF EXISTS `preconsented_group`; " - "DROP INDEX IF EXISTS " - "`app_group_primary.fk_application_has_functional_group_application1_idx`; " - "DROP INDEX IF EXISTS " - "`app_group_primary.fk_application_has_functional_group_functional_group1_" - "idx`; " - "DROP TABLE IF EXISTS `app_group_primary`; " "DROP TABLE IF EXISTS `access_module`; " "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; " "DROP INDEX IF EXISTS " @@ -593,7 +553,6 @@ const std::string kDeleteData = "DELETE FROM `app_group`; " "DELETE FROM `application`; " "DELETE FROM `rpc`; " - "DELETE FROM `app_group_primary`; " "DELETE FROM `access_module`; " "DELETE FROM `version`; " "DELETE FROM `message_type`; " diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index b5d04be8c2..3d5ae4960d 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -967,17 +967,6 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection( return false; } -#ifdef SDL_REMOTE_CONTROL - if (!query_delete.Exec(sql_pt::kDeleteAppGroupPrimary)) { - LOG4CXX_WARN(logger_, "Incorrect delete from app_group_primary."); - return false; - } - if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) { - LOG4CXX_WARN(logger_, "Incorrect delete from module_type."); - return false; - } -#endif // SDL_REMOTE_CONTROL - if (!query_delete.Exec(sql_pt::kDeleteApplication)) { LOG4CXX_WARN(logger_, "Incorrect delete from application."); return false; @@ -1632,20 +1621,6 @@ bool SQLPTRepresentation::GatherAppGroup( } #ifdef SDL_REMOTE_CONTROL -bool SQLPTRepresentation::GatherAppGroupPrimary( - const std::string& app_id, policy_table::Strings* app_groups) const { - dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kSelectAppGroupsPrimary)) { - LOG4CXX_WARN(logger_, "Incorrect select from app groups for primary RC"); - return false; - } - - query.Bind(0, app_id); - while (query.Next()) { - app_groups->push_back(query.GetString(0)); - } - return true; -} bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id, bool* denied) const { @@ -1683,49 +1658,6 @@ bool SQLPTRepresentation::GatherModuleType( return true; } -bool SQLPTRepresentation::SaveAppGroupPrimary( - const std::string& app_id, const policy_table::Strings& app_groups) { - LOG4CXX_AUTO_TRACE(logger_); - dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kInsertAppGroupPrimary)) { - LOG4CXX_WARN(logger_, "Incorrect insert statement for app group primary"); - return false; - } - policy_table::Strings::const_iterator it; - for (it = app_groups.begin(); it != app_groups.end(); ++it) { - std::string ssss = *it; - LOG4CXX_INFO(logger_, "Group: " << ssss); - query.Bind(0, app_id); - query.Bind(1, *it); - if (!query.Exec() || !query.Reset()) { - LOG4CXX_WARN(logger_, - "Incorrect insert into app group primary." - << query.LastError().text()); - return false; - } - } - - return true; -} - -bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id, - bool deny) { - LOG4CXX_AUTO_TRACE(logger_); - dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kUpdateRemoteControlDenied)) { - LOG4CXX_WARN(logger_, "Incorrect update statement for remote control flag"); - return false; - } - LOG4CXX_DEBUG(logger_, "App: " << app_id << std::boolalpha << " - " << deny); - query.Bind(0, deny); - query.Bind(1, app_id); - if (!query.Exec()) { - LOG4CXX_WARN(logger_, "Incorrect update remote control flag."); - return false; - } - return true; -} - bool SQLPTRepresentation::SaveModuleType( const std::string& app_id, const policy_table::ModuleTypes& types) { dbms::SQLQuery query(db()); @@ -1948,20 +1880,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { return false; } -#ifdef SDL_REMOTE_CONTROL - dbms::SQLQuery query_p(db()); - if (!query_p.Prepare(sql_pt::kDeleteAppGroupPrimaryByApplicationId)) { - LOG4CXX_ERROR(logger_, - "Incorrect statement to delete from app_group_primary."); - return false; - } - query_p.Bind(0, app_id); - if (!query_p.Exec()) { - LOG4CXX_ERROR(logger_, "Failed deleting from app_group_primary."); - return false; - } -#endif // SDL_REMOTE_CONTROL - if (!CopyApplication(kDefaultId, app_id)) { return false; } diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h index 97b52ecf05..2ded25e456 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_queries.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_queries.h @@ -116,11 +116,8 @@ extern const std::string kSelectApplicationFull; extern const std::string kUpdatePreloaded; extern const std::string kUpdateRemoteControlDenied; extern const std::string kSelectRemoteControlDenied; -extern const std::string kDeleteAppGroupPrimaryByApplicationId; extern const std::string kCollectFriendlyMsg; -extern const std::string kSelectAppGroupsPrimary; extern const std::string kSelectModuleTypes; -extern const std::string kInsertAppGroupPrimary; extern const std::string kInsertModuleType; extern const std::string kInsertAccessModule; extern const std::string kSelectAccessModules; @@ -128,7 +125,6 @@ extern const std::string kDeleteAccessModules; extern const std::string kInsertRemoteRpc; extern const std::string kSelectRemoteRpcs; extern const std::string kDeleteRemoteRpc; -extern const std::string kDeleteAppGroupPrimary; extern const std::string kDeleteModuleTypes; extern const std::string kDeleteAllDevices; extern const std::string kSelectDBVersion; diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h index 8c3f0ea1c5..4b66c4101b 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h @@ -107,8 +107,6 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool GatherAccessModule(TypeAccess access, policy_table::AccessModules* modules) const; bool GatherRemoteRpc(int module_id, policy_table::RemoteRpcs* rpcs) const; - bool SaveAppGroupPrimary(const std::string& app_id, - const policy_table::Strings& app_groups); bool SaveModuleType(const std::string& app_id, const policy_table::ModuleTypes& types); bool SaveRemoteControlDenied(const std::string& app_id, bool deny); diff --git a/src/components/policy/policy_regular/src/sql_pt_queries.cc b/src/components/policy/policy_regular/src/sql_pt_queries.cc index f0a3c2f160..7938eb4085 100644 --- a/src/components/policy/policy_regular/src/sql_pt_queries.cc +++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc @@ -318,25 +318,6 @@ const std::string kCreateSchema = " REFERENCES `message_type`(`name`) " "); " - "CREATE TABLE IF NOT EXISTS `app_group_primary`( " - " `application_id` VARCHAR(45) NOT NULL, " - " `functional_group_id` INTEGER NOT NULL, " - " PRIMARY KEY(`application_id`,`functional_group_id`), " - " CONSTRAINT `fk_application_has_functional_group_application1` " - " FOREIGN KEY(`application_id`) " - " REFERENCES `application`(`id`), " - " CONSTRAINT `fk_application_has_functional_group_functional_group1` " - " FOREIGN KEY(`functional_group_id`) " - " REFERENCES `functional_group`(`id`) " - "); " - "CREATE INDEX IF NOT EXISTS " - "`app_group_primary.fk_application_has_functional_group_functional_group1_" - "idx` " - " ON `app_group_primary`(`functional_group_id`); " - "CREATE INDEX IF NOT EXISTS " - "`app_group_primary.fk_application_has_functional_group_application1_idx` " - " ON `app_group_primary`(`application_id`); " - /* access_module */ "CREATE TABLE `access_module`( " " `id` INTEGER PRIMARY KEY NOT NULL, " @@ -406,25 +387,13 @@ const std::string kInsertInitData = "INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); " ""; -const std::string kDeleteAppGroupPrimary = "DELETE FROM `app_group_primary`"; - const std::string kDeleteModuleTypes = "DELETE FROM `module_type`"; const std::string kDeleteAllDevices = "DELETE FROM `device`;"; -const std::string kSelectAppGroupsPrimary = - "SELECT `f`.`name` FROM `app_group_primary` AS `a`" - " LEFT JOIN `functional_group` AS `f` " - " ON (`f`.`id` = `a`.`functional_group_id`)" - " WHERE `a`.`application_id` = ?"; - const std::string kSelectRemoteControlDenied = "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? LIMIT 1"; -const std::string kInsertAppGroupPrimary = - "INSERT INTO `app_group_primary` (`application_id`, `functional_group_id`)" - " SELECT ?, `id` FROM `functional_group` WHERE `name` = ? LIMIT 1"; - const std::string kUpdateRemoteControlDenied = "UPDATE `application` SET `remote_control_denied` = ? WHERE `id` = ?"; @@ -436,9 +405,6 @@ const std::string kInsertAccessModule = "INSERT INTO `access_module` (`name`, `user_consent_needed`) " " VALUES(?, ?, ?)"; -const std::string kDeleteAppGroupPrimaryByApplicationId = - "DELETE FROM `app_group_primary` WHERE `application_id` = ?"; - const std::string kSelectAccessModules = "SELECT `id`, `name` FROM `access_module` " " WHERE `user_consent_needed` = ?"; @@ -494,12 +460,6 @@ const std::string kDropSchema = "`preconsented_group.fk_application_has_functional_group_functional_group2_" "idx`; " "DROP TABLE IF EXISTS `preconsented_group`; " - "DROP INDEX IF EXISTS " - "`app_group_primary.fk_application_has_functional_group_application1_idx`; " - "DROP INDEX IF EXISTS " - "`app_group_primary.fk_application_has_functional_group_functional_group1_" - "idx`; " - "DROP TABLE IF EXISTS `app_group_primary`; " "DROP TABLE IF EXISTS `access_module`; " "DROP INDEX IF EXISTS `access_module.fk_module_1_idx`; " "DROP INDEX IF EXISTS " @@ -548,7 +508,6 @@ const std::string kDeleteData = "DELETE FROM `app_group`; " "DELETE FROM `application`; " "DELETE FROM `rpc`; " - "DELETE FROM `app_group_primary`; " "DELETE FROM `access_module`; " "DELETE FROM `version`; " "DELETE FROM `message_type`; " diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 06cbc03dfb..9f529b7d78 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -871,10 +871,6 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection( return false; } #ifdef SDL_REMOTE_CONTROL - if (!query_delete.Exec(sql_pt::kDeleteAppGroupPrimary)) { - LOG4CXX_WARN(logger_, "Incorrect delete from app_group_primary."); - return false; - } if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) { LOG4CXX_WARN(logger_, "Incorrect delete from module_type."); return false; @@ -1534,20 +1530,6 @@ bool SQLPTRepresentation::GatherAppGroup( } #ifdef SDL_REMOTE_CONTROL -bool SQLPTRepresentation::GatherAppGroupPrimary( - const std::string& app_id, policy_table::Strings* app_groups) const { - utils::dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kSelectAppGroupsPrimary)) { - LOG4CXX_WARN(logger_, "Incorrect select from app groups for primary RC"); - return false; - } - - query.Bind(0, app_id); - while (query.Next()) { - app_groups->push_back(query.GetString(0)); - } - return true; -} bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id, bool* denied) const { @@ -1585,31 +1567,6 @@ bool SQLPTRepresentation::GatherModuleType( return true; } -bool SQLPTRepresentation::SaveAppGroupPrimary( - const std::string& app_id, const policy_table::Strings& app_groups) { - LOG4CXX_AUTO_TRACE(logger_); - utils::dbms::SQLQuery query(db()); - if (!query.Prepare(sql_pt::kInsertAppGroupPrimary)) { - LOG4CXX_WARN(logger_, "Incorrect insert statement for app group primary"); - return false; - } - policy_table::Strings::const_iterator it; - for (it = app_groups.begin(); it != app_groups.end(); ++it) { - std::string ssss = *it; - LOG4CXX_INFO(logger_, "Group: " << ssss); - query.Bind(0, app_id); - query.Bind(1, *it); - if (!query.Exec() || !query.Reset()) { - LOG4CXX_WARN(logger_, - "Incorrect insert into app group primary." - << query.LastError().text()); - return false; - } - } - - return true; -} - bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id, bool deny) { LOG4CXX_AUTO_TRACE(logger_); @@ -1849,19 +1806,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) { LOG4CXX_ERROR(logger_, "Failed deleting from app_group."); return false; } -#ifdef SDL_REMOTE_CONTROL - utils::dbms::SQLQuery query_p(db()); - if (!query_p.Prepare(sql_pt::kDeleteAppGroupPrimaryByApplicationId)) { - LOG4CXX_ERROR(logger_, - "Incorrect statement to delete from app_group_primary."); - return false; - } - query_p.Bind(0, app_id); - if (!query_p.Exec()) { - LOG4CXX_ERROR(logger_, "Failed deleting from app_group_primary."); - return false; - } -#endif // SDL_REMOTE_CONTROL if (!CopyApplication(kDefaultId, app_id)) { return false; diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index cbde0ca00f..fd83c82b1a 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -420,7 +420,7 @@ TEST_F(SQLPTRepresentationTest, ASSERT_EQ(0, dbms->FetchOneInt(query_select)); ASSERT_TRUE(reps->RefreshDB()); // Check PT structure destroyed and tables number is 0 - const int32_t total_tables_number = 29; + const int32_t total_tables_number = 28; ASSERT_EQ(total_tables_number, dbms->FetchOneInt(query_select)); const char* query_select_count_of_iap_buffer_full = "SELECT `count_of_iap_buffer_full` FROM `usage_and_error_count`"; -- cgit v1.2.1 From f76bf42318b4cf48b120cfa84d2baae7e85f38b7 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 21:52:50 +0300 Subject: Fix year in RC related files --- .../functional_module/include/functional_module/function_ids.h | 2 +- .../functional_module/include/functional_module/generic_module.h | 2 +- .../functional_module/include/functional_module/module_observer.h | 2 +- .../functional_module/include/functional_module/plugin_manager.h | 2 +- src/components/functional_module/include/functional_module/settings.h | 2 +- .../functional_module/include/functional_module/timer/module_timer.h | 2 +- .../functional_module/include/functional_module/timer/timer_director.h | 2 +- src/components/functional_module/src/plugin_manager.cc | 2 +- src/components/functional_module/src/settings.cc | 2 +- src/components/functional_module/src/timer/timer_director.cc | 2 +- .../include/remote_control/commands/base_command_notification.h | 2 +- .../include/remote_control/commands/base_command_request.h | 2 +- .../include/remote_control/commands/button_press_request.h | 2 +- src/components/remote_control/include/remote_control/commands/command.h | 2 +- .../include/remote_control/commands/get_interior_vehicle_data_request.h | 2 +- .../remote_control/commands/on_interior_vehicle_data_notification.h | 2 +- .../remote_control/include/remote_control/event_engine/event.h | 2 +- .../include/remote_control/event_engine/event_dispatcher.h | 2 +- .../remote_control/include/remote_control/event_engine/event_observer.h | 2 +- src/components/remote_control/include/remote_control/message_helper.h | 2 +- src/components/remote_control/include/remote_control/rc_app_extension.h | 2 +- .../remote_control/include/remote_control/rc_command_factory.h | 2 +- .../remote_control/include/remote_control/rc_module_constants.h | 2 +- src/components/remote_control/include/remote_control/rc_module_timer.h | 2 +- .../remote_control/include/remote_control/remote_control_event.h | 2 +- .../remote_control/include/remote_control/remote_control_plugin.h | 2 +- .../remote_control/include/remote_control/remote_plugin_interface.h | 2 +- .../remote_control/include/remote_control/request_controller.h | 2 +- src/components/remote_control/src/commands/base_command_notification.cc | 2 +- src/components/remote_control/src/commands/base_command_request.cc | 2 +- .../remote_control/src/commands/get_interior_vehicle_data_request.cc | 2 +- src/components/remote_control/src/message_helper.cc | 2 +- src/components/remote_control/src/rc_app_extension.cc | 2 +- src/components/remote_control/src/rc_command_factory.cc | 2 +- src/components/remote_control/src/remote_control_event.cc | 2 +- src/components/remote_control/src/remote_control_plugin.cc | 2 +- src/components/remote_control/src/request_controller.cc | 2 +- src/components/remote_control/test/commands/CMakeLists.txt | 2 +- 38 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/components/functional_module/include/functional_module/function_ids.h b/src/components/functional_module/include/functional_module/function_ids.h index 5b8218e37b..ad6bdca736 100644 --- a/src/components/functional_module/include/functional_module/function_ids.h +++ b/src/components/functional_module/include/functional_module/function_ids.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/include/functional_module/generic_module.h b/src/components/functional_module/include/functional_module/generic_module.h index 212ec32185..505a939637 100644 --- a/src/components/functional_module/include/functional_module/generic_module.h +++ b/src/components/functional_module/include/functional_module/generic_module.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/include/functional_module/module_observer.h b/src/components/functional_module/include/functional_module/module_observer.h index 1608ef5d42..5cd95f4abf 100644 --- a/src/components/functional_module/include/functional_module/module_observer.h +++ b/src/components/functional_module/include/functional_module/module_observer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/include/functional_module/plugin_manager.h b/src/components/functional_module/include/functional_module/plugin_manager.h index ebf0b033c4..2993729dfa 100644 --- a/src/components/functional_module/include/functional_module/plugin_manager.h +++ b/src/components/functional_module/include/functional_module/plugin_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/include/functional_module/settings.h b/src/components/functional_module/include/functional_module/settings.h index cf78c24e8b..9c63f087cf 100644 --- a/src/components/functional_module/include/functional_module/settings.h +++ b/src/components/functional_module/include/functional_module/settings.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/include/functional_module/timer/module_timer.h b/src/components/functional_module/include/functional_module/timer/module_timer.h index d7fc0ba043..68640290e7 100644 --- a/src/components/functional_module/include/functional_module/timer/module_timer.h +++ b/src/components/functional_module/include/functional_module/timer/module_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/include/functional_module/timer/timer_director.h b/src/components/functional_module/include/functional_module/timer/timer_director.h index 65f9f4a6d5..fb67b9b5de 100644 --- a/src/components/functional_module/include/functional_module/timer/timer_director.h +++ b/src/components/functional_module/include/functional_module/timer/timer_director.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/src/plugin_manager.cc b/src/components/functional_module/src/plugin_manager.cc index 7ebafc3d09..8eb46d6c62 100644 --- a/src/components/functional_module/src/plugin_manager.cc +++ b/src/components/functional_module/src/plugin_manager.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/src/settings.cc b/src/components/functional_module/src/settings.cc index 29a96ba63b..16e96000af 100644 --- a/src/components/functional_module/src/settings.cc +++ b/src/components/functional_module/src/settings.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/functional_module/src/timer/timer_director.cc b/src/components/functional_module/src/timer/timer_director.cc index 51d7408fcd..81ce117851 100644 --- a/src/components/functional_module/src/timer/timer_director.cc +++ b/src/components/functional_module/src/timer/timer_director.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/commands/base_command_notification.h b/src/components/remote_control/include/remote_control/commands/base_command_notification.h index 35b8d3f6c2..578afad67b 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_notification.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_notification.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/commands/base_command_request.h b/src/components/remote_control/include/remote_control/commands/base_command_request.h index a76f972930..eb6ea23f74 100644 --- a/src/components/remote_control/include/remote_control/commands/base_command_request.h +++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/commands/button_press_request.h b/src/components/remote_control/include/remote_control/commands/button_press_request.h index 6c5a60a9fe..945f98bdc8 100644 --- a/src/components/remote_control/include/remote_control/commands/button_press_request.h +++ b/src/components/remote_control/include/remote_control/commands/button_press_request.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/commands/command.h b/src/components/remote_control/include/remote_control/commands/command.h index ad471ba151..0e03f8b330 100644 --- a/src/components/remote_control/include/remote_control/commands/command.h +++ b/src/components/remote_control/include/remote_control/commands/command.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h b/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h index d687221fbe..220f7da979 100644 --- a/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h +++ b/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h b/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h index bc9c9bee8e..4ee9ce4709 100644 --- a/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h +++ b/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/event_engine/event.h b/src/components/remote_control/include/remote_control/event_engine/event.h index 531c35135b..0da248e5a7 100644 --- a/src/components/remote_control/include/remote_control/event_engine/event.h +++ b/src/components/remote_control/include/remote_control/event_engine/event.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h b/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h index 4776f355c4..ddee6caccc 100644 --- a/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h +++ b/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/event_engine/event_observer.h b/src/components/remote_control/include/remote_control/event_engine/event_observer.h index e2f3d8ea1e..66a38da88b 100644 --- a/src/components/remote_control/include/remote_control/event_engine/event_observer.h +++ b/src/components/remote_control/include/remote_control/event_engine/event_observer.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/message_helper.h b/src/components/remote_control/include/remote_control/message_helper.h index 2a632c3c50..6358459da7 100644 --- a/src/components/remote_control/include/remote_control/message_helper.h +++ b/src/components/remote_control/include/remote_control/message_helper.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/rc_app_extension.h b/src/components/remote_control/include/remote_control/rc_app_extension.h index aa47624713..95c6b038d5 100644 --- a/src/components/remote_control/include/remote_control/rc_app_extension.h +++ b/src/components/remote_control/include/remote_control/rc_app_extension.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/rc_command_factory.h b/src/components/remote_control/include/remote_control/rc_command_factory.h index 06332995b2..9463c4b1ef 100644 --- a/src/components/remote_control/include/remote_control/rc_command_factory.h +++ b/src/components/remote_control/include/remote_control/rc_command_factory.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/rc_module_constants.h b/src/components/remote_control/include/remote_control/rc_module_constants.h index dc9e39021d..021e3cd6f0 100644 --- a/src/components/remote_control/include/remote_control/rc_module_constants.h +++ b/src/components/remote_control/include/remote_control/rc_module_constants.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/rc_module_timer.h b/src/components/remote_control/include/remote_control/rc_module_timer.h index dbc072a62d..813f26a885 100644 --- a/src/components/remote_control/include/remote_control/rc_module_timer.h +++ b/src/components/remote_control/include/remote_control/rc_module_timer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/remote_control_event.h b/src/components/remote_control/include/remote_control/remote_control_event.h index 4623310557..3c98f971ac 100644 --- a/src/components/remote_control/include/remote_control/remote_control_event.h +++ b/src/components/remote_control/include/remote_control/remote_control_event.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/remote_control_plugin.h b/src/components/remote_control/include/remote_control/remote_control_plugin.h index 85df1d51d1..14ffbd5f3c 100644 --- a/src/components/remote_control/include/remote_control/remote_control_plugin.h +++ b/src/components/remote_control/include/remote_control/remote_control_plugin.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/remote_plugin_interface.h b/src/components/remote_control/include/remote_control/remote_plugin_interface.h index 64aa7208a5..51135d8a8a 100644 --- a/src/components/remote_control/include/remote_control/remote_plugin_interface.h +++ b/src/components/remote_control/include/remote_control/remote_plugin_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/include/remote_control/request_controller.h b/src/components/remote_control/include/remote_control/request_controller.h index 4e1e423e8e..78405c7cf1 100644 --- a/src/components/remote_control/include/remote_control/request_controller.h +++ b/src/components/remote_control/include/remote_control/request_controller.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/commands/base_command_notification.cc b/src/components/remote_control/src/commands/base_command_notification.cc index c79e800a88..2de82abdef 100644 --- a/src/components/remote_control/src/commands/base_command_notification.cc +++ b/src/components/remote_control/src/commands/base_command_notification.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/commands/base_command_request.cc b/src/components/remote_control/src/commands/base_command_request.cc index 3961b79688..b2b97518f6 100644 --- a/src/components/remote_control/src/commands/base_command_request.cc +++ b/src/components/remote_control/src/commands/base_command_request.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc index 0c62ee4711..37ac5f2056 100644 --- a/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc +++ b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/message_helper.cc b/src/components/remote_control/src/message_helper.cc index 734e220359..41a65d4c60 100644 --- a/src/components/remote_control/src/message_helper.cc +++ b/src/components/remote_control/src/message_helper.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/rc_app_extension.cc b/src/components/remote_control/src/rc_app_extension.cc index c5b0584dcd..5f1eac5196 100644 --- a/src/components/remote_control/src/rc_app_extension.cc +++ b/src/components/remote_control/src/rc_app_extension.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/rc_command_factory.cc b/src/components/remote_control/src/rc_command_factory.cc index 410b7eadfa..93b90b64ac 100644 --- a/src/components/remote_control/src/rc_command_factory.cc +++ b/src/components/remote_control/src/rc_command_factory.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/remote_control_event.cc b/src/components/remote_control/src/remote_control_event.cc index ef8a2c4e6f..e4f887ffc6 100644 --- a/src/components/remote_control/src/remote_control_event.cc +++ b/src/components/remote_control/src/remote_control_event.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/remote_control_plugin.cc b/src/components/remote_control/src/remote_control_plugin.cc index cd0f123ba8..516811254b 100644 --- a/src/components/remote_control/src/remote_control_plugin.cc +++ b/src/components/remote_control/src/remote_control_plugin.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2017, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/src/request_controller.cc b/src/components/remote_control/src/request_controller.cc index 602aeb1331..e0ac542a82 100644 --- a/src/components/remote_control/src/request_controller.cc +++ b/src/components/remote_control/src/request_controller.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Ford Motor Company + * Copyright (c) 2017, Ford Motor Company * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/src/components/remote_control/test/commands/CMakeLists.txt b/src/components/remote_control/test/commands/CMakeLists.txt index 1ac186ebf8..09c706fc2f 100644 --- a/src/components/remote_control/test/commands/CMakeLists.txt +++ b/src/components/remote_control/test/commands/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2016, Ford Motor Company +# Copyright (c) 2017, Ford Motor Company # All rights reserved. # # Redistribution and use in source and binary forms, with or without -- cgit v1.2.1 From b02ea29020741c2c415ea0baac08acf57fc664f7 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 21:55:41 +0300 Subject: Add remoute controll to applicaiton groups in preloaded --- src/appMain/sdl_preloaded_pt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index a04d0f5ca9..a8fa5a6f6e 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -2355,7 +2355,7 @@ "steal_focus": false, "priority": "NONE", "default_hmi": "NONE", - "groups": ["Base-4"], + "groups": ["Base-4", "RemoteControl"], "moduleType": [ "RADIO", "CLIMATE" -- cgit v1.2.1 From c875496c25c2d8ba8d6d13f52ba4f9952918cadd Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Tue, 22 Aug 2017 22:14:21 +0300 Subject: Remote controll groups fix --- src/components/remote_control/remote_sdl_pt.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/remote_control/remote_sdl_pt.json b/src/components/remote_control/remote_sdl_pt.json index fc766bc0a9..d1017f89b1 100644 --- a/src/components/remote_control/remote_sdl_pt.json +++ b/src/components/remote_control/remote_sdl_pt.json @@ -2319,8 +2319,7 @@ "priority": "NONE", "default_hmi": "NONE", "moduleType": ["RADIO", "CLIMATE"], - "groups": ["Base-4"], - "groups_primaryRC": ["Base-4", "RemoteControl"] + "groups": ["Base-4", "RemoteControl"] }, "device": { "keep_context": false, -- cgit v1.2.1 From 9ff6b5c5b36b38ecd90e6c08378236cd044f873e Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Fri, 18 Aug 2017 12:24:00 +0300 Subject: Fix EXTERNAL build --- .../policy_external/policy/policy_listener.h | 5 ----- .../policy_external/src/access_remote_impl.cc | 24 ---------------------- .../policy_external/src/policy_table/enums.cc | 8 ++++---- .../policy_external/src/sql_pt_representation.cc | 18 ++++++++++++++++ 4 files changed, 22 insertions(+), 33 deletions(-) diff --git a/src/components/include/policy/policy_external/policy/policy_listener.h b/src/components/include/policy/policy_external/policy/policy_listener.h index bac58235cb..feeac722b9 100644 --- a/src/components/include/policy/policy_external/policy/policy_listener.h +++ b/src/components/include/policy/policy_external/policy/policy_listener.h @@ -155,11 +155,6 @@ class PolicyListener { virtual void OnUpdateHMILevel(const std::string& device_id, const std::string& policy_app_id, const std::string& hmi_level) = 0; - /** - * @brief Signal that country_consent field was updated during PTU - * @param new_consent New value of country_consent - */ - virtual void OnRemoteAllowedChanged(bool new_consent) = 0; /** * @brief Notifies Remote apps about change in permissions diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index bfb9f94c6d..7d61a4deab 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -155,30 +155,6 @@ bool AccessRemoteImpl::CompareParameters( return input->empty(); } -void AccessRemoteImpl::Allow(const Subject& who, const Object& what) { - LOG4CXX_AUTO_TRACE(logger_); - acl_[what][who] = TypeAccess::kAllowed; -} - -void AccessRemoteImpl::Deny(const Subject& who, const Object& what) { - LOG4CXX_AUTO_TRACE(logger_); - acl_[what][who] = TypeAccess::kDisallowed; -} - -void AccessRemoteImpl::Reset(const Subject& who) { - LOG4CXX_AUTO_TRACE(logger_); - std::for_each(acl_.begin(), acl_.end(), Erase(who)); -} - -void AccessRemoteImpl::Reset(const Object& what) { - LOG4CXX_AUTO_TRACE(logger_); - acl_.erase(what); -} - -void AccessRemoteImpl::Reset() { - acl_.clear(); -} - void AccessRemoteImpl::SetDefaultHmiTypes(const Subject& who, const std::vector& hmi_types) { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/policy/policy_external/src/policy_table/enums.cc b/src/components/policy/policy_external/src/policy_table/enums.cc index fc108217c4..168ff86b27 100644 --- a/src/components/policy/policy_external/src/policy_table/enums.cc +++ b/src/components/policy/policy_external/src/policy_table/enums.cc @@ -467,6 +467,10 @@ const char* EnumToJsonString(AppHMIType val) { return "TESTING"; case AHT_SYSTEM: return "SYSTEM"; + case AHT_PROJECTION: + return "PROJECTION"; + case AHT_REMOTE_CONTROL: + return "REMOTE_CONTROL"; default: return ""; } @@ -684,10 +688,6 @@ bool EnumFromJsonString(const std::string& literal, RequestType* result) { *result = RT_DRIVER_PROFILE; return true; } -} -else if ("REMOTE_CONTROL" == literal) { - *result = AHT_REMOTE_CONTROL; - return true; if ("VOICE_SEARCH" == literal) { *result = RT_VOICE_SEARCH; return true; diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 3d5ae4960d..7f67ed82f6 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -1658,6 +1658,24 @@ bool SQLPTRepresentation::GatherModuleType( return true; } +bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id, + bool deny) { + LOG4CXX_AUTO_TRACE(logger_); + dbms::SQLQuery query(db()); + if (!query.Prepare(sql_pt::kUpdateRemoteControlDenied)) { + LOG4CXX_WARN(logger_, "Incorrect update statement for remote control flag"); + return false; + } + LOG4CXX_DEBUG(logger_, "App: " << app_id << std::boolalpha << " - " << deny); + query.Bind(0, deny); + query.Bind(1, app_id); + if (!query.Exec()) { + LOG4CXX_WARN(logger_, "Incorrect update remote control flag."); + return false; + } + return true; +} + bool SQLPTRepresentation::SaveModuleType( const std::string& app_id, const policy_table::ModuleTypes& types) { dbms::SQLQuery query(db()); -- cgit v1.2.1 From 7a4a9a01854b42622d881ef0767ab64a75c3f3e8 Mon Sep 17 00:00:00 2001 From: Ira Lytvynenko Date: Wed, 23 Aug 2017 13:36:44 +0300 Subject: Fix UT --- .../policy/policy_external/test/sql_pt_representation_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index d4df658bd2..a657a01145 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -407,7 +407,7 @@ TEST_F(SQLPTRepresentationTest, query.Prepare(query_select); query.Next(); - const int policy_tables_number = 34; + const int policy_tables_number = 32; ASSERT_EQ(policy_tables_number, query.GetInteger(0)); const std::string query_select_count_of_iap_buffer_full = -- cgit v1.2.1 From 108f153df2c6f4fd3fafd8acb9f8701f2b7a842e Mon Sep 17 00:00:00 2001 From: Masato Ogawa Date: Wed, 23 Aug 2017 23:22:20 +0900 Subject: Add hapticSpatialDataSupported into VideoStreamingCapability --- src/appMain/hmi_capabilities.json | 5 +++-- .../include/application_manager/smart_object_keys.h | 1 + src/components/application_manager/src/smart_object_keys.cc | 1 + .../test/commands/hmi/ui_get_capabilities_response_test.cc | 2 ++ src/components/application_manager/test/hmi_capabilities.json | 5 +++-- src/components/application_manager/test/hmi_capabilities_test.cc | 2 ++ src/components/interfaces/HMI_API.xml | 3 +++ src/components/interfaces/MOBILE_API.xml | 3 +++ 8 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json index 33ee842404..6e9a9e3194 100755 --- a/src/appMain/hmi_capabilities.json +++ b/src/appMain/hmi_capabilities.json @@ -310,7 +310,8 @@ "supportedFormats": [{ "protocol": "RAW", "codec": "H264" - }] + }], + "hapticSpatialDataSupported": false } } }, @@ -436,4 +437,4 @@ "majorVersion": 3, "minorVersion": 0 } -} \ No newline at end of file +} diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 388c4ed80d..24ba1bd1ba 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -351,6 +351,7 @@ extern const char* const resolution_width; extern const char* const resolution_height; extern const char* const max_bitrate; extern const char* const supported_formats; +extern const char* const haptic_spatial_data_supported; } // namespace strings namespace json { diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 355314086f..8bde87f493 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -312,6 +312,7 @@ const char* const resolution_width = "resolutionWidth"; const char* const resolution_height = "resolutionHeight"; const char* const max_bitrate = "maxBitrate"; const char* const supported_formats = "supportedFormats"; +const char* const haptic_spatial_data_supported = "hapticSpatialDataSupported"; } // namespace strings namespace json { diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index 57cafd75e2..0a1e5d8ef7 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -322,6 +322,8 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { video_streaming_capability[strings::supported_formats][0][strings::codec] = hmi_apis::Common_VideoStreamingCodec::H264; + video_streaming_capability[strings::haptic_spatial_data_supported] = true; + ResponseFromHMIPtr command( CreateCommand(command_msg)); diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 435d03c8bf..7c6cdd7dcd 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -316,7 +316,8 @@ { "protocol": "RTP", "codec": "Theora" - }] + }], + "hapticSpatialDataSupported": true } } }, @@ -442,4 +443,4 @@ "majorVersion": 3, "minorVersion": 0 } -} \ No newline at end of file +} diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index bd3aa3e730..4ede705f87 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -419,6 +419,8 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { EXPECT_EQ( 2, vs_capability_so[strings::supported_formats][1][strings::codec].asInt()); + EXPECT_TRUE(vs_capability_so.keyExists(strings::haptic_spatial_data_supported)); + EXPECT_TRUE(vs_capability_so[strings::haptic_spatial_data_supported].asBool()); } TEST_F(HMICapabilitiesTest, VerifyImageType) { diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index db20beb27f..19e36fc9cb 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -2256,6 +2256,9 @@ Each object will contain a VideoStreamingFormat that describes what can be expected. + + True if the system can utilize the haptic spatial data from the source being streamed. + diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 2488998d81..a7ded6299e 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -2548,6 +2548,9 @@ Each object will contain a VideoStreamingFormat that describes what can be expected. + + True if the system can utilize the haptic spatial data from the source being streamed. + -- cgit v1.2.1 From 9745c18409a90be4a2c894a583e5513ef215a0d6 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Wed, 23 Aug 2017 22:26:30 +0300 Subject: Remove not correct preloaded json --- src/appMain/CMakeLists.txt | 13 +- src/components/remote_control/remote_sdl_pt.json | 2340 ---------------------- 2 files changed, 3 insertions(+), 2350 deletions(-) delete mode 100644 src/components/remote_control/remote_sdl_pt.json diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt index 3c5f8e3345..88c2d75dad 100644 --- a/src/appMain/CMakeLists.txt +++ b/src/appMain/CMakeLists.txt @@ -218,18 +218,11 @@ install( ${CMAKE_SOURCE_DIR}/mycert.pem ${CMAKE_SOURCE_DIR}/mykey.pem DESTINATION bin ) -if (REMOTE_CONTROL) - install( - FILES "${CMAKE_SOURCE_DIR}/src/components/remote_control/remote_sdl_pt.json" - DESTINATION ${CMAKE_BINARY_DIR}/bin - RENAME sdl_preloaded_pt.json - ) -else () - install( + +install( FILES sdl_preloaded_pt.json DESTINATION bin - ) -endif () +) if (${QT_HMI}) if (CMAKE_SYSTEM_NAME STREQUAL "QNX") diff --git a/src/components/remote_control/remote_sdl_pt.json b/src/components/remote_control/remote_sdl_pt.json deleted file mode 100644 index d1017f89b1..0000000000 --- a/src/components/remote_control/remote_sdl_pt.json +++ /dev/null @@ -1,2340 +0,0 @@ -{ - "policy_table": { - "module_config": { - "equipment": { - }, - "preloaded_pt": true, - "exchange_after_x_ignition_cycles": 100, - "exchange_after_x_kilometers": 1800, - "exchange_after_x_days": 30, - "timeout_after_x_seconds": 60, - "seconds_between_retries": [1, - 5, - 25, - 125, - 625], - "endpoints": { - "0x07": { - "default": ["http://policies.telematics.ford.com/api/policies"] - }, - "0x04": { - "default": ["http://ivsu.software.ford.com/api/getsoftwareupdates"] - }, - "queryAppsUrl": { - "default": ["http://sdl.shaid.server"] - } - }, - "notifications_per_minute_by_priority": { - "EMERGENCY": 60, - "NAVIGATION": 15, - "VOICECOM": 20, - "COMMUNICATION": 6, - "NORMAL": 4, - "NONE": 0 - } - }, - "functional_groupings": { - "Base-4": { - "rpcs": { - "AddCommand": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "AddSubMenu": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "Alert": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "ChangeRegistration": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "CreateInteractionChoiceSet": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "DeleteCommand": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "DeleteFile": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "DeleteInteractionChoiceSet": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "DeleteSubMenu": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "EncodedSyncPData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "EndAudioPassThru": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "GenericResponse": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "ListFiles": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnAppInterfaceUnregistered": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnAudioPassThru": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "OnButtonEvent": { - "hmi_levels": ["FULL", - "LIMITED", - "BACKGROUND"] - }, - "OnButtonPress": { - "hmi_levels": ["FULL", - "LIMITED", - "BACKGROUND"] - }, - "OnCommand": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "OnDriverDistraction": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "OnEncodedSyncPData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnHashChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnHMIStatus": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnLanguageChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnPermissionsChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnSystemRequest": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "PerformAudioPassThru": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "PerformInteraction": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "PutFile": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "RegisterAppInterface": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "ResetGlobalProperties": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "ScrollableMessage": { - "hmi_levels": ["FULL"] - }, - "SetAppIcon": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SetDisplayLayout": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SetGlobalProperties": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SetMediaClockTimer": { - "hmi_levels": ["FULL", - "LIMITED", - "BACKGROUND"] - }, - "Show": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "Slider": { - "hmi_levels": ["FULL"] - }, - "Speak": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "SubscribeButton": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "SystemRequest": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "UnregisterAppInterface": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "UnsubscribeButton": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - } - } - }, - "Location-1": { - "user_consent_prompt": "Location", - "rpcs": { - "GetVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["gps", - "speed"] - }, - "OnVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["gps", - "speed"] - }, - "SubscribeVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["gps", - "speed"] - }, - "UnsubscribeVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["gps", - "speed"] - } - } - }, - "Notifications": { - "user_consent_prompt": "Notifications", - "rpcs": { - "Alert": { - "hmi_levels": ["BACKGROUND"] - } - } - }, - "Notifications-RC": { - "rpcs": { - "OnPermissionsChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnHMIStatus": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnSystemRequest": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - } - } - }, - "pre_BaseRC-1": { - "rpcs": { - "OnPermissionsChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnHMIStatus": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - } - } - }, - "DrivingCharacteristics-3": { - "user_consent_prompt": "DrivingCharacteristics", - "rpcs": { - "GetVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["accPedalPosition", - "beltStatus", - "driverBraking", - "myKey", - "prndl", - "rpm", - "steeringWheelAngle"] - }, - "OnVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["accPedalPosition", - "beltStatus", - "driverBraking", - "myKey", - "prndl", - "rpm", - "steeringWheelAngle"] - }, - "SubscribeVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["accPedalPosition", - "beltStatus", - "driverBraking", - "myKey", - "prndl", - "rpm", - "steeringWheelAngle"] - }, - "UnsubscribeVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["accPedalPosition", - "beltStatus", - "driverBraking", - "myKey", - "prndl", - "rpm", - "steeringWheelAngle"] - } - } - }, - "VehicleInfo-3": { - "user_consent_prompt": "VehicleInfo", - "rpcs": { - "GetVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["bodyInformation", - "deviceStatus", - "engineTorque", - "externalTemperature", - "fuelLevel", - "fuelLevel_State", - "headLampStatus", - "instantFuelConsumption", - "odometer", - "tirePressure", - "vin", - "wiperStatus"] - }, - "OnVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["bodyInformation", - "deviceStatus", - "engineTorque", - "externalTemperature", - "fuelLevel", - "fuelLevel_State", - "headLampStatus", - "instantFuelConsumption", - "odometer", - "tirePressure", - "vin", - "wiperStatus"] - }, - "SubscribeVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["bodyInformation", - "deviceStatus", - "engineTorque", - "externalTemperature", - "fuelLevel", - "fuelLevel_State", - "headLampStatus", - "instantFuelConsumption", - "odometer", - "tirePressure", - "wiperStatus"] - }, - "UnsubscribeVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["bodyInformation", - "deviceStatus", - "engineTorque", - "externalTemperature", - "fuelLevel", - "fuelLevel_State", - "headLampStatus", - "instantFuelConsumption", - "odometer", - "tirePressure", - "wiperStatus"] - } - } - }, - "PropriataryData-1": { - "rpcs": { - "DiagnosticMessage": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "GetDTCs": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "ReadDID": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - } - } - }, - "PropriataryData-2": { - "rpcs": { - "DiagnosticMessage": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "GetDTCs": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "ReadDID": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - } - } - }, - "ProprietaryData-3": { - "rpcs": { - "GetDTCs": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "ReadDID": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - } - } - }, - "Emergency-1": { - "rpcs": { - "GetVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["airbagStatus", - "clusterModeStatus", - "eCallInfo", - "emergencyEvent"] - }, - "OnVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["airbagStatus", - "clusterModeStatus", - "eCallInfo", - "emergencyEvent"] - }, - "SubscribeVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["airbagStatus", - "clusterModeStatus", - "eCallInfo", - "emergencyEvent"] - }, - "UnsubscribeVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"], - "parameters": ["airbagStatus", - "clusterModeStatus", - "eCallInfo", - "emergencyEvent"] - } - } - }, - "Navigation-1": { - "rpcs": { - "AlertManeuver": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "ShowConstantTBT": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "UpdateTurnList": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - } - } - }, - "Base-6": { - "rpcs": { - "AddCommand": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "AddSubMenu": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "Alert": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "ChangeRegistration": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "CreateInteractionChoiceSet": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "DeleteCommand": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "DeleteFile": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "DeleteInteractionChoiceSet": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "DeleteSubMenu": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "EncodedSyncPData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "EndAudioPassThru": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "GenericResponse": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "ListFiles": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnAppInterfaceUnregistered": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnAudioPassThru": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "OnButtonEvent": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "OnButtonPress": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "OnCommand": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "OnDriverDistraction": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "OnEncodedSyncPData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnHMIStatus": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnLanguageChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnPermissionsChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnSyncPData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnTBTClientState": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "PerformAudioPassThru": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "PerformInteraction": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "PutFile": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "RegisterAppInterface": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "ResetGlobalProperties": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "ScrollableMessage": { - "hmi_levels": ["FULL"] - }, - "SetAppIcon": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SetDisplayLayout": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SetGlobalProperties": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "SetMediaClockTimer": { - "hmi_levels": ["FULL"] - }, - "Show": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "Slider": { - "hmi_levels": ["FULL"] - }, - "Speak": { - "hmi_levels": ["FULL", - "LIMITED"] - }, - "SubscribeButton": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "SyncPData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "UnregisterAppInterface": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "UnsubscribeButton": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - } - } - }, - "OnKeyboardInputOnlyGroup": { - "rpcs": { - "OnKeyboardInput": { - "hmi_levels": ["FULL"] - } - } - }, - "OnTouchEventOnlyGroup": { - "rpcs": { - "OnTouchEvent": { - "hmi_levels": ["FULL"] - } - } - }, - "DiagnosticMessageOnly": { - "rpcs": { - "DiagnosticMessage": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - } - } - }, - "DataConsent-2": { - "user_consent_prompt": "DataConsent", - "rpcs": null - }, - "BaseBeforeDataConsent": { - "rpcs": { - "ChangeRegistration": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "DeleteFile": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "EncodedSyncPData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "ListFiles": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnAppInterfaceUnregistered": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnEncodedSyncPData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnHashChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnHMIStatus": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnLanguageChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnPermissionsChange": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "OnSystemRequest": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "PutFile": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "RegisterAppInterface": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "ResetGlobalProperties": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SetGlobalProperties": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SetAppIcon": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SetDisplayLayout": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "SystemRequest": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - }, - "UnregisterAppInterface": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - } - } - }, - "SendLocation": { - "rpcs": { - "SendLocation": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - } - } - }, - "BackgroundAPT": { - "rpcs": { - "EndAudioPassThru": { - "hmi_levels": ["BACKGROUND"] - }, - "OnAudioPassThru": { - "hmi_levels": ["BACKGROUND"] - }, - "PerformAudioPassThru": { - "hmi_levels": ["BACKGROUND"] - } - } - }, - "RemoteControl": { - "rpcs": { - "ButtonPress": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "GetInteriorVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "SetInteriorVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "OnInteriorVehicleData": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED"] - }, - "SystemRequest": { - "hmi_levels": ["BACKGROUND", - "FULL", - "LIMITED", - "NONE"] - } - } - } - }, - "consumer_friendly_messages": { - "version": "001.001.021", - "messages": { - "AppPermissions": { - "languages": { - "de-de": { - "tts": "%appName% benötigt die folgenden Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Wenn Sie Ja drücken, erklären Sie sich damit einverstanden, dass %vehicleMake% nicht für Schäden oder Verletzungen der Privatsphäre haftet, die im Zusammenhang mit der Nutzung Ihrer Benutzerdaten durch %appName% entstehen. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab.", - "line1": "Zugriffsanfrage(n)", - "line2": "erlauben?" - }, - "en-au": { - "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.", - "line1": "Grant requested", - "line2": "permission(s)?" - }, - "en-gb": { - "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. Please press Yes to allow or No to deny.", - "line1": "Grant requested", - "line2": "permission(s)?", - "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%`s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu." - }, - "en-ie": { - "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press Yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%'s use of your data. Please press Yes to allow or No to deny.", - "line1": "Grant requested", - "line2": "permission(s)?" - }, - "en-us": { - "tts": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. If you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. Please press yes to allow or no to deny.", - "line1": "Grant Requested", - "line2": "Permission(s)?", - "textBody": "%appName% is requesting the use of the following vehicle information and permissions: %functionalGroupLabels%. \n\nIf you press yes, you agree that %vehicleMake% will not be liable for any damages or loss of privacy related to %appName%’s use of your data. You can change these permissions and hear detailed descriptions in the mobile apps settings menu." - }, - "es-en": { - "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.", - "line1": "¿Otorgar permiso(s)", - "line2": "solicitado(s)?", - "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. \n\n Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles." - }, - "es-es": { - "tts": "%appName% está solicitando el uso de los siguientes permisos e información del vehículo: %functionalGroupLabels%. Si pulsa sí, acepta que %vehicleMake% no será responsable de los daños o la pérdida de privacidad relacionados con el uso de sus datos por parte de %appName%. Pulse sí para permitir o no para denegar.", - "line1": "¿Conceder permisos", - "line2": "solicitados?" - }, - "es-mx": { - "tts": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. Si presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar.", - "line1": "¿Otorgar permiso(s)", - "line2": "solicitado(s)?", - "textBody": "%appName% solicita el uso de la siguiente información y permisos del vehículo: %functionalGroupLabels%. \n\nSi presiona Sí, acepta que %vehicleMake% no se hará responsable por los daños o pérdidas de privacidad relacionados con el uso que %appName% haga de sus datos. Presione Sí para permitir y No para denegar. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles." - }, - "fr-ca": { - "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.", - "line1": "Accorder permission(s)", - "line2": "demandée(s)", - "textBody": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles." - }, - "fr-fr": { - "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Si vous appuyez sur Oui, vous acceptez que %vehicleMake% ne sera pas responsable des dommages ou des pertes de confidentialité reliées à l’utilisation de vos données par %appName%. Veuillez appuyer sur Oui pour autoriser ou sur Non pour refuser.", - "line1": "Accorder permission(s)", - "line2": "demandée(s)" - }, - "it-it": { - "tts": "%appName% richiede l'uso delle seguenti informazioni e autorizzazioni sul veicolo: %functionalGroupLabels%. Se si preme Sì, si acconsente che %vehicleMake% non sarà responsabile per danni o perdita di privacy in relazione all'impiego dei dati da parte di %appName%. Premere Sì per consentire e No per negare.", - "line1": "Concedi autorizzaz.", - "line2": "richiesta(e)?" - }, - "nl-nl": { - "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. Als u op Ja drukt, gaat u ermee akkoord dat %vehicleMake% in geen geval aansprakelijk gesteld kan worden voor schade of verlies van privacy als gevolg van het feit dat %appName% gebruik maakt van uw gegevens. Druk op Ja om dit toe te staan of Nee om te weigeren.", - "line1": "Aangevraagde", - "line2": "permissie(s) verlenen?" - }, - "pl-pl": { - "tts": "%appName% wymaga następujących informacji o pojeździe oraz pozwoleń: %functionalGroupLabels%. Naciśnięcie TAK oznacza zgodę na fakt, iż %vehicleMake% nie będzie ponosić odpowiedzialności za szkody ani utratę prywatności w związku z wykorzystaniem przez %appName% danych, należących do użytkownika. Naciśnij TAK w celu udzielenia zgody lub NIE w celu odrzucenia żądania.", - "line1": "Udzielić żądanych", - "line2": "pozwoleń?" - }, - "pt-br": { - "tts": "%appName% está solicitando o uso das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se pressionar sim, você concorda que a %vehicleMake% não será responsável por danos ou perdas de privacidade relacionados ao uso dos seus dados por %appName%. Pressione sim para permitir ou não para negar.", - "line1": "Conceder permissão", - "line2": "solicitada?" - }, - "pt-pt": { - "tts": "%appName% está a solicitar a utilização das seguintes informações e permissões do veículo: %functionalGroupLabels%. Se premir “Sim”, concorda que %vehicleMake% não será responsável por quaisquer danos ou perda de privacidade relacionada com a utilização dos seus dados por parte de %appName%. Prima “Sim” para permitir ou “Não” para recusar.", - "line1": "Conceder permiss.", - "line2": "solicitada(s)?" - }, - "ru-ru": { - "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Нажатием \"\"да\"\", Вы соглашаетесь, что %vehicleMake% не будет нести ответственность за какие-либо убытки или потерю прайвеси, связанные с использованием Ваших данных компанией %appName%. Нажмите \"\"Да\"\", если Вы согласны, или \"\"Нет\"\" - если не согласны.", - "line1": "Предост. заправш.", - "line2": "разрешения?" - }, - "sv-se": { - "tts": "%appName% begär att få tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Om du trycker Ja godkänner du att %vehicleMake% ska hållas skadeslös för alla skador som kan uppstå eller eventuella integritetsintrång som uppstår när %appName% använder dina data. Tryck Ja för att godkänna eller Nej för att neka.", - "line1": "Vill du ge", - "line2": "tillstånd?" - }, - "tr-tr": { - "tts": "%appName%, şu araç bilgilerini ve izinleri kullanma isteğinde bulunuyor: %functionalGroupLabels%. Evet'e basarsanız, %appName%'in verilerinizi kullanması sonucunda oluşabilecek hasarlardan veya gizlilik kaybından %vehicleMake%'in sorumlu olmayacağını kabul etmiş olacaksınız. Lütfen kabul etmek için Evet'e veya reddetmek için Hayır'a basın.", - "line1": "İstenen izinler", - "line2": "verilsin mi?" - }, - "zh-cn": { - "tts": "%appName% 正在请求使用下列车辆信息和权限: %functionalGroupLabels%。如果您按“是”,则表示您同意。 %vehicleMake% 将不会对因 %appName% 使用您的数据而引起的任何损毁或隐私损失负责。 请按“是”允许或按“否”拒绝。", - "line1": "是否允许请求的", - "line2": "权限?" - }, - "zh-tw": { - "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。按「是」,表示您同意,如因 %appName% 使用您的資料導致任何損害或損失,%vehicleMake% 將不負賠償責任。同意請按「是」,拒絕請按「否」。", - "line1": "允許", - "line2": "授權請求?" - } - } - }, - "AppPermissionsHelp": { - "languages": { - "de-de": { - "tts": "%appName% fordert folgende Fahrzeuginformationen und Zugriffsberechtigungen: %functionalGroupLabels%. Im Einstellungsmenü der mobilen Apps können Sie diese Berechtigungen ändern und sich detaillierte Beschreibungen anhören. Mit Ja stimmen Sie zu; mit Nein lehnen Sie ab." - }, - "en-au": { - "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny." - }, - "en-gb": { - "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny." - }, - "en-ie": { - "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press Yes to grant permissions or No to deny." - }, - "en-us": { - "tts": "%appName% is requesting the following vehicle information and permissions: %functionalGroupLabels%. You can change these permissions and hear detailed descriptions in the mobile apps settings menu. Please press yes to grant permissions or no to deny." - }, - "es-en": { - "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar." - }, - "es-es": { - "tts": "%appName% está solicitando los siguientes permisos e información del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y escuchar descripciones detalladas en el menú de configuración de la aplicación móvil. Pulse sí para conceder el permiso o no para denegarlo." - }, - "es-mx": { - "tts": "%appName% solicita la siguiente información y permisos del vehículo: %functionalGroupLabels%. Puede cambiar estos permisos y consultar descripciones detalladas en el menú de configuración de las aplicaciones móviles. Presione Sí para otorgar permisos y No para denegar." - }, - "fr-ca": { - "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser." - }, - "fr-fr": { - "tts": "%appName% demande d’utiliser les informations du véhicule et les permissions suivantes : %functionalGroupLabels%. Vous pouvez modifier ces permissions et entendre les descriptions détaillées dans le menu des réglages des applications mobiles. Veuillez appuyer sur Oui pour accorder les permissions ou sur Non pour refuser." - }, - "it-it": { - "tts": "%appName% richiede le seguenti informazioni e autorizzazioni riguardo il veicolo: %functionalGroupLabels%. È possibile modificare tali autorizzazioni e ascoltare descrizioni dettagliate nel menu impostazioni delle app mobili. Premere Sì per concedere le autorizzazioni e No per negarle." - }, - "nl-nl": { - "tts": "%appName% vraagt gebruikmaking van de volgende voertuiginformatie en toestemmingen aan: %functionalGroupLabels%. U kunt deze toestemmingen wijzigen en gedetailleerde beschrijvingen beluisteren in het instellingenmenu voor mobiele apps. Druk op Ja om permissies te verlenen of op Nee om te weigeren." - }, - "pl-pl": { - "tts": "%appName% wymaga następujących informacji o pojeździe oraz zezwoleń: %functionalGroupLabels%. W menu ustawień aplikacji mobilnych można zmienić owe zezwolenia i usłyszeć ich szczegółowy opis. Naciśnij TAK, aby wyrazić zgodę lub NIE w celu odrzucenia żądania." - }, - "pt-br": { - "tts": "%appName% está solicitando as seguintes informações e permissões do veículo: %functionalGroupLabels%. Você pode alterar estas permissões e ouvir descrições detalhadas no menu de configurações de aplicativos móveis. Pressione sim para conceder as permissões ou não para negar." - }, - "pt-pt": { - "tts": "%appName% está a solicitar as seguintes informações e permissões do veículo: %functionalGroupLabels%. Pode alterar estas permissões e ouvir descrições detalhadas no menu de definições das aplicações móveis. Prima \"\"Sim\"\" para permitir ou \"\"Não\"\" para recusar." - }, - "ru-ru": { - "tts": "%appName% запрашивает следующую информацию об автомобиле и разрешения: %functionalGroupLabels%. Вы можете изменить эти разрешения и прослушать подробные их описания в меню настроек мобильного приложения. Нажмите \"\"да\"\", чтобы предоставить разрешения, или \"\"нет\"\", чтобы не предоставлять." - }, - "sv-se": { - "tts": "%appName% begär tillgång till följande fordonsinformation och tillstånd: %functionalGroupLabels%. Du kan ändra tillstånden och höra detaljerade beskrivningar i menyn för mobilappsinställningar. Tryck Ja för att ge tillstånd eller Nej för att neka." - }, - "tr-tr": { - "tts": "%appName%, şu araç bilgilerini ve izinleri istiyor: %functionalGroupLabels%. Bu izinleri değiştirebilir ve mobil uygulamalar ayarlar menüsünden ayrıntılı açıklamaları dinleyebilirsiniz. Lütfen izin vermek için Evet'e veya reddetmek için Hayır'a basın." - }, - "zh-cn": { - "tts": "%appName% 正在请求下列车辆信息和权限: %functionalGroupLabels%。您可在移动应用程序设置菜单中更改这些权限,并听取详细说明。请按“是”允许权限或按“否”拒绝。" - }, - "zh-tw": { - "tts": "%appName% 正請求使用 %functionalGroupLabels% 的車輛資訊和許可。您可在行動應用程式設定清單中更改這些許可,並聆聽詳細說明。給予許可請按「是」,拒絕請按「否」。" - } - } - }, - "AppPermissionsRevoked": { - "languages": { - "de-de": { - "tts": "Die Autorisierungsdaten der App wurden geändert. %appName% hat keinen Zugriff auf %functionalGroupLabels% mehr. Installieren Sie die neueste Version der App auf Ihrem Gerät.." - }, - "en-au": { - "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device." - }, - "en-gb": { - "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device." - }, - "en-ie": { - "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device." - }, - "en-us": { - "tts": "App authorizations have changed. %appName% can no longer access %functionalGroupLabels%. Please ensure you have the most recent app version installed on your mobile device." - }, - "es-en": { - "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil." - }, - "es-es": { - "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de que tiene la versión más reciente de la aplicación instalada en su dispositivo móvil." - }, - "es-mx": { - "tts": "Las autorizaciones de la aplicación han cambiado. %appName% ya no puede acceder a %functionalGroupLabels%. Asegúrese de haber instalado la versión más reciente de la aplicación en su dispositivo móvil." - }, - "fr-ca": { - "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile." - }, - "fr-fr": { - "tts": "Les autorisations pour app ont changé. %appName% ne peut plus accéder à %functionalGroupLabels%. Veuillez vous assurer que la plus récente version de l’application est installée sur votre appareil mobile." - }, - "it-it": { - "tts": "Le autorizzazioni dell'app sono cambiate. %appName% non è più in grado di accedere a %functionalGroupLabels%. Assicurarsi di avere la versione più recente dell'app installata sul dispositivo mobile." - }, - "nl-nl": { - "tts": "De app-autorisaties zijn gewijzigd. %appName% heeft geen toegang meer tot %functionalGroupLabels%. Zorg ervoor dat u de meest recente app-versie op uw mobiele apparaat geïnstalleerd hebt." - }, - "pl-pl": { - "tts": "Dane dostępu aplikacji zostały zmienione. %appName% nie ma już dostępu do %functionalGroupLabels%. Sprawdź, czy na telefonie komórkowym zainstalowano najnowszą wersję aplikacji." - }, - "pt-br": { - "tts": "As autorizações dos aplicativos foram alteradas. %appName% não pode mais acessar %functionalGroupLabels%. Certifique-se de que a versão mais recente do aplicativo está instalada no seu dispositivo móvel." - }, - "pt-pt": { - "tts": "As autorizações das aplicações mudaram. %appName% já não consegue aceder a %functionalGroupLabels%. Certifique-se de que tem a última versão da aplicação no seu dispositivo móvel." - }, - "ru-ru": { - "tts": "Авторизации приложения изменены. %appName% больше не имеет доступа к %functionalGroupLabels%. Убедитесь, что на вашем мобильном устройстве установлена самая новая версия приложения." - }, - "sv-se": { - "tts": "Appens behörigheter har ändrats. %appName% har inte längre åtkomst till %functionalGroupLabels%. Kontrollera att du har installerat den senaste versionen av appen på mobilenheten." - }, - "tr-tr": { - "tts": "Uygulama yetkileri değişti. %appName% artık %functionalGroupLabels%'e erişemeyecek. Lütfen mobil aygıtınızda en son uygulama sürümünün yüklü olduğundan emin olun." - }, - "zh-cn": { - "tts": "应用程序授权已变更。 %appName% 将不能再访问 %functionalGroupLabels%。 请确认您的移动设备上安装的应用程序是最新版本。" - }, - "zh-tw": { - "tts": "應用程式授權已改變。%appName% 已無法進入 %functionalGroupLabels%。請確認您的行動裝置上安裝了最新版應用程式。" - } - } - }, - "AppUnauthorized": { - "languages": { - "de-de": { - "tts": "Diese Version von %appName% ist nicht autorisiert und wird nicht mit SYNC funktionieren.", - "line1": "nicht autorisiert" - }, - "en-au": { - "tts": "This version of %appName% is not authorized and will not work with SYNC.", - "line1": "not authorized" - }, - "en-gb": { - "tts": "This version of %appName% is not authorized and will not work with SYNC.", - "line1": "not authorized", - "textBody": "This version of %appName% is not authorized and will not work with SYNC." - }, - "en-ie": { - "tts": "This version of %appName% is not authorized and will not work with SYNC.", - "line1": "not authorized" - }, - "en-us": { - "tts": "This version of %appName% is not authorized and will not work with SYNC.", - "line1": "Not Authorized", - "textBody": "This version of %appName% is no longer authorized to work with AppLink. Please update to the latest version of %appName%." - }, - "es-en": { - "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.", - "line1": "no autorizada", - "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC." - }, - "es-es": { - "tts": "Esta versión de %appName% no está autorizada y no funcionará con SYNC.", - "line1": "No autorizada" - }, - "es-mx": { - "tts": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC.", - "line1": "no autorizada", - "textBody": "Esta versión de %appName% no tiene autorización y no funcionará con SYNC." - }, - "fr-ca": { - "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.", - "line1": "non autorisée", - "textBody": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC." - }, - "fr-fr": { - "tts": "Cette version de %appName% n’est pas autorisée et ne fonctionnera pas avec SYNC.", - "line1": "non autorisée" - }, - "it-it": { - "tts": "Questa versione di %appName% non è autorizzata e non funziona con il SYNC.", - "line1": "non autorizzata" - }, - "nl-nl": { - "tts": "Deze versie van %appName% is niet geautoriseerd en werkt niet met SYNC.", - "line1": "niet geautoriseerd" - }, - "pl-pl": { - "tts": "Niniejsza wersja %appName% nie posiada autoryzacji i nie będzie działać z SYNC.", - "line1": "brak autoryzacji" - }, - "pt-br": { - "tts": "Esta versão do %appName% não tem autorização e não funcionará com o SYNC.", - "line1": "não autorizado" - }, - "pt-pt": { - "tts": "Esta versão de %appName% não está autorizada e não funcionará com o SYNC.", - "line1": "não autorizada" - }, - "ru-ru": { - "tts": "Эта версия %appName% не авторизирована и не будет работать с SYNC.", - "line1": "не авторизировано" - }, - "sv-se": { - "tts": "Den här versionen av %appName% är inte godkänd och fungerar inte med SYNC.", - "line1": "är ej godkänd" - }, - "tr-tr": { - "tts": "Bu %appName% sürümüne izin verilmediğinden SYNC ile çalışamaz.", - "line1": "için izin yok" - }, - "zh-cn": { - "tts": "此版本的%appName% 未得到授权,无法在SYNC上使用。", - "line1": "未得到授权" - }, - "zh-tw": { - "tts": "%appName% 的版本未獲得授權,將無法透過 SYNC 使用。", - "line1": "無授權" - } - } - }, - "AppUnsupported": { - "languages": { - "de-de": { - "tts": "Diese Version von %appName% wird von SYNC nicht unterstützt.", - "line1": "nicht unterstützt" - }, - "en-au": { - "tts": "This version of %appName% is not supported by SYNC.", - "line1": "not supported" - }, - "en-gb": { - "tts": "This version of %appName% is not supported by SYNC.", - "line1": "not supported", - "textBody": "This version of %appName% is not supported by SYNC." - }, - "en-ie": { - "tts": "This version of %appName% is not supported by SYNC.", - "line1": "not supported" - }, - "en-us": { - "tts": "This version of %appName% is not supported by SYNC.", - "line1": "Not Supported", - "textBody": "Your version of %appName% is not supported by SYNC." - }, - "es-en": { - "tts": "Esta versión de %appName% no es compatible con SYNC.", - "line1": "no compatible", - "textBody": "Esta versión de %appName% no es compatible con SYNC." - }, - "es-es": { - "tts": "Esta versión de %appName% no es compatible con SYNC.", - "line1": "No compatible" - }, - "es-mx": { - "tts": "Esta versión de %appName% no es compatible con SYNC.", - "line1": "no compatible", - "textBody": "Esta versión de %appName% no es compatible con SYNC." - }, - "fr-ca": { - "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.", - "line1": "incompatible", - "textBody": "Cette version de %appName% n’est pas prise en charge par SYNC." - }, - "fr-fr": { - "tts": "Cette version de %appName% n’est pas prise en charge par SYNC.", - "line1": "incompatible" - }, - "it-it": { - "tts": "Questa versione di %appName% non è supportata dal SYNC.", - "line1": "non supportata" - }, - "nl-nl": { - "tts": "Deze versie van %appName% wordt niet ondersteund door SYNC.", - "line1": "niet ondersteund" - }, - "pl-pl": { - "tts": "Niniejsza wersja %appName% nie jest obsługiwana przez system SYNC.", - "line1": "aplikacja nie obsług." - }, - "pt-br": { - "tts": "Esta versão do %appName% não é suportada pelo SYNC.", - "line1": "não suportado" - }, - "pt-pt": { - "tts": "Esta versão de %appName% não é suportado pelo SYNC.", - "line1": "não suportada" - }, - "ru-ru": { - "tts": "Эта версия %appName% не поддерживается SYNC.", - "line1": "не поддерживается" - }, - "sv-se": { - "tts": "SYNC har inte stöd för den här versionen av %appName%.", - "line1": "stöds ej" - }, - "tr-tr": { - "tts": "Bu %appName% sürümü SYNC tarafından desteklenmiyor.", - "line1": "desteklenmiyor" - }, - "zh-cn": { - "tts": "SYNC不支持此版本的%appName%。", - "line1": "不受支持" - }, - "zh-tw": { - "tts": "SYNC 不支援此版本的%appName% 。", - "line1": "不支援" - } - } - }, - "DataConsent": { - "languages": { - "en-gb": { - "textBody": "Would you like to enable Mobile Apps on SYNC? To use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S. \r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information." - }, - "en-us": { - "line1": "Enable Mobile Apps", - "line2": "on SYNC? (Uses Data)", - "textBody": "Would you like to enable Mobile Apps on SYNC?\r\n\r\nTo use Mobile Apps with SYNC, SYNC will communicate with Ford at least once per month using your mobile device’s data plan. Standard rates may apply. SYNC will send your VIN and SYNC module number to Ford U.S.\r\n\r\nUpdates are about the size of an email, and the occurrence of updates depends on your vehicle usage and when a new app is found on your device. To turn on or off, visit the SYNC Settings menu. See your Owner Guide for more information." - }, - "es-mx": { - "textBody": "Para usar aplicaciones móviles con SYNC, este debe comunicarse con Ford al menos una vez al mes a través del plan de datos de su dispositivo móvil. Pueden aplicar tarifas normales. SYNC enviará su VIN y el número de módulo de SYNC a Ford de Estados Unidos de América. \n\nLas actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario. \n\nPresione Sí para permitir y No para denegar." - }, - "fr-ca": { - "textBody": "Pour utiliser AppLink, SYNC devra communiquer avec Ford au moins une fois par mois en utilisant le forfait de données de votre appareil mobile. Les tarifs réguliers peuvent s’appliquer. SYNC enverra votre NIV et le numéro de votre module SYNC à Ford États-Unis. Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements.\r\n\r\nVeuillez appuyer sur Oui pour autoriser ou sur Non pour refuser." - } - } - }, - "DataConsentHelp": { - "languages": { - "en-us": { - "textBody": "By enabling mobile apps, you consent to allowing SYNC to communicate with Ford at least once per month using your mobile device’s data plan. Disabling will stop all data usage, but you will not be able to use mobile apps on SYNC. See your Owner Guide for more information." - }, - "es-mx": { - "textBody": "Las actualizaciones tienen el tamaño aproximado de un mensaje de correo electrónico, y la frecuencia de las actualizaciones depende del uso de su vehículo y de si se encuentran nuevas aplicaciones en su dispositivo. Para obtener más información, consulte la Guía del propietario." - }, - "fr-ca": { - "textBody": "Les mises à jour ont la taille d’un courriel et la fréquence des mises à jour dépend de l’utilisation de votre véhicule et si une nouvelle application se trouve sur votre appareil. Consultez le Guide de l’utilisateur pour obtenir d’autres renseignements." - } - } - }, - "DisableApps": { - "languages": { - "de-de": { - "tts": "Ausschalten der automatischen Updates führt zum Ausschalten von SYNC mobile Apps. Sie können Ihre mobilen Apps dann nicht mehr mit SYNC nutzen. Bitte drücken Sie Ja zur Bestätigung oder Nein, um abzubrechen.", - "line1": "Auto-Update", - "line2": "und Mobile Apps deaktivieren" - }, - "en-au": { - "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.", - "line1": "Disable auto-updates", - "line2": "and Mobile Apps?" - }, - "en-gb": { - "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.", - "line1": "Disable auto-updates", - "line2": "and Mobile Apps?", - "textBody": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel." - }, - "en-ie": { - "tts": "Disabling automatic updates will also disable SYNC mobile apps. You will not be able to use any mobile apps with SYNC. Please press Yes to confirm or No to cancel.", - "line1": "Disable auto-updates", - "line2": "and Mobile Apps?" - }, - "en-us": { - "tts": "Disabling automatic updates will also disable sync mobile apps. You will not be able to use any mobile apps with SYNC. Please press yes to confirm or no to cancel.", - "line1": "Disable Auto-Updates", - "line2": "and Mobile Apps?", - "textBody": "If you disable, you will not be able to use any mobile apps with SYNC and your vehicle will stop receiving mobile app permission updates via your device`s data plan. Please press yes to disable mobile apps or no to cancel." - }, - "es-en": { - "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.", - "line1": "¿Deshab. actualiz.", - "line2": "autom. y aplic. móv.?", - "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar." - }, - "es-es": { - "tts": "Si desactiva las actualizaciones automáticas, también se desactivará la sincronización de las aplicaciones móviles. No podrá utilizar ninguna aplicación móvil con SYNC. Pulse sí para confirmar o no para cancelar.", - "line1": "¿Desact. actual. auto", - "line2": "y apl. móviles?" - }, - "es-mx": { - "tts": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar.", - "line1": "¿Deshab. actualiz.", - "line2": "autom. y aplic. móv.?", - "textBody": "Si se desactivan las actualizaciones automáticas, también se desactivarán las aplicaciones móviles de SYNC. No podrá usar ninguna aplicación móvil con SYNC. Presione Sí para confirmar o No para cancelar." - }, - "fr-ca": { - "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.", - "line1": "Désactiver màj autom.", - "line2": "et app. mobiles?", - "textBody": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler." - }, - "fr-fr": { - "tts": "La désactivation des mises à jour automatiques désactivera aussi les applications mobiles SYNC. Vous ne pourrez pas utiliser d’application mobile avec SYNC. Veuillez appuyer sur Oui pour confirmer ou sur Non pour annuler.", - "line1": "Désactiver màj autom.", - "line2": "et app. mobiles?" - }, - "it-it": { - "tts": "Disabilitando gli aggiornamenti automatici si disattiva anche la sincronizzazione delle app mobili. Non sarà possibile usare app mobili con il SYNC. Premere Sì per confermare e No per cancellare.", - "line1": "Disabilitare agg. aut.", - "line2": "e app mobili?" - }, - "nl-nl": { - "tts": "Door automatische updates uit te schakelen, schakelt u ook SYNC-mobiele apps uit. U kunt dan geen mobiele apps meer gebruiken met SYNC. Druk op Ja om te bevestigen of op Nee om te annuleren.", - "line1": "Auto-updates en mob.", - "line2": "apps uitschakelen?" - }, - "pl-pl": { - "tts": "Wyłączenie automatycznych aktualizacji spowoduje także wyłączenie aplikacji mobilnych SYNC. Korzystanie z mobilnych aplikacji za pomocą SYNC będzie niemożliwe. Naciśnij TAK, by potwierdzić lub NIE, by anulować.", - "line1": "Wył. automat. aktual.", - "line2": "i aplikacje mobilne?" - }, - "pt-br": { - "tts": "Se as atualizações automáticas forem desativadas, os aplicativos também serão desativados. Você não poderá usar nenhum aplicativo com o SYNC. Pressione sim para confirmar ou não para cancelar.", - "line1": "Desativar atualizações", - "line2": "autom. e aplicativos?" - }, - "pt-pt": { - "tts": "A desactivação das actualizações automáticas desactiva igualmente as aplicações móveis do SYNC. Não poderá utilizar quaisquer aplicações móveis com o SYNC. Prima \"\"Sim\"\" para confirmar ou \"\"Não\"\" para cancelar.", - "line1": "Desact. actual. autom.", - "line2": "e aplicações móveis?" - }, - "ru-ru": { - "tts": "При отключении автоматических обновлений также будут отключены мобильные приложения sync. Вы не сможете использовать какие-либо мобильные приложения с SYNC. Нажмите \"\"Да\"\" для подтверждения или \"\"Нет\"\" для отмены.", - "line1": "Откл. автообновления", - "line2": "и мобил. прилож.?" - }, - "sv-se": { - "tts": "Om du avaktiverar automatisk uppdatering avaktiverar du även synkning av mobilappar. Du kommer inte längre att kunna använda dina mobilappar med SYNC. Tryck Ja för att bekräfta eller Nej för att avbryta.", - "line1": "Avaktiverar autouppdat.", - "line2": "och mobilappar?" - }, - "tr-tr": { - "tts": "Otomatik güncellemeleri devre dışı bırakırsanız sync mobil uygulamalar da devre dışı kalır. SYNC ile mobil uygulama kullanmanız mümkün olmaz. Lütfen onaylamak için Evet'e veya iptal etmek için Hayır'a basın.", - "line1": "Oto. güncelleme ve", - "line2": "mobil uygul. kapat?" - }, - "zh-cn": { - "tts": "禁用自动更新同时也会禁用SYNC移动应用程序。您将无法在 SYNC 中使用任何移动应用程序。请按“是”确认或按“否”取消。", - "line1": "是否禁用自动更新和", - "line2": "移动应用程序?" - }, - "zh-tw": { - "tts": "停用自動更新也將停用 sync 行動應用程式。您將無法透過 SYNC 使用任何行動應用程式。確認請按「是」,取消請按「否」。", - "line1": "停用自動更新", - "line2": "和行動應用程式?" - } - } - }, - "DrivingCharacteristics": { - "languages": { - "de-de": { - "tts": "Eine App hat Zugriff auf die folgenden Fahreigenschaften: Kraftstoffverbrauch, MyKey, Sicherheitsgurtstatus.", - "label": "Fahreigenschaften" - }, - "en-au": { - "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.", - "label": "Driving characteristics" - }, - "en-gb": { - "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.", - "label": "Driving characteristics", - "textBody": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status." - }, - "en-ie": { - "tts": "An app can access the following driving characteristics: Fuel consumption, MyKey, Seat belt status.", - "label": "Driving characteristics" - }, - "en-us": { - "tts": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status.", - "label": "Driving Characteristics", - "textBody": "An app can access the following driving characteristics: Fuel Consumption, MyKey, Seat Belt Status." - }, - "es-en": { - "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.", - "label": "Características del manejo", - "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad." - }, - "es-es": { - "tts": "Una aplicación puede acceder a las siguientes características de conducción: Consumo de combustible, MyKey, Estado cinturones de seguridad.", - "label": "Características de conducción" - }, - "es-mx": { - "tts": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad.", - "label": "Características del manejo", - "textBody": "Las aplicaciones pueden acceder a las siguientes características del manejo: Consumo de combustible, MyKey, Estado del cinturón de seguridad." - }, - "fr-ca": { - "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.", - "label": "Caractéristiques de conduite", - "textBody": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité." - }, - "fr-fr": { - "tts": "Une application peut accéder aux caractéristiques de conduite suivantes: Consommation de carburant, MyKey, État des ceintures de sécurité.", - "label": "Caractéristiques de conduite" - }, - "it-it": { - "tts": "Un'app può avere accesso alle seguenti caratteristiche di guida: Consumo carburante, MyKey, Stato cinture di sicurezza.", - "label": "Caratteristiche di guida" - }, - "nl-nl": { - "tts": "Een app heeft toegang tot de volgende rijkenmerken: Brandstofverbruik, MyKey, Veiligheidsgordelstatus.", - "label": "Rijkenmerken" - }, - "pl-pl": { - "tts": "Aplikacja może uzyskać dostęp do następujących informacji dotyczących jazdy: Zużycie paliwa, MyKey, Stan pasów bezpieczeństwa.", - "label": "Informacje dotyczące stylu jazdy" - }, - "pt-br": { - "tts": "Um aplicativo pode acessar as seguintes características de condução: Consumo de combustível, MyKey, Estado do cinto de segurança.", - "label": "Características de condução" - }, - "pt-pt": { - "tts": "Uma aplicação consegue aceder às seguintes informações de condução: Consumo de combustível, MyKey, Estado dos cintos de segurança.", - "label": "Características de condução" - }, - "ru-ru": { - "tts": "Приложение имеет доступ к следующим характеристикам движения: Расход топлива, MyKey, Состояние ремней безопасности.", - "label": "Характеристики движения" - }, - "sv-se": { - "tts": "Appen kan komma åt följande köregenskaper: Bränsleförbrukning, MyKey, Bältesstatus.", - "label": "Köregenskaper" - }, - "tr-tr": { - "tts": "Bir uygulama şu sürüş karakteristiklerine erişebilir: Yakıt tüketimi, MyKey, Emniyet kemeri durumu.", - "label": "Sürüş karakteristikleri" - }, - "zh-cn": { - "tts": "移动应用程序可访问下列行驶特性: 油耗, MyKey, 安全带状态", - "label": "行驶特性" - }, - "zh-tw": { - "tts": "應用程式可存取以下駕駛特性: 油耗, MyKey, 安全帶狀態", - "label": "駕駛特性" - } - } - }, - "Location": { - "languages": { - "de-de": { - "tts": "Eine App hat Zugriff auf die GPS-Daten und die Geschwindigkeit des Fahrzeugs.", - "label": "GPS und Geschwindigkeit" - }, - "en-au": { - "tts": "An app can access vehicle GPS and speed.", - "label": "GPS and speed" - }, - "en-gb": { - "tts": "An app can access vehicle GPS and speed.", - "label": "GPS and speed", - "textBody": "An app can access vehicle GPS and speed." - }, - "en-ie": { - "tts": "An app can access vehicle GPS and speed.", - "label": "GPS and speed" - }, - "en-us": { - "tts": "An app can access vehicle GPS and speed.", - "label": "GPS and speed", - "textBody": "An app can access vehicle GPS and speed." - }, - "es-en": { - "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.", - "label": "GPS y velocidad", - "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo." - }, - "es-es": { - "tts": "Una aplicación puede acceder al GPS y la velocidad del vehículo.", - "label": "GPS y velocidad" - }, - "es-mx": { - "tts": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo.", - "label": "GPS y velocidad", - "textBody": "Las aplicaciones pueden acceder al GPS y a la velocidad del vehículo." - }, - "fr-ca": { - "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.", - "label": "GPS et vitesse", - "textBody": "Une application peut accéder au GPS et à la vitesse du véhicule." - }, - "fr-fr": { - "tts": "Une application peut accéder au GPS et à la vitesse du véhicule.", - "label": "GPS et vitesse" - }, - "it-it": { - "tts": "Un'app può avere accesso a GPS e velocità del veicolo.", - "label": "GPS e velocità" - }, - "nl-nl": { - "tts": "Een app heeft toegang tot gps en de snelheid van het voertuig.", - "label": "Gps en snelheid" - }, - "pl-pl": { - "tts": "Aplikacja może uzyskać dostęp do modułu GPS i prędkości pojazdu.", - "label": "GPS i prędkość" - }, - "pt-br": { - "tts": "Um aplicativo pode acessar o GPS e a velocidade do veículo.", - "label": "GPS e velocidade" - }, - "pt-pt": { - "tts": "Uma aplicação consegue aceder ao GPS e à velocidade do veículo.", - "label": "GPS e velocidade" - }, - "ru-ru": { - "tts": "Приложение имеет доступ к GPS и скорости автомобиля.", - "label": "GPS и скорость" - }, - "sv-se": { - "tts": "Appen kan komma åt fordonets GPS och hastighetsmätare.", - "label": "GPS och hastighet" - }, - "tr-tr": { - "tts": "Bu uygulama aracın GPS ve hız bilgilerine erişebilir.", - "label": "GPS ve hız" - }, - "zh-cn": { - "tts": "移动应用程序可以访问车辆 GPS 和车速信息。", - "label": "GPS 和车速" - }, - "zh-tw": { - "tts": "應用程式可存取車輛的GPS和速度。", - "label": "GPS和車速" - } - } - }, - "Notifications": { - "languages": { - "de-de": { - "tts": "Läuft die App im Hintergrund, kann Sie Benachrichtigungen senden.", - "label": "Push-Benachrichtigungen" - }, - "en-au": { - "tts": "An app can send notifications when running in the background.", - "label": "Push notifications" - }, - "en-gb": { - "tts": "An app can send notifications when running in the background.", - "label": "Push notifications", - "textBody": "An app can send notifications when running in the background." - }, - "en-ie": { - "tts": "An app can send notifications when running in the background.", - "label": "Push notifications" - }, - "en-us": { - "tts": "An app can send notifications when running in the background.", - "label": "Push notifications", - "textBody": "An app can send notifications when running in the background." - }, - "es-en": { - "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.", - "label": "Notificaciones tipo Push", - "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano." - }, - "es-es": { - "tts": "Una aplicación puede enviar notificaciones cuando se está ejecutando en segundo plano.", - "label": "Notificaciones push" - }, - "es-mx": { - "tts": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano.", - "label": "Notificaciones tipo Push", - "textBody": "Las aplicaciones pueden enviar notificaciones cuando se ejecutan en segundo plano." - }, - "fr-ca": { - "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.", - "label": "Notifications instantanées", - "textBody": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan." - }, - "fr-fr": { - "tts": "Une application peut envoyer des avis lorsqu’elle fonctionne en arrière-plan.", - "label": "Notifications push" - }, - "it-it": { - "tts": "Un'app può inviare notifiche se eseguita in background.", - "label": "Notifiche push" - }, - "nl-nl": { - "tts": "Een app kan meldingen versturen als deze op de achtergrond actief is.", - "label": "Push-meldingen" - }, - "pl-pl": { - "tts": "Aplikacja może wysyłać powiadomienia, działając w tle.", - "label": "Powiadomienia Push" - }, - "pt-br": { - "tts": "Um aplicativo pode enviar notificações quando estiver sendo executado em segundo plano.", - "label": "Notificações Push" - }, - "pt-pt": { - "tts": "Uma aplicação consegue enviar notificações quando está activa em segundo plano.", - "label": "Notificações push" - }, - "ru-ru": { - "tts": "Если приложение работает в фоновом режиме, оно может отправлять оповещения.", - "label": "Оповещения о пересылке" - }, - "sv-se": { - "tts": "Appen kan skicka meddelanden när den körs i bakgrunden.", - "label": "Push-notiser" - }, - "tr-tr": { - "tts": "Bir uygulama arka planda çalışırken bildirim gönderebilir.", - "label": "Anlık bildirimleri" - }, - "zh-cn": { - "tts": "移动应用程序在后台运行时可推送通知。", - "label": "推送通知" - }, - "zh-tw": { - "tts": "車輛行進時,應用程式可在背景中傳送通知。", - "label": "傳送通知" - } - } - }, - "SettingDisableUpdates": { - "languages": { - "de-de": { - "line1": "Updates deakt." - }, - "en-au": { - "line1": "Disable updates" - }, - "en-gb": { - "line1": "Disable updates" - }, - "en-ie": { - "line1": "Disable updates" - }, - "en-us": { - "line1": "Disable Updates", - "textBody": "Disable Updates" - }, - "es-en": { - "line1": "Deshab. actual.", - "textBody": "Deshab. actual." - }, - "es-es": { - "line1": "Desact. actual." - }, - "es-mx": { - "line1": "Deshab. actual.", - "textBody": "Deshab. actual." - }, - "fr-ca": { - "line1": "Désactiver MAJ", - "textBody": "Désactiver MAJ" - }, - "fr-fr": { - "line1": "Désactiver màj" - }, - "it-it": { - "line1": "Disabilita agg." - }, - "nl-nl": { - "line1": "Upd. uitschak." - }, - "pl-pl": { - "line1": "Wyłącz aktual." - }, - "pt-br": { - "line1": "Desat. atualiz." - }, - "pt-pt": { - "line1": "Desact. actualiz." - }, - "ru-ru": { - "line1": "Откл. обновл." - }, - "sv-se": { - "line1": "Inaktivera uppd." - }, - "tr-tr": { - "line1": "Güncell. Kapat" - }, - "zh-cn": { - "line1": "禁用更新" - }, - "zh-tw": { - "line1": "停用更新" - } - } - }, - "SettingEnableUpdates": { - "languages": { - "de-de": { - "line1": "Apps aktivieren" - }, - "en-au": { - "line1": "Enable Apps" - }, - "en-gb": { - "line1": "Enable Apps" - }, - "en-ie": { - "line1": "Enable Apps" - }, - "en-us": { - "line1": "Enable Apps" - }, - "es-en": { - "line1": "Hab. aplic." - }, - "es-es": { - "line1": "Activar apl." - }, - "es-mx": { - "line1": "Hab. aplic." - }, - "fr-ca": { - "line1": "Activer app.", - "textBody": "Activer app." - }, - "fr-fr": { - "line1": "Activer app." - }, - "it-it": { - "line1": "Abilita app" - }, - "nl-nl": { - "line1": "Apps inschak." - }, - "pl-pl": { - "line1": "Włącz aplikacje" - }, - "pt-br": { - "line1": "Ativar aplic." - }, - "pt-pt": { - "line1": "Activar actualiz." - }, - "ru-ru": { - "line1": "Вкл. прилож." - }, - "sv-se": { - "line1": "Aktivera appar" - }, - "tr-tr": { - "line1": "Uygulamaları aç" - }, - "zh-cn": { - "line1": "启用应用程序" - }, - "zh-tw": { - "line1": "啟用應用程式" - } - } - }, - "SettingUpdateAuto": { - "languages": { - "de-de": { - "line1": "Update anford." - }, - "en-au": { - "line1": "Request update" - }, - "en-gb": { - "line1": "Request update" - }, - "en-ie": { - "line1": "Request update" - }, - "en-us": { - "line1": "Request Update", - "textBody": "Select `Update now` to receive app permissions for your SYNC-enabled mobile apps. This may enable additional functionality depending on the app and your settings. If your phone has a working data connection, an update should complete in less than 1 minute." - }, - "es-en": { - "line1": "Solicit. actualiz.", - "textBody": "Solicit. actualiz." - }, - "es-es": { - "line1": "Solicitar actual." - }, - "es-mx": { - "line1": "Solicit. actualiz.", - "textBody": "Solicit. actualiz." - }, - "fr-ca": { - "line1": "Demander MAJ", - "textBody": "Demander MAJ" - }, - "fr-fr": { - "line1": "Demander màj" - }, - "it-it": { - "line1": "Rich. aggiorn." - }, - "nl-nl": { - "line1": "Upd. aanvragen" - }, - "pl-pl": { - "line1": "Zażądaj aktual." - }, - "pt-br": { - "line1": "Solicitar atualiz." - }, - "pt-pt": { - "line1": "Solicit. actualiz." - }, - "ru-ru": { - "line1": "Запрос на обн." - }, - "sv-se": { - "line1": "Begär uppdat." - }, - "tr-tr": { - "line1": "Güncelleme iste" - }, - "zh-cn": { - "line1": "请求更新" - }, - "zh-tw": { - "line1": "請求更新" - } - } - }, - "StatusNeeded": { - "languages": { - "de-de": { - "line1": "Update benötigt" - }, - "en-au": { - "line1": "Update needed" - }, - "en-gb": { - "line1": "Update needed", - "textBody": "Update needed" - }, - "en-ie": { - "line1": "Update needed" - }, - "en-us": { - "line1": "Update Needed", - "textBody": "Update Needed" - }, - "es-en": { - "line1": "Actualiz. neces.", - "textBody": "Actualiz. neces." - }, - "es-es": { - "line1": "Actu. necesaria" - }, - "es-mx": { - "line1": "Actualiz. neces.", - "textBody": "Actualiz. neces." - }, - "fr-ca": { - "line1": "Màj requise", - "textBody": "Màj requise" - }, - "fr-fr": { - "line1": "Mise à jour requise" - }, - "it-it": { - "line1": "Necess. aggiorn." - }, - "nl-nl": { - "line1": "Update nodig" - }, - "pl-pl": { - "line1": "Potrzeba aktual." - }, - "pt-br": { - "line1": "Atualiz. necess." - }, - "pt-pt": { - "line1": "Actual. necess." - }, - "ru-ru": { - "line1": "Необх. обновл." - }, - "sv-se": { - "line1": "Uppdat. krävs" - }, - "tr-tr": { - "line1": "Güncellenmeli" - }, - "zh-cn": { - "line1": "需要进行更新" - }, - "zh-tw": { - "line1": "需更新" - } - } - }, - "StatusPending": { - "languages": { - "de-de": { - "line1": "Aktualisieren..." - }, - "en-au": { - "line1": "Updating..." - }, - "en-gb": { - "line1": "Updating...", - "textBody": "Updating..." - }, - "en-ie": { - "line1": "Updating..." - }, - "en-us": { - "line1": "Updating...", - "textBody": "Updating..." - }, - "es-en": { - "line1": "Actualizando...", - "textBody": "Actualizando..." - }, - "es-es": { - "line1": "Actualizando..." - }, - "es-mx": { - "line1": "Actualizando...", - "textBody": "Actualizando..." - }, - "fr-ca": { - "line1": "MAJ en cours...", - "textBody": "MAJ en cours..." - }, - "fr-fr": { - "line1": "Màj en cours..." - }, - "it-it": { - "line1": "Aggiornamento" - }, - "nl-nl": { - "line1": "Updaten..." - }, - "pl-pl": { - "line1": "Aktualizowanie" - }, - "pt-br": { - "line1": "Atualizando..." - }, - "pt-pt": { - "line1": "A actualizar..." - }, - "ru-ru": { - "line1": "Обновление..." - }, - "sv-se": { - "line1": "Uppdaterar..." - }, - "tr-tr": { - "line1": "Güncelleniyor..." - }, - "zh-cn": { - "line1": "正在更新......" - }, - "zh-tw": { - "line1": "更新中..." - } - } - }, - "StatusUpToDate": { - "languages": { - "de-de": { - "line1": "Aktuelle Version" - }, - "en-au": { - "line1": "Up-to-date" - }, - "en-gb": { - "line1": "Up-to-date", - "textBody": "Up-to-date" - }, - "en-ie": { - "line1": "Up-to-date" - }, - "en-us": { - "line1": "Up-To-Date", - "textBody": "Up-To-Date" - }, - "es-en": { - "line1": "Actualizado", - "textBody": "Actualizado" - }, - "es-es": { - "line1": "Actualizada" - }, - "es-mx": { - "line1": "Actualizado", - "textBody": "Actualizado" - }, - "fr-ca": { - "line1": "Déjà à jour", - "textBody": "Déjà à jour" - }, - "fr-fr": { - "line1": "Déjà à jour" - }, - "it-it": { - "line1": "più recente" - }, - "nl-nl": { - "line1": "Up-to-date" - }, - "pl-pl": { - "line1": "Aktualne" - }, - "pt-br": { - "line1": "Atualizado" - }, - "pt-pt": { - "line1": "Actualizado" - }, - "ru-ru": { - "line1": "Обновлено" - }, - "sv-se": { - "line1": "Uppdat. krävs ej" - }, - "tr-tr": { - "line1": "Güncel" - }, - "zh-cn": { - "line1": "最新更新" - }, - "zh-tw": { - "line1": "更新最新" - } - } - }, - "VehicleInfo": { - "languages": { - "de-de": { - "tts": "Eine App hat Zugriff auf die folgenden Fahrzeuginformationen: Kraftstoff-Füllstand, Kraftstoffverbrauch, Motordrehzahl, Kilometerzähler, FIN, Außentemperatur, Gangstellung, Reifenluftdruck.", - "label": "Fahrzeuginformationen" - }, - "en-au": { - "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.", - "label": "Vehicle information" - }, - "en-gb": { - "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure.", - "label": "Vehicle information", - "textBody": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tire pressure." - }, - "en-ie": { - "tts": "An app can access the following vehicle information: Fuel level, Fuel economy, Engine RPMs, Odometer, VIN, Outside air temperature, Gear position, Tyre pressure.", - "label": "Vehicle information" - }, - "en-us": { - "tts": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure.", - "label": "Vehicle information", - "textBody": "An app can access the following vehicle information: Fuel Level, Fuel Economy, Engine RPMs, Odometer, VIN, External Temperature, Gear Position, Tire Pressure." - }, - "es-en": { - "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.", - "label": "Información del vehículo", - "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos." - }, - "es-es": { - "tts": "Una aplicación puede acceder a la siguiente información del vehículo: Nivel de combustible, Ahorro de combustible, RPM del motor, Cuentakilómetros, VIN, Temperatura aire exterior, Marcha engranada, Presión de neumáticos.", - "label": "Información del vehículo" - }, - "es-mx": { - "tts": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos.", - "label": "Información del vehículo", - "textBody": "Las aplicaciones pueden acceder a la siguiente información del vehículo: Nivel de combustible, Economía de combustible, RPM del motor, Cuentakilómetros, Número de identificación del vehículo, Temperatura externa, Posición del cambio, Presión de los neumáticos." - }, - "fr-ca": { - "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus.", - "label": "Renseignements du véhicule", - "textBody": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Au régime du moteur, Odomètre, NIV, Température extérieure, Position d’embrayage, Pression des pneus." - }, - "fr-fr": { - "tts": "Une application peut accéder aux informations suivantes du véhicule: Niveau de carburant, Économie de carburant, Vitesse de moteur, Compteur kilométrique, NIV, Température extérieure, Position de vitesse, Pression des pneus.", - "label": "Renseignements du véhicule" - }, - "it-it": { - "tts": "Un'app può avere accesso alle seguenti informazioni del veicolo: Livello carburante, Consumi carburante, Numero giri motore, Contachilometri, VIN, Temperatura esterna, Posizione marcia, Pressione pneumatici.", - "label": "Informazioni sul veicolo" - }, - "nl-nl": { - "tts": "Een app heeft toegang tot de volgende voertuiginformatie: Brandstofpeil, Brandstofverbruik, Motortoerental, Kilometerteller, VIN, Buitentemperatuur, Versnellingsstand, Bandenspanning.", - "label": "Voertuiginformatie" - }, - "pl-pl": { - "tts": "Aplikacja może uzyskać dostęp do następujących informacji o pojeździe: Poziom paliwa, Zużycie paliwa, Obroty silnika, Licznik przebiegu, Numer VIN, Temperatura zewnętrzna, Aktualny bieg, Ciśnienie opon.", - "label": "Informacje o pojeździe" - }, - "pt-br": { - "tts": "Um aplicativo pode acessar as seguintes informações sobre o veículo: Nível de combustível, Economia de combustível, RPM do motor, Hodômetro, VIN, Temperatura externa, Posição das marchas, Pressão dos pneus.", - "label": "Informações sobre o veículo" - }, - "pt-pt": { - "tts": "Uma aplicação consegue aceder às seguintes informações do veículo: Nível de combustível, Poupança de combustível, RPM do motor, Conta-quilómetros, VIN, Temperatura exterior, Posição da mudança de velocidade, Pressão dos pneus.", - "label": "Informações do veículo" - }, - "ru-ru": { - "tts": "Приложение имеет доступ к следующим данным автомобиля: Уровень топлива, Економия топлива, Число оборотов двигателя, Одометр, Номер VIN, Температура за бортом, Положение передачи, Давление шин.", - "label": "Информация об автомобиле" - }, - "sv-se": { - "tts": "Appen kan komma åt följande fordonsinformation: Bränslenivå, Bränsleekonomi, Motorns varvtal, Vägmätare, VIN, Utetemperatur, Växelläge, Däcktryck.", - "label": "Fordonsinformation" - }, - "tr-tr": { - "tts": "Bir uygulama şu araç bilgilerine erişebilir: Yakıt seviyesi, Yakıt ekonomisi, Motor devirleri, Kilometre sayacı, VIN, Dış sıcaklık, Vites konumu, Lastik basıncı.", - "label": "Araç bilgisi" - }, - "zh-cn": { - "tts": "移动应用程序可访问下列车辆信息 : 燃油量, 燃油经济性, 发动机转速(RPM), 里程表, VIN, 车外温度, 档位, 胎压.", - "label": "车辆信息" - }, - "zh-tw": { - "tts": "一個應用程式可存取以下車輛資訊 : 燃油存量, 燃油經濟性, 引擎轉速, 里程表, 車輛識別號碼, 車外溫度, 檔位, 胎壓.", - "label": "車輛資訊" - } - } - } - } - }, - "app_policies": { - "default": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi": "NONE", - "moduleType": ["RADIO", "CLIMATE"], - "groups": ["Base-4", "RemoteControl"] - }, - "device": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi": "NONE", - "groups": ["DataConsent-2"] - }, - "pre_DataConsent": { - "keep_context": false, - "steal_focus": false, - "priority": "NONE", - "default_hmi": "NONE", - "groups": ["BaseBeforeDataConsent"] - } - } - } -} -- cgit v1.2.1 From f32003ae77d3bdcea698ec9b8048b0870e96cdf4 Mon Sep 17 00:00:00 2001 From: Masato Ogawa Date: Thu, 24 Aug 2017 17:26:48 +0900 Subject: Updated license headers --- src/components/application_manager/CMakeLists.txt | 3 +++ .../include/application_manager/smart_object_keys.h | 3 +++ src/components/application_manager/src/hmi_command_factory.cc | 3 +++ src/components/application_manager/src/hmi_interfaces_impl.cc | 3 +++ src/components/application_manager/src/mobile_command_factory.cc | 3 +++ .../test/commands/hmi/simple_requests_to_hmi_test.cc | 3 +++ .../test/commands/hmi/simple_response_from_hmi_test.cc | 3 +++ .../test/commands/hmi/ui_get_capabilities_response_test.cc | 3 +++ src/components/application_manager/test/hmi_capabilities_test.cc | 3 +++ 9 files changed, 27 insertions(+) diff --git a/src/components/application_manager/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt index 3c9d921fb4..ddbc7d1be6 100644 --- a/src/components/application_manager/CMakeLists.txt +++ b/src/components/application_manager/CMakeLists.txt @@ -1,6 +1,9 @@ # Copyright (c) 2016, Ford Motor Company # All rights reserved. # +# Copyright (c) 2017 Xevo Inc. +# All rights reserved. +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 24ba1bd1ba..9294d7e1f0 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -2,6 +2,9 @@ Copyright (c) 2013, Ford Motor Company All rights reserved. + Copyright (c) 2017 Xevo Inc. + All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc index 46dd8dcea1..aa10ca4949 100644 --- a/src/components/application_manager/src/hmi_command_factory.cc +++ b/src/components/application_manager/src/hmi_command_factory.cc @@ -2,6 +2,9 @@ Copyright (c) 2013, Ford Motor Company All rights reserved. + Copyright (c) 2017 Xevo Inc. + All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc index d9410e9bd5..109ef143f3 100644 --- a/src/components/application_manager/src/hmi_interfaces_impl.cc +++ b/src/components/application_manager/src/hmi_interfaces_impl.cc @@ -2,6 +2,9 @@ * Copyright (c) 2016, Ford Motor Company * All rights reserved. * + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc index 413fc7a9f1..daa46ca533 100644 --- a/src/components/application_manager/src/mobile_command_factory.cc +++ b/src/components/application_manager/src/mobile_command_factory.cc @@ -2,6 +2,9 @@ Copyright (c) 2013, Ford Motor Company All rights reserved. + Copyright (c) 2017 Xevo Inc. + All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc index 25681263ab..c97430023f 100644 --- a/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc +++ b/src/components/application_manager/test/commands/hmi/simple_requests_to_hmi_test.cc @@ -2,6 +2,9 @@ * Copyright (c) 2016, Ford Motor Company * All rights reserved. * + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * diff --git a/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc index 9f4cf23b0c..e27655c035 100644 --- a/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc +++ b/src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc @@ -2,6 +2,9 @@ * Copyright (c) 2016, Ford Motor Company * All rights reserved. * + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index 0a1e5d8ef7..3342220fcb 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -2,6 +2,9 @@ * Copyright (c) 2016, Ford Motor Company * All rights reserved. * + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 4ede705f87..78f4529c1d 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -2,6 +2,9 @@ * Copyright (c) 2017, Ford Motor Company * All rights reserved. * + * Copyright (c) 2017 Xevo Inc. + * All rights reserved. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * -- cgit v1.2.1 From 79eb327b9ee9199adf8cd6c5359087c9852a566e Mon Sep 17 00:00:00 2001 From: Masato Ogawa Date: Thu, 24 Aug 2017 17:28:04 +0900 Subject: Updated according to changing SendHapticData design --- src/components/interfaces/HMI_API.xml | 29 +++++++++++++++++++---------- src/components/interfaces/MOBILE_API.xml | 32 +++++++++++++++++++------------- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 19e36fc9cb..495c449e85 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -1,7 +1,10 @@ - - - - - - - - - - - - - - - - Indicates the source from where the command was triggered. - - - - - - - Contains information about the HMI zone capabilities. - For future use. - - - - - - Contains information about the TTS capabilities. - - - - - - - - - Contains information about the VR capabilities. - - - - - Contains a list of prerecorded speech items present on the platform. - - - - - - - - - Describes different sampling options for PerformAudioPassThru. - - - - - - - - Describes different quality options for PerformAudioPassThru. - - - - - - Describes different audio type options for PerformAudioPassThru. - - - - - - Describes different audio type configurations for PerformAudioPassThru. - e.g. {8kHz,8-bit,PCM} - - - - - - - - Defines the data types that can be published and subscribed to. - - Notifies GPSData may be subscribed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Defines the hard (physical) and soft (touchscreen) buttons available from SYNC - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59; - used for Type II and CID headunits - - - - - minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59; - used for Type V headunit - - - - - minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59; - used for GEN1.1 MFD3/4/5 headunits - - - - - 5 characters possible - Format: 1|sp c :|sp c c - 1|sp : digit "1" or space - c : character out of following character set: sp|0-9|[letters, see TypeII column in XLS. See [@TODO: create file ref]] - :|sp : colon or space - used for Type II headunit - - - - - 5 chars possible - Format: 1|sp c :|sp c c - 1|sp : digit "1" or space - c : character out of following character set: sp|0-9|[letters, see CID column in XLS. See [@TODO: create file ref]] - :|sp : colon or space - used for CID headunit - NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set - - - - - 6 chars possible - Format: 1|sp c c :|sp c c - 1|sp : digit "1" or space - c : character out of following character set: sp|0-9|[letters, see Type 5 column in XLS]. See [@TODO: create file ref] - :|sp : colon or space - used for Type V headunit - - - - - 6 chars possible - Format: c :|sp c c : c c - :|sp : colon or space - c : character out of following character set: sp|0-9|[letters]. - used for GEN1.1 MFD3/4/5 headunits - - - - - - See DAES for further infos regarding the displays - - - - - - - - - - - - - - - - The first line of first set of main fields of the persistent display; applies to "Show" - - - - The second line of first set of main fields of the persistent display; applies to "Show" - - - - The first line of second set of main fields of persistent display; applies to "Show" - - - - The second line of second set of main fields of the persistent display; applies to "Show" - - - - The status bar on NGN; applies to "Show" - - - - Text value for MediaClock field; applies to "Show" - - - - The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show" - - - - The first line of the alert text field; applies to "Alert" - - - - The second line of the alert text field; applies to "Alert" - - - - The third line of the alert text field; applies to "Alert" - - - - Long form body of text that can include newlines and tabs; applies to "ScrollableMessage" - - - - First line suggestion for a user response (in the case of VR enabled interaction) - - - - First line of navigation text - - - - Second line of navigation text - - - - Estimated Time of Arrival time for navigation - - - - Total distance to destination for navigation - - - - First line of text for audio pass thru - - - - Second line of text for audio pass thru - - - - Header text for slider - - - - Footer text for slider - - - - Primary text for Choice - - - - Secondary text for Choice - - - - Tertiary text for Choice - - - - Optional text to label an app menu button (for certain touchscreen platforms). - - - - Optional name / title of intended location for SendLocation. - - - - Optional description of intended location / establishment (if applicable) for SendLocation. - - - - Optional location address (if applicable) for SendLocation. - - - - Optional hone number of intended location / establishment (if applicable) for SendLocation. - - - - - - - The data in this field contains the title of the currently playing audio track. - - - The data in this field contains the artist or creator of the currently playing audio track. - - - The data in this field contains the album title of the currently playing audio track. - - - The data in this field contains the creation year of the currently playing audio track. - - - The data in this field contains the genre of the currently playing audio track. - - - The data in this field contains the name of the current source for the media. - - - The data in this field is a rating. - - - The data in this field is the current temperature. - - - The data in this field is the maximum temperature for the day. - - - The data in this field is the minimum temperature for the day. - - - The data in this field describes the current weather (ex. cloudy, clear, etc.). - - - The data in this field describes the current humidity value. - - - - - - The image field for SoftButton - - - - The first image field for Choice - - - - The secondary image field for Choice - - - - The image field for vrHelpItem - - - - The image field for Turn - - - - The image field for the menu icon in SetGlobalProperties - - - - The image field for AddCommand - - - - The image field for the app icon (set by setAppIcon) - - - - The image field for Show - - - - The primary image field for ShowConstantTBT - - - - The secondary image field for ShowConstantTBT - - - - The optional image of a destination / location - - - - - - The list of potential character sets - - See [@TODO: create file ref] - - - See [@TODO: create file ref] - - - See [@TODO: create file ref] - - - See [@TODO: create file ref] - - - - - The list of possible alignments, left, right, or centered - - - - - - - Enumeration that describes possible states of turn-by-turn client or AppLink app. - - - - - - - - - - - - - - Enumeration that describes possible states of driver distraction. - - - - - - Contains information about the type of image. - - - - - - The mode in which the SendLocation request is sent - - - - - - - Enum for each type of video streaming protocol type. - - - Raw stream bytes that contains no timestamp data and is the lowest supported video streaming - - - - - RTP facilitates the transfer of real-time data. Information provided by this protocol include - timestamps (for synchronization), sequence numbers (for packet loss and reordering detection) - and the payload format which indicates the encoded format of the data. - - - - - The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the - Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) - for media stream delivery. However, some vendors implement proprietary transport protocols. - - - - - Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by - Macromedia for streaming audio, video and data over the Internet, between a Flash player - and a server. Macromedia is now owned by Adobe, which has released an incomplete version - of the specification of the protocol for public use. - - - - - The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and - Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio. - - - - - - Enum for each type of video streaming codec. - - - A block-oriented motion-compensation-based video compression standard. - As of 2014 it is one of the most commonly used formats for the recording, compression, and - distribution of video content. - - - - - High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video - compression standard, one of several potential successors to the widely used AVC (H.264 or - MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio - at the same level of video quality, or substantially improved video quality at the same - bit rate. It supports resolutions up to 8192x4320, including 8K UHD. - - - - - Theora is derived from the formerly proprietary VP3 codec, released into the public domain - by On2 Technologies. It is broadly comparable in design and bitrate efficiency to - MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of - the features present in some of these other codecs. It is comparable in open standards - philosophy to the BBC's Dirac codec. - - - - - VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and - Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct - successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for - Open Media (AOMedia) are based on VP8. - - - - - Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) - and also enables lossless compression. - - - - - - - Either the static hex icon value or the binary image file name identifier (sent by PutFile). - - - Describes, whether it is a static or dynamic image. - - - - - - Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType - - - Optional text to display (if defined as TEXT or BOTH) - - - Optional image struct for SoftButton (if defined as IMAGE or BOTH) - - - - True, if highlighted - False, if not highlighted - - - - Value which is returned via OnButtonPress / OnButtonEvent - - - Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed. - - - - - - The type of data contained in the "mainField1" text field. - - - The type of data contained in the "mainField2" text field. - - - The type of data contained in the "mainField3" text field. - - - The type of data contained in the "mainField4" text field. - - - - - A choice is an option given to the user, which can be selected either by menu, or through voice recognition system. - - - - - - Optional secondary text to display; e.g. address of POI in a search result entry - - - Optional tertiary text to display; e.g. distance to POI for a search result entry - - - Optional secondary image struct for choice - - - - - - Text to display for VR Help item - - - Image struct for VR Help item - - - Position to display item in VR Help list - - - - - Specifies the version number of the SYNC V4 protocol, that is supported by the mobile application - - - The major version indicates versions that is not-compatible to previous versions. - - - The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality) - - - The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version - - - - - The different global properties. - - The property helpPrompt of setGlobalProperties - - - The property timeoutPrompt of setGlobalProperties - - - The property vrHelpTitle of setGlobalProperties - - - The property array of vrHelp of setGlobalProperties - - - The property in-app menu name of setGlobalProperties - - - The property in-app menu icon of setGlobalProperties - - - The on-screen keyboard configuration of setGlobalProperties - - - - - The list of potential compass directions - - - - - - - - - - - - - - - - - - - - The supported dimensions of the GPS - - No GPS at all - - - Longitude and lattitude - - - Longitude and lattitude and altitude - - - - - The selected gear. - - Parking - - - Reverse gear - - - No gear - - - - - Drive Sport mode - - - 1st gear hold - - - - - - - - - - - - - - - - - - - - - - - - - The volume status of a vehicle component. - - - - - - - - - - - - - - - - - See ComponentVolumeStatus. - - - - - Reflects the status of a cluster instrument warning light. - - - - - - - - - - - - Reflects the status of a vehicle data notification. - - - - - - - - - - - - Reflects the ignition switch stability. - - - - - - - - - - Reflects the status of ignition. - - - - - - - - - - - - - - - - Reflects the status of a vehicle data event; e.g. a seat belt event status. - - - - - - - - - - - - - - Reflects the reported battery status of the connected device, if reported. - - - - - - - - - - - - - - - - Reflects the current primary audio source (if selected). - - - - - - - - - - - - - - - - - - Reflects the status of the wipers. - - - - - - - - - - - - - - - - - - - Reflects the status of a binary vehicle data item. - - - - - - - - - - Reflects the status of a vehicle maintenance mode. - - - - - - - - - - - - Reflects the status of given vehicle component. - - - - - - - - - - - - - - Reflects the status of the ambient light sensor. - - - - - - - - - - - - - References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus. - - - - - - References signal "PrkBrkActv_B_Actl". - - - References signal "Ignition_Switch_Stable". See IgnitionStableStatus. - - - References signal "Ignition_status". See IgnitionStatus. - - - References signal "DrStatDrv_B_Actl". - - - References signal "DrStatPsngr_B_Actl". - - - References signal "DrStatRl_B_Actl". - - - References signal "DrStatRr_B_Actl". - - - - - - References signal "CPM_VoiceRec_STAT". - - - References signal "BT_ICON". - - - References signal "CPM_Call_Active_STAT". - - - References signal "CPM_Phone_Roaming_STAT". - - - References signal "CPM_TextMsg_AVAL". - - - Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus. - - - References signal "CPM_Stereo_Audio_Output". - - - References signal "CPM_Mono_Audio_Output". - - - Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus. - - - References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource. - - - References signal "eCall_Event". - - - - - - Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat". - - - Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat". - - - Status of the ambient light sensor. - - - - - Contains detailed information about the registered application. - - - The name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request). - - - - The AppBundleID of an iOS application or package name of the Android application. This supports App Launch strategies for each platform. - - - - Represents the build version number of this particular mobile app. - - - - A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration). - - - - - - - - - - - - - - - - - Program Service Name - - - Radio Text - - - The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD - - - Program Identification - the call sign for the radio station - - - The program type - The region should be used to differentiate between EU and North America program types - - - Traffic Program Identification - Identifies a station that offers traffic - - - Traffic Announcement Identification - Indicates an ongoing traffic announcement - - - Region - - - - - - - - - - - - - The integer part of the frequency ie for 101.7 this value should be 101 - - - The fractional part of the frequency for 101.7 is 7 - - - - - Read only parameter. - - - number of HD sub-channels if available. Read only parameter. - - - Current HD sub-channel if available - - - Read only parameter. - - - If the signal strength falls below the set value for this parameter, - the radio will tune to an alternative frequency. Read only parameter. - - - True if the radio is on, false is the radio is off. - - - Read only parameter. - - - - - Contains information about a radio control module's capabilities. - - The short name or a short description of the radio control module. - - - - Availability of the control of enable/disable radio. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of radio band. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of radio frequency. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of HD radio channel. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the getting Radio Data System (RDS) data. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the getting the number of available HD channels. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the getting the Radio state. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the getting the signal strength. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the getting the signal Change Threshold. - True: Available, False: Not Available, Not present: Not Available. - - - - - - - - - - - - - - - - - - - - - - - - - - Temperature Unit - - - Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL. - - - - - - - - Read only parameter. - - - - - - - - - - - - - - - - - - - - - Contains information about a climate control module's capabilities. - - The short name or a short description of the climate control module. - - - - Availability of the reading of current temperature. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of fan speed. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of desired temperature. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of turn on/off AC. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of enable/disable air conditioning is ON on the maximum level. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of enable/disable circulate Air mode. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of enable/disable auto mode. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of enable/disable dual mode. - True: Available, False: Not Available, Not present: Not Available. - - - - - Availability of the control of defrost zones. - True: Available, False: Not Available, Not present: Not Available. - - - - - A set of all defrost zones that are controllable. - - - - - Availability of the control of air ventilation mode. - True: Available, False: Not Available, Not present: Not Available. - - - - - A set of all ventilation modes that are controllable. - - - - - - The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist - - - - - - - - - - - - - Enumeration listing possible file types. - - - - - - - - - - - - Reflects the status of the RCM fuel cutoff. - - - - - - - - - - Reflects the emergency event status of the vehicle. - - - - - - - - - - - - - - - - - - Reflects the status of the eCall Notification. - - - - - - - - - - - - - - - - - - Reflects the status of the current power mode qualification. - - - - - - - - - - - - Reflects the status of the current power mode. - - - - - - - - - - - - - - - - - - - - - - Reflects the status of the current car mode. - - - - - - - - - - - - - References signal "eCallNotification_4A". See VehicleDataNotificationStatus. - - - References signal "eCallNotification". See VehicleDataNotificationStatus. - - - References signal "eCallConfirmation". See ECallConfirmationStatus. - - - - - - References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus. - - - References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus. - - - - - - References signal "VedsEvntType_D_Ltchd". See EmergencyEventType. - - - References signal "RCM_FuelCutoff". See FuelCutoffStatus. - - - References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus. - - - - References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values: - 0x00 No event - 0xFE Not supported - 0xFF Fault - - - - References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus. - - - - - - References signal "PowerMode_UB". - - - References signal "PowerModeQF". See PowerModeQualificationStatus. - - - References signal "CarMode". See CarMode. - - - References signal "PowerMode". See PowerMode. - - - - - - Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus. - - - - - - - - - Enumeration that describes possible result codes of a vehicle data entry request. - - Individual vehicle data item / DTC / DID request or subscription successful - - - DTC / DID request successful, however, not all active DTCs or full contents of DID location available - - - This vehicle data item is not allowed for this app by Ford. - - - The user has not granted access to this type of vehicle data item at this time. - - - The ECU ID referenced is not a valid ID on the bus / system. - - - The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system. - - - The vehicle data item is already subscribed. - - - The vehicle data item cannot be unsubscribed because it is not currently subscribed. - - - The request for this item is ignored because it is already in progress. - - - - - The status and pressure of the tires. - - - Status of the Tire Pressure Telltale. See WarningLightStatus. - - - The status of the left front tire. - - - The status of the right front tire. - - - The status of the left rear tire. - - - The status of the right rear tire. - - - The status of the inner left rear. - - - The status of the inner right rear. - - - - - Struct with the GPS data. - - - - - - The current UTC year. - - - The current UTC month. - - - The current UTC day. - - - The current UTC hour. - - - The current UTC minute. - - - The current UTC second. - - - See CompassDirection. - - - PDOP. If undefined or unavailable, then value shall be set to 0. - - - HDOP. If value is unknown, value shall be set to 0. - - - VDOP. If value is unknown, value shall be set to 0. - - - - True, if actual. - False, if infered. - - - - Number of satellites in view - - - See Dimension - - - Altitude in meters - - - The heading. North is 0. Resolution is 0.01 - - - The speed in KPH - - - - - Individual published data request result - - Defined published data element type. - - - Published data result code. - - - - - Individual requested DID result and data - - Individual DID result code. - - - Location of raw data from vehicle data DID - - - Raw DID-based data returned for requested element. - - - - - - - The hour of the media clock. - Some radios only support a max of 19 hours. If out of range, it will be rejected. - - - - - - - - - The name that identifies the field. See TextFieldName. - - - The character set that is supported in this field. See CharacterSet. - - - The number of characters in one row of this field. - - - The number of rows of this field. - - - - - - The image resolution width. - - - The image resolution height. - - - - - - The name that identifies the field. See ImageFieldName. - - - The image types that are supported in this field. See FileType. - - - The image resolution of this field. - - - - - - The x coordinate of the touch. - - - The y coordinate of the touch. - - - - - - - - - - - - - - A touch's unique identifier. The application can track the current touch events by id. - If a touch event has type begin, the id should be added to the set of touches. - If a touch event has type end, the id should be removed from the set of touches. - - - - - The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds. - The timestamp is used to determined the rate of change of position of a touch. - The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user. - If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array. - - - - - - - - - - - - - - - - - - The resolution of the prescribed screen area. - - - Types of screen touch events available in screen area. - - - - - Enumeration that describes possible permission states of a policy table entry. - - - - - - - - - A set of all HMI levels that are permitted for this given RPC. - - - A set of all HMI levels that are prohibited for this given RPC. - - - - - - A set of all parameters that are permitted for this given RPC. - - - A set of all parameters that are prohibited for this given RPC. - - - - - - Name of the individual RPC in the policy table. - - - - - - - Video streaming formats and their specifications. - - Protocol type, see VideoStreamingProtocol - - - Codec type, see VideoStreamingCodec - - - - - Contains information about the display capabilities. - - The type of the display. See DisplayType - - - A set of all fields that support text data. See TextField - - - A set of all fields that support images. See ImageField - - - A set of all supported formats of the media clock. See MediaClockFormat - - - The display's persistent screen supports referencing a static or dynamic image. - - - A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout. - - - A set of all parameters related to a prescribed screen area (e.g. for video / touch input). - - - The number of on-screen custom presets available (if any); otherwise omitted. - - - - - - - Contains information about a button's capabilities. - - The name of the button. See ButtonName. - - - - The button supports a short press. - Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked. - - - - - The button supports a LONG press. - Whenever the button is pressed long, onButtonPressed( LONG) will be invoked. - - - - - The button supports "button down" and "button up". - Whenever the button is pressed, onButtonEvent( DOWN) will be invoked. - Whenever the button is released, onButtonEvent( UP) will be invoked. - - - - - - - - If included, the platform supports RC climate controls. - For this baseline version, maxsize=1. i.e. only one climate control module is supported. - - - - - If included, the platform supports RC radio controls. - For this baseline version, maxsize=1. i.e. only one radio control module is supported. - - - - If included, the platform supports RC button controls with the included button names. - - - - - Contains information about a SoftButton's capabilities. - - - The button supports a short press. - Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked. - - - - - The button supports a LONG press. - Whenever the button is pressed long, onButtonPressed( LONG) will be invoked. - - - - - The button supports "button down" and "button up". - Whenever the button is pressed, onButtonEvent( DOWN) will be invoked. - Whenever the button is released, onButtonEvent( UP) will be invoked. - - - - The button supports referencing a static or dynamic image. - - - - - Contains information about on-screen preset capabilities. - - Onscreen custom presets are available. - - - - - - Availability of build in Nav. True: Available, False: Not Available - - - Availability of build in phone. True: Available, False: Not Available - - - Availability of video streaming. True: Available, False: Not Available - - - - - - - unique ID of the sub menu, the command will be added to. - If not provided, it will be provided to the top level of the in application menu. - - - - - - Position within the items that are are at top level of the in application menu. - 0 will insert at the front. - 1 will insert at the second position. - if position is greater or equal than the number of items on top level, the sub menu will be appended to the end. - If this param was omitted the entry will be added at the end. - - - - - Text to show in the menu for this sub menu. - - - - - A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI) - - - The text or phonemes to speak. - May not be empty. - - - - Describes, whether it is text or a specific phoneme set. See SpeechCapabilities - - - - - - Individual turn text. Must provide at least text or icon for a given turn. - - - Individual turn icon. Must provide at least text or icon for a given turn. - - - - - - Make of the vehicle, e.g. Ford - - - Model of the vehicle, e.g. Fiesta - - - Model Year of the vehicle, e.g. 2013 - - - Trim of the vehicle, e.g. SE - - - - - Enumeration listing possible keyboard layouts. - - - - - - - Enumeration listing possible keyboard events. - - - - - - - - - Enumeration listing possible keyboard events. - - Each keypress is individually sent as the user presses the keyboard keys. - - - The keypresses are queued and a string is eventually sent once the user chooses to submit their entry. - - - The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry. - - - - - Configuration of on-screen keyboard (if available). - - - The keyboard language. - - - - Desired keyboard layout. - - - - - Desired keypress mode. - If omitted, this value will be set to RESEND_CURRENT_ENTRY. - - - - - Array of keyboard characters to enable. - All omitted characters will be greyed out (disabled) on the keyboard. - If omitted, the entire keyboard will be enabled. - - - - Allows an app to prepopulate the text field with a suggested or completed entry as the user types - - - - - - Various information abount connecting device. - - - Device model - - - Device firmware revision - - - Device OS - - - Device OS version - - - Device mobile carrier (if applicable) - - - Omitted if connected not via BT. - - - - - - Enumeration listing possible asynchronous requests. - - - - - - - - - - - - - - - - - - - - - - - - Enumeration listing possible app types. - - - - - - - - - - - - - - - - Predefined screen layout. - - - - Default media / non-media screen. - Can be set as a root screen. - - - - - Default Media screen. - Can be set as a root screen. - - - - - Default Non-media screen. - Can be set as a root screen. - - - - - Custom root media screen containing app-defined onscreen presets. - Can be set as a root screen. - - - - - Custom root template screen containing full screen map with navigation controls. - Can be set as a root screen. - - - - - Custom root template screen containing video represented list. - Can be set as a root screen. - - - - - Custom root template screen containing video represented keyboard. - Can be set as a root screen. - - - - - Custom root template screen containing half-screen graphic with lines of text. - Can be set as a root screen. - - - - - Custom root template screen containing lines of text with half-screen graphic. - Can be set as a root screen. - - - - - Custom root template screen containing only tiled SoftButtons. - Can be set as a root screen. - - - - - Custom root template screen containing only text SoftButtons. - Can be set as a root screen. - - - - - Custom root template screen containing half-screen graphic with tiled SoftButtons. - Can be set as a root screen. - - - - - Custom root template screen containing tiled SoftButtons with half-screen graphic. - Can be set as a root screen. - - - - - Custom root template screen containing half-screen graphic with text and SoftButtons. - Can be set as a root screen. - - - - - Custom root template screen containing text and SoftButtons with half-screen graphic. - Can be set as a root screen. - - - - - Custom root template screen containing half-screen graphic with text only SoftButtons. - Can be set as a root screen. - - - - - Custom root template screen containing text only SoftButtons with half-screen graphic. - Can be set as a root screen. - - - - - Custom root template screen containing a large graphic and SoftButtons. - Can be set as a root screen. - - - - - Custom root template screen containing two graphics and SoftButtons. - Can be set as a root screen. - - - - - Custom root template screen containing only a large graphic. - Can be set as a root screen. - - - - - - Enumeration linking function names with function IDs in AppLink protocol. - Assumes enumeration starts at value 0. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Enumeration linking message types with function types in WiPro protocol. - Assumes enumeration starts at value 0. - - - - - - - - - Milliseconds - - - Seconds part of time - - - Minutes part of time - - - Hours part of time. Note that this structure accepts time only in 24 Hr format - - - Day of the month - - - Month of the year - - - The year in YYYY format - - - Time zone offset in Hours wrt UTC. - - - Time zone offset in Min wrt UTC. - - - - - Describes what kind of waypoint is requested/provided. - - - - - - - Latitude of the location. - - - Longitude of the location. - - - - - - Name of the country (localized) - - - Name of country (ISO 3166-2) - - - (PLZ, ZIP, PIN, CAP etc.) - - - Portion of country (e.g. state) - - - Portion of e.g. state (e.g. county) - - - Hypernym for e.g. city/village - - - Hypernym for e.g. district - - - Hypernym for street, road etc. - - - Portion of thoroughfare e.g. house number - - - - - - Latitude/Longitude of the location. - - - Name of location. - - - Location address for display purposes only - - - Description intended location / establishment (if applicable) - - - Phone number of location / establishment. - - - Image / icon of intended location. - - - Address to be used by navigation engines for search - - - - - - - - - - - - - Extended capabilities for an onboard navigation system - - If the module has the ability to add locations to the onboard nav - - - If the module has the ability to return way points from onboard nav - - - - - Extended capabilities of the module's phone feature - - If the module has the abiulity to perform dial number - - - - - Contains information about this system's video streaming capabilities. - - The preferred resolution of a video stream for decoding and rendering on HMI. - - - The maximum bitrate of video stream that is supported, in kbps. - - - - Detailed information on each format supported by this system, in its preferred order - (i.e. the first element in the array is most preferable to the system). - Each object will contain a VideoStreamingFormat that describes what can be expected. - - - - True if the system can utilize the haptic spatial data from the source being streamed. - - - - - The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist - - - - - - - - - - - - - - - The upper left X-coordinate of the rectangle - - - The upper left Y-coordinate of the rectangle - - - The width of the rectangle - - - The height of the rectangle - - - - - Defines haptic data for each user control object for video streaming application - - A user control spatial identifier - - - The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs. - - - - - - - - Establishes an interface with a mobile application. - Before registerAppInterface no other commands will be accepted/executed. - - - - See SyncMsgVersion - - - - - The mobile application name, e.g. "Ford Drive Green". - Needs to be unique over all applications. - May not be empty. - May not start with a new line character. - May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands) - Needs to be unique over all applications. Applications with the same name will be rejected. - Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported. - - - - - - TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green". - Meant to overcome any failing on speech engine in properly pronouncing / understanding app name. - Needs to be unique over all applications. - May not be empty. - May not start with a new line character. - Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported. - - - - - - Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen. - If not provided, the appName is used instead (and will be truncated if too long) - Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported. - - - - - - Defines an additional voice recognition command. - May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands) - Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported. - - - - - - Indicates if the application is a media or a non-media application. - Only media applications will be able to stream audio to Sync that is audible outside of the BT media source. - - - - - See Language - Current app's expected VR+TTS language - If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus. - - - - - See Language - Current app's expected display language - If there is a mismatch with SYNC, the app will be able to change this registration with changeRegistration prior to app being brought into focus. - - - - - - See AppHMIType - List of all applicable app HMI types stating which HMI classifications to be given to the app. - - - - - - ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles). - This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece. - If omitted, then the previous state of an app's commands, etc. will not be restored. - When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.). - - - - - See DeviceInfo. - - - - ID used to validate app with policy table entries - - - - See AppInfo. - - - - - - The response to registerAppInterface - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - See SyncMsgVersion - - - - The currently active VR+TTS language on Sync. See "Language" for options. - - - - The currently active display language on Sync. See "Language" for options. - - - - See DisplayCapabilities - - - - See ButtonCapabilities - - - - If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities. - - - - If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities. - - - - If not used yet => remove - See HmiZoneCapabilities - - - - See SpeechCapabilities - - - - See PrerecordedSpeech - - - - See VrCapabilities - - - - See AudioPassThruCapability - - - - See AudioPassThruCapability - - - - Specifies the vehicle's type. See VehicleType. - - - - - Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests. - If a mode outside this list is requested, it will be rejected. - - - - - Specifies the HMI’s capabilities. See HMICapabilities. - - - - The SmartDeviceLink version. - - - - The software version of the system that implements the SmartDeviceLink core. - - - - - - - Closes an interface from a mobile application. - After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed. - Will fail, if no registerAppInterface was completed successfully before. - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Allows setting global properties. - - - - The help prompt. - An array of text chunks of type TTSChunk. See TTSChunk. - The array must have at least one item. - - - - - - Help text for a wait timeout. - An array of text chunks of type TTSChunk. See TTSChunk. - The array must have at least one item. - - - - - - VR Help Title text. - If omitted on supported displays, the default SYNC help title shall be used. - If omitted and one or more vrHelp items are provided, the request will be rejected. - - - - - - VR Help Items. - If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used. - If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected. - If omitted and a vrHelpTitle is provided, the request will be rejected. - - - - Optional text to label an app menu button (for certain touchscreen platforms). - - - - >Optional icon to draw on an app menu button (for certain touchscreen platforms). - - - - On-screen keybaord configuration (if available). - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Allows resetting global properties. - - - Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default) - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Adds a command to the in application menu. - Either menuParams or vrCommands must be provided. - - - - unique ID of the command to add. - - - - Optional sub value containing menu parameters - - - - - An array of strings to be used as VR synonyms for this command. - If this array is provided, it may not be empty. - - - - - - Image struct determining whether static or dynamic icon. - If omitted on supported displays, no (or the default if applicable) icon shall be displayed. - - - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Deletes all commands from the in-application menu with the specified command id. - - - ID of the command(s) to delete. - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Adds a sub menu to the in-application menu. - - - unique ID of the sub menu to add. - - - - - Position within the items that are are at top level of the in application menu. - 0 will insert at the front. - 1 will insert at the second position. - If position is greater or equal than the number of items on top level, the sub menu will be appended to the end. - Position of any submenu will always be located before the return and exit options - If this param was omitted the entry will be added at the end. - - - - - Text to show in the menu for this sub menu. - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Deletes a submenu from the in-application menu. - - - The "menuID" of the submenu to delete. (See addSubMenu.menuID) - - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - creates interaction choice set to be used later by performInteraction - - - Unique ID used for this interaction choice set. - - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow). - - - - Text to be displayed first. - - - - - - This is the intial prompt spoken to the user at the start of an interaction. - An array of text chunks of type TTSChunk. See TTSChunk. - The array must have at least one item. - - - - - See InteractionMode. - - - - List of interaction choice set IDs to use with an interaction. - - - - - Help text. This is the spoken string when a user speaks "help" when the interaction is occuring. - An array of text chunks of type TTSChunk. See TTSChunk. - The array must have at least one item. - - - - - - Timeout text. This text is spoken when a VR interaction times out. - An array of text chunks of type TTSChunk. See TTSChunk. - The array must have at least one item. - - - - - - Timeout in milliseconds. - If omitted a standard value of 10000 milliseconds is used. - Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform. - - - - - - Ability to send suggested VR Help Items to display on-screen during Perform Interaction. - If omitted on supported displays, the default SYNC generated list of suggested choices shall be displayed. - - - - - See LayoutMode. - - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - ID of the choice that was selected in response to PerformInteraction. - Only is valid if general result is "success:true". - - - - - - Manually entered text selection, e.g. through keyboard - Can be returned in lieu of choiceID, depending on trigger source - - - - - - See TriggerSource - Only is valid if resultCode is SUCCESS. - - - - - - - Deletes interaction choice set that has been created with "CreateInteractionChoiceSet". - The interaction may only be deleted when not currently in use by a "performInteraction". - - - ID of the interaction choice set to delete. - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided. - - - The first line of the alert text field - - - - The second line of the alert text field - - - - The optional third line of the alert text field - - - - - An array of text chunks of type TTSChunk. See TTSChunk. - The array must have at least one item. - - - - - - Timeout in milliseconds. - Typical timeouts are 3-5 seconds. - If omitted, timeout is set to 5s. - - - - - - Defines if tone should be played. Tone is played before TTS. - If omitted, no tone is played. - - - - - - If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc. - - - - - - App defined SoftButtons. - If omitted on supported displays, the displayed alert shall not have any SoftButtons. - - - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Amount of time (in seconds) that an app must wait before resending an alert. - If provided, another system event or overlay currently has a higher priority than this alert. - An app must not send an alert without waiting at least the amount of time dictated. - - - - - - - Updates the persistent display. Supported fields depend on display capabilities. - - - - The text that should be displayed in a single or upper display line. - If this text is not set, the text of mainField1 stays unchanged. - If this text is empty "", the field will be cleared. - - - - - - The text that should be displayed on the second display line. - If this text is not set, the text of mainField2 stays unchanged. - If this text is empty "", the field will be cleared. - - - - - - The text that should be displayed on the second "page" first display line. - If this text is not set, the text of mainField3 stays unchanged. - If this text is empty "", the field will be cleared. - - - - - - The text that should be displayed on the second "page" second display line. - If this text is not set, the text of mainField4 stays unchanged. - If this text is empty "", the field will be cleared. - - - - - - Specifies how mainField1 and mainField2 texts should be aligned on display. - If omitted, texts will be centered. - - - - - Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc. - - - - - Text value for MediaClock field. Has to be properly formatted by Mobile App according to Sync capabilities. - If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped. - - - - - - The text that should be displayed in the track field. - If this text is not set, the text of mediaTrack stays unchanged. - If this text is empty "", the field will be cleared. - - - - - - Image struct determining whether static or dynamic image to display in app. - If omitted on supported displays, the displayed graphic shall not change. - - - - - - Image struct determining whether static or dynamic secondary image to display in app. - If omitted on supported displays, the displayed secondary graphic shall not change. - - - - - - - App defined SoftButtons. - If omitted on supported displays, the currently displayed SoftButton values will not change. - - - - - - App labeled on-screen presets (i.e. on-screen media presets or dynamic search suggestions). - If omitted on supported displays, the presets will be shown as not defined. - - - - - - App defined metadata information. See MetadataTags. Uses mainField1, mainField2, mainField3, mainField4. - If omitted on supported displays, the currently set metadata tags will not change. - If any text field contains no tags, the metadata tag for that textfield should be removed. - - - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Speaks a text. - - - - An array of text chunks of type TTSChunk. See TTSChunk. - The array must have at least one item. - - - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Sets the initial media clock value and automatic update method. - - - - See StartTime. - startTime must be provided for "COUNTUP" and "COUNTDOWN". - startTime will be ignored for "RESUME", and "CLEAR" - startTime can be sent for "PAUSE", in which case it will update the paused startTime - - - - - - See StartTime. - endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored) - If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA. - endTime will be ignored for "RESUME", and "CLEAR" - endTime can be sent for "PAUSE", in which case it will update the paused endTime - - - - - - Enumeration to control the media clock. - In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused. - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Starts audio pass thru session - - - SYNC will speak this prompt before opening the audio pass thru session. - An array of text chunks of type TTSChunk. See TTSChunk. - The array must have at least one item. - If omitted, then no initial prompt is spoken. - - - - First line of text displayed during audio capture. - - - Second line of text displayed during audio capture. - - - This value shall be allowed at 8 khz or 16 or 22 or 44 khz. - - - The maximum duration of audio recording in milliseconds. - - - Specifies the quality the audio is recorded. Currently 8 bit or 16 bit. - - - Specifies the type of audio data being requested. - - - - Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption. - If omitted, the value is set to true. - - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - When this request is invoked, the audio capture stops. - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Subscribes to built-in HMI buttons. - The application will be notified by the OnButtonEvent and OnButtonPress. - To unsubscribe the notifications, use unsubscribeButton. - - - - Name of the button to subscribe. - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Unsubscribes from built-in HMI buttons. - - - Name of the button to unsubscribe. - - - - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Subscribes for specific published data items. - The data will be only sent if it has changed. - The application will be notified by the onVehicleData notification whenever new data is available. - To unsubscribe the notifications, use unsubscribe with the same subscriptionType. - - - - See GPSData - - - The vehicle speed in kilometers per hour - - - The number of revolutions per minute of the engine - - - The fuel level in the tank (percentage) - - - The fuel level state - - - The instantaneous fuel consumption in microlitres - - - The external temperature in degrees celsius - - - See PRNDL - - - See TireStatus - - - Odometer in km - - - The status of the seat belts - - - The body information including power modes - - - The device status including signal and battery strength - - - The status of the brake pedal - - - The status of the wipers - - - Status of the head lamps - - - Torque value for engine (in Nm) on non-diesel variants - - - Accelerator pedal position (percentage depressed) - - - Current angle of the steering wheel (in deg) - - - - - Emergency Call notification and confirmation data - - - The status of the air bags - - - Information related to an emergency event (and if it occurred) - - - The status modes of the cluster - - - Information related to the MyKey feature - - - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - See GPSData - - - The vehicle speed in kilometers per hour - - - The number of revolutions per minute of the engine - - - The fuel level in the tank (percentage) - - - The fuel level state - - - The instantaneous fuel consumption in microlitres - - - The external temperature in degrees celsius. - - - See PRNDL - - - See TireStatus - - - Odometer in km - - - The status of the seat belts - - - The body information including power modes - - - The device status including signal and battery strength - - - The status of the brake pedal - - - The status of the wipers - - - Status of the head lamps - - - Torque value for engine (in Nm) on non-diesel variants - - - Accelerator pedal position (percentage depressed) - - - Current angle of the steering wheel (in deg) - - - - - Emergency Call notification and confirmation data - - - The status of the air bags - - - Information related to an emergency event (and if it occurred) - - - The status modes of the cluster - - - Information related to the MyKey feature - - - - - - - This function is used to unsubscribe the notifications from the subscribeVehicleData function. - - - See GPSData - - - The vehicle speed in kilometers per hour - - - The number of revolutions per minute of the engine - - - The fuel level in the tank (percentage) - - - The fuel level state - - - The instantaneous fuel consumption in microlitres - - - The external temperature in degrees celsius. - - - See PRNDL - - - See TireStatus - - - Odometer in km - - - The status of the seat belts - - - The body information including power modes - - - The device status including signal and battery strength - - - The status of the brake pedal - - - The status of the wipers - - - Status of the head lamps - - - Torque value for engine (in Nm) on non-diesel variants - - - Accelerator pedal position (percentage depressed) - - - Current angle of the steering wheel (in deg) - - - - - Emergency Call notification and confirmation data - - - The status of the air bags - - - Information related to an emergency event (and if it occurred) - - - The status modes of the cluster - - - Information related to the MyKey feature - - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - See GPSData - - - The vehicle speed in kilometers per hour - - - The number of revolutions per minute of the engine - - - The fuel level in the tank (percentage) - - - The fuel level state - - - The instantaneous fuel consumption in microlitres - - - The external temperature in degrees celsius - - - See PRNDL - - - See TireStatus - - - Odometer in km - - - The status of the seat belts - - - The body information including power modes - - - The device status including signal and battery strength - - - The status of the brake pedal - - - The status of the wipers - - - Status of the head lamps - - - Torque value for engine (in Nm) on non-diesel variants - - - Accelerator pedal position (percentage depressed) - - - Current angle of the steering wheel (in deg) - - - - - Emergency Call notification and confirmation data - - - The status of the air bags - - - Information related to an emergency event (and if it occurred) - - - The status modes of the cluster - - - Information related to the MyKey feature - - - - - - - Non periodic vehicle data read request. - - - See GPSData - - - The vehicle speed in kilometers per hour - - - The number of revolutions per minute of the engine - - - The fuel level in the tank (percentage) - - - The fuel level state - - - The instantaneous fuel consumption in microlitres - - - The external temperature in degrees celsius - - - Vehicle identification number - - - See PRNDL - - - See TireStatus - - - Odometer in km - - - The status of the seat belts - - - The body information including ignition status and internal temp - - - The device status including signal and battery strength - - - The status of the brake pedal - - - The status of the wipers - - - Status of the head lamps - - - Torque value for engine (in Nm) on non-diesel variants - - - Accelerator pedal position (percentage depressed) - - - Current angle of the steering wheel (in deg) - - - - - Emergency Call notification and confirmation data - - - The status of the air bags - - - Information related to an emergency event (and if it occurred) - - - The status modes of the cluster - - - Information related to the MyKey feature - - - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - See GPSData - - - The vehicle speed in kilometers per hour - - - The number of revolutions per minute of the engine - - - The fuel level in the tank (percentage) - - - The fuel level state - - - The instantaneous fuel consumption in microlitres - - - The external temperature in degrees celsius - - - Vehicle identification number - - - See PRNDL - - - See TireStatus - - - Odometer in km - - - The status of the seat belts - - - The body information including power modes - - - The device status including signal and battery strength - - - The status of the brake pedal - - - The status of the wipers - - - Status of the head lamps - - - Torque value for engine (in Nm) on non-diesel variants - - - Accelerator pedal position (percentage depressed) - - - Current angle of the steering wheel (in deg) - - - - - Emergency Call notification and confirmation data - - - The status of the air bags - - - Information related to an emergency event (and if it occurred) - - - The status modes of the cluster - - - Information related to the MyKey feature - - - - - - - Non periodic vehicle data read request - - - Name of ECU. - - - Get raw data from vehicle data DID location(s) - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - Array of requested DID results (with data if available). - - - - - - Vehicle module diagnostic trouble code request. - - - Name of ECU. - - - - DTC Mask Byte to be sent in diagnostic request to module . - - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - 2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf) - - - - - Array of all reported DTCs on module (ecuHeader contains information if list is truncated). - Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf). - - - - - - - Non periodic vehicle diagnostic request - - - Name of target ECU. - - - - Length of message (in bytes). - - - - - Array of bytes comprising CAN message. - - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Array of bytes comprising CAN message result. - - - - - - - Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined - - Body of text that can include newlines and tabs. - - - App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout). - - - - App defined SoftButtons. - If omitted on supported displays, only the system defined "Close" SoftButton will be displayed. - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider. - - Number of selectable items on a horizontal axis - - - Initial position of slider control (cannot exceed numTicks) - - - Text header to display - - - - Text footer to display (meant to display min/max threshold descriptors). - For a static text footer, only one footer string shall be provided in the array. - For a dynamic text footer, the number of footer text string in the array must match the numTicks value. - For a dynamic text footer, text array string should correlate with potential slider position index. - If omitted on supported displays, no footer text shall be displayed. - - - - - App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout). - If omitted, the value is set to 10000. - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Current slider value returned when saved or canceled (aborted) - This value is only returned for resultCodes "SAVED" or "ABORTED" - - - - - - - - - - - - - - - - - - - - - - Fraction of distance till next maneuver (starting from when AlertManeuver is triggered). - Used to calculate progress bar. - - - - - Distance till next maneuver (starting from) from previous maneuver. - Used to calculate progress bar. - - - - - If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay. - If omitted the value will be assumed as FALSE. - - - - - Three dynamic SoftButtons available (first SoftButton is fixed to "Turns"). - If omitted on supported displays, the currently displayed SoftButton values will not change. - - - - - - - true, if successful; false, if failed - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - An array of text chunks of type TTSChunk. See TTSChunk - - - If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed. - - - - - - true, if successful; false, if failed - - - See Result - - - - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - - - If omitted on supported displays, app-defined SoftButton will be left blank. - - - - - - true, if successful; false, if failed - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - Requested voice engine (VR+TTS) language registration - - - Request display language registration - - - Request new app name registration - - - Request new ttsName registration - - - Request new app short name registration - - - Request new VR synonyms registration - - - - - - - - - - - true, if successful - false, if failed - - - - - See Result - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - - Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error. - Currently, only resultCode INVALID_DATA is used. - - - true, if successful; false, if failed - - - - See Result - - - - - Provides additional human readable info regarding the result. - - - - - - Used to push a binary data onto the SYNC module from a mobile device, such as icons and album art - Not supported on first generation SYNC vehicles. - Binary data is in binary part of hybrid msg. - - - - File reference name. - - - - Selected file type. - - - - - Indicates if the file is meant to persist between sessions / ignition cycles. - If set to TRUE, then the system will aim to persist this file through session / cycles. - While files with this designation will have priority over others, they are subject to deletion by the system at any time. - In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file. - If omitted, the value will be set to false. - - - - - - Indicates if the file is meant to be passed thru core to elsewhere on the system. - If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core. - If omitted, the value will be set to false. - - - - - Optional offset in bytes for resuming partial data chunks - - - - Optional length in bytes for resuming partial data chunks - If offset is set to 0, then length is the total length of the file to be downloaded - - - - - - - Response is sent, when the file data was copied (success case). Or when an error occured. - Not supported on First generation SYNC vehicles. - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - Provides the total local space available in SDL Core for the registered app. - If the transfer has systemFile enabled, then the value will be set to 0 automatically. - - - - - Provides additional human readable info regarding the result. - - - - - - Used to delete a file resident on the SYNC module in the app's local cache. - Not supported on first generation SYNC vehicles. - - - - File reference name. - - - - - - - Response is sent, when the file data was deleted (success case). Or when an error occured. - Not supported on First generation SYNC vehicles. - - - true if successful; false, if failed - - - - See Result - - - - - - - - - - - - Provides the total local space available on SYNC for the registered app. - - - - Provides additional human readable info regarding the result. - - - - - - Requests the current list of resident filenames for the registered app. - Not supported on first generation SYNC vehicles. - - - - - - Returns the current list of resident filenames for the registered app along with the current space available - Not supported on First generation SYNC vehicles. - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - An array of all filenames resident on SYNC for the given registered app. - If omitted, then no files currently reside on the system. - - - - - Provides the total local space available on SYNC for the registered app. - - - - Provides additional human readable info regarding the result. - - - - - - Used to set existing local file on SYNC as the app's icon - Not supported on first generation SYNC vehicles. - - - - File reference name. - - - - - - - Response is sent, when the file data was copied (success case). Or when an error occured. - Not supported on First generation SYNC vehicles. - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - - Used to set an alternate display layout. - If not sent, default screen for given platform will be shown - - - - - Predefined or dynamically created screen layout. - Currently only predefined screen layouts are defined. - - - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - See DisplayCapabilities - - - - See ButtonCapabilities - - - - If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities. - - - - If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities. - - - - Provides additional human readable info regarding the result. - - - - - - An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests) - - - The type of system request. - Note that Proprietary requests should forward the binary data to the known proprietary module on the system. - - - - - Filename of HTTP data to store in predefined system staging area. - Mandatory if requestType is HTTP. - PROPRIETARY requestType should ignore this parameter. - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - - - - - - - - Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. - This data will be utilized by the HMI to determine how and when haptic events should occur - - - - Array of rectangle data structures that represent the locations of all user controls present on the HMI. - This data should be updated if/when the application presents a new screen. - When a request is sent, if successful, it will replace all rectangle data previously sent through RPC. - If an empty array is sent, the existing rectangle data will be cleared - - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - - - - Name / title of intended location - - - - - Description intended location / establishment (if applicable) - - - - - Location address (if applicable) - - - - - Phone number of intended location / establishment (if applicable) - - - - - Image / icon of intended location (if applicable and supported) - - - - - - timestamp in ISO 8601 format - - - - - Address to be used for setting destination - - - Defines the mode of prompt for user - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Dials a phone number and switches to phone application. - - - - Phone number is a string, which can be up to 40 chars. - All characters shall be stripped from string except digits 0-9 and * # , ; + - - - - - - - true, if successful - false, if failed - - - - See Result - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - To subscribe in getting changes for Waypoints/destinations - - - - - true, if successful; false, if failed - - - See Result - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - Request for getting waypoint/destination data. - - To request for either the destination only or for all waypoints including destination - - - - - - true, if successful; false, if failed - - - See Result - - - - - - - - - - - - Provides additional human readable info regarding the result. - - - See LocationDetails - - - - - Request to unsubscribe from WayPoints and Destination - - - - - true, if successful; false, if failed - - - See Result - - - - - - - - - - Provides additional human readable info regarding the result. - - - See LocationDetails - - - - - - The type of system capability to get more information on - - - - - - - - See Result - - - - - - - - - - - The capability does not exist on the module - The capability should exist on the module but there was an error retrieving the data. - - - - - true if successful; false, if failed - - - - - - - - See HMILevel - - - - See AudioStreamingState - - - - See SystemContext - - - - - - See AppInterfaceUnregisteredReason - - - - - Notifies application of UP/DOWN events for buttons to which the application is subscribed. - - - Indicates whether this is an UP or DOWN event. - - - If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID) - - - - - Notifies application of LONG/SHORT press events for buttons to which the application is subscribed. - - - Indicates whether this is a LONG or SHORT button press event. - - - If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID) - - - - - Callback for the periodic and non periodic vehicle data read function. - - See GPSData - - - The vehicle speed in kilometers per hour - - - The number of revolutions per minute of the engine - - - The fuel level in the tank (percentage) - - - The fuel level state - - - The instantaneous fuel consumption in microlitres - - - The external temperature in degrees celsius - - - Vehicle identification number. - - - See PRNDL - - - See TireStatus - - - Odometer in km - - - The status of the seat belts - - - The body information including power modes - - - The device status including signal and battery strength - - - The status of the brake pedal - - - The status of the wipers - - - Status of the head lamps - - - Torque value for engine (in Nm) on non-diesel variants - - - Accelerator pedal position (percentage depressed) - - - Current angle of the steering wheel (in deg) - - - - - Emergency Call notification and confirmation data - - - The status of the air bags - - - Information related to an emergency event (and if it occurred) - - - The status modes of the cluster - - - Information related to the MyKey feature - - - - - - - - Command ID, which is related to a specific menu entry - - - - See TriggerSource - - - - - Provides applications with notifications specific to the current TBT client status on the module - - Current State of TBT client - - - - - Provides driver distraction state to mobile applications - - Current State of Driver Distraction - - - - - Provides update to app of which policy-table-enabled functions are available - - Change in permissions for a given set of RPCs - - - - - Binary data is in binary part of hybrid msg - - - - - Current SYNC voice engine (VR+TTS) language - - - Current display language - - - - - - On-screen keyboard event. - Can be full string or individual keypresses depending on keyboard mode. - - - On-screen keyboard input data. - - - - On-screen keyboard input data. - For dynamic keypress events, this will be the current compounded string of entry text. - For entry submission events, this will be the full text entry (this will always return regardless of the mode). - For entry cancelled and entry aborted events, this data param will be omitted. - - - - - - Notifies about touch events on the screen's prescribed area - - The type of touch event. - - - List of all individual touches involved in this event. - - - - - - An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud - Binary data can be included in hybrid part of message for some requests (such as Authentication request responses) - - - The type of system request. - - - - Optional URL for HTTP requests. - If blank, the binary data shall be forwarded to the app. - If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds. - - - - - Optional timeout for HTTP requests - Required if a URL is provided - - - - Optional file type (meant for HTTP file requests). - - - Optional offset in bytes for resuming partial data chunks - - - Optional length in bytes for resuming partial data chunks - - - - - - Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.). - Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data. - - - Calculated hash ID to be referenced during RegisterAppInterface. - - - - - Notification which provides the entire LocationDetails when there is a change to any waypoints or destination. - - See LocationDetails - - - - - - - - - - Allows encoded data in the form of SyncP packets to be sent to the SYNC module. - Legacy / v1 Protocol implementation; use SyncPData instead. - *** DEPRECATED *** - - - - Contains base64 encoded string of SyncP packets. - What is the maxlength? - - - - - - true, if successful; false, if failed - - - - See Result - - - - - - - - - - - Provides additional human readable info regarding the result. - - - - - - - - Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device. - Legacy / v1 Protocol implementation; responds to EncodedSyncPData. - *** DEPRECATED *** - - - Contains base64 encoded string of SyncP packets. - - - - If blank, the SyncP data shall be forwarded to the app. - If not blank, the SyncP data shall be forwarded to the provided URL. - - - - - If blank, the SyncP data shall be forwarded to the app. - If not blank, the SyncP data shall be forwarded with the provided timeout in seconds. - - - - - - - The module where the button should be pressed - - - The name of supported RC climate or radio button. - - - Indicates whether this is a LONG or SHORT button press event. - - - - - - See Result - - - - - - - - - - - - - - - true if successful; false, if failed - - - - - - - The type of a RC module to retrieve module data from the vehicle. - In the future, this should be the Identification of a module. - - - - - If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType. - If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType. - - - - - - - - - See Result - - - - - - - - - - - - - - - - true if successful; false, if failed - - - - It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request. - if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType. - if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe. - - - - - - - - The module data to set for the requested RC module. - - - - - Used to set the values of one remote control module - - - - See Result - - - - - - - - - - - - - - - - - true if successful; false, if failed - - - - - - - - - - - + + + + + + + The request succeeded + + + The request is not supported by the headunit + + + + A button that was requested for subscription is not supported under the current system. + + + + RPC is not authorized in local policy table. + + + + The requested command was rejected, e.g. because mobile app is in background and cannot perform any HMI commands. + Or an HMI command (e.g. Speak) is rejected because a higher priority HMI command (e.g. Alert) is playing. + + + + + A command was aborted, for example due to user interaction (e.g. user pressed button). + Or an HMI command (e.g. Speak) is aborted because a higher priority HMI command (e.g. Alert) was requested. + + + + + A command was ignored, because the intended result is already in effect. + For example, SetMediaClockTimer was used to pause the media clock although the clock is paused already. + NOTE: potentially replaces SUBSCRIBED_ALREADY + + + + The user interrupted the RPC (e.g. PerformAudioPassThru) and indicated to start over. Note, the app must issue the new RPC. + + + + The data may not be changed, because it is currently in use. + For example when trying to delete a command set that is currently involved in an interaction. + + + + The requested vehicle data is not available on this vehicle or is not published. + + + Overlay reached the maximum timeout and closed. + + + + The data sent is invalid. For example: + Invalid Json syntax + Parameters out of bounds (number or enum range) + Mandatory parameters not provided + Parameter provided with wrong type + Invalid characters + Empty string + + + + + + One of the provided IDs is not valid. For example + This applies to CorrelationID, SubscriptionID, CommandID, MenuID, etc. + + + + There was a conflict with an registered name (application or menu item) or vr command + + + An command can not be executed because no application has been registered with RegisterApplication. + + + + The requested language is currently not supported. + Might be because of a mismatch of the currently active language on the headunit and the requested language + + + + The system could not process the request because the necessary memory couldn't be allocated + + + There are too many requests pending (means, that the response has not been delivered, yet).There may be a maximum of 1000 pending requests at a time. + + + There are already too many registered applications + + + RegisterApplication has been called again, after a RegisterApplication was successful before. + + + The RPC (e.g. SubscribeVehicleData) executed successfully but one or more items have a warning or failure. + + + Provided data is valid but something went wrong in the lower layers. + + + RPC is included in a functional group explicitly blocked by the user. + + + The RPC (e.g. ReadDID) executed successfully but the data exceeded the platform maximum threshold and thus, only part of the data is available. + + + Sync doesn't support the protocol that is requested by the mobile application + + + The user has turned off access to vehicle data, and it is globally unavailable to mobile applications. + + + A specified file could not be found on the headunit. + + + User selected to Cancel Route. + + + The RPC (e.g. Slider) executed successfully and the user elected to save the current position / value. + + + The certificate provided during authentication is invalid. + + + The certificate provided during authentication is expired. + + + The provided hash ID does not match the hash of the current set of registered data or the core could not resume the previous data. + + + The requested information is currently not available. This is different than UNSUPPORTED_RESOURCE because it implies the data is at some point available. + + + The value being set is read only + + + + + + + A button was released, after it was pressed for a long time + Actual timing is defined by the headunit and may vary + + + + + A button was released, after it was pressed for a short time + Actual timing is defined by the headunit and may vary + + + + + + + A button has been released up + + + A button has been pressed down + + + + + + English - US + + + Spanish - Mexico + + + French - Canada + + + German - Germany + + + Spanish - Spain + + + English - GB + + + Russian - Russia + + + Turkish - Turkey + + + Polish - Poland + + + French - France + + + Italian - Italy + + + Swedish - Sweden + + + Portuguese - Portugal + + + Dutch (Standard) - Netherlands + + + English - Australia + + + Mandarin - China + + + Mandarin - Taiwan + + + Japanese - Japan + + + Arabic - Saudi Arabia + + + Korean - South Korea + + + Portuguese - Brazil + + + Czech - Czech Republic + + + Danish - Denmark + + + Norwegian - Norway + + + Dutch (Flemish) - Belgium + + + Greek - Greece + + + Hungarian - Hungary + + + Finnish - Finland + + + Slovak - Slovakia + + + English - India + + + Thai - Thailand + + + English - Middle East + + + Hebrew - Israel + + + Romanian - Romania + + + Ukrainian - Ukraine + + + Indonesian - Indonesia + + + Vietnamese - Vietnam + + + Malay - Malaysia + + + Hindi - India + + + + + Describes how the media clock timer should behave on the platform + + Starts the media clock timer counting upwards, as in time elapsed. + + + Starts the media clock timer counting downwards, as in time remaining. + + + Pauses the media clock timer + + + Resume the media clock timer + + + Clears the media clock timer (previously done through Show->mediaClock) + + + + + + Causes the media clock timer to update from 0:00 to a specified time + + + Causes the media clock timer to update from a specified time to 0:00 + + + Indicates to not use the media clock timer + + + + + For application-requested interactions, this mode indicates the method in which the user is notified and uses the interaction. + + This mode causes the interaction to only occur on the display, meaning the choices are provided only via the display. No Voice Interaction. + + + This mode causes the interaction to only occur using the headunits VR system. Selections are made by saying the command. + + + This mode causes both a VR and display selection option for an interaction. The user will first be asked via Voice Interaction (if available). If this is unsuccessful, the system will switch to manual input. + + + + + For touchscreen interactions, the mode of how the choices are presented. + + This mode causes the interaction to display the previous set of choices as icons. + + + This mode causes the interaction to display the previous set of choices as icons along with a search field in the HMI. + + + This mode causes the interaction to display the previous set of choices as a list. + + + This mode causes the interaction to display the previous set of choices as a list along with a search field in the HMI. + + + This mode causes the interaction to immediately display a keyboard entry through the HMI. + + + + + Enumeration that describes current levels of HMI. + + + + + + + + Enumeration that describes possible states of audio streaming. + + + + + + + Enumeration that describes system actions that can be triggered. + + Default action occurs. Standard behavior (e.g. SoftButton clears overlay). + + + App is brought into HMI_FULL. + + + Current system context is maintained. An overlay is persisted even though a SoftButton has been pressed and the notification sent. + + + + + Enumeration that describes possible contexts an app's HMI might be in. Communicated to whichever app is in HMI FULL, except Alert. + + The app's persistent display (whether media/non-media/navigation) is fully visible onscreen. + + + The system is currently in a VR session (with whatever dedicated VR screen being overlaid onscreen). + + + The system is currently displaying an in-App menu onscreen. + + + The app's display HMI is currently being obscured by either a system or other app's overlay. + + + Broadcast only to whichever app has an alert currently being displayed. + + + + + Contains information about the SoftButton capabilities. + + + + + + + Error code, which comes from the module side. + + + + + + + + + + + + + + + + + Indicates the source from where the command was triggered. + + + + + + + Contains information about the HMI zone capabilities. + For future use. + + + + + + Contains information about the TTS capabilities. + + + + + + + + + Contains information about the VR capabilities. + + + + + Contains a list of prerecorded speech items present on the platform. + + + + + + + + + Describes different sampling options for PerformAudioPassThru. + + + + + + + + Describes different quality options for PerformAudioPassThru. + + + + + + Describes different audio type options for PerformAudioPassThru. + + + + + + Describes different audio type configurations for PerformAudioPassThru. + e.g. {8kHz,8-bit,PCM} + + + + + + + + Defines the data types that can be published and subscribed to. + + Notifies GPSData may be subscribed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Defines the hard (physical) and soft (touchscreen) buttons available from the module + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + minutesFieldWidth = 2;minutesFieldMax = 19;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 19;maxMinutes = 59;maxSeconds = 59; + used for Type II and CID headunits + + + + + minutesFieldWidth = 3;minutesFieldMax = 199;secondsFieldWidth = 2;secondsFieldMax = 99;maxHours = 59;maxMinutes = 59;maxSeconds = 59; + used for Type V headunit + + + + + minutesFieldWidth = 2;minutesFieldMax = 59;secondsFieldWidth = 2;secondsFieldMax = 59;maxHours = 9;maxMinutes = 59;maxSeconds = 59; + used for GEN1.1 MFD3/4/5 headunits + + + + + 5 characters possible + Format: 1|sp c :|sp c c + 1|sp : digit "1" or space + c : character out of following character set: sp|0-9|[letters, see TypeII column in XLS. See [@TODO: create file ref]] + :|sp : colon or space + used for Type II headunit + + + + + 5 chars possible + Format: 1|sp c :|sp c c + 1|sp : digit "1" or space + c : character out of following character set: sp|0-9|[letters, see CID column in XLS. See [@TODO: create file ref]] + :|sp : colon or space + used for CID headunit + NOTE: difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character set + + + + + 6 chars possible + Format: 1|sp c c :|sp c c + 1|sp : digit "1" or space + c : character out of following character set: sp|0-9|[letters, see Type 5 column in XLS]. See [@TODO: create file ref] + :|sp : colon or space + used for Type V headunit + + + + + 6 chars possible + Format: c :|sp c c : c c + :|sp : colon or space + c : character out of following character set: sp|0-9|[letters]. + used for GEN1.1 MFD3/4/5 headunits + + + + + + See DAES for further infos regarding the displays + + + + + + + + + + + + + + + + The first line of first set of main fields of the persistent display; applies to "Show" + + + + The second line of first set of main fields of the persistent display; applies to "Show" + + + + The first line of second set of main fields of persistent display; applies to "Show" + + + + The second line of second set of main fields of the persistent display; applies to "Show" + + + + The status bar on NGN; applies to "Show" + + + + Text value for MediaClock field; applies to "Show" + + + + The track field of NGN and GEN1.1 MFD displays. This field is only available for media applications; applies to "Show" + + + + The first line of the alert text field; applies to "Alert" + + + + The second line of the alert text field; applies to "Alert" + + + + The third line of the alert text field; applies to "Alert" + + + + Long form body of text that can include newlines and tabs; applies to "ScrollableMessage" + + + + First line suggestion for a user response (in the case of VR enabled interaction) + + + + First line of navigation text + + + + Second line of navigation text + + + + Estimated Time of Arrival time for navigation + + + + Total distance to destination for navigation + + + + First line of text for audio pass thru + + + + Second line of text for audio pass thru + + + + Header text for slider + + + + Footer text for slider + + + + Primary text for Choice + + + + Secondary text for Choice + + + + Tertiary text for Choice + + + + Optional text to label an app menu button (for certain touchscreen platforms). + + + + Optional name / title of intended location for SendLocation. + + + + Optional description of intended location / establishment (if applicable) for SendLocation. + + + + Optional location address (if applicable) for SendLocation. + + + + Optional hone number of intended location / establishment (if applicable) for SendLocation. + + + + + + + The image field for SoftButton + + + + The first image field for Choice + + + + The secondary image field for Choice + + + + The image field for vrHelpItem + + + + The image field for Turn + + + + The image field for the menu icon in SetGlobalProperties + + + + The image field for AddCommand + + + + The image field for the app icon (set by setAppIcon) + + + + The image field for Show + + + + The primary image field for ShowConstantTBT + + + + The secondary image field for ShowConstantTBT + + + + The optional image of a destination / location + + + + + + The list of potential character sets + + See [@TODO: create file ref] + + + See [@TODO: create file ref] + + + See [@TODO: create file ref] + + + See [@TODO: create file ref] + + + + + The list of possible alignments, left, right, or centered + + + + + + + Enumeration that describes possible states of turn-by-turn client or AppLink app. + + + + + + + + + + + + + + Enumeration that describes possible states of driver distraction. + + + + + + Contains information about the type of image. + + + + + + The mode in which the SendLocation request is sent + + + + + + + Enum for each type of video streaming protocol type. + + Raw stream bytes that contains no timestamp data and is the lowest supported video streaming + + + RTP facilitates the transfer of real-time data. Information provided by this protocol include timestamps (for synchronization), sequence numbers (for packet loss and reordering detection) and the payload format which indicates the encoded format of the data. + + + The transmission of streaming data itself is not a task of RTSP. Most RTSP servers use the Real-time Transport Protocol (RTP) in conjunction with Real-time Control Protocol (RTCP) for media stream delivery. However, some vendors implement proprietary transport protocols. + + + Real-Time Messaging Protocol (RTMP) was initially a proprietary protocol developed by Macromedia for streaming audio, video and data over the Internet, between a Flash player and a server. Macromedia is now owned by Adobe, which has released an incomplete version of the specification of the protocol for public use. + + + The WebM container is based on a profile of Matroska. WebM initially supported VP8 video and Vorbis audio streams. In 2013 it was updated to accommodate VP9 video and Opus audio. + + + + + Enum for each type of video streaming codec. + + A block-oriented motion-compensation-based video compression standard. As of 2014 it is one of the most commonly used formats for the recording, compression, and distribution of video content. + + + High Efficiency Video Coding (HEVC), also known as H.265 and MPEG-H Part 2, is a video compression standard, one of several potential successors to the widely used AVC (H.264 or MPEG-4 Part 10). In comparison to AVC, HEVC offers about double the data compression ratio at the same level of video quality, or substantially improved video quality at the same bit rate. It supports resolutions up to 8192x4320, including 8K UHD. + + + Theora is derived from the formerly proprietary VP3 codec, released into the public domain by On2 Technologies. It is broadly comparable in design and bitrate efficiency to MPEG-4 Part 2, early versions of Windows Media Video, and RealVideo while lacking some of the features present in some of these other codecs. It is comparable in open standards philosophy to the BBC's Dirac codec. + + + VP8 can be multiplexed into the Matroska-based container format WebM along with Vorbis and Opus audio. The image format WebP is based on VP8's intra-frame coding. VP8's direct successor, VP9, and the emerging royalty-free internet video format AV1 from the Alliance for Open Media (AOMedia) are based on VP8. + + + Similar to VP8, but VP9 is customized for video resolutions beyond high-definition video (UHD) and also enables lossless compression. + + + + + + Either the static hex icon value or the binary image file name identifier (sent by PutFile). + + + Describes, whether it is a static or dynamic image. + + + + + + Describes, whether it is text, highlighted text, icon, or dynamic image. See softButtonType + + + Optional text to display (if defined as TEXT or BOTH) + + + Optional image struct for SoftButton (if defined as IMAGE or BOTH) + + + + True, if highlighted + False, if not highlighted + + + + Value which is returned via OnButtonPress / OnButtonEvent + + + Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed. + + + + + A choice is an option given to the user, which can be selected either by menu, or through voice recognition system. + + + + + + Optional secondary text to display; e.g. address of POI in a search result entry + + + Optional tertiary text to display; e.g. distance to POI for a search result entry + + + Optional secondary image struct for choice + + + + + + Text to display for VR Help item + + + Image struct for VR Help item + + + Position to display item in VR Help list + + + + + Specifies the version number of the SmartDeviceLink protocol that is supported by the mobile application + + + The major version indicates versions that is not-compatible to previous versions. + + + The minor version indicates a change to a previous version that should still allow to be run on an older version (with limited functionality) + + + The patch version indicates a fix to existing functionality in a previous version that should still be able to be run on an older version + + + + + The different global properties. + + The property helpPrompt of setGlobalProperties + + + The property timeoutPrompt of setGlobalProperties + + + The property vrHelpTitle of setGlobalProperties + + + The property array of vrHelp of setGlobalProperties + + + The property in-app menu name of setGlobalProperties + + + The property in-app menu icon of setGlobalProperties + + + The on-screen keyboard configuration of setGlobalProperties + + + + + The list of potential compass directions + + + + + + + + + + + + + + + + + + + + The supported dimensions of the GPS + + No GPS at all + + + Longitude and latitude + + + Longitude and latitude and altitude + + + + + The selected gear. + + Parking + + + Reverse gear + + + No gear + + + + + Drive Sport mode + + + 1st gear hold + + + + + + + + + + + + + + + + + + + + + + + + + The volume status of a vehicle component. + + + + + + + + + + + + + + + + + See ComponentVolumeStatus. + + + + + Reflects the status of a cluster instrument warning light. + + + + + + + + + + + + Reflects the status of a vehicle data notification. + + + + + + + + + + + + Reflects the ignition switch stability. + + + + + + + + + + Reflects the status of ignition. + + + + + + + + + + + + + + + + Reflects the status of a vehicle data event; e.g. a seat belt event status. + + + + + + + + + + + + + + Reflects the reported battery status of the connected device, if reported. + + + + + + + + + + + + + + + + Reflects the current primary audio source (if selected). + + + + + + + + + + + + + + + + + + Reflects the status of the wipers. + + + + + + + + + + + + + + + + + + + Reflects the status of a binary vehicle data item. + + + + + + + + + + Reflects the status of a vehicle maintenance mode. + + + + + + + + + + + + Reflects the status of given vehicle component. + + + + + + + + + + + + + + Reflects the status of the ambient light sensor. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + References signal "VedsDrvBelt_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsPasBelt_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw1PasBckl_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw1DrvBckl_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw2lBckl_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw1PasChld_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw2rBckl_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw2mBckl_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw3mBckl_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw3lBckl_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw3rBckl_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw2lRib_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw2rRib_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw1mBelt_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsRw1mBckl_D_Ltchd". See VehicleDataEventStatus. + + + + + + References signal "PrkBrkActv_B_Actl". + + + References signal "Ignition_Switch_Stable". See IgnitionStableStatus. + + + References signal "Ignition_status". See IgnitionStatus. + + + References signal "DrStatDrv_B_Actl". + + + References signal "DrStatPsngr_B_Actl". + + + References signal "DrStatRl_B_Actl". + + + References signal "DrStatRr_B_Actl". + + + + + + References signal "CPM_VoiceRec_STAT". + + + References signal "BT_ICON". + + + References signal "CPM_Call_Active_STAT". + + + References signal "CPM_Phone_Roaming_STAT". + + + References signal "CPM_TextMsg_AVAL". + + + Device battery level status. References signal "CPM_Batt_Level_STAT". See DeviceLevelStatus. + + + References signal "CPM_Stereo_Audio_Output". + + + References signal "CPM_Mono_Audio_Output". + + + Device signal level status. References signal "CPM_Signal_Strength_STAT". See DeviceLevelStatus. + + + References signal "CPM_Stereo_PAS_Source". See PrimaryAudioSource. + + + References signal "eCall_Event". + + + + + + Status of the low beam lamps. References signal "HeadLampLoActv_B_Stat". + + + Status of the high beam lamps. References signal "HeadLghtHiOn_B_Stat". + + + Status of the ambient light sensor. + + + + + Contains detailed information about the registered application. + + + The name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request). + + + + The AppBundleID of an iOS application or package name of the Android application. This supports App Launch strategies for each platform. + + + + Represents the build version number of this particular mobile app. + + + + A file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration). + + + + + + + + Enumeration listing possible file types. + + + + + + + + + + + + Reflects the status of the RCM fuel cutoff. + + + + + + + + + + Reflects the emergency event status of the vehicle. + + + + + + + + + + + + + + + + + + Reflects the status of the eCall Notification. + + + + + + + + + + + + + + + + + + Reflects the status of the current power mode qualification. + + + + + + + + + + + + Reflects the status of the current power mode. + + + + + + + + + + + + + + + + + + + + + + Reflects the status of the current car mode. + + + + + + + + + + + + + References signal "eCallNotification_4A". See VehicleDataNotificationStatus. + + + References signal "eCallNotification". See VehicleDataNotificationStatus. + + + References signal "eCallConfirmation". See ECallConfirmationStatus. + + + + + + References signal "VedsDrvBag_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsDrvSideBag_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsDrvCrtnBag_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsPasBag_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsPasCrtnBag_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsKneeDrvBag_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsPasSideBag_D_Ltchd". See VehicleDataEventStatus. + + + References signal "VedsKneePasBag_D_Ltchd". See VehicleDataEventStatus. + + + + + + References signal "VedsEvntType_D_Ltchd". See EmergencyEventType. + + + References signal "RCM_FuelCutoff". See FuelCutoffStatus. + + + References signal "VedsEvntRoll_D_Ltchd". See VehicleDataEventStatus. + + + + References signal "VedsMaxDeltaV_D_Ltchd". Change in velocity in KPH. Additional reserved values: + 0x00 No event + 0xFE Not supported + 0xFF Fault + + + + References signal "VedsMultiEvnt_D_Ltchd". See VehicleDataEventStatus. + + + + + + References signal "PowerMode_UB". + + + References signal "PowerModeQF". See PowerModeQualificationStatus. + + + References signal "CarMode". See CarMode. + + + References signal "PowerMode". See PowerMode. + + + + + + Indicates whether e911 override is on. References signal "MyKey_e911Override_St". See VehicleDataStatus. + + + + + + + + + Enumeration that describes possible result codes of a vehicle data entry request. + + Individual vehicle data item / DTC / DID request or subscription successful + + + DTC / DID request successful, however, not all active DTCs or full contents of DID location available + + + This vehicle data item is not allowed for this app by Ford. + + + The user has not granted access to this type of vehicle data item at this time. + + + The ECU ID referenced is not a valid ID on the bus / system. + + + The requested vehicle data item / DTC / DID is not currently available or responding on the bus / system. + + + The vehicle data item is already subscribed. + + + The vehicle data item cannot be unsubscribed because it is not currently subscribed. + + + The request for this item is ignored because it is already in progress. + + + + + The status and pressure of the tires. + + + Status of the Tire Pressure Telltale. See WarningLightStatus. + + + The status of the left front tire. + + + The status of the right front tire. + + + The status of the left rear tire. + + + The status of the right rear tire. + + + The status of the inner left rear. + + + The status of the inner right rear. + + + + + Struct with the GPS data. + + + + + + The current UTC year. + + + The current UTC month. + + + The current UTC day. + + + The current UTC hour. + + + The current UTC minute. + + + The current UTC second. + + + See CompassDirection. + + + PDOP. If undefined or unavailable, then value shall be set to 0. + + + HDOP. If value is unknown, value shall be set to 0. + + + VDOP. If value is unknown, value shall be set to 0. + + + + True, if actual. + False, if inferred. + + + + Number of satellites in view + + + See Dimension + + + Altitude in meters + + + The heading. North is 0. Resolution is 0.01 + + + The speed in KPH + + + + + Individual published data request result + + Defined published data element type. + + + Published data result code. + + + + + Individual requested DID result and data + + Individual DID result code. + + + Location of raw data from vehicle data DID + + + Raw DID-based data returned for requested element. + + + + + + + The hour of the media clock. + Some radios only support a max of 19 hours. If out of range, it will be rejected. + + + + + + + + + The name that identifies the field. See TextFieldName. + + + The character set that is supported in this field. See CharacterSet. + + + The number of characters in one row of this field. + + + The number of rows of this field. + + + + + + The image resolution width. + + + The image resolution height. + + + + + + The name that identifies the field. See ImageFieldName. + + + The image types that are supported in this field. See FileType. + + + The image resolution of this field. + + + + + + The x coordinate of the touch. + + + The y coordinate of the touch. + + + + + + + + + + + + + + A touch's unique identifier. The application can track the current touch events by id. + If a touch event has type begin, the id should be added to the set of touches. + If a touch event has type end, the id should be removed from the set of touches. + + + + + The time that the touch was recorded. This number can the time since the beginning of the session or something else as long as the units are in milliseconds. + The timestamp is used to determined the rate of change of position of a touch. + The application also uses the time to verify whether two touches, with different ids, are part of a single action by the user. + If there is only a single timestamp in this array, it is the same for every coordinate in the coordinates array. + + + + + + + + + + + + + + + + + + The resolution of the prescribed screen area. + + + Types of screen touch events available in screen area. + + + + + Enumeration that describes possible permission states of a policy table entry. + + + + + + + + + A set of all HMI levels that are permitted for this given RPC. + + + A set of all HMI levels that are prohibited for this given RPC. + + + + + + A set of all parameters that are permitted for this given RPC. + + + A set of all parameters that are prohibited for this given RPC. + + + + + + Name of the individual RPC in the policy table. + + + + + + + Contains information about the display capabilities. + + The type of the display. See DisplayType + + + A set of all fields that support text data. See TextField + + + A set of all fields that support images. See ImageField + + + A set of all supported formats of the media clock. See MediaClockFormat + + + The display's persistent screen supports referencing a static or dynamic image. + + + A set of all predefined persistent display templates available on headunit. To be referenced in SetDisplayLayout. + + + A set of all parameters related to a prescribed screen area (e.g. for video / touch input). + + + The number of on-screen custom presets available (if any); otherwise omitted. + + + + + + Contains information about a button's capabilities. + + The name of the button. See ButtonName. + + + + The button supports a short press. + Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked. + + + + + The button supports a LONG press. + Whenever the button is pressed long, onButtonPressed( LONG) will be invoked. + + + + + The button supports "button down" and "button up". + Whenever the button is pressed, onButtonEvent( DOWN) will be invoked. + Whenever the button is released, onButtonEvent( UP) will be invoked. + + + + + Contains information about a SoftButton's capabilities. + + + The button supports a short press. + Whenever the button is pressed short, onButtonPressed( SHORT) will be invoked. + + + + + The button supports a LONG press. + Whenever the button is pressed long, onButtonPressed( LONG) will be invoked. + + + + + The button supports "button down" and "button up". + Whenever the button is pressed, onButtonEvent( DOWN) will be invoked. + Whenever the button is released, onButtonEvent( UP) will be invoked. + + + + The button supports referencing a static or dynamic image. + + + + Contains information about on-screen preset capabilities. + + Onscreen custom presets are available. + + + + + Availability of build in Nav. True: Available, False: Not Available + + + Availability of build in phone. True: Available, False: Not Available + + + Availability of video streaming. + + + + + + unique ID of the sub menu, the command will be added to. + If not provided, it will be provided to the top level of the in application menu. + + + + + Position within the items that are are at top level of the in application menu. + 0 will insert at the front. + 1 will insert at the second position. + if position is greater or equal than the number of items on top level, the sub menu will be appended to the end. + If this param was omitted the entry will be added at the end. + + + + Text to show in the menu for this sub menu. + + + + A TTS chunk, that consists of the text/phonemes to speak and the type (like text or SAPI) + + + The text or phonemes to speak. + May not be empty. + + + + Describes, whether it is text or a specific phoneme set. See SpeechCapabilities + + + + + Individual turn text. Must provide at least text or icon for a given turn. + + + Individual turn icon. Must provide at least text or icon for a given turn. + + + + + Make of the vehicle, e.g. Ford + + + Model of the vehicle, e.g. Fiesta + + + Model Year of the vehicle, e.g. 2013 + + + Trim of the vehicle, e.g. SE + + + + Enumeration listing possible keyboard layouts. + + + + + + Enumeration listing possible keyboard events. + + + + + + + + Enumeration listing possible keyboard events. + + Each keypress is individually sent as the user presses the keyboard keys. + + + The keypresses are queued and a string is eventually sent once the user chooses to submit their entry. + + + The keypresses are queue and a string is sent each time the user presses a keyboard key; the string contains the entire current entry. + + + + Configuration of on-screen keyboard (if available). + + The keyboard language. + + + Desired keyboard layout. + + + + Desired keypress mode. + If omitted, this value will be set to RESEND_CURRENT_ENTRY. + + + + Array of keyboard characters to enable. + All omitted characters will be greyed out (disabled) on the keyboard. + If omitted, the entire keyboard will be enabled. + + + Allows an app to prepopulate the text field with a suggested or completed entry as the user types + + + + Various information about connecting device. + + Device model + + + Device firmware revision + + + Device OS + + + Device OS version + + + Device mobile carrier (if applicable) + + + Omitted if connected not via BT. + + + + Enumeration listing possible asynchronous requests. + + + + + + + + + + + + + + + + + + + + + + + Enumeration listing possible app types. + + + + + + + + + + + + + + + Predefined screen layout. + + + Default media / non-media screen. + Can be set as a root screen. + + + + + Default Media screen. + Can be set as a root screen. + + + + + Default Non-media screen. + Can be set as a root screen. + + + + + Custom root media screen containing app-defined onscreen presets. + Can be set as a root screen. + + + + + Custom root template screen containing full screen map with navigation controls. + Can be set as a root screen. + + + + + Custom root template screen containing video represented list. + Can be set as a root screen. + + + + + Custom root template screen containing video represented keyboard. + Can be set as a root screen. + + + + + Custom root template screen containing half-screen graphic with lines of text. + Can be set as a root screen. + + + + + Custom root template screen containing lines of text with half-screen graphic. + Can be set as a root screen. + + + + + Custom root template screen containing only tiled SoftButtons. + Can be set as a root screen. + + + + + Custom root template screen containing only text SoftButtons. + Can be set as a root screen. + + + + + Custom root template screen containing half-screen graphic with tiled SoftButtons. + Can be set as a root screen. + + + + + Custom root template screen containing tiled SoftButtons with half-screen graphic. + Can be set as a root screen. + + + + + Custom root template screen containing half-screen graphic with text and SoftButtons. + Can be set as a root screen. + + + + + Custom root template screen containing text and SoftButtons with half-screen graphic. + Can be set as a root screen. + + + + + Custom root template screen containing half-screen graphic with text only SoftButtons. + Can be set as a root screen. + + + + + Custom root template screen containing text only SoftButtons with half-screen graphic. + Can be set as a root screen. + + + + + Custom root template screen containing a large graphic and SoftButtons. + Can be set as a root screen. + + + + + Custom root template screen containing two graphics and SoftButtons. + Can be set as a root screen. + + + + + Custom root template screen containing only a large graphic. + Can be set as a root screen. + + + + + Enumeration linking function names with function IDs in AppLink protocol. Assumes enumeration starts at value 0. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enumeration linking message types with function types in WiPro protocol. + Assumes enumeration starts at value 0. + + + + + + + + + Milliseconds + + + Seconds part of time + + + Minutes part of time + + + Hours part of time. Note that this structure accepts time only in 24 Hr format + + + Day of the month + + + Month of the year + + + The year in YYYY format + + + Time zone offset in Hours wrt UTC. + + + Time zone offset in Min wrt UTC. + + + + + Describes what kind of waypoint is requested/provided. + + + + + + + Latitude of the location. + + + Longitude of the location. + + + + + + Name of the country (localized) + + + Name of country (ISO 3166-2) + + + (PLZ, ZIP, PIN, CAP etc.) + + + Portion of country (e.g. state) + + + Portion of e.g. state (e.g. county) + + + Hypernym for e.g. city/village + + + Hypernym for e.g. district + + + Hypernym for street, road etc. + + + Portion of thoroughfare e.g. house number + + + + + + Latitude/Longitude of the location. + + + Name of location. + + + Location address for display purposes only + + + Description intended location / establishment (if applicable) + + + Phone number of location / establishment. + + + Image / icon of intended location. + + + Address to be used by navigation engines for search + + + + + Enumerations of all available system capability types + + + + + + + + Extended capabilities for an onboard navigation system + + If the module has the ability to add locations to the onboard nav + + + If the module has the ability to return way points from onboard nav + + + + + Extended capabilities of the module's phone feature + + If the module has the ability to perform dial number + + + + + Video streaming formats and their specifications. + + Protocol type, see VideoStreamingProtocol + + + Codec type, see VideoStreamingCodec + + + + + Contains information about this system's video streaming capabilities. + + The preferred resolution of a video stream for decoding and rendering on HMI. + + + The maximum bitrate of video stream that is supported, in kbps. + + + Detailed information on each format supported by this system, in its preferred order (i.e. the first element in the array is most preferable to the system). Each object will contain a VideoStreamingFormat that describes what can be expected. + + + True if the system can utilize the haptic spatial data from the source being streamed. If not included, it can be assumed the module doesn't support haptic spatial data'. + + + + + + + + Temperature Unit + + + Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL. + + + + + + Program Service Name + + + Radio Text + + + The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD + + + Program Identification - the call sign for the radio station + + + The program type - The region should be used to differentiate between EU and North America program types + + + Traffic Program Identification - Identifies a station that offers traffic + + + Traffic Announcement Identification - Indicates an ongoing traffic announcement + + + Region + + + + + + The integer part of the frequency ie for 101.7 this value should be 101 + + + The fractional part of the frequency for 101.7 is 7 + + + + + + + number of HD sub-channels if available + + + Current HD sub-channel if available + + + + + If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency + + + True if the radio is on, false is the radio is off + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the moduleType is CLIMATE then a "climateControlData" should exist + + + + + + + + + + Contains information about a radio control module's capabilities. + + + + The short friendly name of the climate control module. + It should not be used to identify a module by mobile application. + + + + + Availability of the control of enable/disable radio. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of radio band. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of radio frequency. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of HD radio channel. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting Radio Data System (RDS) data. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the number of available HD channels. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the Radio state. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the signal strength. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the getting the signal Change Threshold. + True: Available, False: Not Available, Not present: Not Available. + + + + + + Contains information about a climate control module's capabilities. + + + The short friendly name of the climate control module. + It should not be used to identify a module by mobile application. + + + + Availability of the control of fan speed. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of desired temperature. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of turn on/off AC. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable air conditioning is ON on the maximum level. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable circulate Air mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable auto mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of enable/disable dual mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + Availability of the control of defrost zones. + True: Available, False: Not Available, Not present: Not Available. + + + + + A set of all defrost zones that are controllable. + + + + + Availability of the control of air ventilation mode. + True: Available, False: Not Available, Not present: Not Available. + + + + + A set of all ventilation modes that are controllable. + + + + + + + If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported. + + + If included, the platform supports RC radio controls.For this baseline version, maxsize=1. i.e. only one radio control module is supported. + + + If included, the platform supports RC button controls with the included button names. + + + + + + The systemCapabilityType indicates which type of data should be changed and identifies which data object exists in this struct. For example, if the SystemCapability Type is NAVIGATION then a "navigationCapability" should exist + + Used as a descriptor of what data to expect in this struct. The corresponding param to this enum should be included and the only other para included. + + + Describes extended capabilities for onboard navigation system + + + Describes extended capabilities of the module's phone feature + + + Describes extended capabilities of the module's phone feature + + + Describes extended capabilities of the module's phone feature + + + + + + The data in this field contains the title of the currently playing audio track. + + + The data in this field contains the artist or creator of the currently playing audio track. + + + The data in this field contains the album title of the currently playing audio track. + + + The data in this field contains the creation year of the currently playing audio track. + + + The data in this field contains the genre of the currently playing audio track. + + + The data in this field contains the name of the current source for the media. + + + The data in this field is a rating. + + + The data in this field is the current temperature. + + + The data in this field is the maximum temperature for the day. + + + The data in this field is the minimum temperature for the day. + + + The data in this field describes the current weather (ex. cloudy, clear, etc.). + + + The data in this field describes the current humidity value. + + + + + + The type of data contained in the "mainField1" text field. + + + The type of data contained in the "mainField2" text field. + + + The type of data contained in the "mainField3" text field. + + + The type of data contained in the "mainField4" text field. + + + + + + The upper left X-coordinate of the rectangle + + + The upper left Y-coordinate of the rectangle + + + The width of the rectangle + + + The height of the rectangle + + + + + Defines haptic data for each user control object for video streaming application + + A user control spatial identifier + + + The position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs. + + + + + + + + Establishes an interface with a mobile application. + Before registerAppInterface no other commands will be accepted/executed. + + + + See SyncMsgVersion + + + + + The mobile application name, e.g. "Ford Drive Green". + Needs to be unique over all applications. + May not be empty. + May not start with a new line character. + May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands) + Needs to be unique over all applications. Applications with the same name will be rejected. + Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported. + + + + + + TTS string for VR recognition of the mobile application name, e.g. "Ford Drive Green". + Meant to overcome any failing on speech engine in properly pronouncing / understanding app name. + Needs to be unique over all applications. + May not be empty. + May not start with a new line character. + Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported. + + + + + + Provides an abbreviated version of the app name (if needed), that will be displayed on the NGN media screen. + If not provided, the appName is used instead (and will be truncated if too long) + Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported. + + + + + + Defines an additional voice recognition command. + May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands) + Only characters from char set [@TODO: Create char set (character/hex value) for each ACM and refer to] are supported. + + + + + + Indicates if the application is a media or a non-media application. + Only media applications will be able to stream audio to the module that is audible outside of the BT media source. + + + + + See Language + Current app's expected VR+TTS language + If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus. + + + + + See Language + Current app's expected display language + If there is a mismatch with the module, the app will be able to change this registration with changeRegistration prior to app being brought into focus. + + + + + + See AppHMIType + List of all applicable app HMI types stating which HMI classifications to be given to the app. + + + + + + ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles). + This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece. + If omitted, then the previous state of an app's commands, etc. will not be restored. + When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.). + + + + + See DeviceInfo. + + + + ID used to validate app with policy table entries + + + + See AppInfo. + + + + + + The response to registerAppInterface + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + See SyncMsgVersion + + + + The currently active VR+TTS language on the module. See "Language" for options. + + + + The currently active display language on the module. See "Language" for options. + + + + See DisplayCapabilities + + + + See ButtonCapabilities + + + + If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities. + + + + If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities. + + + See HmiZoneCapabilities + + + See SpeechCapabilities + + + + See PrerecordedSpeech + + + + See VrCapabilities + + + + See AudioPassThruCapability + + + + See AudioPassThruCapability + + + + Specifies the vehicle's type. See VehicleType. + + + + + Specifies the white-list of supported diagnostic modes (0x00-0xFF) capable for DiagnosticMessage requests. + If a mode outside this list is requested, it will be rejected. + + + + + Specifies the HMI’s capabilities. See HMICapabilities. + + + + The SmartDeviceLink version. + + + + The software version of the system that implements the SmartDeviceLink core. + + + + + + Closes an interface from a mobile application. + After unregisterAppInterface, no commands other than registerAppInterface will be accepted/executed. + Will fail, if no registerAppInterface was completed successfully before. + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Allows setting global properties. + + + + The help prompt. + An array of text chunks of type TTSChunk. See TTSChunk. + The array must have at least one item. + + + + + + Help text for a wait timeout. + An array of text chunks of type TTSChunk. See TTSChunk. + The array must have at least one item. + + + + + + VR Help Title text. + If omitted on supported displays, the default module help title shall be used. + If omitted and one or more vrHelp items are provided, the request will be rejected. + + + + + + VR Help Items. + If omitted on supported displays, the default AppLink VR help / What Can I Say? screen shall be used. + If the list of VR Help Items contains nonsequential positions (e.g. [1,2,4]), the RPC shall be rejected. + If omitted and a vrHelpTitle is provided, the request will be rejected. + + + + Optional text to label an app menu button (for certain touchscreen platforms). + + + + >Optional icon to draw on an app menu button (for certain touchscreen platforms). + + + + On-screen keyboard configuration (if available). + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Allows resetting global properties. + + + Contains the names of all global properties (like timeoutPrompt) that should be unset. Resetting means, that they have the same value as at start up (default) + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Adds a command to the in application menu. + Either menuParams or vrCommands must be provided. + + + + unique ID of the command to add. + + + + Optional sub value containing menu parameters + + + + + An array of strings to be used as VR synonyms for this command. + If this array is provided, it may not be empty. + + + + + + Image struct determining whether static or dynamic icon. + If omitted on supported displays, no (or the default if applicable) icon shall be displayed. + + + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Deletes all commands from the in-application menu with the specified command id. + + + ID of the command(s) to delete. + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Adds a sub menu to the in-application menu. + + + unique ID of the sub menu to add. + + + + + Position within the items that are are at top level of the in application menu. + 0 will insert at the front. + 1 will insert at the second position. + If position is greater or equal than the number of items on top level, the sub menu will be appended to the end. + Position of any submenu will always be located before the return and exit options + If this param was omitted the entry will be added at the end. + + + + + Text to show in the menu for this sub menu. + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Deletes a submenu from the in-application menu. + + + The "menuID" of the submenu to delete. (See addSubMenu.menuID) + + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + creates interaction choice set to be used later by performInteraction + + + Unique ID used for this interaction choice set. + + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Triggers an interaction (e.g. "Permit GPS?" - Yes, no, Always Allow). + + + + Text to be displayed first. + + + + + + This is the initial prompt spoken to the user at the start of an interaction. + An array of text chunks of type TTSChunk. See TTSChunk. + The array must have at least one item. + + + + + See InteractionMode. + + + + List of interaction choice set IDs to use with an interaction. + + + + + Help text. This is the spoken string when a user speaks "help" when the interaction is occurring. + An array of text chunks of type TTSChunk. See TTSChunk. + The array must have at least one item. + + + + + + Timeout text. This text is spoken when a VR interaction times out. + An array of text chunks of type TTSChunk. See TTSChunk. + The array must have at least one item. + + + + + + Timeout in milliseconds. + If omitted a standard value of 10000 milliseconds is used. + Applies only to the menu portion of the interaction. The VR timeout will be handled by the platform. + + + + + + Ability to send suggested VR Help Items to display on-screen during Perform Interaction. + If omitted on supported displays, the default generated list of suggested choices shall be displayed. + + + + + See LayoutMode. + + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + ID of the choice that was selected in response to PerformInteraction. + Only is valid if general result is "success:true". + + + + + + Manually entered text selection, e.g. through keyboard + Can be returned in lieu of choiceID, depending on trigger source + + + + + + See TriggerSource + Only is valid if resultCode is SUCCESS. + + + + + + + Deletes interaction choice set that has been created with "CreateInteractionChoiceSet". + The interaction may only be deleted when not currently in use by a "performInteraction". + + + ID of the interaction choice set to delete. + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Shows an alert which typically consists of text-to-speech message and text on the display. At least either alertText1, alertText2 or TTSChunks need to be provided. + + + The first line of the alert text field + + + + The second line of the alert text field + + + + The optional third line of the alert text field + + + + + An array of text chunks of type TTSChunk. See TTSChunk. + The array must have at least one item. + + + + + + Timeout in milliseconds. + Typical timeouts are 3-5 seconds. + If omitted, timeout is set to 5s. + + + + + + Defines if tone should be played. Tone is played before TTS. + If omitted, no tone is played. + + + + + + If supported on the given platform, the alert GUI will include some sort of animation indicating that loading of a feature is progressing. e.g. a spinning wheel or hourglass, etc. + + + + + + App defined SoftButtons. + If omitted on supported displays, the displayed alert shall not have any SoftButtons. + + + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Amount of time (in seconds) that an app must wait before resending an alert. + If provided, another system event or overlay currently has a higher priority than this alert. + An app must not send an alert without waiting at least the amount of time dictated. + + + + + + + Updates the persistent display. Supported fields depend on display capabilities. + + + + The text that should be displayed in a single or upper display line. + If this text is not set, the text of mainField1 stays unchanged. + If this text is empty "", the field will be cleared. + + + + + + The text that should be displayed on the second display line. + If this text is not set, the text of mainField2 stays unchanged. + If this text is empty "", the field will be cleared. + + + + + + The text that should be displayed on the second "page" first display line. + If this text is not set, the text of mainField3 stays unchanged. + If this text is empty "", the field will be cleared. + + + + + + The text that should be displayed on the second "page" second display line. + If this text is not set, the text of mainField4 stays unchanged. + If this text is empty "", the field will be cleared. + + + + + + Specifies how mainField1 and mainField2 texts should be aligned on display. + If omitted, texts will be centered. + + + + + Requires investigation regarding the nav display capabilities. Potentially lower lowerStatusBar, upperStatusBar, titleBar, etc. + + + + + Text value for MediaClock field. Has to be properly formatted by Mobile App according to the module's capabilities. + If this text is set, any automatic media clock updates previously set with SetMediaClockTimer will be stopped. + + + + + + The text that should be displayed in the track field. + If this text is not set, the text of mediaTrack stays unchanged. + If this text is empty "", the field will be cleared. + + + + + + Image struct determining whether static or dynamic image to display in app. + If omitted on supported displays, the displayed graphic shall not change. + + + + + + Image struct determining whether static or dynamic secondary image to display in app. + If omitted on supported displays, the displayed secondary graphic shall not change. + + + + + + + App defined SoftButtons. + If omitted on supported displays, the currently displayed SoftButton values will not change. + + + + + + App labeled on-screen presets (i.e. on-screen media presets or dynamic search suggestions). + If omitted on supported displays, the presets will be shown as not defined. + + + + + App defined metadata information. See MetadataStruct. Uses mainField1, mainField2, mainField3, mainField4. + If omitted on supported displays, the currently set metadata tags will not change. + If any text field contains no tags or the none tag, the metadata tag for that textfield should be removed. + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Speaks a text. + + + + An array of text chunks of type TTSChunk. See TTSChunk. + The array must have at least one item. + + + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Sets the initial media clock value and automatic update method. + + + + See StartTime. + startTime must be provided for "COUNTUP" and "COUNTDOWN". + startTime will be ignored for "RESUME", and "CLEAR" + startTime can be sent for "PAUSE", in which case it will update the paused startTime + + + + + + See StartTime. + endTime can be provided for "COUNTUP" and "COUNTDOWN"; to be used to calculate any visual progress bar (if not provided, this feature is ignored) + If endTime is greater then startTime for COUNTDOWN or less than startTime for COUNTUP, then the request will return an INVALID_DATA. + endTime will be ignored for "RESUME", and "CLEAR" + endTime can be sent for "PAUSE", in which case it will update the paused endTime + + + + + + Enumeration to control the media clock. + In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused. + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Starts audio pass thru session + + + The module will speak this prompt before opening the audio pass thru session. + An array of text chunks of type TTSChunk. See TTSChunk. + The array must have at least one item. + If omitted, then no initial prompt is spoken. + + + + First line of text displayed during audio capture. + + + Second line of text displayed during audio capture. + + + This value shall be allowed at 8 kHz or 16 or 22 or 44 kHz. + + + The maximum duration of audio recording in milliseconds. + + + Specifies the quality the audio is recorded. Currently 8 bit or 16 bit. + + + Specifies the type of audio data being requested. + + + + Defines if the current audio source should be muted during the APT session. If not, the audio source will play without interruption. + If omitted, the value is set to true. + + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + When this request is invoked, the audio capture stops. + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Subscribes to built-in HMI buttons. + The application will be notified by the OnButtonEvent and OnButtonPress. + To unsubscribe the notifications, use unsubscribeButton. + + + + Name of the button to subscribe. + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Unsubscribes from built-in HMI buttons. + + + Name of the button to unsubscribe. + + + + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Subscribes for specific published data items. + The data will be only sent if it has changed. + The application will be notified by the onVehicleData notification whenever new data is available. + To unsubscribe the notifications, use unsubscribe with the same subscriptionType. + + + + See GPSData + + + The vehicle speed in kilometers per hour + + + The number of revolutions per minute of the engine + + + The fuel level in the tank (percentage) + + + The fuel level state + + + The instantaneous fuel consumption in microlitres + + + The external temperature in degrees celsius + + + See PRNDL + + + See TireStatus + + + Odometer in km + + + The status of the seat belts + + + The body information including power modes + + + The device status including signal and battery strength + + + The status of the brake pedal + + + The status of the wipers + + + Status of the head lamps + + + Torque value for engine (in Nm) on non-diesel variants + + + Accelerator pedal position (percentage depressed) + + + Current angle of the steering wheel (in deg) + + + + + Emergency Call notification and confirmation data + + + The status of the air bags + + + Information related to an emergency event (and if it occurred) + + + The status modes of the cluster + + + Information related to the MyKey feature + + + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + See GPSData + + + The vehicle speed in kilometers per hour + + + The number of revolutions per minute of the engine + + + The fuel level in the tank (percentage) + + + The fuel level state + + + The instantaneous fuel consumption in microlitres + + + The external temperature in degrees celsius. + + + See PRNDL + + + See TireStatus + + + Odometer in km + + + The status of the seat belts + + + The body information including power modes + + + The device status including signal and battery strength + + + The status of the brake pedal + + + The status of the wipers + + + Status of the head lamps + + + Torque value for engine (in Nm) on non-diesel variants + + + Accelerator pedal position (percentage depressed) + + + Current angle of the steering wheel (in deg) + + + + + Emergency Call notification and confirmation data + + + The status of the air bags + + + Information related to an emergency event (and if it occurred) + + + The status modes of the cluster + + + Information related to the MyKey feature + + + + + + + This function is used to unsubscribe the notifications from the subscribeVehicleData function. + + + See GPSData + + + The vehicle speed in kilometers per hour + + + The number of revolutions per minute of the engine + + + The fuel level in the tank (percentage) + + + The fuel level state + + + The instantaneous fuel consumption in microlitres + + + The external temperature in degrees celsius. + + + See PRNDL + + + See TireStatus + + + Odometer in km + + + The status of the seat belts + + + The body information including power modes + + + The device status including signal and battery strength + + + The status of the brake pedal + + + The status of the wipers + + + Status of the head lamps + + + Torque value for engine (in Nm) on non-diesel variants + + + Accelerator pedal position (percentage depressed) + + + Current angle of the steering wheel (in deg) + + + + + Emergency Call notification and confirmation data + + + The status of the air bags + + + Information related to an emergency event (and if it occurred) + + + The status modes of the cluster + + + Information related to the MyKey feature + + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + See GPSData + + + The vehicle speed in kilometers per hour + + + The number of revolutions per minute of the engine + + + The fuel level in the tank (percentage) + + + The fuel level state + + + The instantaneous fuel consumption in microlitres + + + The external temperature in degrees celsius + + + See PRNDL + + + See TireStatus + + + Odometer in km + + + The status of the seat belts + + + The body information including power modes + + + The device status including signal and battery strength + + + The status of the brake pedal + + + The status of the wipers + + + Status of the head lamps + + + Torque value for engine (in Nm) on non-diesel variants + + + Accelerator pedal position (percentage depressed) + + + Current angle of the steering wheel (in deg) + + + + + Emergency Call notification and confirmation data + + + The status of the air bags + + + Information related to an emergency event (and if it occurred) + + + The status modes of the cluster + + + Information related to the MyKey feature + + + + + + + Non periodic vehicle data read request. + + + See GPSData + + + The vehicle speed in kilometers per hour + + + The number of revolutions per minute of the engine + + + The fuel level in the tank (percentage) + + + The fuel level state + + + The instantaneous fuel consumption in microlitres + + + The external temperature in degrees celsius + + + Vehicle identification number + + + See PRNDL + + + See TireStatus + + + Odometer in km + + + The status of the seat belts + + + The body information including ignition status and internal temp + + + The device status including signal and battery strength + + + The status of the brake pedal + + + The status of the wipers + + + Status of the head lamps + + + Torque value for engine (in Nm) on non-diesel variants + + + Accelerator pedal position (percentage depressed) + + + Current angle of the steering wheel (in deg) + + + + + Emergency Call notification and confirmation data + + + The status of the air bags + + + Information related to an emergency event (and if it occurred) + + + The status modes of the cluster + + + Information related to the MyKey feature + + + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + See GPSData + + + The vehicle speed in kilometers per hour + + + The number of revolutions per minute of the engine + + + The fuel level in the tank (percentage) + + + The fuel level state + + + The instantaneous fuel consumption in microlitres + + + The external temperature in degrees celsius + + + Vehicle identification number + + + See PRNDL + + + See TireStatus + + + Odometer in km + + + The status of the seat belts + + + The body information including power modes + + + The device status including signal and battery strength + + + The status of the brake pedal + + + The status of the wipers + + + Status of the head lamps + + + Torque value for engine (in Nm) on non-diesel variants + + + Accelerator pedal position (percentage depressed) + + + Current angle of the steering wheel (in deg) + + + + + Emergency Call notification and confirmation data + + + The status of the air bags + + + Information related to an emergency event (and if it occurred) + + + The status modes of the cluster + + + Information related to the MyKey feature + + + + + + + Non periodic vehicle data read request + + + Name of ECU. + + + Get raw data from vehicle data DID location(s) + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + Array of requested DID results (with data if available). + + + + + + Vehicle module diagnostic trouble code request. + + + Name of ECU. + + + + DTC Mask Byte to be sent in diagnostic request to module . + + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + 2 byte ECU Header for DTC response (as defined in VHR_Layout_Specification_DTCs.pdf) + + + + + Array of all reported DTCs on module (ecuHeader contains information if list is truncated). + Each DTC is represented by 4 bytes (3 bytes of data and 1 byte status as defined in VHR_Layout_Specification_DTCs.pdf). + + + + + + + Non periodic vehicle diagnostic request + + + Name of target ECU. + + + + Length of message (in bytes). + + + + + Array of bytes comprising CAN message. + + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Array of bytes comprising CAN message result. + + + + + + + Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined + + Body of text that can include newlines and tabs. + + + App defined timeout. Indicates how long of a timeout from the last action (i.e. scrolling message resets timeout). + + + + App defined SoftButtons. + If omitted on supported displays, only the system defined "Close" SoftButton will be displayed. + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider. + + Number of selectable items on a horizontal axis + + + Initial position of slider control (cannot exceed numTicks) + + + Text header to display + + + + Text footer to display (meant to display min/max threshold descriptors). + For a static text footer, only one footer string shall be provided in the array. + For a dynamic text footer, the number of footer text string in the array must match the numTicks value. + For a dynamic text footer, text array string should correlate with potential slider position index. + If omitted on supported displays, no footer text shall be displayed. + + + + + App defined timeout. Indicates how long of a timeout from the last action (i.e. sliding control resets timeout). + If omitted, the value is set to 10000. + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Current slider value returned when saved or canceled (aborted) + This value is only returned for resultCodes "SAVED" or "ABORTED" + + + + + + + + + + + + + + + + + + + + + + Fraction of distance till next maneuver (starting from when AlertManeuver is triggered). + Used to calculate progress bar. + + + + + Distance till next maneuver (starting from) from previous maneuver. + Used to calculate progress bar. + + + + + If and when a maneuver has completed while an AlertManeuver is active, the app must send this value set to TRUE in order to clear the AlertManeuver overlay. + If omitted the value will be assumed as FALSE. + + + + + Three dynamic SoftButtons available (first SoftButton is fixed to "Turns"). + If omitted on supported displays, the currently displayed SoftButton values will not change. + + + + + + + true, if successful; false, if failed + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + An array of text chunks of type TTSChunk. See TTSChunk + + + If omitted on supported displays, only the system defined "Close" SoftButton shall be displayed. + + + + + + true, if successful; false, if failed + + + See Result + + + + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + + + If omitted on supported displays, app-defined SoftButton will be left blank. + + + + + + true, if successful; false, if failed + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + Requested voice engine (VR+TTS) language registration + + + Request display language registration + + + Request new app name registration + + + Request new ttsName registration + + + Request new app short name registration + + + Request new VR synonyms registration + + + + + + + + + + + true, if successful + false, if failed + + + + + See Result + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + + Generic Response is sent, when the name of a received msg cannot be retrieved. Only used in case of an error. + Currently, only resultCode INVALID_DATA is used. + + + true, if successful; false, if failed + + + + See Result + + + + + Provides additional human readable info regarding the result. + + + + + + Used to push a binary data onto the module from a mobile device, such as icons and album art + Not supported on first generation of SDL enabled modules. + Binary data is in binary part of hybrid msg. + + + + File reference name. + + + + Selected file type. + + + + + Indicates if the file is meant to persist between sessions / ignition cycles. + If set to TRUE, then the system will aim to persist this file through session / cycles. + While files with this designation will have priority over others, they are subject to deletion by the system at any time. + In the event of automatic deletion by the system, the app will receive a rejection and have to resend the file. + If omitted, the value will be set to false. + + + + + + Indicates if the file is meant to be passed thru core to elsewhere on the system. + If set to TRUE, then the system will instead pass the data thru as it arrives to a predetermined area outside of core. + If omitted, the value will be set to false. + + + + + Optional offset in bytes for resuming partial data chunks + + + + Optional length in bytes for resuming partial data chunks + If offset is set to 0, then length is the total length of the file to be downloaded + + + + + + Response is sent, when the file data was copied (success case). Or when an error occurred. + Not supported on first generation SDL enabled vehicles. + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + Provides the total local space available in SDL Core for the registered app. + If the transfer has systemFile enabled, then the value will be set to 0 automatically. + + + + + Provides additional human readable info regarding the result. + + + + + + Used to delete a file resident on the module in the app's local cache. + Not supported on first generation SDL enabled vehicles. + + + + File reference name. + + + + + + + Response is sent, when the file data was deleted (success case). Or when an error occurred. + Not supported on First generation SDL enabled vehicles. + + + true if successful; false, if failed + + + + See Result + + + + + + + + + + + + Provides the total local space available on the module for the registered app. + + + + Provides additional human readable info regarding the result. + + + + + + Requests the current list of resident filenames for the registered app. + Not supported on first generation SDL enabled vehicles. + + + + + + Returns the current list of resident filenames for the registered app along with the current space available + Not supported on First generation SDL enabled vehicles. + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + An array of all filenames resident on the module for the given registered app. + If omitted, then no files currently reside on the system. + + + + + Provides the total local space available on the module for the registered app. + + + + Provides additional human readable info regarding the result. + + + + + + Used to set existing local file on the module as the app's icon + Not supported on first generation SDL enabled vehicles. + + + + File reference name. + + + + + + + Response is sent, when the file data was copied (success case). Or when an error occurred. + Not supported on First generation SDL enabled vehicles. + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + + Used to set an alternate display layout. + If not sent, default screen for given platform will be shown + + + + + Predefined or dynamically created screen layout. + Currently only predefined screen layouts are defined. + + + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + See DisplayCapabilities + + + + See ButtonCapabilities + + + + If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities. + + + + If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities. + + + + Provides additional human readable info regarding the result. + + + + + + An asynchronous request from the device; binary data can be included in hybrid part of message for some requests (such as HTTP, Proprietary, or Authentication requests) + + + The type of system request. + Note that Proprietary requests should forward the binary data to the known proprietary module on the system. + + + + + Filename of HTTP data to store in predefined system staging area. + Mandatory if requestType is HTTP. + PROPRIETARY requestType should ignore this parameter. + + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + + + + + + + + + + + + + + + Name / title of intended location + + + + + Description intended location / establishment (if applicable) + + + + + Location address (if applicable) + + + + + Phone number of intended location / establishment (if applicable) + + + + + Image / icon of intended location (if applicable and supported) + + + + + + timestamp in ISO 8601 format + + + + + Address to be used for setting destination + + + Defines the mode of prompt for user + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Dials a phone number and switches to phone application. + + + + Phone number is a string, which can be up to 40 chars. + All characters shall be stripped from string except digits 0-9 and * # , ; + + + + + + + + true, if successful + false, if failed + + + + See Result + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + The module where the button should be pressed + + + The name of supported RC climate or radio button. + + + Indicates whether this is a LONG or SHORT button press event. + + + + + + See Result + + + + + + + + + + + + + + + true if successful; false, if failed + + + + + + + The type of a RC module to retrieve module data from the vehicle. + In the future, this should be the Identification of a module. + + + + + If subscribe is true, the head unit will register onInteriorVehicleData notifications for the requested moduelType. + If subscribe is false, the head unit will unregister onInteriorVehicleData notifications for the requested moduelType. + + + + + + + + + See Result + + + + + + + + + + + + + + + + true if successful; false, if failed + + + + It is a conditional-mandatory parameter: must be returned in case "subscribe" parameter was present in the related request. + if "true" - the "moduleType" from request is successfully subscribed and the head unit will send onInteriorVehicleData notifications for the moduleType. + if "false" - the "moduleType" from request is either unsubscribed or failed to subscribe. + + + + + + + The module data to set for the requested RC module. + + + + + Used to set the values of one remote control module + + + + See Result + + + + + + + + + + + + + + + + + + true if successful; false, if failed + + + + + To subscribe in getting changes for Waypoints/destinations + + + + + true, if successful; false, if failed + + + See Result + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + Request for getting waypoint/destination data. + + To request for either the destination only or for all waypoints including destination + + + + + + true, if successful; false, if failed + + + See Result + + + + + + + + + + + + Provides additional human readable info regarding the result. + + + See LocationDetails + + + + + Request to unsubscribe from WayPoints and Destination + + + + + true, if successful; false, if failed + + + See Result + + + + + + + + + + Provides additional human readable info regarding the result. + + + See LocationDetails + + + + + Request for expanded information about a supported system/HMI capability + + The type of system capability to get more information on + + + + + + + + See Result + + + + + + + + + + + + The capability does not exist on the module + + + The capability should exist on the module but there was an error retrieving the data. + + + + Provides additional human readable info regarding the result. + + + true if successful; false, if failed + + + + + Send the spatial data gathered from SDLCarWindow or VirtualDisplayEncoder to the HMI. This data will be utilized by the HMI to determine how and when haptic events should occur + + Array of spatial data structures that represent the locations of all user controls present on the HMI. This data should be updated if/when the application presents a new screen. When a request is sent, if successful, it will replace all spatial data previously sent through RPC. If an empty array is sent, the existing spatial data will be cleared + + + + + + true if successful; false if failed + + + Provides additional human readable info regarding the result. + + + See Result + + + + + + + + + + See HMILevel + + + + See AudioStreamingState + + + + See SystemContext + + + + + + See AppInterfaceUnregisteredReason + + + + + Notifies application of UP/DOWN events for buttons to which the application is subscribed. + + + Indicates whether this is an UP or DOWN event. + + + If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID) + + + + + Notifies application of LONG/SHORT press events for buttons to which the application is subscribed. + + + Indicates whether this is a LONG or SHORT button press event. + + + If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID) + + + + + Callback for the periodic and non periodic vehicle data read function. + + See GPSData + + + The vehicle speed in kilometers per hour + + + The number of revolutions per minute of the engine + + + The fuel level in the tank (percentage) + + + The fuel level state + + + The instantaneous fuel consumption in microlitres + + + The external temperature in degrees celsius + + + Vehicle identification number. + + + See PRNDL + + + See TireStatus + + + Odometer in km + + + The status of the seat belts + + + The body information including power modes + + + The device status including signal and battery strength + + + The status of the brake pedal + + + The status of the wipers + + + Status of the head lamps + + + Torque value for engine (in Nm) on non-diesel variants + + + Accelerator pedal position (percentage depressed) + + + Current angle of the steering wheel (in deg) + + + + + Emergency Call notification and confirmation data + + + The status of the air bags + + + Information related to an emergency event (and if it occurred) + + + The status modes of the cluster + + + Information related to the MyKey feature + + + + + + + + Command ID, which is related to a specific menu entry + + + + See TriggerSource + + + + + Provides applications with notifications specific to the current TBT client status on the module + + Current State of TBT client + + + + + Provides driver distraction state to mobile applications + + Current State of Driver Distraction + + + + + Provides update to app of which policy-table-enabled functions are available + + Change in permissions for a given set of RPCs + + + + + Binary data is in binary part of hybrid msg + + + + + Current SDL voice engine (VR+TTS) language + + + Current display language + + + + + + On-screen keyboard event. + Can be full string or individual keypresses depending on keyboard mode. + + + On-screen keyboard input data. + + + + On-screen keyboard input data. + For dynamic keypress events, this will be the current compounded string of entry text. + For entry submission events, this will be the full text entry (this will always return regardless of the mode). + For entry cancelled and entry aborted events, this data param will be omitted. + + + + + + Notifies about touch events on the screen's prescribed area + + The type of touch event. + + + List of all individual touches involved in this event. + + + + + + An asynchronous request from the system for specific data from the device or the cloud or response to a request from the device or cloud + Binary data can be included in hybrid part of message for some requests (such as Authentication request responses) + + + The type of system request. + + + + Optional URL for HTTP requests. + If blank, the binary data shall be forwarded to the app. + If not blank, the binary data shall be forwarded to the url with a provided timeout in seconds. + + + + + Optional timeout for HTTP requests + Required if a URL is provided + + + + Optional file type (meant for HTTP file requests). + + + Optional offset in bytes for resuming partial data chunks + + + Optional length in bytes for resuming partial data chunks + + + + + + Notification containing an updated hashID which can be used over connection cycles (i.e. loss of connection, ignition cycles, etc.). + Sent after initial registration and subsequently after any change in the calculated hash of all persisted app data. + + + Calculated hash ID to be referenced during RegisterAppInterface. + + + + + Notification which provides the entire LocationDetails when there is a change to any waypoints or destination. + + See LocationDetails + + + + + + + + + + + + + + + Allows encoded data in the form of SyncP packets to be sent to the SYNC module. + Legacy / v1 Protocol implementation; use SyncPData instead. + *** DEPRECATED *** + + + + Contains base64 encoded string of SyncP packets. + What is the maxlength? + + + + + + true, if successful; false, if failed + + + + See Result + + + + + + + + + + + Provides additional human readable info regarding the result. + + + + + + + + Callback including encoded data of any SyncP packets that SYNC needs to send back to the mobile device. + Legacy / v1 Protocol implementation; responds to EncodedSyncPData. + *** DEPRECATED *** + + + Contains base64 encoded string of SyncP packets. + + + + If blank, the SyncP data shall be forwarded to the app. + If not blank, the SyncP data shall be forwarded to the provided URL. + + + + + If blank, the SyncP data shall be forwarded to the app. + If not blank, the SyncP data shall be forwarded with the provided timeout in seconds. + + + + + + + diff --git a/tools/InterfaceGenerator/generator/parsers/RPCBase.py b/tools/InterfaceGenerator/generator/parsers/RPCBase.py index 59edf4a9b3..4853916dad 100755 --- a/tools/InterfaceGenerator/generator/parsers/RPCBase.py +++ b/tools/InterfaceGenerator/generator/parsers/RPCBase.py @@ -655,7 +655,11 @@ class Parser(object): raise ParseError("Unexpected attributes for element '" + element_name + "' of parameter '" + params["name"]) - if len(subelement.getchildren()) != 0: + children = subelement.getchildren() + for child in children: + if child.tag == "description": + children.remove(child) + if len(children) != 0: raise ParseError("Unexpected subelements for element '" + element_name + "' of parameter '" + params["name"]) -- cgit v1.2.1 From eb8da353032082928b90d3820bcbb98eda08ad98 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Fri, 22 Sep 2017 11:38:33 -0400 Subject: Remove app launching guide from README It is confusing to keep it here, it will be moved to the Wiki. Also removing Travis Badge since it is no longer used for CI. --- README.md | 52 +--------------------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/README.md b/README.md index f7a0f6763f..a3f08e3fc1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ [![Slack Status](http://sdlslack.herokuapp.com/badge.svg)](http://slack.smartdevicelink.com) -[![Build Status](https://travis-ci.org/smartdevicelink/sdl_core.svg?branch=master)](https://travis-ci.org/smartdevicelink/sdl_core) - - [![codecov.io](https://codecov.io/github/smartdevicelink/sdl_core/coverage.svg?branch=develop)](https://codecov.io/github/smartdevicelink/sdl_core?branch=develop) +[![codecov.io](https://codecov.io/github/smartdevicelink/sdl_core/coverage.svg?branch=develop)](https://codecov.io/github/smartdevicelink/sdl_core?branch=develop) # SmartDeviceLink (SDL) @@ -121,54 +119,6 @@ There are several RPCs that are "required" to be implemented in order for SDL to * OnSystemRequest * Speak -## App Launching - -Below are instructions for testing app launching and query with a full system set up. - -### SDL Server -The app querying specification defines an endpoint within Policies where sdl_core will reach out to receive a list of applications that can be launched. The SDL Server provides the back end functionality for app launching and querying. - -You can find the SDL Server on [GitHub](https://github.com/smartdevicelink/sdl_server). The README contains detailed instructions for installing and launching the server. Launch the server on your local machine, and direct your browser to http://localhost:3000. - -The [App Launching Server Specification](https://github.com/smartdevicelink/sdl_server/blob/master/docs/application_launching_v1.0.md) defines an endpoint `/applications/available/:moduleId.json` which return a list of applications available for launching to the handset for filtering. - -To check if there is a module already available you can go to http://localhost:3000/modules.json. If there is a module available, there will be one or more objects in the response array. Keep this response, you'll need the "_id" field for later. - -If there is not a module already available, go to http://localhost:3000/cars and define a new vehicle, then check http://localhost:3000/modules.json. - -Next, you'll need to define applications that can be launched. Go to http://localhost:3000/apps and define some applications. Make sure that you define a url scheme under the iOS tab of the application. This is required for an application to be launched from SDL. A URL scheme has the format `someScheme://`. Save the URL Scheme you used for later steps. - -You'll also need the local ip address of your machine - -At the end of the SDL Server set up you should have - 1. SDL Server running on your local machine connected to mongo db - 2. Your machine's local IP Address - 3. The module id of your vehicle - 4. The URL Scheme of the app you want to launch - -### Mobile -You need at least one app installed on the test device (presumably an iPhone), which we have built for you, the [V4Tester application](https://app.box.com/s/eeloquc0fhqfmxjjubw7kousf12f3pzg). This application implements SDL 4.0 and will respond to SDL Core's QUERY_APPS system request, as well as filter the response for available applications. If you do not have any other applications on the device, you can only test QUERY_APPS functionality, in which no applications will be sent to sdl core which can be launched. - -In order to support the launching of an application, you'll have to create an additional app which responds to the URL Scheme of the application that you set up on the SDL Server. To do so, go to Xcode, select File>New>Project... and under ios/application create a Single View Application. Open the application's Info.plist file (under the Supporting Files section of the project explorer by default). Highlight the Information Property List item and click the plus button to add a new entry to the Property List. From the drop down menu, select URL Types as the key. In the Item 0 dictionary add a "URL Schemes" Array, and make Item 0 in the array the prefix to the URL you previously defined (So if you defined `someScheme://` then Item 0 should be "someScheme"). Make sure the URL identifier matches your application's identifier. When you're finished you should have something that looks like the following. Install this application on your test device. **Note** - this application will only launch during this process, since it is not SDL Connected it will not register with the head unit. - -![Plist Example](http://i.imgur.com/AFyJlZQ.png) - -At the end of the Mobile device set up you should have - 1. The V4 Tester Application installed on your device - 2. An application for launching that matches the application submitted to SDL Server - 3. Your iPhone should be on the same network as the machine running SDL Server - -### SDL Core -Take the following steps to launch applications from sdl core. - - 1. Install the [correct version of SDL Core](https://github.com/smartdevicelink/sdl_core/pull/39) - 2. Add the queryAppsUrl that you saved during sdl server set up in the src/appMain/preloaded_pt.json under the "endpoints" property in the format `http://[local machine ip]:3000/applications/available[moduleId].json`. For example `http://192.168.0.150:3000/applications/available/789b739c47c7490321058200.json`. - 3. Run SDL Core - 4. Launch the V4 Tester application on the iPhone - 5. Connect the application via wifi by entering the IP address of Core into the V4 tester - 6. Both applications should show up on the head unit for launching - 7. Select the other application, and you should see it launched and brought to the foreground on the phone - ## Test Coverage ### Used technologies * GCOV - test coverage program. -- cgit v1.2.1 From 6ef1e4b894ac5298c9b1b0c1e13f2ecf6c07f13d Mon Sep 17 00:00:00 2001 From: JackLivio Date: Fri, 22 Sep 2017 14:49:15 -0400 Subject: Require nav or projection app for SendHapticData --- .../src/commands/mobile/send_haptic_data_request.cc | 17 ++++++++++++++++- .../test/commands/mobile/send_haptic_data_test.cc | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc index cabfef15f6..569eba6c02 100644 --- a/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc @@ -49,7 +49,22 @@ void SendHapticDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; - SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true); + + ApplicationSharedPtr app = application_manager_.application(connection_key()); + + if (!app) { + LOG4CXX_ERROR(logger_, "Application is not registered"); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; + } + + if (app->is_navi() || app->mobile_projection_enabled()) { + SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true); + } else { + SendResponse(false, + mobile_apis::Result::DISALLOWED, + "Application is not of type Navigation or Mobile Projection"); + } } void SendHapticDataRequest::on_event(const event_engine::Event& event) { diff --git a/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc index 49483209b6..2a3b5d922a 100644 --- a/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc +++ b/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc @@ -95,6 +95,11 @@ class SendHapticDataResponseTest }; TEST_F(SendHapticDataRequestTest, Run_SUCCESS) { + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillOnce(Return(mock_app_)); + + EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(true)); + EXPECT_CALL(app_mngr_, ManageHMICommand( HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData))) @@ -106,6 +111,22 @@ TEST_F(SendHapticDataRequestTest, Run_SUCCESS) { command->Run(); } +TEST_F(SendHapticDataRequestTest, Run_DISALLOWED) { + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillOnce(Return(mock_app_)); + + EXPECT_CALL(*mock_app_, is_navi()).WillOnce(Return(false)); + + EXPECT_CALL(*mock_app_, mobile_projection_enabled()).WillOnce(Return(false)); + + EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).WillOnce(Return(true)); + + SendHapticDataRequestPtr command(CreateCommand(msg_)); + + command->Init(); + command->Run(); +} + TEST_F(SendHapticDataRequestTest, OnEvent_SUCCESS) { EXPECT_CALL( app_mngr_, -- cgit v1.2.1 From 694b039b12c4129096e3ad5ba8681f4151df2792 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Mon, 25 Sep 2017 17:42:13 -0400 Subject: Validate outgoing video params Reverts this section back to https://github.com/shoamano83/sdl_core/commit/f6ea1262c4b6a3d1e10dc89fa570720a6c85ea9d#diff-4a7a19ae471dc741759dcc42796f9fc3R1513 --- .../protocol_handler/src/protocol_handler_impl.cc | 31 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 7f30017856..35a3fb032a 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -1538,12 +1538,37 @@ void ProtocolHandlerImpl::NotifySessionStartedResult( } BsonObject start_session_ack_params; + bson_object_initialize_default(&start_session_ack_params); // when video service is successfully started, copy input parameters // ("width", "height", "videoProtocol", "videoCodec") to the ACK packet if (packet->service_type() == kMobileNav && packet->data() != NULL) { - start_session_ack_params = bson_object_from_bytes(packet->data()); - } else { - bson_object_initialize_default(&start_session_ack_params); + BsonObject req_param = bson_object_from_bytes(packet->data()); + BsonElement* element = NULL; + + if ((element = bson_object_get(&req_param, strings::height)) != NULL && + element->type == TYPE_INT32) { + bson_object_put_int32(&start_session_ack_params, + strings::height, + bson_object_get_int32(&req_param, strings::height)); + } + if ((element = bson_object_get(&req_param, strings::width)) != NULL && + element->type == TYPE_INT32) { + bson_object_put_int32(&start_session_ack_params, + strings::width, + bson_object_get_int32(&req_param, strings::width)); + } + char* protocol = + bson_object_get_string(&req_param, strings::video_protocol); + if (protocol != NULL) { + bson_object_put_string( + &start_session_ack_params, strings::video_protocol, protocol); + } + char* codec = bson_object_get_string(&req_param, strings::video_codec); + if (codec != NULL) { + bson_object_put_string( + &start_session_ack_params, strings::video_codec, codec); + } + bson_object_deinitialize(&req_param); } ProtocolPacket::ProtocolVersion* fullVersion; -- cgit v1.2.1 From cf77cfe2e71837cd00467a0a6c449dce8d2bb840 Mon Sep 17 00:00:00 2001 From: "Andrey Oleynik (GitHub)" Date: Tue, 26 Sep 2017 18:21:33 +0300 Subject: Updates outdated rules and environment details --- COMMITTERS.md | 6 ++---- CONTRIBUTING.md | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/COMMITTERS.md b/COMMITTERS.md index 210fceb421..dc1665ffbb 100644 --- a/COMMITTERS.md +++ b/COMMITTERS.md @@ -59,9 +59,7 @@ Branch name should be: ##Pull request message * Describe the reason why you created pull request and what changes there are. -* Add related Jira ticket as link. - ( EXAMPLE: - `Related: [APPLINK-xxxxx](put direct link here)`) +* Add related GitHub issue id as link. * If there was an old pull request, add link. ( EXAMPLE: `Old pull request is [here](put direct link here)`) ##Adding reviewers: @@ -87,7 +85,7 @@ Branch name should be: * Successfully passed review. * Rebase in case of existing conflicts. * Contributor can squash commits in case of adding same code in different commits. -* Contact @AGaliuzov or @anosach-luxoft to merge pull request. +* Contact [Livio team](https://livio.io/#our-team) and request to merge pull request ##Additional sources * [Google cppint.py](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 42cf5d0898..a23bcb67a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,12 @@ Third party contributions are essential for making SDL great. However, we do have a few guidelines we need contributors to follow. +## Environment +Currently supported: +* Ubuntu Linux 14.04 with GCC 4.9.x +* Ubuntu Linux 16.04 with GCC 5.4.x +* [C++11 standard](https://github.com/smartdevicelink/sdl_evolution/issues/132) + ### Issues If writing a bug report, please make sure it has enough info. Include all relevant information. -- cgit v1.2.1 From 907b72883e4d116d4b17b0e9e709b380c58c6f58 Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Tue, 26 Sep 2017 17:28:34 -0400 Subject: Add `remoteControl` to HMICapability struct in Mobile API --- .../application_manager/hmi_capabilities_impl.h | 15 +++ .../application_manager/smart_object_keys.h | 1 + .../commands/hmi/ui_get_capabilities_response.cc | 11 +++ .../mobile/register_app_interface_request.cc | 2 + .../src/hmi_capabilities_impl.cc | 12 +++ .../application_manager/src/smart_object_keys.cc | 1 + .../hmi/ui_get_capabilities_response_test.cc | 108 +++++++++++++++++++++ .../test/hmi_capabilities_test.cc | 2 + .../application_manager/mock_hmi_capabilities.h | 3 + .../include/application_manager/hmi_capabilities.h | 14 +++ src/components/interfaces/MOBILE_API.xml | 3 + 11 files changed, 172 insertions(+) diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h index cbab1fcc80..9380fb41ac 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h @@ -424,6 +424,20 @@ class HMICapabilitiesImpl : public HMICapabilities { */ bool video_streaming_supported() const OVERRIDE; + /* + * @brief Interface to store whether HMI supports remote control + * + * @param supported Indicates whether video streaming is supported by HMI + */ + void set_rc_supported(const bool supported) OVERRIDE; + + /* + * @brief Retrieves whether HMI supports remote control + * + * @return TRUE if it supported, otherwise FALSE + */ + bool rc_supported() const OVERRIDE; + /* * @brief Interface used to store information regarding * the navigation "System Capability" @@ -557,6 +571,7 @@ class HMICapabilitiesImpl : public HMICapabilities { bool is_navigation_supported_; bool is_phone_call_supported_; bool is_video_streaming_supported_; + bool is_rc_supported_; std::string ccpu_version_; smart_objects::SmartObject* navigation_capability_; smart_objects::SmartObject* phone_capability_; diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 25fa435364..0d4eeea0c4 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -270,6 +270,7 @@ extern const char* hmi_capabilities; extern const char* navigation; extern const char* phone_call; extern const char* video_streaming; +extern const char* remote_control; extern const char* sdl_version; extern const char* system_software_version; extern const char* priority; diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc index 3b5aeac639..73cf835ff5 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc @@ -84,6 +84,12 @@ void UIGetCapabilitiesResponse::Run() { msg_params[strings::hmi_capabilities][strings::video_streaming] .asBool()); } + if (msg_params[strings::hmi_capabilities].keyExists( + strings::remote_control)) { + hmi_capabilities.set_rc_supported( + msg_params[strings::hmi_capabilities][strings::remote_control] + .asBool()); + } } if (msg_params.keyExists(strings::system_capabilities)) { @@ -104,6 +110,11 @@ void UIGetCapabilitiesResponse::Run() { msg_params[strings::system_capabilities] [strings::video_streaming_capability]); } + if (msg_params[strings::system_capabilities].keyExists( + strings::rc_capability)) { + hmi_capabilities.set_rc_capability( + msg_params[strings::system_capabilities][strings::rc_capability]); + } } } diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 74bc0c032e..5185d9e5a6 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -494,6 +494,8 @@ void FillUIRelatedFields(smart_objects::SmartObject& response_params, hmi_capabilities.phone_call_supported(); response_params[strings::hmi_capabilities][strings::video_streaming] = hmi_capabilities.video_streaming_supported(); + response_params[strings::hmi_capabilities][strings::remote_control] = + hmi_capabilities.rc_supported(); } void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index 28049f8e35..e39b728155 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -391,6 +391,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr) , is_navigation_supported_(false) , is_phone_call_supported_(false) , is_video_streaming_supported_(false) + , is_rc_supported_(false) , navigation_capability_(NULL) , phone_capability_(NULL) , video_streaming_capability_(NULL) @@ -650,6 +651,10 @@ void HMICapabilitiesImpl::set_video_streaming_supported(const bool supported) { is_video_streaming_supported_ = supported; } +void HMICapabilitiesImpl::set_rc_supported(const bool supported) { + is_rc_supported_ = supported; +} + void HMICapabilitiesImpl::set_navigation_capability( const smart_objects::SmartObject& navigation_capability) { if (navigation_capability_) { @@ -803,6 +808,10 @@ bool HMICapabilitiesImpl::video_streaming_supported() const { return is_video_streaming_supported_; } +bool HMICapabilitiesImpl::rc_supported() const { + return is_rc_supported_; +} + const smart_objects::SmartObject* HMICapabilitiesImpl::navigation_capability() const { return navigation_capability_; @@ -1150,6 +1159,9 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { Formatters::CFormatterJsonBase::jsonValueToObj(rc_capability, rc_capability_so); set_rc_capability(rc_capability_so); + if (!rc_capability_so.empty()) { + set_rc_supported(true); + } } } } // UI end diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index 45bab026b4..0bf3287e42 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -234,6 +234,7 @@ const char* hmi_capabilities = "hmiCapabilities"; const char* navigation = "navigation"; const char* phone_call = "phoneCall"; const char* video_streaming = "videoStreaming"; +const char* remote_control = "remoteControl"; const char* sdl_version = "sdlVersion"; const char* system_software_version = "systemSoftwareVersion"; const char* priority = "priority"; diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index b02c9851ee..aabefc382e 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -241,6 +241,28 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreaming_SUCCESS) { command->Run(); } +TEST_F(UIGetCapabilitiesResponseTest, SetRemoteControl_SUCCESS) { + MessageSharedPtr command_msg = CreateCommandMsg(); + (*command_msg)[strings::msg_params][strings::hmi_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + (*command_msg)[strings::msg_params][strings::hmi_capabilities] + [strings::remote_control] = true; + + ResponseFromHMIPtr command( + CreateCommand(command_msg)); + + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(mock_hmi_capabilities_)); + + smart_objects::SmartObject hmi_capabilities_so = + (*command_msg)[strings::msg_params][strings::hmi_capabilities]; + EXPECT_CALL( + mock_hmi_capabilities_, + set_rc_supported(hmi_capabilities_so[strings::remote_control].asBool())); + + command->Run(); +} + TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) { MessageSharedPtr command_msg = CreateCommandMsg(); (*command_msg)[strings::msg_params][strings::system_capabilities] = @@ -339,6 +361,92 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { command->Run(); } +TEST_F(UIGetCapabilitiesResponseTest, SetRemoteControlCapability_SUCCESS) { + MessageSharedPtr command_msg = CreateCommandMsg(); + (*command_msg)[strings::msg_params][strings::system_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::rc_capability] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + smart_objects::SmartObject& remote_control_capability = + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::rc_capability]; + + remote_control_capability["climateControlCapabilities"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + remote_control_capability["climateControlCapabilities"][0] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + smart_objects::SmartObject& climate_control_capability = + remote_control_capability["climateControlCapabilities"][0]; + + climate_control_capability["moduleName"] = "Climate"; + climate_control_capability["fanSpeedAvailable"] = true; + climate_control_capability["desiredTemperatureAvailable"] = true; + climate_control_capability["acEnableAvailable"] = true; + climate_control_capability["acMaxEnableAvailable"] = true; + climate_control_capability["circulateAirEnableAvailable"] = true; + climate_control_capability["autoModeEnableAvailable"] = true; + climate_control_capability["dualModeEnableAvailable"] = true; + + climate_control_capability["defrostZoneAvailable"] = true; + climate_control_capability["defrostZone"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + climate_control_capability["defrostZone"][0] = "ALL"; + + climate_control_capability["ventilationModeAvailable"] = true; + climate_control_capability["ventilationMode"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + climate_control_capability["ventilationMode"][0] = "BOTH"; + + remote_control_capability["radioControlCapabilities"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + remote_control_capability["radioControlCapabilities"][0] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + smart_objects::SmartObject& radio_control_capability = + remote_control_capability["radioControlCapabilities"][0]; + + radio_control_capability["moduleName"] = "Radio"; + radio_control_capability["radioEnableAvailable"] = true; + radio_control_capability["radioBandAvailable"] = true; + radio_control_capability["radioFrequencyAvailable"] = true; + radio_control_capability["hdChannelAvailable"] = true; + radio_control_capability["rdsDataAvailable"] = true; + radio_control_capability["availableHDsAvailable"] = true; + radio_control_capability["stateAvailable"] = true; + radio_control_capability["signalStrengthAvailable"] = true; + radio_control_capability["signalChangeThresholdAvailable"] = true; + + remote_control_capability[hmi_response::button_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + remote_control_capability[hmi_response::button_capabilities][0] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + smart_objects::SmartObject& button_capability = + remote_control_capability[hmi_response::button_capabilities][0]; + + button_capability[strings::button_name] = "OK"; + button_capability["shortPressAvailable"] = true; + button_capability["longPressAvailable"] = true; + button_capability["upDownAvailable"] = true; + + ResponseFromHMIPtr command( + CreateCommand(command_msg)); + + EXPECT_CALL(app_mngr_, hmi_capabilities()) + .WillOnce(ReturnRef(mock_hmi_capabilities_)); + + EXPECT_CALL(mock_hmi_capabilities_, + set_rc_capability(remote_control_capability)); + + command->Run(); +} + } // namespace ui_get_capabilities_response } // namespace hmi_commands_test } // namespace commands_test diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 2eb6956353..b8369528aa 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -507,6 +507,7 @@ TEST_F(HMICapabilitiesTest, EXPECT_FALSE(hmi_capabilities->navigation_supported()); EXPECT_TRUE(hmi_capabilities->phone_call_supported()); EXPECT_FALSE(hmi_capabilities->video_streaming_supported()); + EXPECT_FALSE(hmi_capabilities->rc_supported()); // verify phone capability const smart_objects::SmartObject phone_capability_so = @@ -547,6 +548,7 @@ TEST_F(HMICapabilitiesTest, EXPECT_TRUE(hmi_capabilities->navigation_supported()); EXPECT_FALSE(hmi_capabilities->phone_call_supported()); EXPECT_FALSE(hmi_capabilities->video_streaming_supported()); + EXPECT_FALSE(hmi_capabilities->rc_supported()); // verify navigation capabilities smart_objects::SmartObject navigation_capability_so = diff --git a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h index dd7ec5f0d5..468bdbe5eb 100644 --- a/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h +++ b/src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h @@ -160,6 +160,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities { MOCK_CONST_METHOD0(video_streaming_supported, bool()); MOCK_METHOD1(set_video_streaming_supported, void(const bool supported)); + MOCK_CONST_METHOD0(rc_supported, bool()); + MOCK_METHOD1(set_rc_supported, void(const bool supported)); + MOCK_CONST_METHOD0(navigation_capability, const smart_objects::SmartObject*()); MOCK_METHOD1(set_navigation_capability, diff --git a/src/components/include/application_manager/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h index fb40367b00..1283584ef8 100644 --- a/src/components/include/application_manager/hmi_capabilities.h +++ b/src/components/include/application_manager/hmi_capabilities.h @@ -426,6 +426,20 @@ class HMICapabilities { */ virtual bool video_streaming_supported() const = 0; + /* + * @brief Interface to store whether HMI supports remote control + * + * @param supported Indicates whether remote control is supported by HMI + */ + virtual void set_rc_supported(const bool supported) = 0; + + /* + * @brief Retrieves whether HMI supports remote control + * + * @return TRUE if it supported, otherwise FALSE + */ + virtual bool rc_supported() const = 0; + /* * @brief Interface used to store information regarding * the navigation "System Capability" diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 804520fe4d..a1c64aecda 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -1994,6 +1994,9 @@ Availability of video streaming. + + Availability of remote control feature. True: Available, False: Not Available + -- cgit v1.2.1 From bfdcdd0f21dc83ffb8a607060d3392cad10406a4 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Tue, 26 Sep 2017 15:00:32 +0300 Subject: Fix PTU applying for default app policy section There was a problem with applying changes for applications which is registered with "default" policies and this policy group was updated after PTU. In this case permissions for already registered applications which is using these groups still have permissions as before update. Also default policy section was not updated after PTU with changes in this section. This issue is reproduced on EXTERNAL_PROPRIETARY flow only. To fix this issue there was removed code in CacheManager, which incorrectly assigns default policies to apps with "default" policies. Also there was a redundant code because default policies is unwrapped in PTU before its applying, so all specific application policies is already have actual new default policy permissions. In this case it is correct to assign to every app his own policies from PTU. Also there was updated logic in ProcessAppPolicyCheckResults() to perform all needed actions once per app, because its possible that results could contain sever results for one app_id. --- .../policy_external/include/policy/policy_helper.h | 17 ++++++ .../include/policy/policy_manager_impl.h | 18 +++++- .../policy_external/include/policy/policy_types.h | 22 +++++++ .../policy/policy_external/src/cache_manager.cc | 36 +++++------- .../policy/policy_external/src/policy_helper.cc | 35 +++++++++++ .../policy_external/src/policy_manager_impl.cc | 68 ++++++++++------------ .../policy/policy_regular/src/cache_manager.cc | 10 ---- 7 files changed, 135 insertions(+), 71 deletions(-) diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h index 42c1ec0b46..6945f45b45 100644 --- a/src/components/policy/policy_external/include/policy/policy_helper.h +++ b/src/components/policy/policy_external/include/policy/policy_helper.h @@ -199,6 +199,23 @@ struct CheckAppPolicy { CheckAppPolicyResults& out_results_; }; +/** + * @brief Helper struct for filling actions to be done for processed application + * using CheckAppPolicyResults data as a source + */ +struct FillActionsForAppPolicies { + FillActionsForAppPolicies( + ApplicationsPoliciesActions& actions, + const policy_table::ApplicationPolicies& app_policies) + : actions_(actions), app_policies_(app_policies) {} + + void operator()(const policy::CheckAppPolicyResults::value_type& value); + + private: + ApplicationsPoliciesActions& actions_; + const policy_table::ApplicationPolicies& app_policies_; +}; + /* * @brief Fill permissions data with merged rpc permissions for hmi levels and * parameters diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index f8d226c86a..80ceb06e7e 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -719,8 +719,9 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief Processes results from policy table update analysis done by - * CheckPermissionsChanges() by sending OnPermissionChange and - * OnAppPermissionChanged notifications + * CheckPermissionsChanges() by filling ApplicationsPoliciesActions struct + * with actions which should be done for every application and passes them to + * ProcessActionsForAppPolicies() * @param results Collection of per-application results * @param app_policies Reference to updated application policies section as * a data source for generating notifications data @@ -729,6 +730,19 @@ class PolicyManagerImpl : public PolicyManager { const CheckAppPolicyResults& results, const policy_table::ApplicationPolicies& app_policies); + /** + * @brief Processes actions filled in ProcessAppPolicyCheckResults() for every + * application by sending OnPermissionChange and OnAppPermissionChanged + * notifications and by checking consent where it needed + * @param actions Reference to map with actions to be done or not for every + * application + * @param app_policies Reference to updated application policies section as + * a data source for generating notifications data + */ + void ProcessActionsForAppPolicies( + const ApplicationsPoliciesActions& actions, + const policy_table::ApplicationPolicies& app_policies); + /** * @brief Fill structure to be sent with OnPermissionsChanged notification * diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h index 9ba1a1cfff..f57919b6f7 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -431,6 +431,28 @@ struct ExternalConsentStatusItemSorter { } }; +/** + * @brief The ApplicationPolicyActions struct contains actions which should be + * done for some application + */ +struct ApplicationPolicyActions { + ApplicationPolicyActions() + : is_notify_system(false) + , is_send_permissions_to_app(false) + , is_consent_needed(false) {} + + bool is_notify_system; + bool is_send_permissions_to_app; + bool is_consent_needed; +}; + +/** + * @brief ApplicationsPoliciesActions map of actions to be done for every + * application + */ +typedef std::map + ApplicationsPoliciesActions; + /** * @brief Customer connectivity settings status */ diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 22040c88b2..1c81f84a81 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -630,7 +630,7 @@ void CacheManager::ProcessUpdate( *(initial_policy_iter->second.RequestType); const std::string& app_id = initial_policy_iter->first; - RequestTypes merged_pt_request_types; + bool update_request_types = true; if (app_id == kDefaultId || app_id == kPreDataConsentId) { if (new_request_types.is_omitted()) { @@ -638,25 +638,28 @@ void CacheManager::ProcessUpdate( "Application " << app_id << " has omitted RequestTypes." " Previous values will be kept."); - return; - } - if (new_request_types.empty()) { + update_request_types = false; + } else if (new_request_types.empty()) { if (new_request_types.is_cleaned_up()) { LOG4CXX_INFO(logger_, "Application " << app_id << " has cleaned up all values." " Previous values will be kept."); - return; + update_request_types = false; + } else { + LOG4CXX_INFO(logger_, + "Application " << app_id + << " has empty RequestTypes." + " Any parameter will be allowed."); } - LOG4CXX_INFO(logger_, - "Application " << app_id - << " has empty RequestTypes." - " Any parameter will be allowed."); } - merged_pt_request_types = new_request_types; - } else { - merged_pt_request_types = new_request_types; } + + const RequestTypes merged_pt_request_types = + update_request_types + ? new_request_types + : *(pt_->policy_table.app_policies_section.apps[app_id].RequestType); + pt_->policy_table.app_policies_section.apps[app_id] = initial_policy_iter->second; *(pt_->policy_table.app_policies_section.apps[app_id].RequestType) = @@ -682,15 +685,6 @@ bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) { pt_->policy_table.app_policies_section.apps[iter->first].set_to_null(); pt_->policy_table.app_policies_section.apps[iter->first].set_to_string( ""); - } else if (policy::kDefaultId == (iter->second).get_string()) { - policy_table::ApplicationPolicies::const_iterator iter_default = - update_pt.policy_table.app_policies_section.apps.find(kDefaultId); - if (update_pt.policy_table.app_policies_section.apps.end() == - iter_default) { - LOG4CXX_ERROR(logger_, "The default section was not found in PTU"); - continue; - } - ProcessUpdate(iter_default); } else { ProcessUpdate(iter); } diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index 3041323489..5425777833 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -484,6 +484,41 @@ bool CheckAppPolicy::IsRequestTypeChanged( return diff.size(); } +void FillActionsForAppPolicies::operator()( + const policy::CheckAppPolicyResults::value_type& value) { + const std::string app_id = value.first; + const policy_table::ApplicationPolicies::const_iterator app_policy = + app_policies_.find(app_id); + + if (app_policies_.end() == app_policy) { + return; + } + + if (IsPredefinedApp(*app_policy)) { + return; + } + + switch (value.second) { + case RESULT_APP_REVOKED: + case RESULT_NICKNAME_MISMATCH: + actions_[app_id].is_notify_system = true; + return; + case RESULT_CONSENT_NEEDED: + case RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED: + actions_[app_id].is_consent_needed = true; + break; + case RESULT_CONSENT_NOT_REQIURED: + case RESULT_PERMISSIONS_REVOKED: + case RESULT_REQUEST_TYPE_CHANGED: + break; + case RESULT_NO_CHANGES: + default: + return; + } + actions_[app_id].is_notify_system = true; + actions_[app_id].is_send_permissions_to_app = true; +} + FillNotificationData::FillNotificationData(Permissions& data, GroupConsent group_state, GroupConsent undefined_group_consent, diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 8a80e7755b..d50779383a 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -385,53 +385,45 @@ CheckAppPolicyResults PolicyManagerImpl::CheckPermissionsChanges( void PolicyManagerImpl::ProcessAppPolicyCheckResults( const CheckAppPolicyResults& results, const policy_table::ApplicationPolicies& app_policies) { - CheckAppPolicyResults::const_iterator it_results = results.begin(); + ApplicationsPoliciesActions actions_for_apps_policies; + FillActionsForAppPolicies filler(actions_for_apps_policies, app_policies); - for (; results.end() != it_results; ++it_results) { - const policy_table::ApplicationPolicies::const_iterator app_policy = - app_policies.find(it_results->first); + std::for_each(results.begin(), results.end(), filler); + ProcessActionsForAppPolicies(actions_for_apps_policies, app_policies); +} + +void PolicyManagerImpl::ProcessActionsForAppPolicies( + const ApplicationsPoliciesActions& actions, + const policy_table::ApplicationPolicies& app_policies) { + ApplicationsPoliciesActions::const_iterator it_actions = actions.begin(); + for (; it_actions != actions.end(); ++it_actions) { + policy_table::ApplicationPolicies::const_iterator app_policy = + app_policies.find(it_actions->first); if (app_policies.end() == app_policy) { continue; } - if (IsPredefinedApp(*app_policy)) { - continue; - } + if (it_actions->second.is_consent_needed) { + // Post-check after ExternalConsent consent changes + const std::string& policy_app_id = app_policy->first; + if (!IsConsentNeeded(policy_app_id)) { + sync_primitives::AutoLock lock(app_permissions_diff_lock_); - switch (it_results->second) { - case RESULT_NO_CHANGES: - continue; - case RESULT_APP_REVOKED: - NotifySystem(*app_policy); - continue; - case RESULT_NICKNAME_MISMATCH: - NotifySystem(*app_policy); - continue; - case RESULT_CONSENT_NEEDED: - case RESULT_PERMISSIONS_REVOKED_AND_CONSENT_NEEDED: { - // Post-check after ExternalConsent consent changes - const std::string policy_app_id = app_policy->first; - if (!IsConsentNeeded(policy_app_id)) { - sync_primitives::AutoLock lock(app_permissions_diff_lock_); - - PendingPermissions::iterator app_id_diff = - app_permissions_diff_.find(policy_app_id); - - if (app_permissions_diff_.end() != app_id_diff) { - app_id_diff->second.appPermissionsConsentNeeded = false; - } + PendingPermissions::iterator app_id_diff = + app_permissions_diff_.find(policy_app_id); + + if (app_permissions_diff_.end() != app_id_diff) { + app_id_diff->second.appPermissionsConsentNeeded = false; } - } break; - case RESULT_CONSENT_NOT_REQIURED: - case RESULT_PERMISSIONS_REVOKED: - case RESULT_REQUEST_TYPE_CHANGED: - break; - default: - continue; + } + } + if (it_actions->second.is_notify_system) { + NotifySystem(*app_policy); + } + if (it_actions->second.is_send_permissions_to_app) { + SendPermissionsToApp(*app_policy); } - NotifySystem(*app_policy); - SendPermissionsToApp(*app_policy); } } diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 78674c81f3..f4fa573c1b 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -238,16 +238,6 @@ bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) { pt_->policy_table.app_policies_section.apps[iter->first].set_to_null(); pt_->policy_table.app_policies_section.apps[iter->first].set_to_string( ""); - } else if (policy::kDefaultId == (iter->second).get_string()) { - policy_table::ApplicationPolicies::const_iterator iter_default = - update_pt.policy_table.app_policies_section.apps.find(kDefaultId); - if (update_pt.policy_table.app_policies_section.apps.end() == - iter_default) { - LOG4CXX_ERROR(logger_, "The default section was not found in PTU"); - continue; - } - pt_->policy_table.app_policies_section.apps[iter->first] = - iter_default->second; } else { pt_->policy_table.app_policies_section.apps[iter->first] = iter->second; } -- cgit v1.2.1 From 7e1d12a8bddd9180d3c43e41911c6620b1372739 Mon Sep 17 00:00:00 2001 From: AKalinich-Luxoft Date: Tue, 26 Sep 2017 16:34:38 +0300 Subject: Fix unit test expectation --- .../policy/policy_external/test/policy_manager_impl_ptu_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index c958f6bcd7..da0cd913b6 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -1344,7 +1344,7 @@ TEST_F(PolicyManagerImplTest2, // Add app policy_manager_->AddApplication(section_name, HmiTypes(policy_table::AHT_DEFAULT)); - EXPECT_CALL(listener_, OnPendingPermissionChange(section_name)).Times(2); + EXPECT_CALL(listener_, OnPendingPermissionChange(section_name)); // PTU has single invalid RequestTypes, which must be dropped and replaced // with default RT -- cgit v1.2.1 From faefdd9df024d1379f46589abe79b08fea4f3544 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 28 Sep 2017 14:57:26 +0900 Subject: fix: build break with ENABLE_LOG=OFF --- .../application_manager/src/application_manager_impl.cc | 8 ++++---- src/components/application_manager/src/policies/policy_handler.cc | 2 ++ src/components/policy/policy_regular/src/cache_manager.cc | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index ab20222fcf..a65fe395da 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1611,11 +1611,11 @@ void ApplicationManagerImpl::SendMessageToMobile( (*message)[strings::params][strings::function_id].asUInt()); if (function_id == mobile_apis::FunctionID::RegisterAppInterfaceID && (*message)[strings::msg_params][strings::success].asBool()) { - const bool is_for_plugin = plugin_manager_.IsAppForPlugins(app); LOG4CXX_INFO(logger_, - "Registered app " << app->app_id() << " is " - << (is_for_plugin ? "" : "not ") - << "for plugins."); + "Registered app " + << app->app_id() << " is " + << (plugin_manager_.IsAppForPlugins(app) ? "" : "not ") + << "for plugins."); } #endif // SDL_REMOTE_CONTROL } else if (app) { diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index ad21f533a1..374f7f4237 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -808,7 +808,9 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate( const Applications::value_type value) const { LOG4CXX_AUTO_TRACE(logger_); +#ifdef ENABLE_LOG const uint32_t app_id = value->app_id(); +#endif if (!value->IsRegistered()) { LOG4CXX_DEBUG(logger_, diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 78674c81f3..179ddc11b7 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include "utils/file_system.h" #include "json/reader.h" -- cgit v1.2.1 From 1b8e82a38e879a022647e6e17498c9865d7853e3 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Thu, 28 Sep 2017 23:18:01 +0900 Subject: Remove temporary value app_id Reflecting review comment. --- .../application_manager/src/policies/policy_handler.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 374f7f4237..e6ebaf3b83 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -808,19 +808,17 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate( const Applications::value_type value) const { LOG4CXX_AUTO_TRACE(logger_); -#ifdef ENABLE_LOG - const uint32_t app_id = value->app_id(); -#endif - if (!value->IsRegistered()) { LOG4CXX_DEBUG(logger_, - "Application " << app_id << " is not marked as registered."); + "Application " << value->app_id() + << " is not marked as registered."); return false; } LOG4CXX_DEBUG(logger_, - "Application " << app_id << " marked as registered." - "Checking its parameters."); + "Application " << value->app_id() + << " marked as registered." + "Checking its parameters."); DeviceParams device_params = GetDeviceParams( value->device(), -- cgit v1.2.1 From b7ee0366e1494a2dde2f111b240b69da895d61c3 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Thu, 28 Sep 2017 17:12:22 -0400 Subject: Revert "fix: build break with ENABLE_LOG=OFF" --- .../application_manager/src/application_manager_impl.cc | 8 ++++---- .../application_manager/src/policies/policy_handler.cc | 10 +++++----- src/components/policy/policy_regular/src/cache_manager.cc | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 1d41388910..411813cc83 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1611,11 +1611,11 @@ void ApplicationManagerImpl::SendMessageToMobile( (*message)[strings::params][strings::function_id].asUInt()); if (function_id == mobile_apis::FunctionID::RegisterAppInterfaceID && (*message)[strings::msg_params][strings::success].asBool()) { + const bool is_for_plugin = plugin_manager_.IsAppForPlugins(app); LOG4CXX_INFO(logger_, - "Registered app " - << app->app_id() << " is " - << (plugin_manager_.IsAppForPlugins(app) ? "" : "not ") - << "for plugins."); + "Registered app " << app->app_id() << " is " + << (is_for_plugin ? "" : "not ") + << "for plugins."); } #endif // SDL_REMOTE_CONTROL } else if (app) { diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index e6ebaf3b83..ad21f533a1 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -808,17 +808,17 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate( const Applications::value_type value) const { LOG4CXX_AUTO_TRACE(logger_); + const uint32_t app_id = value->app_id(); + if (!value->IsRegistered()) { LOG4CXX_DEBUG(logger_, - "Application " << value->app_id() - << " is not marked as registered."); + "Application " << app_id << " is not marked as registered."); return false; } LOG4CXX_DEBUG(logger_, - "Application " << value->app_id() - << " marked as registered." - "Checking its parameters."); + "Application " << app_id << " marked as registered." + "Checking its parameters."); DeviceParams device_params = GetDeviceParams( value->device(), diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 8b6b9a433e..b395e4e04c 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -36,7 +36,6 @@ #include #include #include -#include #include "utils/file_system.h" #include "json/reader.h" -- cgit v1.2.1 From bae43b7e233787146aa9bed8f046ab10193e1dfe Mon Sep 17 00:00:00 2001 From: JackLivio Date: Fri, 29 Sep 2017 10:27:23 -0400 Subject: Fix compilation warning #1789 Changes made in #1789 + compilation fix. Original author @shoamano83 --- src/appMain/main.cc | 2 ++ .../application_manager/src/application_manager_impl.cc | 8 ++++---- .../application_manager/src/policies/policy_handler.cc | 10 +++++----- src/components/policy/policy_regular/src/cache_manager.cc | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/appMain/main.cc b/src/appMain/main.cc index 58ab02b123..07b9cacb78 100644 --- a/src/appMain/main.cc +++ b/src/appMain/main.cc @@ -148,10 +148,12 @@ int32_t main(int32_t argc, char** argv) { // Check if no error values were read from config file if (profile_instance.ErrorOccured()) { +#ifdef ENABLE_LOG const std::string& error = profile_instance.ErrorDescription(); LOG4CXX_FATAL(logger_, error); FLUSH_LOGGER(); DEINIT_LOGGER(); +#endif exit(EXIT_FAILURE); } diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 411813cc83..1d41388910 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1611,11 +1611,11 @@ void ApplicationManagerImpl::SendMessageToMobile( (*message)[strings::params][strings::function_id].asUInt()); if (function_id == mobile_apis::FunctionID::RegisterAppInterfaceID && (*message)[strings::msg_params][strings::success].asBool()) { - const bool is_for_plugin = plugin_manager_.IsAppForPlugins(app); LOG4CXX_INFO(logger_, - "Registered app " << app->app_id() << " is " - << (is_for_plugin ? "" : "not ") - << "for plugins."); + "Registered app " + << app->app_id() << " is " + << (plugin_manager_.IsAppForPlugins(app) ? "" : "not ") + << "for plugins."); } #endif // SDL_REMOTE_CONTROL } else if (app) { diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index ad21f533a1..e6ebaf3b83 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -808,17 +808,17 @@ bool PolicyHandler::IsAppSuitableForPolicyUpdate( const Applications::value_type value) const { LOG4CXX_AUTO_TRACE(logger_); - const uint32_t app_id = value->app_id(); - if (!value->IsRegistered()) { LOG4CXX_DEBUG(logger_, - "Application " << app_id << " is not marked as registered."); + "Application " << value->app_id() + << " is not marked as registered."); return false; } LOG4CXX_DEBUG(logger_, - "Application " << app_id << " marked as registered." - "Checking its parameters."); + "Application " << value->app_id() + << " marked as registered." + "Checking its parameters."); DeviceParams device_params = GetDeviceParams( value->device(), diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index b395e4e04c..8b6b9a433e 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include "utils/file_system.h" #include "json/reader.h" -- cgit v1.2.1 From e746f8661cb57d105a94663ba8543eaddd381527 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Fri, 29 Sep 2017 10:39:15 -0400 Subject: Remove ifdef clearner approach to handling warning as error. --- src/appMain/main.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/appMain/main.cc b/src/appMain/main.cc index 07b9cacb78..81482c4335 100644 --- a/src/appMain/main.cc +++ b/src/appMain/main.cc @@ -148,12 +148,9 @@ int32_t main(int32_t argc, char** argv) { // Check if no error values were read from config file if (profile_instance.ErrorOccured()) { -#ifdef ENABLE_LOG - const std::string& error = profile_instance.ErrorDescription(); - LOG4CXX_FATAL(logger_, error); + LOG4CXX_FATAL(logger_, profile_instance.ErrorDescription()); FLUSH_LOGGER(); DEINIT_LOGGER(); -#endif exit(EXIT_FAILURE); } -- cgit v1.2.1 From 945413ef789a9b0b1f3c1196353e82a1afd117c2 Mon Sep 17 00:00:00 2001 From: fronneburg Date: Tue, 3 Oct 2017 12:19:31 -0700 Subject: Fix/1701 (#1702) proper socket streamer cleanup --- .../media_manager/include/media_manager/file_streamer_adapter.h | 2 ++ .../media_manager/include/media_manager/pipe_streamer_adapter.h | 2 ++ .../media_manager/include/media_manager/socket_streamer_adapter.h | 2 ++ .../media_manager/include/media_manager/streamer_adapter.h | 2 ++ src/components/media_manager/src/socket_streamer_adapter.cc | 8 ++++++++ src/components/media_manager/src/streamer_adapter.cc | 5 ++++- 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/components/media_manager/include/media_manager/file_streamer_adapter.h b/src/components/media_manager/include/media_manager/file_streamer_adapter.h index 293c6721ee..c4c91a98d8 100644 --- a/src/components/media_manager/include/media_manager/file_streamer_adapter.h +++ b/src/components/media_manager/include/media_manager/file_streamer_adapter.h @@ -54,6 +54,8 @@ class FileStreamerAdapter : public StreamerAdapter { const std::string& app_storage_folder); virtual ~FileStreamer(); + virtual void Close() {} + protected: virtual bool Connect(); virtual void Disconnect(); diff --git a/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h b/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h index 1e998ef82f..c079e04954 100644 --- a/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h +++ b/src/components/media_manager/include/media_manager/pipe_streamer_adapter.h @@ -53,6 +53,8 @@ class PipeStreamerAdapter : public StreamerAdapter { const std::string& app_storage_folder); virtual ~PipeStreamer(); + virtual void Close() {} + protected: virtual bool Connect(); virtual void Disconnect(); diff --git a/src/components/media_manager/include/media_manager/socket_streamer_adapter.h b/src/components/media_manager/include/media_manager/socket_streamer_adapter.h index 45311b6077..3b647a0b83 100644 --- a/src/components/media_manager/include/media_manager/socket_streamer_adapter.h +++ b/src/components/media_manager/include/media_manager/socket_streamer_adapter.h @@ -55,6 +55,8 @@ class SocketStreamerAdapter : public StreamerAdapter { const std::string& header); virtual ~SocketStreamer(); + virtual void Close(); + protected: virtual bool Connect(); virtual void Disconnect(); diff --git a/src/components/media_manager/include/media_manager/streamer_adapter.h b/src/components/media_manager/include/media_manager/streamer_adapter.h index 30353b8d09..5ac8e05cac 100644 --- a/src/components/media_manager/include/media_manager/streamer_adapter.h +++ b/src/components/media_manager/include/media_manager/streamer_adapter.h @@ -72,6 +72,8 @@ class StreamerAdapter : public MediaAdapterImpl { virtual void threadMain(); virtual void exitThreadMain(); + virtual void Close() = 0; + protected: virtual bool Connect() = 0; virtual void Disconnect() = 0; diff --git a/src/components/media_manager/src/socket_streamer_adapter.cc b/src/components/media_manager/src/socket_streamer_adapter.cc index 2bb0fe10ec..60b01c901b 100644 --- a/src/components/media_manager/src/socket_streamer_adapter.cc +++ b/src/components/media_manager/src/socket_streamer_adapter.cc @@ -108,13 +108,21 @@ bool SocketStreamerAdapter::SocketStreamer::Connect() { return true; } +void SocketStreamerAdapter::SocketStreamer::Close() { + Disconnect(); +} + void SocketStreamerAdapter::SocketStreamer::Disconnect() { LOG4CXX_AUTO_TRACE(logger); if (0 < send_socket_fd_) { + shutdown(send_socket_fd_, SHUT_RDWR); close(send_socket_fd_); + send_socket_fd_ = 0; } if (0 < socket_fd_) { + shutdown(socket_fd_, SHUT_RDWR); close(socket_fd_); + socket_fd_ = 0; } } diff --git a/src/components/media_manager/src/streamer_adapter.cc b/src/components/media_manager/src/streamer_adapter.cc index 20c067da1c..90a40b1add 100644 --- a/src/components/media_manager/src/streamer_adapter.cc +++ b/src/components/media_manager/src/streamer_adapter.cc @@ -44,9 +44,12 @@ StreamerAdapter::StreamerAdapter(Streamer* const streamer) } StreamerAdapter::~StreamerAdapter() { - delete streamer_; + if (streamer_) { + streamer_->Close(); + } thread_->join(); threads::DeleteThread(thread_); + delete streamer_; } void StreamerAdapter::StartActivity(int32_t application_key) { -- cgit v1.2.1 From e2f83f2200021f1fb140c1491c402bde527d8f58 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Wed, 4 Oct 2017 04:55:45 +0900 Subject: fix: invalid memory access in websocket_handler (#1687) * fix: invalid memory access in websocket_handler * Revert "fix: invalid memory access in websocket_handler" This reverts commit 120c087d92fac3e3c950f1e689461aafd2fa459c. * fix: (again) invalid memory access in websocket_handler Previous commit was incomplete; we need to shift the whole buffer. --- .../message_broker/src/lib_messagebroker/websocket_handler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp b/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp index 17c2dd92ae..9fd364cf17 100644 --- a/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp +++ b/src/3rd_party-static/message_broker/src/lib_messagebroker/websocket_handler.cpp @@ -160,9 +160,9 @@ namespace NsMessageBroker DBG_MSG(("CWebSocketHandler::parseWebSocketData()length:%d; size:%d;" " position:%d\n", (int)length, size, position)); - for (unsigned long i = 0; (i < size); i++) { - Buffer[parsedBufferPosition + i] = recBuffer[i+position]; - } + memmove(&Buffer[parsedBufferPosition], &recBuffer[position], + size - position); + b_size -= position; parsedBufferPosition += length; recBuffer += length; -- cgit v1.2.1 From 41d3029c1698e5b12a529a44fd2c0bae8f66202d Mon Sep 17 00:00:00 2001 From: Jacob Keeler Date: Tue, 3 Oct 2017 16:17:26 -0400 Subject: Add .github folder along with new Issue and PR templates (#1800) --- .github/CONTRIBUTING.md | 32 ++++++++++++++ .github/ISSUE_TEMPLATE.md | 23 ++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 33 ++++++++++++++ COMMITTERS.md | 95 ---------------------------------------- CONTRIBUTING.md | 35 --------------- 5 files changed, 88 insertions(+), 130 deletions(-) create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 COMMITTERS.md delete mode 100644 CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000000..6daef5fe25 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing to SDL Projects + +Third party contributions are essential for making SDL great. However, we do have a few guidelines we need contributors to follow. + +### Issues +If writing a bug report, please make sure [you follow the issue template](https://github.com/smartdevicelink/sdl_core/blob/master/.github/ISSUE_TEMPLATE.md). Include all relevant information. + +If requesting a feature, understand that we appreciate the input! However, it may not immediately fit our roadmap, and it may take a while for us to get to your request. + +### Gitflow +We use [GitFlow](http://nvie.com/posts/a-successful-git-branching-model/) as our branch management system. Please follow GitFlow's guidelines while contributing to any SDL project. + +### Pull Requests +* Please follow the repository's [Style Guide](https://github.com/smartdevicelink/sdl_core/wiki/SDL-Coding-Style-Guide) for all code and documentation. +* All pull requests should be sent to `smartdevicelink/sdl_core/`, to `develop` or `master` branch. +* All feature branches should be based on `develop` and have the format `feature/branch_name`. +* All fix branches should be based on `develop` and have the format `fix/branch_name`. +* All new functionality requests should be provided only for `develop` branch. +* In case an issue should be fixed in a short time (after release), open a pull request to `master` with a branch name of `hotfix/branch_name`. +* In case an issue exists in both the `develop` and `master` branches, open a pull request to `develop` only. Do not open the same pull request against the `master` branch. +* All pull requests should implement a single feature or fix a single bug. Pull Requests that involve multiple changes (it is our discretion what precisely this means) will be rejected with a reason. +* All commits should be separated into logical units, i.e. unrelated changes should be in different commits within a pull request. +* Work in progress pull requests should have "[WIP]" in front of the Pull Request title. When you believe the pull request is ready to merge, remove this tag and @mention the appropriate SDL team to schedule a review. +* All new code *must* include unit tests. Bug fixes should have a test that fails previously and now passes. All new features should be covered. If your code does not have tests, or regresses old tests, it will be rejected. +* A great example of a [pull request can be found here](https://github.com/smartdevicelink/SmartDeviceLink-iOS/pull/45). + +### Contributor's License Agreement (CLA) +In order to accept Pull Requests from contributors, you must first sign [the Contributor's License Agreement](https://docs.google.com/forms/d/1VNR8EUd5b46cQ7uNbCq1fJmnu0askNpUp5dudLKRGpU/viewform). If you need to make a change to information that you entered, [please contact us](mailto:theresa@livio.io). + +## Additional Resources +* [General GitHub documentation](https://help.github.com/) +* [GitHub pull request documentation](https://help.github.com/send-pull-requests/) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..1b58b20e86 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,23 @@ +[Delete any non-applicable sections, but we may ask for more information.] + +### Bug Report +[Summary] + +##### Reproduction Steps +1. [Step 1] +2. [Step 2] +3. [Step 3] + +##### Expected Behavior +[Some expected behavior] + +##### Observed Behavior +[Some observed behavior] + +##### OS & Version Information +* OS/Version: [The OS/Version you were running when the bug occurred] +* SDL Core Version: [The version of SDL Core you were using when the bug occurred] +* Testing Against: [What you tested with to observe this behavior. Proxy, App, HMI etc.] + +##### Test Case, Sample Code, and / or Example App +[Paste a link to a PR, gist, or other code that exemplifies this behavior] \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..83c3261f9b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,33 @@ +[Things to note: Pull Requests **must** fix an issue. Discussion about the feature / bug takes place in the issue, discussion of the implementation takes place in the PR. Please also see the [Contributing Guide](https://github.com/smartdevicelink/sdl_core/blob/master/.github/CONTRIBUTING.md) for information on branch naming and the CLA. + +Delete the above section when you've read it.] + +Fixes #[issue number] + +This PR is **[ready / not ready]** for review. + +### Risk +This PR makes **[no / minor / major]** API changes. + +### Testing Plan +[Describe how you plan to unit test the changes in this PR] + +### Summary +[Summary of PR changes] + +### Changelog +##### Breaking Changes +* [Breaking change info] + +##### Enhancements +* [Enhancement info] + +##### Bug Fixes +* [Bug Fix Info] + +### Tasks Remaining: +- [ ] [Task 1] +- [ ] [Task 2] + +### CLA +- [ ] I have signed [the CLA](https://docs.google.com/forms/d/e/1FAIpQLSdsgJY33VByaX482zHzi-xUm49JNnmuJOyAM6uegPQ2LXYVfA/viewform) \ No newline at end of file diff --git a/COMMITTERS.md b/COMMITTERS.md deleted file mode 100644 index 210fceb421..0000000000 --- a/COMMITTERS.md +++ /dev/null @@ -1,95 +0,0 @@ -#Committing changes to SDL - -We would like to make it easier for community members to contribute to SDL -using pull requests. This makes the process of contributing a little easier for the contributor since they don't -need to concern themselves with the question, "What branch do I base my changes -on?" This is already called out in the CONTRIBUTING.md. - -##Terminology -Many of these terms have more than one meaning. For the purposes of this -document, the following terms refer to specific things. - -**contributor** - A person who makes a change to SDL and submits a change -set in the form of a pull request. - -**reviewer** - A person responsible for reviewing a pull request. - -**master branch** - [The base branch](https://github.com/smartdevicelink/sdl_core/tree/master). - -**develop branch** - [The branch](https://github.com/LuxoftSDL/sdl_core/tree/develop) where bug fixes against the latest release or release candidate are merged. - -## Pre-commit hook installation -* Go to tools/infrastructure/ -* Run install-hooks.py -* or : Just run "python tools/infrastructure/install-hooks.py" - -##Pull request checklist -* Add Unit tests. -* All tests pass (see Run all tests section). -* Check component design -* Check amount of required memory, memory leaks. -* Assertion must be used in the right way. -* Are there cyclic dependencies? -* Level of abstraction adequate? -* Are there any platform gotchas? (Does a change make an assumption about - platform specific behavior that is incompatible with other platforms? e.g. - Windows paths vs. POSIX paths). -* Thread safe code. -* No deadlocks. -* Is Doxygen API documentation available? -* Do you have thread specific comment provided? (if another thread uses added method/classes, - there must be comment which explains: When method will be called by thread? Which thread calls the method? e.g.) -* Do you have specific realization code comments? -* Add log messages. -* There are no Google code style errors. (You can download Google [cpplint.py](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py)) -* Check branch naming. -* Check correct commit messages in commits (see Pull request message section). -* Check correct pull request target (`master` or `develop`) -* Check correct pull request message -* Add reviewers - -##Run all tests -* Run in root build directory `make test` - -##Branch naming -Branch name should be: -* `hotfix/` or -* `feature/` or -* `fix/` - -##Pull request message -* Describe the reason why you created pull request and what changes there are. -* Add related Jira ticket as link. - ( EXAMPLE: - `Related: [APPLINK-xxxxx](put direct link here)`) -* If there was an old pull request, add link. ( EXAMPLE: `Old pull request is [here](put direct link here)`) - -##Adding reviewers: -* Add one domain expert -* Add your mentor (for junior developers only) -* Add all junior developers (for junior developers only) - -`Note`: Everyone from SDL team developers can review any pull request (“reviewed” comment is not required) - -##Review process -* Reviewers can leave comments to code only in `commits` tab. -* Contributor must answer each comment (Contributor should specify addressee in comment). -* In case contributor is disagree with reviewer, contributor writes his opinion -* In case contributor is agree with reviewer, contributor leaves link to new commit with changes. -* When reviewer is agree with all changes in pull request, he must leave `Reviewed` comment. - -##Successfully passed review: -* Contributor answered to all comments -* Contributor fixed all mistakes -* All reviewers left `Reviewed` comment - -##Merging -* Successfully passed review. -* Rebase in case of existing conflicts. -* Contributor can squash commits in case of adding same code in different commits. -* Contact @AGaliuzov or @anosach-luxoft to merge pull request. - -##Additional sources -* [Google cppint.py](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py) -* [Git commit best practices](http://chris.beams.io/posts/git-commit/) -* [GitHub Working with formatting](https://help.github.com/articles/working-with-advanced-formatting/) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 42cf5d0898..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,35 +0,0 @@ -# Contributing to SDL Projects - -Third party contributions are essential for making SDL great. However, we do have a few guidelines we need contributors to follow. - -### Issues -If writing a bug report, please make sure it has enough info. Include all relevant information. - -If requesting a feature, understand that we appreciate the input! However, it may not immediately fit our roadmap, and it may take a while for us to get to your request. - -### Gitflow -We use Gitflow as our branch management system. Please follow gitflow's guidelines while contributing to any SDL project. - -### Pull Requests -* Please follow the repository's for all code and documentation. -* All pull requests should be sent to `smartdevicelink/sdl_core/`, to `develop` or `master` branch. -* All feature branches should be based on `develop` and have the format `feature/branch_name`. -* All fix branches should be based on `develop` and have the format `fix/branch_name`. -* All new functionality requests should be provided only for `develop` branch. -* In case defect should be fixed in short time (after release), send pull request to `master` and have the format `hotfix/branch_name`. -* In case defect exists in `develop` and `master` branches, send pull request to `develop` only. Do not send the same pull request to the `master` branch. -* All pull requests should implement a single feature or fix a single bug. Pull Requests that involve multiple changes (it is our discretion what precisely this means) will be rejected with a reason. -* All commits should be separated into logical units, i.e. unrelated changes should be in different commits within a pull request. -* Work in progress pull requests should have "[WIP]" in front of the Pull Request title. When you believe the pull request is ready to merge, remove this tag and @mention the appropriate SDL team to schedule a review. -* All new code *must* include unit tests. Bug fixes should have a test that fails previously and now passes. All new features should be covered. If your code does not have tests, or regresses old tests, it will be rejected. -* A great example of a [pull request can be found here](https://github.com/smartdevicelink/SmartDeviceLink-iOS/pull/45). - -### Contributor's License Agreement (CLA) -In order to accept Pull Requests from contributors, you must first sign [the Contributor's License Agreement](https://docs.google.com/forms/d/1VNR8EUd5b46cQ7uNbCq1fJmnu0askNpUp5dudLKRGpU/viewform). If you need to make a change to information that you entered, [please contact us](mailto:theresa@livio.io). - -## Additional Resources -* [General GitHub documentation](https://help.github.com/) -* [GitHub pull request documentation](https://help.github.com/send-pull-requests/) -* [Contributor's License Agreement](https://docs.google.com/forms/d/1VNR8EUd5b46cQ7uNbCq1fJmnu0askNpUp5dudLKRGpU/viewform) -* [Committers.md](https://github.com/LuxoftSDL/sdl_core/blob/feature/Add_Committers_file/COMMITTERS.md) - -- cgit v1.2.1 From 2b076477a8a9adaceef398f304d1ecae1d938cf4 Mon Sep 17 00:00:00 2001 From: Sho Amano Date: Wed, 4 Oct 2017 13:53:13 +0900 Subject: fix: media_managet_test fails if EXTENDED_MEDIA_MODE is enabled --- src/components/media_manager/test/media_manager_impl_test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc index 7d0226fa67..a9dc27d7a3 100644 --- a/src/components/media_manager/test/media_manager_impl_test.cc +++ b/src/components/media_manager/test/media_manager_impl_test.cc @@ -123,10 +123,12 @@ class MediaManagerImplTest : public ::testing::Test { .WillOnce(Return(mock_app_)); EXPECT_CALL(mock_media_manager_settings_, app_storage_folder()) .WillOnce(ReturnRef(kStorageFolder)); +#ifndef EXTENDED_MEDIA_MODE EXPECT_CALL(mock_media_manager_settings_, app_resource_folder()) .WillOnce(ReturnRef(kResourceFolder)); EXPECT_CALL(mock_media_manager_settings_, recording_file_source()) .WillOnce(ReturnRef(kRecordingFileSource)); +#endif } void InitMediaManagerPrecondition(const std::string& server_type) { -- cgit v1.2.1 From 59e018bdd42fcafe7ddeccc6c25909e18f5178fb Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 4 Oct 2017 11:02:54 -0400 Subject: Remove Remote Control Policies From Default --- src/appMain/sdl_preloaded_pt.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index c4f58c04c2..b912adc10b 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -2344,11 +2344,7 @@ "steal_focus": false, "priority": "NONE", "default_hmi": "NONE", - "groups": ["Base-4", "RemoteControl"], - "moduleType": [ - "RADIO", - "CLIMATE" - ] + "groups": ["Base-4"], }, "device": { "keep_context": false, -- cgit v1.2.1 From a3d5a500ed8f52cbd4c39a4349ad644f1566a4d4 Mon Sep 17 00:00:00 2001 From: JackLivio Date: Wed, 4 Oct 2017 11:04:47 -0400 Subject: Update sdl_preloaded_pt.json --- src/appMain/sdl_preloaded_pt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json index b912adc10b..58abfb6f80 100644 --- a/src/appMain/sdl_preloaded_pt.json +++ b/src/appMain/sdl_preloaded_pt.json @@ -2344,7 +2344,7 @@ "steal_focus": false, "priority": "NONE", "default_hmi": "NONE", - "groups": ["Base-4"], + "groups": ["Base-4"] }, "device": { "keep_context": false, -- cgit v1.2.1 From 096051fc25bd31810941b39bcf2e7bb6d4002944 Mon Sep 17 00:00:00 2001 From: "Andrey Oleynik (GitHub)" Date: Fri, 6 Oct 2017 09:32:38 +0300 Subject: Reverts changes in COMMITERS.md according to review note This reverts commit cf77cfe2e71837cd00467a0a6c449dce8d2bb840. --- COMMITTERS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/COMMITTERS.md b/COMMITTERS.md index dc1665ffbb..210fceb421 100644 --- a/COMMITTERS.md +++ b/COMMITTERS.md @@ -59,7 +59,9 @@ Branch name should be: ##Pull request message * Describe the reason why you created pull request and what changes there are. -* Add related GitHub issue id as link. +* Add related Jira ticket as link. + ( EXAMPLE: + `Related: [APPLINK-xxxxx](put direct link here)`) * If there was an old pull request, add link. ( EXAMPLE: `Old pull request is [here](put direct link here)`) ##Adding reviewers: @@ -85,7 +87,7 @@ Branch name should be: * Successfully passed review. * Rebase in case of existing conflicts. * Contributor can squash commits in case of adding same code in different commits. -* Contact [Livio team](https://livio.io/#our-team) and request to merge pull request +* Contact @AGaliuzov or @anosach-luxoft to merge pull request. ##Additional sources * [Google cppint.py](https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py) -- cgit v1.2.1 From 1c3bea3687c17a5e5909576c5b53b7187e341456 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Fri, 6 Oct 2017 14:40:45 -0400 Subject: Reject invalid enum values in video params Fixes issues where invalid enum values are ignored but still reciprocated in the StartSessionACK --- .../src/application_manager_impl.cc | 34 +++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 1d41388910..9814b4cff8 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1227,8 +1227,22 @@ bool ApplicationManagerImpl::StartNaviService( if (service_type == ServiceType::kMobileNav) { smart_objects::SmartObject converted_params(smart_objects::SmartType_Map); ConvertVideoParamsToSO(converted_params, params); + std::vector rejected_params; + if (converted_params.keyExists(strings::codec) && + converted_params[strings::codec] == + hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM) { + rejected_params.push_back(strings::codec); + } + if (converted_params.keyExists(strings::protocol) && + converted_params[strings::protocol] == + hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM) { + rejected_params.push_back(strings::protocol); + } - if (!converted_params.empty()) { + if (!rejected_params.empty()) { + OnStreamingConfigured(app_id, service_type, false, rejected_params); + return false; + } else if (!converted_params.empty()) { LOG4CXX_INFO(logger_, "Sending video configuration params"); #ifdef DEBUG MessageHelper::PrintSmartObject(converted_params); @@ -1248,6 +1262,8 @@ bool ApplicationManagerImpl::StartNaviService( } else { LOG4CXX_WARN(logger_, "Refused navi service by HMI level"); } + std::vector empty; + OnStreamingConfigured(app_id, service_type, false, empty); return false; } @@ -1390,8 +1406,7 @@ void ApplicationManagerImpl::OnServiceStartedCallback( type, ServiceType::kMobileNav, ServiceType::kAudio)) { if (app->is_navi() || app->mobile_projection_enabled()) { if (!StartNaviService(session_key, type, params)) { - connection_handler().NotifyServiceStartedResult( - session_key, false, empty); + LOG4CXX_WARN(logger_, "Starting Navigation service failed"); } return; } else { @@ -4020,21 +4035,12 @@ void ApplicationManagerImpl::ConvertVideoParamsToSO( const char* protocol = bson_object_get_string(obj, protocol_handler::strings::video_protocol); if (protocol != NULL) { - hmi_apis::Common_VideoStreamingProtocol::eType protocol_enum = - ConvertVideoProtocol(protocol); - if (protocol_enum != - hmi_apis::Common_VideoStreamingProtocol::INVALID_ENUM) { - output[strings::protocol] = protocol_enum; - } + output[strings::protocol] = ConvertVideoProtocol(protocol); } const char* codec = bson_object_get_string(obj, protocol_handler::strings::video_codec); if (codec != NULL) { - hmi_apis::Common_VideoStreamingCodec::eType codec_enum = - ConvertVideoCodec(codec); - if (codec_enum != hmi_apis::Common_VideoStreamingCodec::INVALID_ENUM) { - output[strings::codec] = codec_enum; - } + output[strings::codec] = ConvertVideoCodec(codec); } BsonElement* element = bson_object_get(obj, protocol_handler::strings::height); -- cgit v1.2.1 From b54736202669404d0b4642af2fcf340c873f1e41 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Thu, 12 Oct 2017 17:45:19 -0400 Subject: RC capabilities is set in RC.GetCapabilities, not UI.GetCapabilities Also make sure to set rc_supported based on the result of this RPC --- .../commands/hmi/rc_get_capabilities_response.cc | 11 ++- .../src/commands/hmi/rc_is_ready_request.cc | 6 +- .../commands/hmi/ui_get_capabilities_response.cc | 11 --- .../hmi/rc_get_capabilities_response_test.cc | 73 ++++++++++++++ .../test/commands/hmi/rc_is_ready_request_test.cc | 3 + .../hmi/ui_get_capabilities_response_test.cc | 108 --------------------- src/components/interfaces/HMI_API.xml | 3 + 7 files changed, 92 insertions(+), 123 deletions(-) diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc index 3ff6edd125..82cbd7f128 100644 --- a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc @@ -45,9 +45,14 @@ void RCGetCapabilitiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); - - hmi_capabilities.set_rc_capability( - (*message_)[strings::msg_params][strings::rc_capability]); + bool capability_exists = + (*message_)[strings::msg_params].keyExists(strings::rc_capability); + + if (capability_exists) { + hmi_capabilities.set_rc_capability( + (*message_)[strings::msg_params][strings::rc_capability]); + } + hmi_capabilities.set_rc_supported(capability_exists); } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc index 71b803d198..a976ce1044 100644 --- a/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc +++ b/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc @@ -62,10 +62,14 @@ void RCIsReadyRequest::on_event(const event_engine::Event& event) { HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_is_rc_cooperating(is_available); + if (!is_available) { + hmi_capabilities.set_rc_supported(false); + } + if (!CheckAvailabilityHMIInterfaces(application_manager_, HmiInterfaces::HMI_INTERFACE_RC)) { LOG4CXX_INFO(logger_, - "HmiInterfaces::HMI_INTERFACE_VR isn't available"); + "HmiInterfaces::HMI_INTERFACE_RC isn't available"); return; } SendMessageToHMI(); diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc index 73cf835ff5..3b5aeac639 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc @@ -84,12 +84,6 @@ void UIGetCapabilitiesResponse::Run() { msg_params[strings::hmi_capabilities][strings::video_streaming] .asBool()); } - if (msg_params[strings::hmi_capabilities].keyExists( - strings::remote_control)) { - hmi_capabilities.set_rc_supported( - msg_params[strings::hmi_capabilities][strings::remote_control] - .asBool()); - } } if (msg_params.keyExists(strings::system_capabilities)) { @@ -110,11 +104,6 @@ void UIGetCapabilitiesResponse::Run() { msg_params[strings::system_capabilities] [strings::video_streaming_capability]); } - if (msg_params[strings::system_capabilities].keyExists( - strings::rc_capability)) { - hmi_capabilities.set_rc_capability( - msg_params[strings::system_capabilities][strings::rc_capability]); - } } } diff --git a/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc index f851bd644a..90be018e74 100644 --- a/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc @@ -87,6 +87,78 @@ class RCGetCapabilitiesResponseTest TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) { MessageSharedPtr command_msg = CreateCommandMsg(); + (*command_msg)[strings::msg_params][strings::system_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::rc_capability] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + smart_objects::SmartObject& remote_control_capability = + (*command_msg)[strings::msg_params][strings::system_capabilities] + [strings::rc_capability]; + + remote_control_capability["climateControlCapabilities"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + remote_control_capability["climateControlCapabilities"][0] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + smart_objects::SmartObject& climate_control_capability = + remote_control_capability["climateControlCapabilities"][0]; + + climate_control_capability["moduleName"] = "Climate"; + climate_control_capability["fanSpeedAvailable"] = true; + climate_control_capability["desiredTemperatureAvailable"] = true; + climate_control_capability["acEnableAvailable"] = true; + climate_control_capability["acMaxEnableAvailable"] = true; + climate_control_capability["circulateAirEnableAvailable"] = true; + climate_control_capability["autoModeEnableAvailable"] = true; + climate_control_capability["dualModeEnableAvailable"] = true; + + climate_control_capability["defrostZoneAvailable"] = true; + climate_control_capability["defrostZone"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + climate_control_capability["defrostZone"][0] = "ALL"; + + climate_control_capability["ventilationModeAvailable"] = true; + climate_control_capability["ventilationMode"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + climate_control_capability["ventilationMode"][0] = "BOTH"; + + remote_control_capability["radioControlCapabilities"] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + remote_control_capability["radioControlCapabilities"][0] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + smart_objects::SmartObject& radio_control_capability = + remote_control_capability["radioControlCapabilities"][0]; + + radio_control_capability["moduleName"] = "Radio"; + radio_control_capability["radioEnableAvailable"] = true; + radio_control_capability["radioBandAvailable"] = true; + radio_control_capability["radioFrequencyAvailable"] = true; + radio_control_capability["hdChannelAvailable"] = true; + radio_control_capability["rdsDataAvailable"] = true; + radio_control_capability["availableHDsAvailable"] = true; + radio_control_capability["stateAvailable"] = true; + radio_control_capability["signalStrengthAvailable"] = true; + radio_control_capability["signalChangeThresholdAvailable"] = true; + + remote_control_capability[hmi_response::button_capabilities] = + smart_objects::SmartObject(smart_objects::SmartType_Array); + + remote_control_capability[hmi_response::button_capabilities][0] = + smart_objects::SmartObject(smart_objects::SmartType_Map); + + smart_objects::SmartObject& button_capability = + remote_control_capability[hmi_response::button_capabilities][0]; + + button_capability[strings::button_name] = "OK"; + button_capability["shortPressAvailable"] = true; + button_capability["longPressAvailable"] = true; + button_capability["upDownAvailable"] = true; + RCGetCapabilitiesResponsePtr command( CreateCommand(command_msg)); @@ -97,6 +169,7 @@ TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) { (*command_msg)[strings::msg_params][strings::rc_capability]; EXPECT_CALL(mock_hmi_capabilities_, set_rc_capability(rc_capability_so)); + EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(true)); command->Run(); } diff --git a/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc index af54321ca7..27a77ba990 100644 --- a/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc +++ b/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc @@ -79,6 +79,9 @@ class RCIsReadyRequestTest } EXPECT_CALL(mock_hmi_capabilities_, set_is_rc_cooperating(is_rc_cooperating_available)); + if (!is_rc_cooperating_available) { + EXPECT_CALL(mock_hmi_capabilities_, set_rc_supported(false)); + } if (is_message_contain_param) { EXPECT_CALL(app_mngr_, hmi_interfaces()) diff --git a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc index aabefc382e..b02c9851ee 100644 --- a/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -241,28 +241,6 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreaming_SUCCESS) { command->Run(); } -TEST_F(UIGetCapabilitiesResponseTest, SetRemoteControl_SUCCESS) { - MessageSharedPtr command_msg = CreateCommandMsg(); - (*command_msg)[strings::msg_params][strings::hmi_capabilities] = - smart_objects::SmartObject(smart_objects::SmartType_Map); - (*command_msg)[strings::msg_params][strings::hmi_capabilities] - [strings::remote_control] = true; - - ResponseFromHMIPtr command( - CreateCommand(command_msg)); - - EXPECT_CALL(app_mngr_, hmi_capabilities()) - .WillOnce(ReturnRef(mock_hmi_capabilities_)); - - smart_objects::SmartObject hmi_capabilities_so = - (*command_msg)[strings::msg_params][strings::hmi_capabilities]; - EXPECT_CALL( - mock_hmi_capabilities_, - set_rc_supported(hmi_capabilities_so[strings::remote_control].asBool())); - - command->Run(); -} - TEST_F(UIGetCapabilitiesResponseTest, SetNavigationCapability_SUCCESS) { MessageSharedPtr command_msg = CreateCommandMsg(); (*command_msg)[strings::msg_params][strings::system_capabilities] = @@ -361,92 +339,6 @@ TEST_F(UIGetCapabilitiesResponseTest, SetVideoStreamingCapability_SUCCESS) { command->Run(); } -TEST_F(UIGetCapabilitiesResponseTest, SetRemoteControlCapability_SUCCESS) { - MessageSharedPtr command_msg = CreateCommandMsg(); - (*command_msg)[strings::msg_params][strings::system_capabilities] = - smart_objects::SmartObject(smart_objects::SmartType_Map); - - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::rc_capability] = - smart_objects::SmartObject(smart_objects::SmartType_Map); - smart_objects::SmartObject& remote_control_capability = - (*command_msg)[strings::msg_params][strings::system_capabilities] - [strings::rc_capability]; - - remote_control_capability["climateControlCapabilities"] = - smart_objects::SmartObject(smart_objects::SmartType_Array); - - remote_control_capability["climateControlCapabilities"][0] = - smart_objects::SmartObject(smart_objects::SmartType_Map); - - smart_objects::SmartObject& climate_control_capability = - remote_control_capability["climateControlCapabilities"][0]; - - climate_control_capability["moduleName"] = "Climate"; - climate_control_capability["fanSpeedAvailable"] = true; - climate_control_capability["desiredTemperatureAvailable"] = true; - climate_control_capability["acEnableAvailable"] = true; - climate_control_capability["acMaxEnableAvailable"] = true; - climate_control_capability["circulateAirEnableAvailable"] = true; - climate_control_capability["autoModeEnableAvailable"] = true; - climate_control_capability["dualModeEnableAvailable"] = true; - - climate_control_capability["defrostZoneAvailable"] = true; - climate_control_capability["defrostZone"] = - smart_objects::SmartObject(smart_objects::SmartType_Array); - climate_control_capability["defrostZone"][0] = "ALL"; - - climate_control_capability["ventilationModeAvailable"] = true; - climate_control_capability["ventilationMode"] = - smart_objects::SmartObject(smart_objects::SmartType_Array); - climate_control_capability["ventilationMode"][0] = "BOTH"; - - remote_control_capability["radioControlCapabilities"] = - smart_objects::SmartObject(smart_objects::SmartType_Array); - - remote_control_capability["radioControlCapabilities"][0] = - smart_objects::SmartObject(smart_objects::SmartType_Map); - - smart_objects::SmartObject& radio_control_capability = - remote_control_capability["radioControlCapabilities"][0]; - - radio_control_capability["moduleName"] = "Radio"; - radio_control_capability["radioEnableAvailable"] = true; - radio_control_capability["radioBandAvailable"] = true; - radio_control_capability["radioFrequencyAvailable"] = true; - radio_control_capability["hdChannelAvailable"] = true; - radio_control_capability["rdsDataAvailable"] = true; - radio_control_capability["availableHDsAvailable"] = true; - radio_control_capability["stateAvailable"] = true; - radio_control_capability["signalStrengthAvailable"] = true; - radio_control_capability["signalChangeThresholdAvailable"] = true; - - remote_control_capability[hmi_response::button_capabilities] = - smart_objects::SmartObject(smart_objects::SmartType_Array); - - remote_control_capability[hmi_response::button_capabilities][0] = - smart_objects::SmartObject(smart_objects::SmartType_Map); - - smart_objects::SmartObject& button_capability = - remote_control_capability[hmi_response::button_capabilities][0]; - - button_capability[strings::button_name] = "OK"; - button_capability["shortPressAvailable"] = true; - button_capability["longPressAvailable"] = true; - button_capability["upDownAvailable"] = true; - - ResponseFromHMIPtr command( - CreateCommand(command_msg)); - - EXPECT_CALL(app_mngr_, hmi_capabilities()) - .WillOnce(ReturnRef(mock_hmi_capabilities_)); - - EXPECT_CALL(mock_hmi_capabilities_, - set_rc_capability(remote_control_capability)); - - command->Run(); -} - } // namespace ui_get_capabilities_response } // namespace hmi_commands_test } // namespace commands_test diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 32360aa357..7f68573fae 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -2112,6 +2112,9 @@ Availability of build in phone. True: Available, False: Not Available + + Availability of built-in video streaming. True: Available, False: Not Available + -- cgit v1.2.1 From 913c61c525a852236e0f73212cddfcf3ab3a07a3 Mon Sep 17 00:00:00 2001 From: jacobkeeler Date: Fri, 20 Oct 2017 14:14:22 -0400 Subject: Update HMI API interface versions --- src/components/interfaces/HMI_API.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index 7f68573fae..ab3933fc0f 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -37,7 +37,7 @@ - + @@ -2662,7 +2662,7 @@ - + Method is invoked at system start-up. SDL requests the information about all supported hardware buttons and their capabilities @@ -2746,7 +2746,7 @@ - + HMI must notify SDL about its readiness to start communication. In fact, this has to be the first message between SDL and HMI. @@ -3352,7 +3352,7 @@ - + Request from SDL to show an alert message on the display. @@ -3864,7 +3864,7 @@ - + Method is invoked at system startup. Response must provide the information about presence of UI Navigation module and its readiness to cooperate with SDL. @@ -4887,7 +4887,7 @@ - + Method is invoked at system startup. Response should provide information about presence of any of remote controllable module and its readiness to cooperate with SDL. -- cgit v1.2.1