summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-09-06 15:23:58 -0400
committerGitHub <noreply@github.com>2017-09-06 15:23:58 -0400
commit9fe7901605feff7807f5f557a04015bce6258a1a (patch)
treeaf3dccd8bd75ba120ac1c258c228c79d1f2b4010
parentd33bfa260cd13494b9f6f1b4993e936e60ef2f27 (diff)
parent6c54997a2ea0966af5b289e36b3eca81140da3d7 (diff)
downloadsdl_core-9fe7901605feff7807f5f557a04015bce6258a1a.tar.gz
Merge pull request #1708 from LuxoftAKutsan/feature/sdl_remote_control_baseline
Remote control baseline
-rw-r--r--CMakeLists.txt21
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/output.021759
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/requests78
-rw-r--r--src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/traces.01131
-rw-r--r--src/appMain/CMakeLists.txt17
-rwxr-xr-xsrc/appMain/hmi_capabilities.json153
-rw-r--r--src/appMain/life_cycle.cc6
-rw-r--r--src/appMain/life_cycle.h4
-rw-r--r--src/appMain/sdl_preloaded_pt.json65
-rw-r--r--src/appMain/smartDeviceLink.ini2
-rw-r--r--src/components/CMakeLists.txt6
-rw-r--r--src/components/application_manager/CMakeLists.txt17
-rw-r--r--src/components/application_manager/include/application_manager/app_extension.h58
-rw-r--r--src/components/application_manager/include/application_manager/application.h57
-rw-r--r--src/components/application_manager/include/application_manager/application_impl.h64
-rw-r--r--src/components/application_manager/include/application_manager/application_manager_impl.h70
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h90
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h73
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_request.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/hmi/ui_send_haptic_data_response.h2
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_request.h3
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/send_haptic_data_response.h3
-rw-r--r--src/components/application_manager/include/application_manager/core_service.h214
-rw-r--r--src/components/application_manager/include/application_manager/hmi_capabilities_impl.h10
-rw-r--r--src/components/application_manager/include/application_manager/hmi_interfaces.h3
-rw-r--r--src/components/application_manager/include/application_manager/message.h21
-rw-r--r--src/components/application_manager/include/application_manager/message_helper.h25
-rw-r--r--src/components/application_manager/include/application_manager/policies/policy_handler.h83
-rw-r--r--src/components/application_manager/include/application_manager/service.h183
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h1
-rw-r--r--src/components/application_manager/src/application_impl.cc77
-rw-r--r--src/components/application_manager/src/application_manager_impl.cc277
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc5
-rw-r--r--src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc8
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc55
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc95
-rw-r--r--src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc53
-rw-r--r--src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc3
-rw-r--r--src/components/application_manager/src/commands/mobile/get_system_capability_request.cc12
-rw-r--r--src/components/application_manager/src/commands/mobile/register_app_interface_request.cc13
-rw-r--r--src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc8
-rw-r--r--src/components/application_manager/src/commands/mobile/send_haptic_data_response.cc4
-rw-r--r--src/components/application_manager/src/core_service.cc231
-rw-r--r--src/components/application_manager/src/hmi_capabilities_impl.cc33
-rw-r--r--src/components/application_manager/src/hmi_command_factory.cc25
-rw-r--r--src/components/application_manager/src/hmi_interfaces_impl.cc4
-rw-r--r--src/components/application_manager/src/message.cc44
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc91
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc151
-rw-r--r--src/components/application_manager/src/request_controller.cc10
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc1
-rw-r--r--src/components/application_manager/test/CMakeLists.txt6
-rw-r--r--src/components/application_manager/test/commands/command_request_impl_test.cc6
-rw-r--r--src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc21
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc108
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc172
-rw-r--r--src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc79
-rw-r--r--src/components/application_manager/test/commands/hmi/simple_response_from_hmi_test.cc3
-rw-r--r--src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/alert_request_test.cc3
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_interaction_choice_set_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc19
-rw-r--r--src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc3
-rw-r--r--src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc8
-rw-r--r--src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc5
-rw-r--r--src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc35
-rw-r--r--src/components/application_manager/test/commands/mobile/set_display_layout_test.cc4
-rw-r--r--src/components/application_manager/test/commands/mobile/show_test.cc12
-rw-r--r--src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_button_request_test.cc2
-rw-r--r--src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc4
-rw-r--r--src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc6
-rw-r--r--src/components/application_manager/test/hmi_capabilities.json332
-rw-r--r--src/components/application_manager/test/hmi_capabilities_test.cc47
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_application.h30
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_hmi_capabilities.h6
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_message_helper.h9
-rwxr-xr-xsrc/components/application_manager/test/message_helper/CMakeLists.txt7
-rw-r--r--src/components/application_manager/test/mock_message_helper.cc23
-rw-r--r--src/components/application_manager/test/rc_policy_handler_test.cc400
-rw-r--r--src/components/config_profile/include/config_profile/profile.h23
-rw-r--r--src/components/config_profile/src/profile.cc11
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc4
-rw-r--r--src/components/formatters/test/meta_formatter_test.cc43
-rw-r--r--src/components/formatters/test/src/create_smartSchema.cc1
-rw-r--r--src/components/formatters/test/src/meta_formatter_test_helper.cc27
-rw-r--r--src/components/functional_module/CMakeLists.txt58
-rw-r--r--src/components/functional_module/include/functional_module/function_ids.h63
-rw-r--r--src/components/functional_module/include/functional_module/generic_module.h179
-rw-r--r--src/components/functional_module/include/functional_module/module_observer.h54
-rw-r--r--src/components/functional_module/include/functional_module/plugin_manager.h158
-rw-r--r--src/components/functional_module/include/functional_module/timer/module_timer.h246
-rw-r--r--src/components/functional_module/include/functional_module/timer/timer_director.h92
-rw-r--r--src/components/functional_module/src/generic_module.cc54
-rw-r--r--src/components/functional_module/src/plugin_manager.cc393
-rw-r--r--src/components/functional_module/src/timer/timer_director.cc156
-rw-r--r--src/components/functional_module/test/CMakeLists.txt53
-rw-r--r--src/components/functional_module/test/include/driver_generic_module_test.h80
-rw-r--r--src/components/functional_module/test/include/mock_application.h248
-rw-r--r--src/components/functional_module/test/include/mock_module_observer.h50
-rw-r--r--src/components/functional_module/test/include/mock_service.h76
-rw-r--r--src/components/functional_module/test/include/module_timer_test.h56
-rw-r--r--src/components/functional_module/test/plugins/CMakeLists.txt17
-rw-r--r--src/components/functional_module/test/plugins/mock_generic_module.cc23
-rw-r--r--src/components/functional_module/test/plugins/mock_generic_module.h71
-rw-r--r--src/components/functional_module/test/src/generic_module_test.cc106
-rw-r--r--src/components/functional_module/test/src/module_timer_test.cc123
-rw-r--r--src/components/functional_module/test/src/plugin_manager_test.cc146
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_adapter_impl.h2
-rw-r--r--src/components/hmi_message_handler/include/hmi_message_handler/hmi_message_handler_impl.h19
-rw-r--r--src/components/hmi_message_handler/src/hmi_message_handler_impl.cc3
-rw-r--r--src/components/hmi_message_handler/src/messagebroker_adapter.cc4
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_adapter_test.cc4
-rw-r--r--src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc6
-rw-r--r--src/components/include/application_manager/application_manager.h49
-rw-r--r--src/components/include/application_manager/application_manager_settings.h1
-rw-r--r--src/components/include/application_manager/hmi_capabilities.h12
-rw-r--r--src/components/include/application_manager/policies/policy_handler_interface.h68
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_adapter.h6
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_handler_settings.h2
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_observer.h1
-rw-r--r--src/components/include/hmi_message_handler/hmi_message_sender.h1
-rw-r--r--src/components/include/policy/policy_external/policy/policy_listener.h78
-rw-r--r--src/components/include/policy/policy_external/policy/policy_manager.h183
-rw-r--r--src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h8
-rw-r--r--src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h31
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_listener.h (renamed from src/components/policy/policy_regular/include/policy/policy_listener.h)45
-rw-r--r--src/components/include/policy/policy_regular/policy/policy_manager.h174
-rw-r--r--src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h (renamed from src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h)6
-rw-r--r--src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h31
-rw-r--r--src/components/include/test/application_manager/mock_application_manager.h23
-rw-r--r--src/components/include/test/application_manager/mock_application_manager_settings.h1
-rw-r--r--src/components/include/test/application_manager/policies/mock_policy_handler_interface.h30
-rw-r--r--src/components/include/test/hmi_message_handler/mock_hmi_message_handler_settings.h2
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_cache_manager.h (renamed from src/components/policy/policy_external/test/include/policy/mock_cache_manager.h)6
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_listener.h16
-rw-r--r--src/components/include/test/policy/policy_external/policy/mock_policy_manager.h25
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h (renamed from src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h)10
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h (renamed from src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h)43
-rw-r--r--src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h24
-rw-r--r--src/components/include/utils/macro.h11
-rw-r--r--src/components/interfaces/HMI_API.xml424
-rw-r--r--src/components/interfaces/MOBILE_API.xml448
-rw-r--r--src/components/media_manager/CMakeLists.txt7
-rw-r--r--src/components/media_manager/include/media_manager/media_manager_impl.h7
-rw-r--r--src/components/media_manager/src/media_manager_impl.cc8
-rw-r--r--src/components/media_manager/test/media_manager_impl_test.cc423
-rw-r--r--src/components/policy/policy_external/CMakeLists.txt4
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote.h139
-rw-r--r--src/components/policy/policy_external/include/policy/access_remote_impl.h174
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h8
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager_interface.h4
-rw-r--r--src/components/policy/policy_external/include/policy/policy_helper.h3
-rw-r--r--src/components/policy/policy_external/include/policy/policy_manager_impl.h802
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/enums.h3
-rw-r--r--src/components/policy/policy_external/include/policy/policy_table/types.h12
-rw-r--r--src/components/policy/policy_external/include/policy/policy_types.h1
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_queries.h12
-rw-r--r--src/components/policy/policy_external/include/policy/sql_pt_representation.h17
-rw-r--r--src/components/policy/policy_external/src/access_remote_impl.cc261
-rw-r--r--src/components/policy/policy_external/src/policy_helper.cc3
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc168
-rw-r--r--src/components/policy/policy_external/src/policy_table/enums.cc43
-rw-r--r--src/components/policy/policy_external/src/policy_table/types.cc30
-rw-r--r--src/components/policy/policy_external/src/policy_table/validation.cc38
-rw-r--r--src/components/policy/policy_external/src/sql_pt_queries.cc136
-rw-r--r--src/components/policy/policy_external/src/sql_pt_representation.cc222
-rw-r--r--src/components/policy/policy_external/test/CMakeLists.txt6
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_access_remote.h73
-rw-r--r--src/components/policy/policy_external/test/include/policy/mock_app_stopwatch.h53
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_test_base.cc2
-rw-r--r--src/components/policy/policy_external/test/sql_pt_representation_test.cc4
-rw-r--r--src/components/policy/policy_regular/CMakeLists.txt9
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote.h122
-rw-r--r--src/components/policy/policy_regular/include/policy/access_remote_impl.h169
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager.h18
-rw-r--r--src/components/policy/policy_regular/include/policy/cache_manager_interface.h14
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_manager_impl.h796
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/enums.h4
-rw-r--r--src/components/policy/policy_regular/include/policy/policy_table/types.h12
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_queries.h13
-rw-r--r--src/components/policy/policy_regular/include/policy/sql_pt_representation.h17
-rw-r--r--src/components/policy/policy_regular/src/access_remote_impl.cc247
-rw-r--r--src/components/policy/policy_regular/src/cache_manager.cc17
-rw-r--r--src/components/policy/policy_regular/src/policy_manager_impl.cc149
-rw-r--r--src/components/policy/policy_regular/src/policy_table/enums.cc42
-rw-r--r--src/components/policy/policy_regular/src/policy_table/types.cc29
-rw-r--r--src/components/policy/policy_regular/src/policy_table/validation.cc40
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_queries.cc82
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc226
-rw-r--r--src/components/policy/policy_regular/test/CMakeLists.txt6
-rw-r--r--src/components/policy/policy_regular/test/access_remote_impl_test.cc95
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_access_remote.h73
-rw-r--r--src/components/policy/policy_regular/test/include/policy/mock_policy_manager.h185
-rw-r--r--src/components/policy/policy_regular/test/policy_manager_impl_test.cc24
-rw-r--r--src/components/policy/policy_regular/test/sql_pt_representation_test.cc39
-rw-r--r--src/components/protocol_handler/test/protocol_packet_test.cc15
-rw-r--r--src/components/remote_control/CMakeLists.txt83
-rw-r--r--src/components/remote_control/include/remote_control/commands/base_command_notification.h110
-rw-r--r--src/components/remote_control/include/remote_control/commands/base_command_request.h293
-rw-r--r--src/components/remote_control/include/remote_control/commands/button_press_request.h104
-rw-r--r--src/components/remote_control/include/remote_control/commands/command.h84
-rw-r--r--src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h101
-rw-r--r--src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h75
-rw-r--r--src/components/remote_control/include/remote_control/commands/on_remote_control_settings_notification.h79
-rw-r--r--src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h127
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event.h127
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h203
-rw-r--r--src/components/remote_control/include/remote_control/event_engine/event_observer.h96
-rw-r--r--src/components/remote_control/include/remote_control/message_helper.h122
-rw-r--r--src/components/remote_control/include/remote_control/module_helper.h0
-rw-r--r--src/components/remote_control/include/remote_control/rc_app_extension.h82
-rw-r--r--src/components/remote_control/include/remote_control/rc_command_factory.h66
-rw-r--r--src/components/remote_control/include/remote_control/rc_module_constants.h233
-rw-r--r--src/components/remote_control/include/remote_control/rc_module_timer.h70
-rw-r--r--src/components/remote_control/include/remote_control/remote_control_event.h82
-rw-r--r--src/components/remote_control/include/remote_control/remote_control_plugin.h163
-rw-r--r--src/components/remote_control/include/remote_control/remote_plugin_interface.h118
-rw-r--r--src/components/remote_control/include/remote_control/request_controller.h110
-rw-r--r--src/components/remote_control/include/remote_control/resource_allocation_manager.h114
-rw-r--r--src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h136
-rw-r--r--src/components/remote_control/src/commands/base_command_notification.cc154
-rw-r--r--src/components/remote_control/src/commands/base_command_request.cc564
-rw-r--r--src/components/remote_control/src/commands/button_press_request.cc264
-rw-r--r--src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc224
-rw-r--r--src/components/remote_control/src/commands/on_interior_vehicle_data_notification.cc103
-rw-r--r--src/components/remote_control/src/commands/on_remote_control_settings_notification.cc122
-rw-r--r--src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc350
-rw-r--r--src/components/remote_control/src/message_helper.cc154
-rw-r--r--src/components/remote_control/src/module_helper.cc0
-rw-r--r--src/components/remote_control/src/rc_app_extension.cc62
-rw-r--r--src/components/remote_control/src/rc_command_factory.cc86
-rw-r--r--src/components/remote_control/src/remote_control_event.cc56
-rw-r--r--src/components/remote_control/src/remote_control_plugin.cc334
-rw-r--r--src/components/remote_control/src/request_controller.cc96
-rw-r--r--src/components/remote_control/src/resource_allocation_manager_impl.cc373
-rw-r--r--src/components/remote_control/test/CMakeLists.txt67
-rw-r--r--src/components/remote_control/test/commands/CMakeLists.txt62
-rw-r--r--src/components/remote_control/test/commands/button_press_request_test.cc344
-rw-r--r--src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc291
-rw-r--r--src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc182
-rw-r--r--src/components/remote_control/test/commands/on_remote_control_settings_test.cc326
-rw-r--r--src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc433
-rw-r--r--src/components/remote_control/test/include/mock_application.h335
-rw-r--r--src/components/remote_control/test/include/mock_remote_control_plugin.h54
-rw-r--r--src/components/remote_control/test/include/mock_resource_allocation_manager.h40
-rw-r--r--src/components/remote_control/test/src/rc_app_extension_test.cc43
-rw-r--r--src/components/remote_control/test/src/rc_library_test.cc92
-rw-r--r--src/components/remote_control/test/src/rc_module_test.cc263
-rw-r--r--src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc470
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc11
-rw-r--r--src/components/telemetry_monitor/CMakeLists.txt2
-rw-r--r--src/components/telemetry_monitor/src/telemetry_monitor.cc64
-rw-r--r--src/components/telemetry_monitor/test/telemetry_monitor_test.cc8
-rw-r--r--src/components/transport_manager/test/transport_manager_impl_test.cc8
-rw-r--r--src/components/utils/include/utils/file_system.h1
-rw-r--r--src/components/utils/include/utils/log_message_loop_thread.h2
-rw-r--r--src/components/utils/src/file_system.cc43
-rw-r--r--src/components/utils/src/log_message_loop_thread.cc4
-rw-r--r--src/components/utils/src/threads/thread_delegate.cc1
-rw-r--r--src/components/utils/test/async_runner_test.cc112
-rw-r--r--src/components/utils/test/conditional_variable_test.cc2
-rw-r--r--src/components/utils/test/messagemeter_test.cc10
-rw-r--r--src/components/utils/test/scope_guard_test.cc18
-rw-r--r--src/components/utils/test/shared_ptr_test.cc2
-rw-r--r--src/components/utils/test/sqlite_wrapper/sql_query_test.cc4
270 files changed, 21203 insertions, 24303 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e68df883f..b8fd497a09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,11 +52,11 @@ 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)
-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)
@@ -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/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/output.0 b/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/output.0
deleted file mode 100644
index 5feeff5217..0000000000
--- a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/output.0
+++ /dev/null
@@ -1,21759 +0,0 @@
-@%:@! /bin/sh
-@%:@ Guess values for system-dependent variables and create Makefiles.
-@%:@ Generated by GNU Autoconf 2.69.
-@%:@
-@%:@
-@%:@ 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 \$(( 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 about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do 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 @S|@? 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 "@S|@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 @S|@as_val. Take advantage of shells that can avoid forks. The arguments
-@%:@ must be portable across @S|@(()) 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 @S|@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'"
-
-
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "$0" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit 0
-fi
-
-# 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
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string=`eval $cmd`) 2>/dev/null &&
- echo_test_string=`eval $cmd` &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL $0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL $0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "$0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
-fi
-
-
-
-
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&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=.
-LIB@&t@OBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-PACKAGE_URL=
-
-ac_unique_file="src/main/cpp/logger.cpp"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='LTLIBOBJS
-LIB@&t@OBJS
-LOGCHAR_IS_UNICHAR
-LOGCHAR_IS_WCHAR
-LOGCHAR_IS_UTF8
-CHARSET_EBCDIC
-CHARSET_USASCII
-CHARSET_ISO88591
-CHARSET_UTF8
-CFSTRING_API
-UNICHAR_API
-WCHAR_T_API
-CHAR_API
-HAS_LIBESMTP
-CPPFLAGS_ODBC
-LIBS_ODBC
-IODBC_CONFIG
-HAS_ODBC
-HAS_FWIDE
-HAS_WCHAR_T
-HAS_STD_LOCALE
-HAS_SYSLOG
-HAS_WCSTOMBS
-HAS_MBSRTOWCS
-APU_LIBS
-APR_LIBS
-base_dir
-manual_dest
-enable_latex_docs
-enable_html_docs
-enable_dot
-LATEX_DOC_FALSE
-LATEX_DOC_TRUE
-DOC_FALSE
-DOC_TRUE
-DOT
-DOXYGEN
-LIBTOOL
-ac_ct_F77
-FFLAGS
-F77
-CXXCPP
-am__fastdepCXX_FALSE
-am__fastdepCXX_TRUE
-CXXDEPMODE
-ac_ct_CXX
-CXXFLAGS
-CXX
-CPP
-RANLIB
-AR
-ECHO
-LN_S
-EGREP
-GREP
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-LT_VERSION
-target_os
-target_vendor
-target_cpu
-target
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-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_shared
-enable_static
-enable_fast_install
-enable_dependency_tracking
-with_gnu_ld
-enable_libtool_lock
-with_pic
-with_tags
-enable_doxygen
-enable_dot
-enable_html_docs
-enable_latex_docs
-with_apr
-with_apr_util
-with_ODBC
-with_SMTP
-enable_char
-enable_wchar_t
-enable_unichar
-enable_cfstring
-with_charset
-with_logchar
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP
-CXX
-CXXFLAGS
-CCC
-CXXCPP
-F77
-FFLAGS'
-
-
-# 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}'
-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 this package 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
- @<:@@S|@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/PACKAGE@:>@
- --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]
- --target=TARGET configure for building compilers for TARGET [HOST]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
- 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-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@:>@
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
- --disable-libtool-lock avoid locking (might break parallel builds)
- --enable-doxygen enable documentation generation with doxygen (auto)
- --enable-dot use 'dot' to generate graphs in doxygen (auto)
- --enable-html-docs enable HTML generation with doxygen (yes)
- --enable-latex-docs enable LaTeX documentation generation with doxygen
- (no)
- --enable-char enable char API (yes)
- --enable-wchar_t enable wchar_t API (yes if wchar_t available)
- --enable-unichar enable unichar API (no)
- --enable-cfstring enable cfstring API (no)
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@
- --with-pic try to use only PIC/non-PIC objects @<:@default=use
- both@:>@
- --with-tags@<:@=TAGS@:>@ include additional configurations @<:@automatic@:>@
- --with-apr=PATH prefix for installed APR or the full path to
- apr-config
- --with-apr-util=PATH prefix for installed APU or the full path to
- apu-config
- --with-ODBC ODBC support. Accepted arguments : unixODBC, iODBC,
- Microsoft, no (default=no)
- --with-SMTP SMTP support. Accepted arguments : libesmtp, no
- (default=no)
- --with-charset=TYPE locale charset. Accepted TYPE variants: auto, utf-8,
- iso-8859-1, usascii, ebcdic (default=auto)
- --with-logchar=TYPE type for logchar. Accepted TYPE variants: utf-8,
- wchar_t, unichar (default=utf-8)
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- CXXCPP C++ preprocessor
- F77 Fortran 77 compiler command
- FFLAGS Fortran 77 compiler flags
-
-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 the package provider.
-_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
-configure
-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.@S|@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.@S|@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_try_cpp LINENO
-@%:@ ----------------------
-@%:@ Try to preprocess conftest.@S|@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_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;}
- ;;
-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_try_run LINENO
-@%:@ ----------------------
-@%:@ Try to link conftest.@S|@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_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_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 <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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_cxx_try_compile LINENO
-@%:@ ----------------------------
-@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_cxx_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_cxx_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_cxx_try_compile
-
-@%:@ ac_fn_cxx_try_cpp LINENO
-@%:@ ------------------------
-@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_cxx_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_cxx_preproc_warn_flag$ac_cxx_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_cxx_try_cpp
-
-@%:@ ac_fn_cxx_try_link LINENO
-@%:@ -------------------------
-@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_cxx_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_cxx_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_cxx_try_link
-
-@%:@ ac_fn_f77_try_compile LINENO
-@%:@ ----------------------------
-@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_f77_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_f77_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_f77_try_compile
-
-@%:@ ac_fn_f77_try_link LINENO
-@%:@ -------------------------
-@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded.
-ac_fn_f77_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_f77_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_f77_try_link
-
-@%:@ ac_fn_cxx_check_func LINENO FUNC VAR
-@%:@ ------------------------------------
-@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_cxx_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 <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#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_cxx_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_cxx_check_func
-
-@%:@ ac_fn_cxx_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_cxx_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_cxx_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_cxx_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_cxx_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;}
- ;;
-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_cxx_check_header_mongrel
-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 $as_me, 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
-
-
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# autoconf 2.50 or higher to rebuild aclocal.m4, because the
-# AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
-
-
-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.
-
-
-# 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
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-#
-# +1 : ? : +1 == new interface that does not break old one
-# +1 : ? : 0 == new interface that breaks old one
-# ? : ? : 0 == no new interfaces, but breaks apps
-# ? :+1 : ? == just some internal changes, nothing breaks but might work
-# better
-# CURRENT : REVISION : AGE
-LT_VERSION=10:0:0
-
-
-
-
-
-am__api_version="1.9"
-# 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; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
-# 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 (
- 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
- rm -f conftest.file
- 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
-
- 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; }
-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`
-
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
-# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
-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 mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
- # We used to keeping the `.' as first argument, in order to
- # allow $(mkdir_p) to be used without argument. As in
- # $(mkdir_p) $(somedir)
- # where $(somedir) is conditionally defined. However this is wrong
- # for two reasons:
- # 1. if the package is installed by a user who cannot write `.'
- # make install will fail,
- # 2. the above comment should most certainly read
- # $(mkdir_p) $(DESTDIR)$(somedir)
- # so it does not work when $(somedir) is undefined and
- # $(DESTDIR) is not.
- # To support the latter case, we have to write
- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
- # so the `.' trick is pointless.
- mkdir_p='mkdir -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-p ./--version;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs)'
- else
- mkdir_p='$(install_sh) -d'
- fi
-fi
-
-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
-
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
-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=log4cxx
- VERSION=0.10.0
-
-
-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"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
-
-# 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="\${SHELL} \$(install_sh) -c -s"
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
-
-
-
-
-
-
-# Checks for programs
-# ----------------------------------------------------------------------------
-
-@%:@ 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 --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
-
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo done
-.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
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
- am__include=include
- am__quote=
- _am_result=GNU
-fi
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
- am__include=.include
- am__quote="\""
- _am_result=BSD
- fi
-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='\'
-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 <stdio.h>
-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 <stdarg.h>
-#include <stdio.h>
-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
-
-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'.
- 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
- 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 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- 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
- ;;
- none) break ;;
- esac
- # 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.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} 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 ${lt_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # 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
-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
-
-fi
-
-SED=$lt_cv_path_SED
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5
-$as_echo "$SED" >&6; }
-
-{ $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"
-
-
-
-@%:@ 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 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&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 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&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 $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
- 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
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD-compatible nm" >&5
-$as_echo_n "checking for BSD-compatible 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
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
-
-{ $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
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognise dependent libraries" >&5
-$as_echo_n "checking how to recognise 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
-aix4* | aix5*)
- 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'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | kfreebsd*-gnu | 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
- ;;
-
-gnu*)
- 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]) 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
- ;;
-
-interix3*)
- # 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 Linux ELF.
-linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd* | netbsdelf*-gnu | knetbsd*-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=unknown
- ;;
-
-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
- ;;
-
-solaris*)
- 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
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- 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_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-# 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 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 __oline__ "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-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|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-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- 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-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- 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
- ;;
-sparc*-*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*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-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 <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> 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 <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@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 <ac_nonexistent.h>
-_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 <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> 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 <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@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 <ac_nonexistent.h>
-_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 <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-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 <string.h>
-
-_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 <stdlib.h>
-
-_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 <ctype.h>
-#include <stdlib.h>
-#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_mongrel "$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
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- 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_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # 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_CXX="$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
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-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_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$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_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- 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
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# 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_cxx_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_cxx_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_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GXX=yes
-else
- GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-else
- CXXFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_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_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-depcc="$CXX" 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_CXX_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'.
- 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_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- 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 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- 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
- ;;
- none) break ;;
- esac
- # 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.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} 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_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-
-
-
-
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_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; }
-if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> 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 <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_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 <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_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_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> 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 <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_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 <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_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 \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-fi
-
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor
- 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_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$F77"; then
- ac_cv_prog_F77="$F77" # 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_F77="$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
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5
-$as_echo "$F77" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$F77" && break
- done
-fi
-if test -z "$F77"; then
- ac_ct_F77=$F77
- for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor
-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_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_F77"; then
- ac_cv_prog_ac_ct_F77="$ac_ct_F77" # 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_F77="$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_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5
-$as_echo "$ac_ct_F77" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_F77" && break
-done
-
- if test "x$ac_ct_F77" = x; then
- F77=""
- 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
- F77=$ac_ct_F77
- fi
-fi
-
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 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
-rm -f a.out
-
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file. (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5
-$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
-if ${ac_cv_f77_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat > conftest.$ac_ext <<_ACEOF
- program main
-#ifndef __GNUC__
- choke me
-#endif
-
- end
-_ACEOF
-if ac_fn_f77_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_f77_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5
-$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5
-$as_echo_n "checking whether $F77 accepts -g... " >&6; }
-if ${ac_cv_prog_f77_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- FFLAGS=-g
-cat > conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-if ac_fn_f77_try_compile "$LINENO"; then :
- ac_cv_prog_f77_g=yes
-else
- ac_cv_prog_f77_g=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5
-$as_echo "$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
- FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-g -O2"
- else
- FFLAGS="-g"
- fi
-else
- if test "x$ac_cv_f77_compiler_gnu" = xyes; then
- FFLAGS="-O2"
- else
- FFLAGS=
- fi
-fi
-
-if test $ac_compiler_gnu = yes; then
- G77=yes
-else
- G77=
-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
-
-
-
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-
-# 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*)
- # 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;
- ;;
-
- 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
- ;;
-
- 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
- ;;
- *)
- # 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.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- 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`
- ;;
- 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
-
-
-
-
-# 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]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \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\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[ABCDEGRST]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux*)
- if test "$host_cpu" = ia64; then
- symcode='[ABCDGIRSTW]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- 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
-
-# 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
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Try without a prefix undercore, 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.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-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 <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_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_save_LIBS"
- CFLAGS="$lt_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 -f 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
-
-{ $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
-
-
-
-
-
-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
-
-# 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 to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; 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}ar"
- $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
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
- ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; 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="ar"
- $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
-
- 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
-else
- AR="$ac_cv_prog_AR"
-fi
-
-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
-
-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
-
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-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 \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-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 <<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
-
-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 <<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
-
-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
-
-enable_dlopen=no
-enable_win32_dll=no
-
-@%:@ 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
-
-
-@%:@ Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
- withval=$with_pic; pic_mode="$withval"
-else
- pic_mode=default
-fi
-
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-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;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-
-# 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 warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$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
-printf "$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 conftest*
-
-
-
-lt_prog_compiler_no_builtin_flag=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag=' -fno-builtin'
-
-
-{ $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
- printf "$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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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=
-
-{ $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 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*)
- # 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'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # 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'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
-
- interix3*)
- # 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
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # 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='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- 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
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic='-qnocommon'
- lt_prog_compiler_wl='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # 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'
- ;;
-
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # 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'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- 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
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-#
-# 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_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- printf "$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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works" >&5
-$as_echo "$lt_prog_compiler_pic_works" >&6; }
-
-if test x"$lt_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
-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
-
-#
-# 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_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
- fi
- else
- lt_prog_compiler_static_works=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works" >&5
-$as_echo "$lt_prog_compiler_static_works" >&6; }
-
-if test x"$lt_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
- printf "$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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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 ..
- rmdir 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=
- enable_shared_with_static_runtimes=no
- archive_cmds=
- archive_expsym_cmds=
- old_archive_From_new_cmds=
- old_archive_from_expsyms_cmds=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- thread_safe_flag_spec=
- hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld=
- hardcode_libdir_separator=
- hardcode_direct=no
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- link_all_deplibs=unknown
- hardcode_automatic=no
- module_cmds=
- module_expsym_cmds=
- always_export_symbols=no
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # 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_"
- # 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.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # 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
- ;;
- esac
-
- ld_shlibs=yes
- if test "$with_gnu_ld" = 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>/dev/null` in
- *\ [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
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- 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
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> 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*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- 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/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- 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
- ;;
-
- interix3*)
- 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'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- 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; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # 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; $echo \"$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' ;;
- esac
- archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; 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 -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- link_all_deplibs=no
- else
- ld_shlibs=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-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 $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'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<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.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- 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
- ;;
-
- 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
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$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 $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
-
- 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
- ;;
-
- aix4* | aix5*)
- 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
- 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")) && (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].*|aix5*)
- 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_libdir_separator=':'
- link_all_deplibs=yes
-
- 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
- hardcode_direct=yes
- 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
- 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
-
- # 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.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 echo "${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.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- 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*)
- 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
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # 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.
- 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 `echo "$deplibs" | $SED -e '\''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'
- fix_srcfile_path='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- whole_archive_flag_spec=''
- link_all_deplibs=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- freebsd1*)
- ld_shlibs=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 -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # GNU/kFreeBSD uses gcc -shared to do shared libraries.
- kfreebsd*-gnu)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- link_all_deplibs=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${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 -a "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared -fPIC ${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
- 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 -a "$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 ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -shared -fPIC ${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'
- ;;
- *)
- archive_cmds='$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
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld='+b $libdir'
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- link_all_deplibs=yes
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-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
- ;;
-
- openbsd*)
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- 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
- ;;
-
- 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" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- 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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${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='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -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; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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
- hardcode_libdir_separator=:
- ;;
-
- solaris*)
- no_undefined_flag=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared ${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 ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- 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'
- 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 linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- 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*)
- 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='`test -z "$SCOABSPATH" && echo ${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,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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
- 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
-
-#
-# 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; }
- $rm conftest*
- printf "$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
- archive_cmds_need_lc=no
- else
- archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
-$as_echo "$archive_cmds_need_lc" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-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"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # 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.
- 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
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-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
- 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'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- 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<name>.so
- # instead of lib<name>.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*)
- 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=`$echo "X$lib" | $Xsed -e '\''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'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- 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*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- 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'
- 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="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- 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
- ;;
- 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
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # 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}${versuffix}$shared_ext ${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`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- 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
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-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='GNU ld.so'
- ;;
-
-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[123]*) 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
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-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
- 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'
- ;;
-
-interix3*)
- 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'
- 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
- 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 Linux ELF.
-linux*)
- 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'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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'
- ;;
-
-knetbsd*-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='GNU ld.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
- 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=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=yes
- ;;
-
-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"
- ;;
-
-solaris*)
- 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=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
- 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
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- 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
- 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
- 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'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- 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'
- ;;
-
-uts4*)
- version_type=linux
- 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
-
-{ $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-existant 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_AC_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; 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
-
-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"
- { $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
-
-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*)
- 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="-dld"
-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="-dld"
-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 <<EOF
-#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#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
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=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;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-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 <<EOF
-#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#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
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=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;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- exit (status);
-}
-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
-
-
-# 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
- ;;
-
-aix4* | aix5*)
- 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; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler \
- CC \
- LD \
- lt_prog_compiler_wl \
- lt_prog_compiler_pic \
- lt_prog_compiler_static \
- lt_prog_compiler_no_builtin_flag \
- export_dynamic_flag_spec \
- thread_safe_flag_spec \
- whole_archive_flag_spec \
- enable_shared_with_static_runtimes \
- old_archive_cmds \
- old_archive_from_new_cmds \
- predep_objects \
- postdep_objects \
- predeps \
- postdeps \
- compiler_lib_search_path \
- archive_cmds \
- archive_expsym_cmds \
- postinstall_cmds \
- postuninstall_cmds \
- old_archive_from_expsyms_cmds \
- allow_undefined_flag \
- no_undefined_flag \
- export_symbols_cmds \
- hardcode_libdir_flag_spec \
- hardcode_libdir_flag_spec_ld \
- hardcode_libdir_separator \
- hardcode_automatic \
- module_cmds \
- module_expsym_cmds \
- lt_cv_prog_compiler_c_o \
- exclude_expsyms \
- include_expsyms; do
-
- case $var in
- old_archive_cmds | \
- old_archive_from_new_cmds | \
- archive_cmds | \
- archive_expsym_cmds | \
- module_cmds | \
- module_expsym_cmds | \
- old_archive_from_expsyms_cmds | \
- export_symbols_cmds | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5
-$as_echo "$as_me: creating $ofile" >&6;}
-
- cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 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, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# 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.
-
-# 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//"
-
-# 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
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# 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
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# 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
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# 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 and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# 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
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# 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 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
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# 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
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
-
-# 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
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_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
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
-
- case $host_os in
- aix3*)
- cat <<\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
-EOF
- ;;
- esac
-
- # 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)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-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"
-
-
-@%:@ Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then :
- withval=$with_tags; tagnames="$withval"
-fi
-
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not exist" >&5
-$as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-$as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-$as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
- fi
- fi
- if test -z "$LTCFLAGS"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
- "") ;;
- *) as_fn_error $? "invalid tag name: $tagname" "$LINENO" 5
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- as_fn_error $? "tag name \"$tagname\" already exists" "$LINENO" 5
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# 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 warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$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
-printf "$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 conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-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++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-else
- lt_prog_compiler_no_builtin_flag_CXX=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
-
-@%:@ 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 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&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 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_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
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${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
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- 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.
- archive_cmds_CXX='$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 "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-{ $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; }
-ld_shlibs_CXX=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix4* | aix5*)
- 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].*|aix5*)
- 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.
-
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
-
- 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
- hardcode_direct_CXX=yes
- else
- # We have old collect2
- hardcode_direct_CXX=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_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- 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
-
- # 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_CXX=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_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_CXX='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$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.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_CXX='${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_CXX=' ${wl}-bernotok'
- allow_undefined_flag_CXX=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_CXX="\$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
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_CXX='$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...
- archive_expsym_cmds_CXX='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
- ld_shlibs_CXX=no
- fi
- ;;
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- whole_archive_flag_spec_CXX=''
- link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$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'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_CXX=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- freebsd[12]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- ld_shlibs_CXX=no
- ;;
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='${wl}-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=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
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$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) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${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
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
- ;;
- *)
- export_dynamic_flag_spec_CXX='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- ;;
- *)
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=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
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$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; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${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
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- interix3*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${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_CXX='$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_CXX='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++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -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.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
- ;;
- linux*)
- 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.
- archive_cmds_CXX='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'
- archive_expsym_cmds_CXX='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; echo $list'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # 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."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$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
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- archive_expsym_cmds_CXX='$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'
-
- hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
- whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$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
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # 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=`echo $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; echo $list'
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=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::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- ld_shlibs_CXX=no
- ;;
- openbsd*)
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- ;;
- osf3*)
- 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.
- archive_cmds_CXX='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'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # 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=`echo $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; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # 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 "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- 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.
- archive_cmds_CXX='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'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_CXX='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'
-
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # 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=`echo $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; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_CXX=:
-
- # 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 "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$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'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
- ;;
- esac
- link_all_deplibs_CXX=yes
-
- output_verbose_link_cmd='echo'
-
- # 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.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$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.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -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 \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$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 \"\-L\""
- fi
-
- hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
- fi
- ;;
- esac
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='${wl}-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$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.
- # 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.
- # So that behaviour is only enabled if SCOABSPATH is set to a
- # non-empty value in the environment. Most likely only useful for
- # creating official distributions of packages.
- # This is a hack until libtool officially supports absolute path
- # names for shared libraries.
- no_undefined_flag_CXX='${wl}-z,text'
- allow_undefined_flag_CXX='${wl}-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$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
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-GCC_CXX="$GXX"
-LD_CXX="$LD"
-
-
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-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
- # 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
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
- for p in `eval $output_verbose_link_cmd`; do
- case $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
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p 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 "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX="${prev}${p}"
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${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 "$postdeps_CXX"; then
- postdeps_CXX="${prev}${p}"
- else
- postdeps_CXX="${postdeps_CXX} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$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 "$predep_objects_CXX"; then
- predep_objects_CXX="$p"
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX="$p"
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$rm -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix3*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # 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.
- postdeps_CXX='-lCstd -lCrun'
- ;;
- esac
- ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
-
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ $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; }
-
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-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_CXX='-Bstatic'
- fi
- ;;
- amigaos*)
- # 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_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | os2* | pw32*)
- # 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_CXX='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
- ;;
- interix3*)
- # 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_prog_compiler_pic_CXX=-Kconform_pic
- fi
- ;;
- hpux*)
- # 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*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_CXX='-qnocommon'
- lt_prog_compiler_wl_CXX='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+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_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-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_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if ${lt_prog_compiler_pic_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_CXX" >&5
-$as_echo "$lt_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $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_prog_compiler_static_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_static_works_CXX=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
- fi
- else
- lt_prog_compiler_static_works_CXX=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works_CXX" >&5
-$as_echo "$lt_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
- :
-else
- lt_prog_compiler_static_CXX=
-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_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_CXX=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 ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = 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; }
-
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # 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
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- export_symbols_cmds_CXX="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- kfreebsd*-gnu)
- link_all_deplibs_CXX=no
- ;;
- linux*)
- link_all_deplibs_CXX=no
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_CXX 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; }
- $rm conftest*
- printf "$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_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds_CXX 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
- archive_cmds_need_lc_CXX=no
- else
- archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5
-$as_echo "$archive_cmds_need_lc_CXX" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-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"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # 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.
- 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
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-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
- 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'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- 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<name>.so
- # instead of lib<name>.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*)
- 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=`$echo "X$lib" | $Xsed -e '\''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'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- 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*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- 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'
- 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="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- 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
- ;;
- 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
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # 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}${versuffix}$shared_ext ${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`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- 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
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-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='GNU ld.so'
- ;;
-
-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[123]*) 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
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-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
- 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'
- ;;
-
-interix3*)
- 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'
- 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
- 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 Linux ELF.
-linux*)
- 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'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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'
- ;;
-
-knetbsd*-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='GNU ld.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
- 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=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=yes
- ;;
-
-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"
- ;;
-
-solaris*)
- 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=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
- 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
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- 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
- 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
- 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'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- 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'
- ;;
-
-uts4*)
- version_type=linux
- 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
-
-{ $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_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
- test -n "$runpath_var_CXX" || \
- test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_CXX" != 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_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
- test "$hardcode_minus_L_CXX" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink; 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
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_CXX \
- CC_CXX \
- LD_CXX \
- lt_prog_compiler_wl_CXX \
- lt_prog_compiler_pic_CXX \
- lt_prog_compiler_static_CXX \
- lt_prog_compiler_no_builtin_flag_CXX \
- export_dynamic_flag_spec_CXX \
- thread_safe_flag_spec_CXX \
- whole_archive_flag_spec_CXX \
- enable_shared_with_static_runtimes_CXX \
- old_archive_cmds_CXX \
- old_archive_from_new_cmds_CXX \
- predep_objects_CXX \
- postdep_objects_CXX \
- predeps_CXX \
- postdeps_CXX \
- compiler_lib_search_path_CXX \
- archive_cmds_CXX \
- archive_expsym_cmds_CXX \
- postinstall_cmds_CXX \
- postuninstall_cmds_CXX \
- old_archive_from_expsyms_cmds_CXX \
- allow_undefined_flag_CXX \
- no_undefined_flag_CXX \
- export_symbols_cmds_CXX \
- hardcode_libdir_flag_spec_CXX \
- hardcode_libdir_flag_spec_ld_CXX \
- hardcode_libdir_separator_CXX \
- hardcode_automatic_CXX \
- module_cmds_CXX \
- module_expsym_cmds_CXX \
- lt_cv_prog_compiler_c_o_CXX \
- exclude_expsyms_CXX \
- include_expsyms_CXX; do
-
- case $var in
- old_archive_cmds_CXX | \
- old_archive_from_new_cmds_CXX | \
- archive_cmds_CXX | \
- archive_expsym_cmds_CXX | \
- module_cmds_CXX | \
- module_expsym_cmds_CXX | \
- old_archive_from_expsyms_cmds_CXX | \
- export_symbols_cmds_CXX | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# 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_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# 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_CXX
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# 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
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-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
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-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
-
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# 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 warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$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
-printf "$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 conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-{ $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
- ;;
-aix4* | aix5*)
- 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; }
-
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-{ $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 test "$GCC" = yes; then
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_static_F77='-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_F77='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # 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_F77='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # 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_F77='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_F77='-fno-common'
- ;;
-
- interix3*)
- # 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_F77=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_F77=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # 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_F77='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_F77='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_F77='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_F77='-Bstatic'
- else
- lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_F77='-qnocommon'
- lt_prog_compiler_wl_F77='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # 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_F77='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_F77='-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_F77='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_F77='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-fpic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_F77='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_F77='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_F77='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_F77='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_F77='-Qoption ld '
- lt_prog_compiler_pic_F77='-PIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_F77='-Kconform_pic'
- lt_prog_compiler_static_F77='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_pic_F77='-KPIC'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_F77='-Wl,'
- lt_prog_compiler_can_build_shared_F77=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_F77='-pic'
- lt_prog_compiler_static_F77='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_F77=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_F77" >&5
-$as_echo "$lt_prog_compiler_pic_F77" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; }
-if ${lt_prog_compiler_pic_works_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_pic_works_F77=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_F77"
- # 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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_F77" >&5
-$as_echo "$lt_prog_compiler_pic_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
- case $lt_prog_compiler_pic_F77 in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
- esac
-else
- lt_prog_compiler_pic_F77=
- lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_F77=
- ;;
- *)
- lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ $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_prog_compiler_static_works_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_static_works_F77=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
- fi
- else
- lt_prog_compiler_static_works_F77=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works_F77" >&5
-$as_echo "$lt_prog_compiler_static_works_F77" >&6; }
-
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
- :
-else
- lt_prog_compiler_static_F77=
-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_F77+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_F77=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_F77=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 ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = 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_F77=
- enable_shared_with_static_runtimes_F77=no
- archive_cmds_F77=
- archive_expsym_cmds_F77=
- old_archive_From_new_cmds_F77=
- old_archive_from_expsyms_cmds_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- thread_safe_flag_spec_F77=
- hardcode_libdir_flag_spec_F77=
- hardcode_libdir_flag_spec_ld_F77=
- hardcode_libdir_separator_F77=
- hardcode_direct_F77=no
- hardcode_minus_L_F77=no
- hardcode_shlibpath_var_F77=unsupported
- link_all_deplibs_F77=unknown
- hardcode_automatic_F77=no
- module_cmds_F77=
- module_expsym_cmds_F77=
- always_export_symbols_F77=no
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_F77=
- # 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_F77="_GLOBAL_OFFSET_TABLE_"
- # 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.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # 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
- ;;
- esac
-
- ld_shlibs_F77=yes
- if test "$with_gnu_ld" = 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_F77='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_F77='${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_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_F77=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [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
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_F77=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_F77='$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_F77='-L$libdir'
- hardcode_minus_L_F77=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_F77=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_F77=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_F77='-L$libdir'
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=no
- enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_F77='$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_F77='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_F77=no
- fi
- ;;
-
- interix3*)
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${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_F77='$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_F77='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'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
- esac
- archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- link_all_deplibs_F77=no
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $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_F77=no
- cat <<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.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_F77=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
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_F77=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_F77" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_F77=
- export_dynamic_flag_spec_F77=
- whole_archive_flag_spec_F77=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_F77=unsupported
- always_export_symbols_F77=yes
- archive_expsym_cmds_F77='$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_F77=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_F77=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- 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
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_F77='$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].*|aix5*)
- 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_F77=''
- hardcode_direct_F77=yes
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
-
- 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
- hardcode_direct_F77=yes
- else
- # We have old collect2
- hardcode_direct_F77=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_F77=yes
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_libdir_separator_F77=
- 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
-
- # 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_F77=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_F77='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat > conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-if ac_fn_f77_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_F77='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_F77="-z nodefs"
- archive_expsym_cmds_F77="\$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.
- cat > conftest.$ac_ext <<_ACEOF
- program main
-
- end
-_ACEOF
-if ac_fn_f77_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_F77='${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_F77=' ${wl}-bernotok'
- allow_undefined_flag_F77=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_F77='$convenience'
- archive_cmds_need_lc_F77=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_F77="\$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*)
- archive_cmds_F77='$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_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_F77=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_F77=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # 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.
- hardcode_libdir_flag_spec_F77=' '
- allow_undefined_flag_F77=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_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_F77='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_F77=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_F77=no
- hardcode_direct_F77=no
- hardcode_automatic_F77=yes
- hardcode_shlibpath_var_F77=unsupported
- whole_archive_flag_spec_F77=''
- link_all_deplibs_F77=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- freebsd1*)
- ld_shlibs_F77=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_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- # GNU/kFreeBSD uses gcc -shared to do shared libraries.
- kfreebsd*-gnu)
- archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- link_all_deplibs_F77=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_F77='$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_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_direct_F77=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$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_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$CC -shared -fPIC ${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_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_F77='$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
- hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_F77=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_F77='+b $libdir'
- hardcode_direct_F77=no
- hardcode_shlibpath_var_F77=no
- ;;
- *)
- hardcode_direct_F77=yes
- export_dynamic_flag_spec_F77='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_F77=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- link_all_deplibs_F77=yes
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- newsos6)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- hardcode_shlibpath_var_F77=no
- ;;
-
- openbsd*)
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-R$libdir'
- ;;
- *)
- archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_minus_L_F77=yes
- allow_undefined_flag_F77=unsupported
- archive_cmds_F77='$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_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_F77=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_F77=' -expect_unresolved \*'
- archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_F77='-rpath $libdir'
- fi
- hardcode_libdir_separator_F77=:
- ;;
-
- solaris*)
- no_undefined_flag_F77=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_F77='$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'
- fi
- hardcode_libdir_flag_spec_F77='-R$libdir'
- hardcode_shlibpath_var_F77=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs_F77=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_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_direct_F77=yes
- hardcode_minus_L_F77=yes
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_F77='$CC -r -o $output$reload_objs'
- hardcode_direct_F77=no
- ;;
- motorola)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_F77=no
- ;;
-
- sysv4.3*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- export_dynamic_flag_spec_F77='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_F77=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_F77=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag_F77='${wl}-z,text'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$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_F77='${wl}-z,text'
- allow_undefined_flag_F77='${wl}-z,nodefs'
- archive_cmds_need_lc_F77=no
- hardcode_shlibpath_var_F77=no
- hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_F77=':'
- link_all_deplibs_F77=yes
- export_dynamic_flag_spec_F77='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_F77='-L$libdir'
- hardcode_shlibpath_var_F77=no
- ;;
-
- *)
- ld_shlibs_F77=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5
-$as_echo "$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_F77=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_F77 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; }
- $rm conftest*
- printf "$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_F77
- pic_flag=$lt_prog_compiler_pic_F77
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_F77
- allow_undefined_flag_F77=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds_F77 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
- archive_cmds_need_lc_F77=no
- else
- archive_cmds_need_lc_F77=yes
- fi
- allow_undefined_flag_F77=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_F77" >&5
-$as_echo "$archive_cmds_need_lc_F77" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-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"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # 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.
- 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
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-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
- 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'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- 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<name>.so
- # instead of lib<name>.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*)
- 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=`$echo "X$lib" | $Xsed -e '\''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'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- 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*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- 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'
- 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="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- 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
- ;;
- 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
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # 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}${versuffix}$shared_ext ${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`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- 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
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-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='GNU ld.so'
- ;;
-
-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[123]*) 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
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-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
- 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'
- ;;
-
-interix3*)
- 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'
- 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
- 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 Linux ELF.
-linux*)
- 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'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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'
- ;;
-
-knetbsd*-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='GNU ld.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
- 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=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=yes
- ;;
-
-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"
- ;;
-
-solaris*)
- 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=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
- 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
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- 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
- 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
- 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'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- 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'
- ;;
-
-uts4*)
- version_type=linux
- 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
-
-{ $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_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
- test -n "$runpath_var_F77" || \
- test "X$hardcode_automatic_F77" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_F77" != 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_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
- test "$hardcode_minus_L_F77" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_F77=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_F77=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_F77=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5
-$as_echo "$hardcode_action_F77" >&6; }
-
-if test "$hardcode_action_F77" = relink; 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
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_F77 \
- CC_F77 \
- LD_F77 \
- lt_prog_compiler_wl_F77 \
- lt_prog_compiler_pic_F77 \
- lt_prog_compiler_static_F77 \
- lt_prog_compiler_no_builtin_flag_F77 \
- export_dynamic_flag_spec_F77 \
- thread_safe_flag_spec_F77 \
- whole_archive_flag_spec_F77 \
- enable_shared_with_static_runtimes_F77 \
- old_archive_cmds_F77 \
- old_archive_from_new_cmds_F77 \
- predep_objects_F77 \
- postdep_objects_F77 \
- predeps_F77 \
- postdeps_F77 \
- compiler_lib_search_path_F77 \
- archive_cmds_F77 \
- archive_expsym_cmds_F77 \
- postinstall_cmds_F77 \
- postuninstall_cmds_F77 \
- old_archive_from_expsyms_cmds_F77 \
- allow_undefined_flag_F77 \
- no_undefined_flag_F77 \
- export_symbols_cmds_F77 \
- hardcode_libdir_flag_spec_F77 \
- hardcode_libdir_flag_spec_ld_F77 \
- hardcode_libdir_separator_F77 \
- hardcode_automatic_F77 \
- module_cmds_F77 \
- module_expsym_cmds_F77 \
- lt_cv_prog_compiler_c_o_F77 \
- exclude_expsyms_F77 \
- include_expsyms_F77; do
-
- case $var in
- old_archive_cmds_F77 | \
- old_archive_from_new_cmds_F77 | \
- archive_cmds_F77 | \
- archive_expsym_cmds_F77 | \
- module_cmds_F77 | \
- module_expsym_cmds_F77 | \
- old_archive_from_expsyms_cmds_F77 | \
- export_symbols_cmds_F77 | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_F77
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_F77
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# 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_F77
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# 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_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# 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
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-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"
-
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# 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 warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$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
-printf "$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 conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-
-old_archive_cmds_GCJ=$old_archive_cmds
-
-
-lt_prog_compiler_no_builtin_flag_GCJ=
-
-if test "$GCC" = yes; then
- lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
-
-
-{ $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
- printf "$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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-{ $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 test "$GCC" = yes; then
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_static_GCJ='-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_GCJ='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # 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_GCJ='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # 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_GCJ='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_GCJ='-fno-common'
- ;;
-
- interix3*)
- # 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_GCJ=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_GCJ=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # 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_GCJ='-fPIC'
- ;;
- esac
- ;;
-
- *)
- lt_prog_compiler_pic_GCJ='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_GCJ='-Bstatic'
- else
- lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- lt_prog_compiler_pic_GCJ='-qnocommon'
- lt_prog_compiler_wl_GCJ='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # 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_GCJ='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl_GCJ='-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_GCJ='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- newsos6)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-fpic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static_GCJ='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- lt_prog_compiler_wl_GCJ='-Qoption ld ';;
- *)
- lt_prog_compiler_wl_GCJ='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl_GCJ='-Qoption ld '
- lt_prog_compiler_pic_GCJ='-PIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_prog_compiler_pic_GCJ='-Kconform_pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_pic_GCJ='-KPIC'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl_GCJ='-Wl,'
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic_GCJ='-pic'
- lt_prog_compiler_static_GCJ='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared_GCJ=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_GCJ" >&5
-$as_echo "$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; }
-if ${lt_prog_compiler_pic_works_GCJ+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_pic_works_GCJ=no
- ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
- # 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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
- fi
- fi
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_GCJ" >&5
-$as_echo "$lt_prog_compiler_pic_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
- case $lt_prog_compiler_pic_GCJ in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
- esac
-else
- lt_prog_compiler_pic_GCJ=
- lt_prog_compiler_can_build_shared_GCJ=no
-fi
-
-fi
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_GCJ=
- ;;
- *)
- lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
- ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ $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_prog_compiler_static_works_GCJ+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_prog_compiler_static_works_GCJ=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
- fi
- else
- lt_prog_compiler_static_works_GCJ=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works_GCJ" >&5
-$as_echo "$lt_prog_compiler_static_works_GCJ" >&6; }
-
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
- :
-else
- lt_prog_compiler_static_GCJ=
-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_GCJ+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_GCJ=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$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:__oline__: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/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_GCJ=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 ..
- rmdir conftest
- $rm conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = 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_GCJ=
- enable_shared_with_static_runtimes_GCJ=no
- archive_cmds_GCJ=
- archive_expsym_cmds_GCJ=
- old_archive_From_new_cmds_GCJ=
- old_archive_from_expsyms_cmds_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- thread_safe_flag_spec_GCJ=
- hardcode_libdir_flag_spec_GCJ=
- hardcode_libdir_flag_spec_ld_GCJ=
- hardcode_libdir_separator_GCJ=
- hardcode_direct_GCJ=no
- hardcode_minus_L_GCJ=no
- hardcode_shlibpath_var_GCJ=unsupported
- link_all_deplibs_GCJ=unknown
- hardcode_automatic_GCJ=no
- module_cmds_GCJ=
- module_expsym_cmds_GCJ=
- always_export_symbols_GCJ=no
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms_GCJ=
- # 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_GCJ="_GLOBAL_OFFSET_TABLE_"
- # 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.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
- case $host_os in
- cygwin* | mingw* | pw32*)
- # 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
- ;;
- esac
-
- ld_shlibs_GCJ=yes
- if test "$with_gnu_ld" = 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_GCJ='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec_GCJ='${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_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec_GCJ=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [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
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs_GCJ=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, 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 modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- archive_cmds_GCJ='$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_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- ld_shlibs_GCJ=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_GCJ=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=no
- enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- archive_cmds_GCJ='$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_GCJ='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_GCJ=no
- fi
- ;;
-
- interix3*)
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${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_GCJ='$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_GCJ='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'
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$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' ;;
- esac
- archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- link_all_deplibs_GCJ=no
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $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_GCJ=no
- cat <<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.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs_GCJ=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
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs_GCJ=no
- fi
- ;;
- esac
-
- if test "$ld_shlibs_GCJ" = no; then
- runpath_var=
- hardcode_libdir_flag_spec_GCJ=
- export_dynamic_flag_spec_GCJ=
- whole_archive_flag_spec_GCJ=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag_GCJ=unsupported
- always_export_symbols_GCJ=yes
- archive_expsym_cmds_GCJ='$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_GCJ=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_GCJ=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- 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
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_GCJ='$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].*|aix5*)
- 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_GCJ=''
- hardcode_direct_GCJ=yes
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
-
- 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
- hardcode_direct_GCJ=yes
- else
- # We have old collect2
- hardcode_direct_GCJ=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_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_libdir_separator_GCJ=
- 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
-
- # 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_GCJ=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_GCJ='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${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_GCJ='${wl}-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_GCJ="-z nodefs"
- archive_expsym_cmds_GCJ="\$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.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
- hardcode_libdir_flag_spec_GCJ='${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_GCJ=' ${wl}-bernotok'
- allow_undefined_flag_GCJ=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_GCJ='$convenience'
- archive_cmds_need_lc_GCJ=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds_GCJ="\$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*)
- archive_cmds_GCJ='$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_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs_GCJ=no
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec_GCJ=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # 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.
- hardcode_libdir_flag_spec_GCJ=' '
- allow_undefined_flag_GCJ=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_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_From_new_cmds_GCJ='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes_GCJ=yes
- ;;
-
- darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- archive_cmds_need_lc_GCJ=no
- hardcode_direct_GCJ=no
- hardcode_automatic_GCJ=yes
- hardcode_shlibpath_var_GCJ=unsupported
- whole_archive_flag_spec_GCJ=''
- link_all_deplibs_GCJ=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- freebsd1*)
- ld_shlibs_GCJ=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_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- # GNU/kFreeBSD uses gcc -shared to do shared libraries.
- kfreebsd*-gnu)
- archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- link_all_deplibs_GCJ=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${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_GCJ='$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_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_direct_GCJ=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$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_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared -fPIC ${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_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_GCJ='$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
- hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
- hardcode_direct_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- ;;
- *)
- hardcode_direct_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L_GCJ=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- link_all_deplibs_GCJ=yes
- ;;
-
- netbsd* | netbsdelf*-gnu | knetbsd*-gnu)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- newsos6)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- openbsd*)
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- ;;
- *)
- archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_minus_L_GCJ=yes
- allow_undefined_flag_GCJ=unsupported
- archive_cmds_GCJ='$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_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator_GCJ=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
- else
- allow_undefined_flag_GCJ=' -expect_unresolved \*'
- archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_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_GCJ='-rpath $libdir'
- fi
- hardcode_libdir_separator_GCJ=:
- ;;
-
- solaris*)
- no_undefined_flag_GCJ=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds_GCJ='$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'
- fi
- hardcode_libdir_flag_spec_GCJ='-R$libdir'
- hardcode_shlibpath_var_GCJ=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- link_all_deplibs_GCJ=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_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_direct_GCJ=yes
- hardcode_minus_L_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds_GCJ='$CC -r -o $output$reload_objs'
- hardcode_direct_GCJ=no
- ;;
- motorola)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- sysv4.3*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- export_dynamic_flag_spec_GCJ='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var_GCJ=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs_GCJ=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- no_undefined_flag_GCJ='${wl}-z,text'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$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_GCJ='${wl}-z,text'
- allow_undefined_flag_GCJ='${wl}-z,nodefs'
- archive_cmds_need_lc_GCJ=no
- hardcode_shlibpath_var_GCJ=no
- hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator_GCJ=':'
- link_all_deplibs_GCJ=yes
- export_dynamic_flag_spec_GCJ='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec_GCJ='-L$libdir'
- hardcode_shlibpath_var_GCJ=no
- ;;
-
- *)
- ld_shlibs_GCJ=no
- ;;
- esac
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_GCJ" >&5
-$as_echo "$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_GCJ=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds_GCJ 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; }
- $rm conftest*
- printf "$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_GCJ
- pic_flag=$lt_prog_compiler_pic_GCJ
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
- allow_undefined_flag_GCJ=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds_GCJ 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
- archive_cmds_need_lc_GCJ=no
- else
- archive_cmds_need_lc_GCJ=yes
- fi
- allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_GCJ" >&5
-$as_echo "$archive_cmds_need_lc_GCJ" >&6; }
- ;;
- esac
- fi
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-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"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # 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.
- 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
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-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
- 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'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- 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<name>.so
- # instead of lib<name>.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*)
- 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=`$echo "X$lib" | $Xsed -e '\''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'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux
- 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*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- 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'
- 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="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- 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
- ;;
- 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
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # 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}${versuffix}$shared_ext ${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`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- 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
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-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='GNU ld.so'
- ;;
-
-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[123]*) 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
- ;;
- freebsd*) # from 4.6 on
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-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
- 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'
- ;;
-
-interix3*)
- 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'
- 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
- 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 Linux ELF.
-linux*)
- 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'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # 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)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;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'
- ;;
-
-knetbsd*-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='GNU ld.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
- 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=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=yes
- ;;
-
-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"
- ;;
-
-solaris*)
- 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=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
- 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
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- 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
- 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
- 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'
- shlibpath_overrides_runpath=no
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- shlibpath_overrides_runpath=yes
- 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'
- ;;
-
-uts4*)
- version_type=linux
- 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
-
-{ $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_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
- test -n "$runpath_var_GCJ" || \
- test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct_GCJ" != 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_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
- test "$hardcode_minus_L_GCJ" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_GCJ=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_GCJ=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_GCJ=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_GCJ" >&5
-$as_echo "$hardcode_action_GCJ" >&6; }
-
-if test "$hardcode_action_GCJ" = relink; 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
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_GCJ \
- CC_GCJ \
- LD_GCJ \
- lt_prog_compiler_wl_GCJ \
- lt_prog_compiler_pic_GCJ \
- lt_prog_compiler_static_GCJ \
- lt_prog_compiler_no_builtin_flag_GCJ \
- export_dynamic_flag_spec_GCJ \
- thread_safe_flag_spec_GCJ \
- whole_archive_flag_spec_GCJ \
- enable_shared_with_static_runtimes_GCJ \
- old_archive_cmds_GCJ \
- old_archive_from_new_cmds_GCJ \
- predep_objects_GCJ \
- postdep_objects_GCJ \
- predeps_GCJ \
- postdeps_GCJ \
- compiler_lib_search_path_GCJ \
- archive_cmds_GCJ \
- archive_expsym_cmds_GCJ \
- postinstall_cmds_GCJ \
- postuninstall_cmds_GCJ \
- old_archive_from_expsyms_cmds_GCJ \
- allow_undefined_flag_GCJ \
- no_undefined_flag_GCJ \
- export_symbols_cmds_GCJ \
- hardcode_libdir_flag_spec_GCJ \
- hardcode_libdir_flag_spec_ld_GCJ \
- hardcode_libdir_separator_GCJ \
- hardcode_automatic_GCJ \
- module_cmds_GCJ \
- module_expsym_cmds_GCJ \
- lt_cv_prog_compiler_c_o_GCJ \
- exclude_expsyms_GCJ \
- include_expsyms_GCJ; do
-
- case $var in
- old_archive_cmds_GCJ | \
- old_archive_from_new_cmds_GCJ | \
- archive_cmds_GCJ | \
- archive_expsym_cmds_GCJ | \
- module_cmds_GCJ | \
- module_expsym_cmds_GCJ | \
- old_archive_from_expsyms_cmds_GCJ | \
- export_symbols_cmds_GCJ | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# 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_GCJ
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-
-# 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_GCJ
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-
-# 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
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-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"
-
- else
- tagname=""
- fi
- ;;
-
- RC)
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# 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.
-
-# 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 warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-printf "$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
-printf "$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 conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # 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
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- compiler_RC \
- CC_RC \
- LD_RC \
- lt_prog_compiler_wl_RC \
- lt_prog_compiler_pic_RC \
- lt_prog_compiler_static_RC \
- lt_prog_compiler_no_builtin_flag_RC \
- export_dynamic_flag_spec_RC \
- thread_safe_flag_spec_RC \
- whole_archive_flag_spec_RC \
- enable_shared_with_static_runtimes_RC \
- old_archive_cmds_RC \
- old_archive_from_new_cmds_RC \
- predep_objects_RC \
- postdep_objects_RC \
- predeps_RC \
- postdeps_RC \
- compiler_lib_search_path_RC \
- archive_cmds_RC \
- archive_expsym_cmds_RC \
- postinstall_cmds_RC \
- postuninstall_cmds_RC \
- old_archive_from_expsyms_cmds_RC \
- allow_undefined_flag_RC \
- no_undefined_flag_RC \
- export_symbols_cmds_RC \
- hardcode_libdir_flag_spec_RC \
- hardcode_libdir_flag_spec_ld_RC \
- hardcode_libdir_separator_RC \
- hardcode_automatic_RC \
- module_cmds_RC \
- module_expsym_cmds_RC \
- lt_cv_prog_compiler_c_o_RC \
- exclude_expsyms_RC \
- include_expsyms_RC; do
-
- case $var in
- old_archive_cmds_RC | \
- old_archive_from_new_cmds_RC | \
- archive_cmds_RC | \
- archive_expsym_cmds_RC | \
- module_cmds_RC | \
- module_expsym_cmds_RC | \
- old_archive_from_expsyms_cmds_RC | \
- export_symbols_cmds_RC | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\$0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
- ;;
- esac
-
-cfgfile="$ofile"
-
- cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# 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
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# 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
-
-# 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
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# 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
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# 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
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# 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
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# 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_RC
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# 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_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# 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
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-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"
-
- ;;
-
- *)
- as_fn_error $? "Unsupported tag name: $tagname" "$LINENO" 5
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- as_fn_error $? "unable to update list of available tagged configurations." "$LINENO" 5
- fi
-fi
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Prevent multiple expansion
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $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
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC QCC
- 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_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # 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_CXX="$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
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC QCC
-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_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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_CXX="$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_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- 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
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# 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_cxx_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_cxx_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_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GXX=yes
-else
- GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-else
- CXXFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_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_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-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="$CXX" 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_CXX_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'.
- 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_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- 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 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- case $depmode in
- 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
- ;;
- none) break ;;
- esac
- # 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.
- if depmode=$depmode \
- source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftest.${OBJEXT-o} 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_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
-
-
-if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_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; }
-if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> 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 <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_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 <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_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_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> 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 <limits.h>
-@%:@else
-@%:@ include <assert.h>
-@%:@endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_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 <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_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 \"$CXXCPP\" 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
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-# CXX fine tuning
-case "$host" in
- *-dec-osf*)
- CXXFLAGS="$CXXFLAGS -std strict_ansi_errors"
- ;;
- *)
- ;;
-esac
-
-# Doxygen
-
-@%:@ Check whether --enable-doxygen was given.
-if test "${enable_doxygen+set}" = set; then :
- enableval=$enable_doxygen;
-fi
-
-
-@%:@ Check whether --enable-dot was given.
-if test "${enable_dot+set}" = set; then :
- enableval=$enable_dot;
-fi
-
-
-@%:@ Check whether --enable-html-docs was given.
-if test "${enable_html_docs+set}" = set; then :
- enableval=$enable_html_docs;
-else
- enable_html_docs=yes
-fi
-
-
-@%:@ Check whether --enable-latex-docs was given.
-if test "${enable_latex_docs+set}" = set; then :
- enableval=$enable_latex_docs;
-else
- enable_latex_docs=no
-fi
-
-
-if test "x$enable_doxygen" = xno; then
- enable_doc=no
-else
- # Extract the first word of "doxygen", so it can be a program name with args.
-set dummy doxygen; 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_path_DOXYGEN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $DOXYGEN in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path.
- ;;
- *)
- 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_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
- $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
-
- ;;
-esac
-fi
-DOXYGEN=$ac_cv_path_DOXYGEN
-if test -n "$DOXYGEN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5
-$as_echo "$DOXYGEN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "x$DOXYGEN" = x; then
- if test "x$enable_doxygen" = xyes; then
- as_fn_error $? "could not find doxygen" "$LINENO" 5
- fi
- enable_doc=no
- else
- enable_doc=yes
- # Extract the first word of "dot", so it can be a program name with args.
-set dummy dot; 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_path_DOT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $DOT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DOT="$DOT" # Let the user override the test with a path.
- ;;
- *)
- 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_path_DOT="$as_dir/$ac_word$ac_exec_ext"
- $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
-
- ;;
-esac
-fi
-DOT=$ac_cv_path_DOT
-if test -n "$DOT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5
-$as_echo "$DOT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-
-
-if test x$enable_doc = xyes; then
- DOC_TRUE=
- DOC_FALSE='#'
-else
- DOC_TRUE='#'
- DOC_FALSE=
-fi
-
-
-
-if test x$enable_latex_docs = xyes; then
- LATEX_DOC_TRUE=
- LATEX_DOC_FALSE='#'
-else
- LATEX_DOC_TRUE='#'
- LATEX_DOC_FALSE=
-fi
-
-
-if test x$DOT = x; then
- if test "x$enable_dot" = xyes; then
- as_fn_error $? "could not find dot" "$LINENO" 5
- fi
- enable_dot=no
-else
- enable_dot=yes
-fi
-
-manual_dest="manual"
-base_dir=`(cd $srcdir && pwd)`
-
-
-
-
-
-
-
-
-
-
-# Checks header files
-# ----------------------------------------------------------------------------
-
- apr_found="no"
-
- if test "$target_os" = "os2-emx"; then
- # Scripts don't pass test -x on OS/2
- TEST_X="test -f"
- else
- TEST_X="test -x"
- fi
-
- acceptable_majors="1"
-
- apr_temp_acceptable_apr_config=""
- for apr_temp_major in $acceptable_majors
- do
- case $apr_temp_major in
- 0)
- apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-config"
- ;;
- *)
- apr_temp_acceptable_apr_config="$apr_temp_acceptable_apr_config apr-$apr_temp_major-config"
- ;;
- esac
- done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APR" >&5
-$as_echo_n "checking for APR... " >&6; }
-
-@%:@ Check whether --with-apr was given.
-if test "${with_apr+set}" = set; then :
- withval=$with_apr;
- if test "$withval" = "no" || test "$withval" = "yes"; then
- as_fn_error $? "--with-apr requires a directory or file to be provided" "$LINENO" 5
- fi
-
- for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
- do
- for lookdir in "$withval/bin" "$withval"
- do
- if $TEST_X "$lookdir/$apr_temp_apr_config_file"; then
- apr_config="$lookdir/$apr_temp_apr_config_file"
-
- apr_found="yes"
- break 2
- fi
- done
- done
-
- if test "$apr_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
- apr_config="$withval"
- apr_found="yes"
- fi
-
- if test "$apr_found" != "yes"; then
- as_fn_error $? "the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file." "$LINENO" 5
- fi
-
-else
-
- if test -n "1" && test "1" = "1"; then
- for apr_temp_apr_config_file in $apr_temp_acceptable_apr_config
- do
- if $apr_temp_apr_config_file --help > /dev/null 2>&1 ; then
- apr_config="$apr_temp_apr_config_file"
-
- apr_found="yes"
- break
- else
- for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do
- if $TEST_X "$lookdir/bin/$apr_temp_apr_config_file"; then
- apr_config="$lookdir/bin/$apr_temp_apr_config_file"
-
- apr_found="yes"
- break 2
- fi
- done
- fi
- done
- fi
- if test "$apr_found" = "no" && test -d ""; then
- apr_temp_abs_srcdir="`cd && pwd`"
- apr_found="reconfig"
- apr_bundled_major="`sed -n '/#define.*APR_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"/include/apr_version.h\"`"
- case $apr_bundled_major in
- "")
- as_fn_error $? "failed to find major version of bundled APR" "$LINENO" 5
- ;;
- 0)
- apr_temp_apr_config_file="apr-config"
- ;;
- *)
- apr_temp_apr_config_file="apr-$apr_bundled_major-config"
- ;;
- esac
- if test -n ""; then
- apr_config="/$apr_temp_apr_config_file"
- else
- apr_config="/$apr_temp_apr_config_file"
- fi
- fi
-
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_found" >&5
-$as_echo "$apr_found" >&6; }
-
-if test "$apr_found" = "no"; then
- as_fn_error $? "APR could not be located. Please use the --with-apr option." "$LINENO" 5
-fi
-
-CPPFLAGS="$CPPFLAGS `$apr_config --cppflags` `$apr_config --includes`"
-APR_LIBS="`$apr_config --link-ld --libs`"
-
-LDFLAGS="$LDFLAGS $APR_LIBS"
-
-
- apu_found="no"
-
- if test "$target_os" = "os2-emx"; then
- # Scripts don't pass test -x on OS/2
- TEST_X="test -f"
- else
- TEST_X="test -x"
- fi
-
- acceptable_majors="1"
-
- apu_temp_acceptable_apu_config=""
- for apu_temp_major in $acceptable_majors
- do
- case $apu_temp_major in
- 0)
- apu_temp_acceptable_apu_config="$apu_temp_acceptable_apu_config apu-config"
- ;;
- *)
- apu_temp_acceptable_apu_config="$apu_temp_acceptable_apu_config apu-$apu_temp_major-config"
- ;;
- esac
- done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APR-util" >&5
-$as_echo_n "checking for APR-util... " >&6; }
-
-@%:@ Check whether --with-apr-util was given.
-if test "${with_apr_util+set}" = set; then :
- withval=$with_apr_util;
- if test "$withval" = "no" || test "$withval" = "yes"; then
- as_fn_error $? "--with-apr-util requires a directory or file to be provided" "$LINENO" 5
- fi
-
- for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
- do
- for lookdir in "$withval/bin" "$withval"
- do
- if $TEST_X "$lookdir/$apu_temp_apu_config_file"; then
- apu_config="$lookdir/$apu_temp_apu_config_file"
-
- apu_found="yes"
- break 2
- fi
- done
- done
-
- if test "$apu_found" != "yes" && $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
- apu_config="$withval"
- apu_found="yes"
- fi
-
- if test "$apu_found" != "yes"; then
- as_fn_error $? "the --with-apr-util parameter is incorrect. It must specify an install prefix, a build directory, or an apu-config file." "$LINENO" 5
- fi
-
-else
-
- if test -n "1" && test "1" = "1"; then
- for apu_temp_apu_config_file in $apu_temp_acceptable_apu_config
- do
- if $apu_temp_apu_config_file --help > /dev/null 2>&1 ; then
- apu_config="$apu_temp_apu_config_file"
-
- apu_found="yes"
- break
- else
- for lookdir in /usr /usr/local /usr/local/apr /opt/apr; do
- if $TEST_X "$lookdir/bin/$apu_temp_apu_config_file"; then
- apu_config="$lookdir/bin/$apu_temp_apu_config_file"
-
- apu_found="yes"
- break 2
- fi
- done
- fi
- done
- fi
- if test "$apu_found" = "no" && test -d ""; then
- apu_temp_abs_srcdir="`cd && pwd`"
- apu_found="reconfig"
- apu_bundled_major="`sed -n '/#define.*APU_MAJOR_VERSION/s/^[^0-9]*\([0-9]*\).*$/\1/p' \"/include/apu_version.h\"`"
- case $apu_bundled_major in
- "")
- as_fn_error $? "failed to find major version of bundled APU" "$LINENO" 5
- ;;
- 0)
- apu_temp_apu_config_file="apu-config"
- ;;
- *)
- apu_temp_apu_config_file="apu-$apu_bundled_major-config"
- ;;
- esac
- if test -n ""; then
- apu_config="/$apu_temp_apu_config_file"
- else
- apu_config="/$apu_temp_apu_config_file"
- fi
- fi
-
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $apu_found" >&5
-$as_echo "$apu_found" >&6; }
-
-if test "$apu_found" = "no"; then
- as_fn_error $? "APR-util could not be located. Please use the --with-apr-util option." "$LINENO" 5
-fi
-
-CPPFLAGS="$CPPFLAGS `$apu_config --includes`"
-APU_LIBS="`$apu_config --link-ld --libs`"
-
-LDFLAGS="$LDFLAGS $APU_LIBS"
-
-# Checks local idioms
-# ----------------------------------------------------------------------------
-
-# for local syslog() function for SyslogAppender
-for ac_func in mbsrtowcs
-do :
- ac_fn_cxx_check_func "$LINENO" "mbsrtowcs" "ac_cv_func_mbsrtowcs"
-if test "x$ac_cv_func_mbsrtowcs" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_MBSRTOWCS 1
-_ACEOF
- have_mbsrtowcs=yes
-else
- have_mbsrtowcs=no
-fi
-done
-
-if test "$have_mbsrtowcs" = "yes"
-then
- HAS_MBSRTOWCS=1
-
-else
- HAS_MBSRTOWCS=0
-
-fi
-
-for ac_func in wcstombs
-do :
- ac_fn_cxx_check_func "$LINENO" "wcstombs" "ac_cv_func_wcstombs"
-if test "x$ac_cv_func_wcstombs" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_WCSTOMBS 1
-_ACEOF
- have_wcstombs=yes
-else
- have_wcstombs=no
-fi
-done
-
-if test "$have_wcstombs" = "yes"
-then
- HAS_WCSTOMBS=1
-
-else
- HAS_WCSTOMBS=0
-
-fi
-
-# for local syslog() function for SyslogAppender
-for ac_func in syslog
-do :
- ac_fn_cxx_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
-if test "x$ac_cv_func_syslog" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_SYSLOG 1
-_ACEOF
- have_syslog=yes
-else
- have_syslog=no
-fi
-done
-
-if test "$have_syslog" = "yes"
-then
- HAS_SYSLOG=1
-
-else
- HAS_SYSLOG=0
-
-fi
-
-
-ac_fn_cxx_check_header_mongrel "$LINENO" "locale" "ac_cv_header_locale" "$ac_includes_default"
-if test "x$ac_cv_header_locale" = xyes; then :
- have_locale=yes
-else
- have_locale=no
-fi
-
-
-if test "$have_locale" = "yes"
-then
- HAS_STD_LOCALE=1
-
-else
- HAS_STD_LOCALE=0
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
-$as_echo_n "checking for wchar_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <string>
- std::wstring w;
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- have_wchar_t=yes
-else
- have_wchar_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_wchar_t" >&5
-$as_echo "$have_wchar_t" >&6; }
-if test "$have_wchar_t" = "yes"
-then
- HAS_WCHAR_T=1
-
-else
- HAS_WCHAR_T=0
-
-fi
-
-for ac_func in fwide
-do :
- ac_fn_cxx_check_func "$LINENO" "fwide" "ac_cv_func_fwide"
-if test "x$ac_cv_func_fwide" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_FWIDE 1
-_ACEOF
- have_fwide=yes
-else
- have_fwide=no
-fi
-done
-
-if test "$have_fwide" = "yes"
-then
- HAS_FWIDE=1
-
-else
- HAS_FWIDE=0
-
-fi
-
-
-# Checks for libraries
-# ----------------------------------------------------------------------------
-
-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
-
-
-
-#for ODBCAppender
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ODBC support" >&5
-$as_echo_n "checking for ODBC support... " >&6; }
-
-@%:@ Check whether --with-ODBC was given.
-if test "${with_ODBC+set}" = set; then :
- withval=$with_ODBC; ac_with_odbc=$withval
-else
- ac_with_odbc=no
-fi
-
-case "$ac_with_odbc" in
- Microsoft)
- HAS_ODBC=1
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Microsoft" >&5
-$as_echo "Microsoft" >&6; }
- LIBS_ODBC="-lodbc32"
- ;;
- unixODBC)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unixODBC" >&5
-$as_echo "unixODBC" >&6; }
- ac_fn_cxx_check_header_mongrel "$LINENO" "sqlext.h" "ac_cv_header_sqlext_h" "$ac_includes_default"
-if test "x$ac_cv_header_sqlext_h" = xyes; then :
-
-else
- as_fn_error $? "unixODBC not found !" "$LINENO" 5
-fi
-
-
- HAS_ODBC=1
-
- LIBS_ODBC="-lodbc"
- ;;
- iODBC)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: iODBC" >&5
-$as_echo "iODBC" >&6; }
- # Extract the first word of "iodbc-config", so it can be a program name with args.
-set dummy iodbc-config; 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_IODBC_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$IODBC_CONFIG"; then
- ac_cv_prog_IODBC_CONFIG="$IODBC_CONFIG" # 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_IODBC_CONFIG="yes"
- $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
-
- test -z "$ac_cv_prog_IODBC_CONFIG" && ac_cv_prog_IODBC_CONFIG="no"
-fi
-fi
-IODBC_CONFIG=$ac_cv_prog_IODBC_CONFIG
-if test -n "$IODBC_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IODBC_CONFIG" >&5
-$as_echo "$IODBC_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test "x$IODBC_CONFIG" = "xyes"
- then
- HAS_ODBC=1
-
- LIBS_ODBC="`iodbc-config --libs`"
- CPPFLAGS_ODBC="`iodbc-config --cflags`"
- else
- as_fn_error $? "iODBC not found !" "$LINENO" 5
- fi
- ;;
- no)
- HAS_ODBC=0
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ???" >&5
-$as_echo "???" >&6; }
- as_fn_error $? "Unknown option : $ac_with_odbc" "$LINENO" 5
- ;;
-esac
-
-
-
-
-#for SMTPAppender
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SMTP support" >&5
-$as_echo_n "checking for SMTP support... " >&6; }
-
-@%:@ Check whether --with-SMTP was given.
-if test "${with_SMTP+set}" = set; then :
- withval=$with_SMTP; ac_with_smtp=$withval
-else
- ac_with_smtp=no
-fi
-
-case "$ac_with_smtp" in
- libesmtp)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: libesmtp" >&5
-$as_echo "libesmtp" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for smtp_create_session in -lesmtp" >&5
-$as_echo_n "checking for smtp_create_session in -lesmtp... " >&6; }
-if ${ac_cv_lib_esmtp_smtp_create_session+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lesmtp -lesmtp $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 smtp_create_session ();
-int
-main ()
-{
-return smtp_create_session ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- ac_cv_lib_esmtp_smtp_create_session=yes
-else
- ac_cv_lib_esmtp_smtp_create_session=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_esmtp_smtp_create_session" >&5
-$as_echo "$ac_cv_lib_esmtp_smtp_create_session" >&6; }
-if test "x$ac_cv_lib_esmtp_smtp_create_session" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-@%:@define HAVE_LIBESMTP 1
-_ACEOF
-
- LIBS="-lesmtp $LIBS"
-
-else
- as_fn_error $? "libesmtp library not found !" "$LINENO" 5
-fi
-
- HAS_LIBESMTP=1
-
- LIBS="-lesmtp $LIBS"
- ;;
- no)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- HAS_LIBESMTP=0
-
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ???" >&5
-$as_echo "???" >&6; }
- as_fn_error $? "Unknown option : $ac_with_smtp" "$LINENO" 5
- ;;
-esac
-
-#for char api
-@%:@ Check whether --enable-char was given.
-if test "${enable_char+set}" = set; then :
- enableval=$enable_char;
-fi
-
-if test "x$enable_char" = xno; then
- have_char_api=no
-else
- have_char_api=yes
-fi
-
-if test "$have_char_api" = "yes"
-then
- CHAR_API=1
-
-else
- CHAR_API=0
-
-fi
-
-#for wchar_t api
-@%:@ Check whether --enable-wchar_t was given.
-if test "${enable_wchar_t+set}" = set; then :
- enableval=$enable_wchar_t;
-fi
-
-if test "x$enable_wchar_t" = xno; then
- have_wchar_t_api=no
-else
- if test "$have_wchar_t" = "yes"
- then
- have_wchar_t_api=yes
- else
- have_wchar_t_api=no
- fi
-fi
-
-if test "$have_wchar_t_api" = "yes"
-then
- WCHAR_T_API=1
-
-else
- WCHAR_T_API=0
-
-fi
-
-#for unichar api
-@%:@ Check whether --enable-unichar was given.
-if test "${enable_unichar+set}" = set; then :
- enableval=$enable_unichar;
-fi
-
-if test "x$enable_unichar" = "yes"
-then
- UNICHAR_API=1
-
-else
- UNICHAR_API=0
-
-fi
-
-#for cfstring api
-@%:@ Check whether --enable-cfstring was given.
-if test "${enable_cfstring+set}" = set; then :
- enableval=$enable_cfstring;
-fi
-
-if test "x$enable_cfstring" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cfstring" >&5
-$as_echo_n "checking for cfstring... " >&6; }
- CPPFLAGS="$CPPFLAGS -framework CoreFoundation"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #include <CoreFoundation/CFString.h>
- CFStringRef x = CFSTR("Hello");
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- have_cfstring_api=yes
-else
- have_cfstring_api=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cfstring_api" >&5
-$as_echo "$have_cfstring_api" >&6; }
-else
- have_cfstring_api=no
-fi
-
-if test "$have_cfstring_api" = "yes"
-then
- CFSTRING_API=1
-
-else
- CFSTRING_API=0
-
-fi
-
-#determine charset type
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking charset type" >&5
-$as_echo_n "checking charset type... " >&6; }
-
-@%:@ Check whether --with-charset was given.
-if test "${with_charset+set}" = set; then :
- withval=$with_charset; ac_with_charset=$withval
-else
- ac_with_charset=auto
-fi
-
-
-case "$ac_with_charset" in
- utf-8)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: utf-8" >&5
-$as_echo "utf-8" >&6; }
- CHARSET_UTF8=1
-
- CHARSET_ISO88591=0
-
- CHARSET_USASCII=0
-
- CHARSET_EBCDIC=0
-
- ;;
-
- iso-8859-1)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: iso-8859-1" >&5
-$as_echo "iso-8859-1" >&6; }
- CHARSET_UTF8=0
-
- CHARSET_ISO88591=1
-
- CHARSET_USASCII=0
-
- CHARSET_EBCDIC=0
-
- ;;
-
- usascii)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: usascii" >&5
-$as_echo "usascii" >&6; }
- CHARSET_UTF8=0
-
- CHARSET_ISO88591=0
-
- CHARSET_USASCII=1
-
- CHARSET_EBCDIC=0
-
- ;;
-
- ebcdic)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: usascii" >&5
-$as_echo "usascii" >&6; }
- CHARSET_UTF8=0
-
- CHARSET_ISO88591=0
-
- CHARSET_USASCII=0
-
- CHARSET_EBCDIC=1
-
- ;;
-
- auto)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: auto" >&5
-$as_echo "auto" >&6; }
- CHARSET_UTF8=0
-
- CHARSET_ISO88591=0
-
- CHARSET_USASCII=0
-
- CHARSET_EBCDIC=0
-
- ;;
-
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ???" >&5
-$as_echo "???" >&6; }
- as_fn_error $? "Invalid charset type: $ac_with_charset" "$LINENO" 5
- ;;
-esac
-
-
-
-#determine logchar type
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking logchar type" >&5
-$as_echo_n "checking logchar type... " >&6; }
-
-@%:@ Check whether --with-logchar was given.
-if test "${with_logchar+set}" = set; then :
- withval=$with_logchar; ac_with_logchar=$withval
-else
- ac_with_logchar=utf-8
-fi
-
-
-case "$ac_with_logchar" in
- utf-8)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: utf-8" >&5
-$as_echo "utf-8" >&6; }
- LOGCHAR_IS_UTF8=1
-
- LOGCHAR_IS_WCHAR=0
-
- LOGCHAR_IS_UNICHAR=0
-
- ;;
-
- wchar_t)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: wchar_t" >&5
-$as_echo "wchar_t" >&6; }
- LOGCHAR_IS_UTF8=0
-
- LOGCHAR_IS_WCHAR=1
-
- LOGCHAR_IS_UNICHAR=0
-
- ;;
-
- unichar)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unichar" >&5
-$as_echo "unichar" >&6; }
- LOGCHAR_IS_UTF8=0
-
- LOGCHAR_IS_WCHAR=0
-
- LOGCHAR_IS_UNICHAR=1
-
- ;;
-
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ???" >&5
-$as_echo "???" >&6; }
- as_fn_error $? "Invalid logchar type: $ac_with_logchar" "$LINENO" 5
- ;;
-esac
-
-
-
-# Create files
-# ----------------------------------------------------------------------------
-
-ac_config_files="$ac_config_files Makefile liblog4cxx.pc src/Makefile src/main/Makefile src/main/cpp/Makefile src/main/include/Makefile src/main/include/log4cxx/log4cxx.h src/main/include/log4cxx/private/log4cxx_private.h src/main/include/log4cxx/private/Makefile src/main/include/log4cxx/Makefile src/main/include/log4cxx/helpers/Makefile src/main/include/log4cxx/net/Makefile src/main/include/log4cxx/nt/Makefile src/main/include/log4cxx/spi/Makefile src/main/include/log4cxx/spi/location/Makefile src/main/include/log4cxx/varia/Makefile src/main/include/log4cxx/xml/Makefile src/main/include/log4cxx/config/Makefile src/main/include/log4cxx/db/Makefile src/main/include/log4cxx/rolling/Makefile src/main/include/log4cxx/pattern/Makefile src/main/include/log4cxx/filter/Makefile src/site/Makefile src/site/doxy/Makefile src/site/doxy/Doxyfile src/test/Makefile src/test/resources/Makefile src/test/resources/input/Makefile src/test/resources/input/ndc/Makefile src/test/resources/input/rolling/Makefile src/test/resources/input/xml/Makefile src/test/cpp/Makefile src/test/resources/witness/Makefile src/test/resources/witness/encoding/Makefile src/test/resources/witness/ndc/Makefile src/test/resources/witness/rolling/Makefile src/examples/Makefile src/examples/cpp/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}'
-
-# Transform confdefs.h into DEFS.
-# Protect against shell expansion while executing Makefile rules.
-# Protect against Makefile macro expansion.
-#
-# If the first sed substitution is executed (which looks for macros that
-# take arguments), then branch to the quote section. Otherwise,
-# look for a macro that doesn't take arguments.
-ac_script='
-:mline
-/\\$/{
- N
- s,\\\n,,
- b mline
-}
-t clear
-:clear
-s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
-t quote
-b any
-:quote
-s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
-s/\[/\\&/g
-s/\]/\\&/g
-s/\$/$$/g
-H
-:any
-${
- g
- s/^\n//
- s/\n/ /g
- p
-}
-'
-DEFS=`sed -n "$ac_script" confdefs.h`
-
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIB@&t@OBJS; 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
-LIB@&t@OBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-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__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DOC_TRUE}" && test -z "${DOC_FALSE}"; then
- as_fn_error $? "conditional \"DOC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${LATEX_DOC_TRUE}" && test -z "${LATEX_DOC_FALSE}"; then
- as_fn_error $? "conditional \"LATEX_DOC\" 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 @S|@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 @S|@? 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 @S|@as_val. Take advantage of shells that can avoid forks. The arguments
-@%:@ must be portable across @S|@(()) 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 "@S|@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 $as_me, 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
-
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-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
-
-Configuration files:
-$config_files
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-config.status
-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'
-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;;
- --he | --h | --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"
-
-_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" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "liblog4cxx.pc") CONFIG_FILES="$CONFIG_FILES liblog4cxx.pc" ;;
- "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
- "src/main/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/Makefile" ;;
- "src/main/cpp/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/cpp/Makefile" ;;
- "src/main/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/Makefile" ;;
- "src/main/include/log4cxx/log4cxx.h") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/log4cxx.h" ;;
- "src/main/include/log4cxx/private/log4cxx_private.h") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/private/log4cxx_private.h" ;;
- "src/main/include/log4cxx/private/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/private/Makefile" ;;
- "src/main/include/log4cxx/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/Makefile" ;;
- "src/main/include/log4cxx/helpers/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/helpers/Makefile" ;;
- "src/main/include/log4cxx/net/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/net/Makefile" ;;
- "src/main/include/log4cxx/nt/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/nt/Makefile" ;;
- "src/main/include/log4cxx/spi/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/spi/Makefile" ;;
- "src/main/include/log4cxx/spi/location/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/spi/location/Makefile" ;;
- "src/main/include/log4cxx/varia/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/varia/Makefile" ;;
- "src/main/include/log4cxx/xml/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/xml/Makefile" ;;
- "src/main/include/log4cxx/config/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/config/Makefile" ;;
- "src/main/include/log4cxx/db/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/db/Makefile" ;;
- "src/main/include/log4cxx/rolling/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/rolling/Makefile" ;;
- "src/main/include/log4cxx/pattern/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/pattern/Makefile" ;;
- "src/main/include/log4cxx/filter/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/include/log4cxx/filter/Makefile" ;;
- "src/site/Makefile") CONFIG_FILES="$CONFIG_FILES src/site/Makefile" ;;
- "src/site/doxy/Makefile") CONFIG_FILES="$CONFIG_FILES src/site/doxy/Makefile" ;;
- "src/site/doxy/Doxyfile") CONFIG_FILES="$CONFIG_FILES src/site/doxy/Doxyfile" ;;
- "src/test/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/Makefile" ;;
- "src/test/resources/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/Makefile" ;;
- "src/test/resources/input/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/input/Makefile" ;;
- "src/test/resources/input/ndc/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/input/ndc/Makefile" ;;
- "src/test/resources/input/rolling/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/input/rolling/Makefile" ;;
- "src/test/resources/input/xml/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/input/xml/Makefile" ;;
- "src/test/cpp/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/cpp/Makefile" ;;
- "src/test/resources/witness/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/witness/Makefile" ;;
- "src/test/resources/witness/encoding/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/witness/encoding/Makefile" ;;
- "src/test/resources/witness/ndc/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/witness/ndc/Makefile" ;;
- "src/test/resources/witness/rolling/Makefile") CONFIG_FILES="$CONFIG_FILES src/test/resources/witness/rolling/Makefile" ;;
- "src/examples/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/Makefile" ;;
- "src/examples/cpp/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/cpp/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_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 2>/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
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$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"
-
-
-eval set X " :F $CONFIG_FILES :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
-_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
-$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
- ;;
-
-
- :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"" || for mf in $CONFIG_FILES; 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.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /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"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //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' -e 's/\$U/'"$U"'/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
- ;;
-
- 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/apache-log4cxx-0.10.0/autom4te.cache/requests b/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/requests
deleted file mode 100644
index 4230a26bbf..0000000000
--- a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/requests
+++ /dev/null
@@ -1,78 +0,0 @@
-# This file was generated by Autom4te Thu Apr 10 10:06:43 UTC 2014.
-# It contains the lists of macros which have been traced.
-# It can be safely removed.
-
-@request = (
- bless( [
- '0',
- 1,
- [
- '/usr/share/autoconf'
- ],
- [
- '/usr/share/autoconf/autoconf/autoconf.m4f',
- 'aclocal.m4',
- 'configure.in'
- ],
- {
- 'AM_MAKEFILE_INCLUDE' => 1,
- 'AC_CONFIG_HEADERS' => 1,
- 'sinclude' => 1,
- '_AM_SUBST_NOTMAKE' => 1,
- 'AM_GNU_GETTEXT' => 1,
- '_AM_COND_ELSE' => 1,
- 'AC_REQUIRE_AUX_FILE' => 1,
- 'AC_CONFIG_LINKS' => 1,
- 'm4_sinclude' => 1,
- 'AM_AUTOMAKE_VERSION' => 1,
- 'AM_PROG_CC_C_O' => 1,
- 'LT_SUPPORTED_TAG' => 1,
- 'AC_CANONICAL_TARGET' => 1,
- 'AM_SILENT_RULES' => 1,
- 'AM_PROG_F77_C_O' => 1,
- 'AC_SUBST' => 1,
- 'm4_pattern_forbid' => 1,
- 'AM_MAINTAINER_MODE' => 1,
- 'AC_CONFIG_LIBOBJ_DIR' => 1,
- 'AM_INIT_AUTOMAKE' => 1,
- 'AC_FC_FREEFORM' => 1,
- 'AM_POT_TOOLS' => 1,
- 'AC_CANONICAL_HOST' => 1,
- 'LT_INIT' => 1,
- 'AC_CONFIG_AUX_DIR' => 1,
- 'LT_CONFIG_LTDL_DIR' => 1,
- '_AM_MAKEFILE_INCLUDE' => 1,
- 'AC_FC_PP_SRCEXT' => 1,
- 'AC_CANONICAL_SYSTEM' => 1,
- '_LT_AC_TAGCONFIG' => 1,
- 'AM_PATH_GUILE' => 1,
- 'AC_CONFIG_FILES' => 1,
- 'AC_LIBSOURCE' => 1,
- 'AC_CANONICAL_BUILD' => 1,
- 'AC_INIT' => 1,
- 'AC_SUBST_TRACE' => 1,
- 'AM_PROG_AR' => 1,
- 'm4_include' => 1,
- 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
- 'AH_OUTPUT' => 1,
- 'AC_FC_PP_DEFINE' => 1,
- 'AC_DEFINE_TRACE_LITERAL' => 1,
- 'm4_pattern_allow' => 1,
- 'AM_CONDITIONAL' => 1,
- '_AM_COND_ENDIF' => 1,
- '_AM_COND_IF' => 1,
- 'AM_PROG_MOC' => 1,
- 'AM_PROG_CXX_C_O' => 1,
- 'AC_CONFIG_SUBDIRS' => 1,
- 'include' => 1,
- 'AM_PROG_FC_C_O' => 1,
- 'AM_XGETTEXT_OPTION' => 1,
- 'AM_NLS' => 1,
- 'AM_ENABLE_MULTILIB' => 1,
- 'AC_PROG_LIBTOOL' => 1,
- '_m4_warn' => 1,
- 'AC_FC_SRCEXT' => 1
- }
- ], 'Autom4te::Request' )
- );
-
diff --git a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/traces.0 b/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/traces.0
deleted file mode 100644
index e3e68a1a13..0000000000
--- a/src/3rd_party/apache-log4cxx-0.10.0/autom4te.cache/traces.0
+++ /dev/null
@@ -1,1131 +0,0 @@
-m4trace:aclocal.m4:7256: -1- m4_include([find_apr.m4])
-m4trace:aclocal.m4:7257: -1- m4_include([find_apu.m4])
-m4trace:configure.in:1: -1- AC_INIT([src/main/cpp/logger.cpp])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^_?A[CHUM]_])
-m4trace:configure.in:1: -1- m4_pattern_forbid([_AC_])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
-m4trace:configure.in:1: -1- m4_pattern_allow([^AS_FLAGS$])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^_?m4_])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^dnl$])
-m4trace:configure.in:1: -1- m4_pattern_forbid([^_?AS_])
-m4trace:configure.in:1: -1- AC_SUBST([SHELL])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([SHELL])
-m4trace:configure.in:1: -1- m4_pattern_allow([^SHELL$])
-m4trace:configure.in:1: -1- AC_SUBST([PATH_SEPARATOR])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PATH_SEPARATOR$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_NAME])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_STRING])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
-m4trace:configure.in:1: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([PACKAGE_URL])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_URL$])
-m4trace:configure.in:1: -1- AC_SUBST([exec_prefix], [NONE])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([exec_prefix])
-m4trace:configure.in:1: -1- m4_pattern_allow([^exec_prefix$])
-m4trace:configure.in:1: -1- AC_SUBST([prefix], [NONE])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([prefix])
-m4trace:configure.in:1: -1- m4_pattern_allow([^prefix$])
-m4trace:configure.in:1: -1- AC_SUBST([program_transform_name], [s,x,x,])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([program_transform_name])
-m4trace:configure.in:1: -1- m4_pattern_allow([^program_transform_name$])
-m4trace:configure.in:1: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([bindir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^bindir$])
-m4trace:configure.in:1: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([sbindir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^sbindir$])
-m4trace:configure.in:1: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([libexecdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^libexecdir$])
-m4trace:configure.in:1: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([datarootdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^datarootdir$])
-m4trace:configure.in:1: -1- AC_SUBST([datadir], ['${datarootdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([datadir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^datadir$])
-m4trace:configure.in:1: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([sysconfdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^sysconfdir$])
-m4trace:configure.in:1: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([sharedstatedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^sharedstatedir$])
-m4trace:configure.in:1: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([localstatedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^localstatedir$])
-m4trace:configure.in:1: -1- AC_SUBST([includedir], ['${prefix}/include'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([includedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^includedir$])
-m4trace:configure.in:1: -1- AC_SUBST([oldincludedir], ['/usr/include'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([oldincludedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^oldincludedir$])
-m4trace:configure.in:1: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
- ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
- ['${datarootdir}/doc/${PACKAGE}'])])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([docdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^docdir$])
-m4trace:configure.in:1: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([infodir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^infodir$])
-m4trace:configure.in:1: -1- AC_SUBST([htmldir], ['${docdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([htmldir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^htmldir$])
-m4trace:configure.in:1: -1- AC_SUBST([dvidir], ['${docdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([dvidir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^dvidir$])
-m4trace:configure.in:1: -1- AC_SUBST([pdfdir], ['${docdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([pdfdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^pdfdir$])
-m4trace:configure.in:1: -1- AC_SUBST([psdir], ['${docdir}'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([psdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^psdir$])
-m4trace:configure.in:1: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([libdir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^libdir$])
-m4trace:configure.in:1: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([localedir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^localedir$])
-m4trace:configure.in:1: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([mandir])
-m4trace:configure.in:1: -1- m4_pattern_allow([^mandir$])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_NAME$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
-@%:@undef PACKAGE_NAME])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
-@%:@undef PACKAGE_TARNAME])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_VERSION$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
-@%:@undef PACKAGE_VERSION])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_STRING$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
-@%:@undef PACKAGE_STRING])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
-@%:@undef PACKAGE_BUGREPORT])
-m4trace:configure.in:1: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
-m4trace:configure.in:1: -1- m4_pattern_allow([^PACKAGE_URL$])
-m4trace:configure.in:1: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
-@%:@undef PACKAGE_URL])
-m4trace:configure.in:1: -1- AC_SUBST([DEFS])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([DEFS])
-m4trace:configure.in:1: -1- m4_pattern_allow([^DEFS$])
-m4trace:configure.in:1: -1- AC_SUBST([ECHO_C])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([ECHO_C])
-m4trace:configure.in:1: -1- m4_pattern_allow([^ECHO_C$])
-m4trace:configure.in:1: -1- AC_SUBST([ECHO_N])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([ECHO_N])
-m4trace:configure.in:1: -1- m4_pattern_allow([^ECHO_N$])
-m4trace:configure.in:1: -1- AC_SUBST([ECHO_T])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([ECHO_T])
-m4trace:configure.in:1: -1- m4_pattern_allow([^ECHO_T$])
-m4trace:configure.in:1: -1- AC_SUBST([LIBS])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:1: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:1: -1- AC_SUBST([build_alias])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([build_alias])
-m4trace:configure.in:1: -1- m4_pattern_allow([^build_alias$])
-m4trace:configure.in:1: -1- AC_SUBST([host_alias])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([host_alias])
-m4trace:configure.in:1: -1- m4_pattern_allow([^host_alias$])
-m4trace:configure.in:1: -1- AC_SUBST([target_alias])
-m4trace:configure.in:1: -1- AC_SUBST_TRACE([target_alias])
-m4trace:configure.in:1: -1- m4_pattern_allow([^target_alias$])
-m4trace:configure.in:22: -1- AC_CANONICAL_HOST
-m4trace:configure.in:22: -1- AC_CANONICAL_BUILD
-m4trace:configure.in:22: -1- AC_REQUIRE_AUX_FILE([config.sub])
-m4trace:configure.in:22: -1- AC_REQUIRE_AUX_FILE([config.guess])
-m4trace:configure.in:22: -1- AC_SUBST([build], [$ac_cv_build])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([build])
-m4trace:configure.in:22: -1- m4_pattern_allow([^build$])
-m4trace:configure.in:22: -1- AC_SUBST([build_cpu], [$[1]])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([build_cpu])
-m4trace:configure.in:22: -1- m4_pattern_allow([^build_cpu$])
-m4trace:configure.in:22: -1- AC_SUBST([build_vendor], [$[2]])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([build_vendor])
-m4trace:configure.in:22: -1- m4_pattern_allow([^build_vendor$])
-m4trace:configure.in:22: -1- AC_SUBST([build_os])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([build_os])
-m4trace:configure.in:22: -1- m4_pattern_allow([^build_os$])
-m4trace:configure.in:22: -1- AC_SUBST([host], [$ac_cv_host])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([host])
-m4trace:configure.in:22: -1- m4_pattern_allow([^host$])
-m4trace:configure.in:22: -1- AC_SUBST([host_cpu], [$[1]])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([host_cpu])
-m4trace:configure.in:22: -1- m4_pattern_allow([^host_cpu$])
-m4trace:configure.in:22: -1- AC_SUBST([host_vendor], [$[2]])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([host_vendor])
-m4trace:configure.in:22: -1- m4_pattern_allow([^host_vendor$])
-m4trace:configure.in:22: -1- AC_SUBST([host_os])
-m4trace:configure.in:22: -1- AC_SUBST_TRACE([host_os])
-m4trace:configure.in:22: -1- m4_pattern_allow([^host_os$])
-m4trace:configure.in:23: -1- AC_CANONICAL_TARGET
-m4trace:configure.in:23: -1- AC_SUBST([target], [$ac_cv_target])
-m4trace:configure.in:23: -1- AC_SUBST_TRACE([target])
-m4trace:configure.in:23: -1- m4_pattern_allow([^target$])
-m4trace:configure.in:23: -1- AC_SUBST([target_cpu], [$[1]])
-m4trace:configure.in:23: -1- AC_SUBST_TRACE([target_cpu])
-m4trace:configure.in:23: -1- m4_pattern_allow([^target_cpu$])
-m4trace:configure.in:23: -1- AC_SUBST([target_vendor], [$[2]])
-m4trace:configure.in:23: -1- AC_SUBST_TRACE([target_vendor])
-m4trace:configure.in:23: -1- m4_pattern_allow([^target_vendor$])
-m4trace:configure.in:23: -1- AC_SUBST([target_os])
-m4trace:configure.in:23: -1- AC_SUBST_TRACE([target_os])
-m4trace:configure.in:23: -1- m4_pattern_allow([^target_os$])
-m4trace:configure.in:34: -1- AC_SUBST([LT_VERSION])
-m4trace:configure.in:34: -1- AC_SUBST_TRACE([LT_VERSION])
-m4trace:configure.in:34: -1- m4_pattern_allow([^LT_VERSION$])
-m4trace:configure.in:36: -1- AH_OUTPUT([HAVE_NO_EXPLICIT_EXPORTS], [/* no explicit exports */
-#define LOG4CXX_EXPORT])
-m4trace:configure.in:40: -1- AM_INIT_AUTOMAKE([log4cxx], [0.10.0])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
-m4trace:configure.in:40: -1- AM_AUTOMAKE_VERSION([1.9.6])
-m4trace:configure.in:40: -1- AC_REQUIRE_AUX_FILE([install-sh])
-m4trace:configure.in:40: -1- AC_SUBST([INSTALL_PROGRAM])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
-m4trace:configure.in:40: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
-m4trace:configure.in:40: -1- AC_SUBST([INSTALL_SCRIPT])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
-m4trace:configure.in:40: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
-m4trace:configure.in:40: -1- AC_SUBST([INSTALL_DATA])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([INSTALL_DATA])
-m4trace:configure.in:40: -1- m4_pattern_allow([^INSTALL_DATA$])
-m4trace:configure.in:40: -1- AC_SUBST([CYGPATH_W])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([CYGPATH_W])
-m4trace:configure.in:40: -1- m4_pattern_allow([^CYGPATH_W$])
-m4trace:configure.in:40: -1- AC_SUBST([PACKAGE], [log4cxx])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([PACKAGE])
-m4trace:configure.in:40: -1- m4_pattern_allow([^PACKAGE$])
-m4trace:configure.in:40: -1- AC_SUBST([VERSION], [0.10.0])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([VERSION])
-m4trace:configure.in:40: -1- m4_pattern_allow([^VERSION$])
-m4trace:configure.in:40: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
-m4trace:configure.in:40: -1- m4_pattern_allow([^PACKAGE$])
-m4trace:configure.in:40: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
-@%:@undef PACKAGE])
-m4trace:configure.in:40: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
-m4trace:configure.in:40: -1- m4_pattern_allow([^VERSION$])
-m4trace:configure.in:40: -1- AH_OUTPUT([VERSION], [/* Version number of package */
-@%:@undef VERSION])
-m4trace:configure.in:40: -1- AC_SUBST([ACLOCAL])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([ACLOCAL])
-m4trace:configure.in:40: -1- m4_pattern_allow([^ACLOCAL$])
-m4trace:configure.in:40: -1- AC_SUBST([AUTOCONF])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AUTOCONF])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AUTOCONF$])
-m4trace:configure.in:40: -1- AC_SUBST([AUTOMAKE])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AUTOMAKE])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AUTOMAKE$])
-m4trace:configure.in:40: -1- AC_SUBST([AUTOHEADER])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AUTOHEADER])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AUTOHEADER$])
-m4trace:configure.in:40: -1- AC_SUBST([MAKEINFO])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([MAKEINFO])
-m4trace:configure.in:40: -1- m4_pattern_allow([^MAKEINFO$])
-m4trace:configure.in:40: -1- AC_SUBST([install_sh])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([install_sh])
-m4trace:configure.in:40: -1- m4_pattern_allow([^install_sh$])
-m4trace:configure.in:40: -1- AC_SUBST([STRIP])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([STRIP])
-m4trace:configure.in:40: -1- m4_pattern_allow([^STRIP$])
-m4trace:configure.in:40: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
-m4trace:configure.in:40: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
-m4trace:configure.in:40: -1- AC_SUBST([mkdir_p])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([mkdir_p])
-m4trace:configure.in:40: -1- m4_pattern_allow([^mkdir_p$])
-m4trace:configure.in:40: -1- AC_SUBST([AWK])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AWK])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AWK$])
-m4trace:configure.in:40: -1- AC_SUBST([SET_MAKE])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([SET_MAKE])
-m4trace:configure.in:40: -1- m4_pattern_allow([^SET_MAKE$])
-m4trace:configure.in:40: -1- AC_SUBST([am__leading_dot])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([am__leading_dot])
-m4trace:configure.in:40: -1- m4_pattern_allow([^am__leading_dot$])
-m4trace:configure.in:40: -1- AC_SUBST([AMTAR])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([AMTAR])
-m4trace:configure.in:40: -1- m4_pattern_allow([^AMTAR$])
-m4trace:configure.in:40: -1- AC_SUBST([am__tar])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([am__tar])
-m4trace:configure.in:40: -1- m4_pattern_allow([^am__tar$])
-m4trace:configure.in:40: -1- AC_SUBST([am__untar])
-m4trace:configure.in:40: -1- AC_SUBST_TRACE([am__untar])
-m4trace:configure.in:40: -1- m4_pattern_allow([^am__untar$])
-m4trace:configure.in:45: -1- AC_PROG_LIBTOOL
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
-aclocal.m4:1927: AC_ENABLE_SHARED is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
-aclocal.m4:1966: AC_ENABLE_STATIC is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
-aclocal.m4:2005: AC_ENABLE_FAST_INSTALL is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([CFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LIBS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CC$])
-m4trace:configure.in:45: -1- AC_SUBST([ac_ct_CC])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([ac_ct_CC])
-m4trace:configure.in:45: -1- m4_pattern_allow([^ac_ct_CC$])
-m4trace:configure.in:45: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([EXEEXT])
-m4trace:configure.in:45: -1- m4_pattern_allow([^EXEEXT$])
-m4trace:configure.in:45: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([OBJEXT])
-m4trace:configure.in:45: -1- m4_pattern_allow([^OBJEXT$])
-m4trace:configure.in:45: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([DEPDIR])
-m4trace:configure.in:45: -1- m4_pattern_allow([^DEPDIR$])
-m4trace:configure.in:45: -1- AC_SUBST([am__include])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__include])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__include$])
-m4trace:configure.in:45: -1- AC_SUBST([am__quote])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__quote])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__quote$])
-m4trace:configure.in:45: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-m4trace:configure.in:45: -1- AC_SUBST([AMDEP_TRUE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([AMDEP_TRUE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^AMDEP_TRUE$])
-m4trace:configure.in:45: -1- AC_SUBST([AMDEP_FALSE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([AMDEP_FALSE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^AMDEP_FALSE$])
-m4trace:configure.in:45: -1- AC_SUBST([AMDEPBACKSLASH])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
-m4trace:configure.in:45: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
-m4trace:configure.in:45: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CCDEPMODE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CCDEPMODE$])
-m4trace:configure.in:45: -1- AM_CONDITIONAL([am__fastdepCC], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3])
-m4trace:configure.in:45: -1- AC_SUBST([am__fastdepCC_TRUE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
-m4trace:configure.in:45: -1- AC_SUBST([am__fastdepCC_FALSE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
-aclocal.m4:2146: AC_PROG_LD is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([GREP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([GREP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^GREP$])
-m4trace:configure.in:45: -1- AC_SUBST([EGREP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([EGREP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^EGREP$])
-m4trace:configure.in:45: -1- AC_SUBST([LN_S], [$as_ln_s])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LN_S])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LN_S$])
-m4trace:configure.in:45: -1- AC_SUBST([ECHO])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([ECHO])
-m4trace:configure.in:45: -1- m4_pattern_allow([^ECHO$])
-m4trace:configure.in:45: -1- AC_SUBST([AR])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([AR])
-m4trace:configure.in:45: -1- m4_pattern_allow([^AR$])
-m4trace:configure.in:45: -1- AC_SUBST([RANLIB])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([RANLIB])
-m4trace:configure.in:45: -1- m4_pattern_allow([^RANLIB$])
-m4trace:configure.in:45: -1- AC_SUBST([STRIP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([STRIP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^STRIP$])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1462: AC_ARG_ENABLE is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:621: AC_LIBTOOL_COMPILER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:666: AC_LIBTOOL_LINKER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:2687: AC_TRY_LINK is expanded from...
-../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
-../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:475: _LT_AC_LOCK is expanded from...
-aclocal.m4:1079: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:5348: AC_LIBTOOL_PROG_LD_SHLIBS is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:5348: AC_LIBTOOL_PROG_LD_SHLIBS is expanded from...
-aclocal.m4:2669: _LT_AC_LANG_C_CONFIG is expanded from...
-aclocal.m4:2668: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
-@%:@undef HAVE_DLFCN_H])
-m4trace:configure.in:45: -1- AC_SUBST([CPP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([CPP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPP$])
-m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^STDC_HEADERS$])
-m4trace:configure.in:45: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
-@%:@undef STDC_HEADERS])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
-@%:@undef HAVE_SYS_TYPES_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
-@%:@undef HAVE_SYS_STAT_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
-@%:@undef HAVE_STDLIB_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
-@%:@undef HAVE_STRING_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
-@%:@undef HAVE_MEMORY_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
-@%:@undef HAVE_STRINGS_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
-@%:@undef HAVE_INTTYPES_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
-@%:@undef HAVE_STDINT_H])
-m4trace:configure.in:45: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
-@%:@undef HAVE_UNISTD_H])
-m4trace:configure.in:45: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
-m4trace:configure.in:45: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
-m4trace:configure.in:45: -1- _LT_AC_TAGCONFIG
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-../../lib/autoconf/general.m4:1481: AC_ARG_WITH is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: tag name \"$tagname\" already exists], [aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([CXX])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.in:45: -1- AC_SUBST([CXXFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXXFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXXFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LIBS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([CXX])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.in:45: -1- AC_SUBST([ac_ct_CXX])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([ac_ct_CXX])
-m4trace:configure.in:45: -1- m4_pattern_allow([^ac_ct_CXX$])
-m4trace:configure.in:45: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXXDEPMODE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXXDEPMODE$])
-m4trace:configure.in:45: -1- AM_CONDITIONAL([am__fastdepCXX], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
-m4trace:configure.in:45: -1- AC_SUBST([am__fastdepCXX_TRUE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
-m4trace:configure.in:45: -1- AC_SUBST([am__fastdepCXX_FALSE])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
-m4trace:configure.in:45: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
-m4trace:configure.in:45: -1- AC_SUBST([CXXCPP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.in:45: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([CXXCPP])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.in:45: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:2746: _LT_AC_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:2745: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:2746: _LT_AC_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:2745: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:621: AC_LIBTOOL_COMPILER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:2746: _LT_AC_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:2745: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_static_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:666: AC_LIBTOOL_LINKER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:2746: _LT_AC_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:2745: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([F77])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([F77])
-m4trace:configure.in:45: -1- m4_pattern_allow([^F77$])
-m4trace:configure.in:45: -1- AC_SUBST([FFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([FFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^FFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.in:45: -1- AC_SUBST([LIBS])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:45: -1- AC_SUBST([F77])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([F77])
-m4trace:configure.in:45: -1- m4_pattern_allow([^F77$])
-m4trace:configure.in:45: -1- AC_SUBST([ac_ct_F77])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([ac_ct_F77])
-m4trace:configure.in:45: -1- m4_pattern_allow([^ac_ct_F77$])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_pic_works_F77, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:621: AC_LIBTOOL_COMPILER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:3909: _LT_AC_LANG_F77_CONFIG is expanded from...
-aclocal.m4:3908: AC_LIBTOOL_LANG_F77_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_static_works_F77, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:666: AC_LIBTOOL_LINKER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:3909: _LT_AC_LANG_F77_CONFIG is expanded from...
-aclocal.m4:3908: AC_LIBTOOL_LANG_F77_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/lang.m4:125: AC_LANG_SAVE is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_pic_works_GCJ, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:621: AC_LIBTOOL_COMPILER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_CACHE_VAL(lt_prog_compiler_static_works_GCJ, ...): suspicious cache-id, must contain _cv_ to be cached], [../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
-../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
-aclocal.m4:666: AC_LIBTOOL_LINKER_OPTION is expanded from...
-aclocal.m4:4821: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:5348: AC_LIBTOOL_PROG_LD_SHLIBS is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2661: _AC_LINK_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2678: AC_LINK_IFELSE is expanded from...
-aclocal.m4:295: _LT_AC_SYS_LIBPATH_AIX is expanded from...
-aclocal.m4:5348: AC_LIBTOOL_PROG_LD_SHLIBS is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/lang.m4:134: AC_LANG_RESTORE is expanded from...
-aclocal.m4:4011: _LT_AC_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:4010: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/lang.m4:125: AC_LANG_SAVE is expanded from...
-aclocal.m4:4067: _LT_AC_LANG_RC_CONFIG is expanded from...
-aclocal.m4:4066: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/lang.m4:134: AC_LANG_RESTORE is expanded from...
-aclocal.m4:4067: _LT_AC_LANG_RC_CONFIG is expanded from...
-aclocal.m4:4066: AC_LIBTOOL_LANG_RC_CONFIG is expanded from...
-aclocal.m4:1805: _LT_AC_TAGCONFIG is expanded from...
-aclocal.m4:86: AC_LIBTOOL_SETUP is expanded from...
-aclocal.m4:66: _AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:31: AC_PROG_LIBTOOL is expanded from...
-aclocal.m4:6337: AM_PROG_LIBTOOL is expanded from...
-configure.in:45: the top level])
-m4trace:configure.in:45: -1- AC_SUBST([LIBTOOL])
-m4trace:configure.in:45: -1- AC_SUBST_TRACE([LIBTOOL])
-m4trace:configure.in:45: -1- m4_pattern_allow([^LIBTOOL$])
-m4trace:configure.in:47: -1- AC_SUBST([SET_MAKE])
-m4trace:configure.in:47: -1- AC_SUBST_TRACE([SET_MAKE])
-m4trace:configure.in:47: -1- m4_pattern_allow([^SET_MAKE$])
-m4trace:configure.in:49: -1- AC_SUBST([CXX])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.in:49: -1- AC_SUBST([CXXFLAGS])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CXXFLAGS])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CXXFLAGS$])
-m4trace:configure.in:49: -1- AC_SUBST([LDFLAGS])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([LDFLAGS])
-m4trace:configure.in:49: -1- m4_pattern_allow([^LDFLAGS$])
-m4trace:configure.in:49: -1- AC_SUBST([LIBS])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([LIBS])
-m4trace:configure.in:49: -1- m4_pattern_allow([^LIBS$])
-m4trace:configure.in:49: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:49: -1- AC_SUBST([CXX])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CXX])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CXX$])
-m4trace:configure.in:49: -1- AC_SUBST([ac_ct_CXX])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([ac_ct_CXX])
-m4trace:configure.in:49: -1- m4_pattern_allow([^ac_ct_CXX$])
-m4trace:configure.in:49: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([CXXDEPMODE])
-m4trace:configure.in:49: -1- m4_pattern_allow([^CXXDEPMODE$])
-m4trace:configure.in:49: -1- AM_CONDITIONAL([am__fastdepCXX], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
-m4trace:configure.in:49: -1- AC_SUBST([am__fastdepCXX_TRUE])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE])
-m4trace:configure.in:49: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
-m4trace:configure.in:49: -1- AC_SUBST([am__fastdepCXX_FALSE])
-m4trace:configure.in:49: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
-m4trace:configure.in:49: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
-m4trace:configure.in:51: -1- AC_SUBST([CXXCPP])
-m4trace:configure.in:51: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.in:51: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.in:51: -1- AC_SUBST([CPPFLAGS])
-m4trace:configure.in:51: -1- AC_SUBST_TRACE([CPPFLAGS])
-m4trace:configure.in:51: -1- m4_pattern_allow([^CPPFLAGS$])
-m4trace:configure.in:51: -1- AC_SUBST([CXXCPP])
-m4trace:configure.in:51: -1- AC_SUBST_TRACE([CXXCPP])
-m4trace:configure.in:51: -1- m4_pattern_allow([^CXXCPP$])
-m4trace:configure.in:66: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:66: the top level])
-m4trace:configure.in:70: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:70: the top level])
-m4trace:configure.in:74: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:74: the top level])
-m4trace:configure.in:80: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:80: the top level])
-m4trace:configure.in:88: -1- AC_SUBST([DOXYGEN])
-m4trace:configure.in:88: -1- AC_SUBST_TRACE([DOXYGEN])
-m4trace:configure.in:88: -1- m4_pattern_allow([^DOXYGEN$])
-m4trace:configure.in:96: -1- AC_SUBST([DOT])
-m4trace:configure.in:96: -1- AC_SUBST_TRACE([DOT])
-m4trace:configure.in:96: -1- m4_pattern_allow([^DOT$])
-m4trace:configure.in:99: -1- AM_CONDITIONAL([DOC], [test x$enable_doc = xyes])
-m4trace:configure.in:99: -1- AC_SUBST([DOC_TRUE])
-m4trace:configure.in:99: -1- AC_SUBST_TRACE([DOC_TRUE])
-m4trace:configure.in:99: -1- m4_pattern_allow([^DOC_TRUE$])
-m4trace:configure.in:99: -1- AC_SUBST([DOC_FALSE])
-m4trace:configure.in:99: -1- AC_SUBST_TRACE([DOC_FALSE])
-m4trace:configure.in:99: -1- m4_pattern_allow([^DOC_FALSE$])
-m4trace:configure.in:100: -1- AM_CONDITIONAL([LATEX_DOC], [test x$enable_latex_docs = xyes])
-m4trace:configure.in:100: -1- AC_SUBST([LATEX_DOC_TRUE])
-m4trace:configure.in:100: -1- AC_SUBST_TRACE([LATEX_DOC_TRUE])
-m4trace:configure.in:100: -1- m4_pattern_allow([^LATEX_DOC_TRUE$])
-m4trace:configure.in:100: -1- AC_SUBST([LATEX_DOC_FALSE])
-m4trace:configure.in:100: -1- AC_SUBST_TRACE([LATEX_DOC_FALSE])
-m4trace:configure.in:100: -1- m4_pattern_allow([^LATEX_DOC_FALSE$])
-m4trace:configure.in:114: -1- AC_SUBST([enable_dot])
-m4trace:configure.in:114: -1- AC_SUBST_TRACE([enable_dot])
-m4trace:configure.in:114: -1- m4_pattern_allow([^enable_dot$])
-m4trace:configure.in:115: -1- AC_SUBST([enable_html_docs])
-m4trace:configure.in:115: -1- AC_SUBST_TRACE([enable_html_docs])
-m4trace:configure.in:115: -1- m4_pattern_allow([^enable_html_docs$])
-m4trace:configure.in:116: -1- AC_SUBST([enable_latex_docs])
-m4trace:configure.in:116: -1- AC_SUBST_TRACE([enable_latex_docs])
-m4trace:configure.in:116: -1- m4_pattern_allow([^enable_latex_docs$])
-m4trace:configure.in:117: -1- AC_SUBST([manual_dest])
-m4trace:configure.in:117: -1- AC_SUBST_TRACE([manual_dest])
-m4trace:configure.in:117: -1- m4_pattern_allow([^manual_dest$])
-m4trace:configure.in:118: -1- AC_SUBST([base_dir])
-m4trace:configure.in:118: -1- AC_SUBST_TRACE([base_dir])
-m4trace:configure.in:118: -1- m4_pattern_allow([^base_dir$])
-m4trace:configure.in:132: -1- AC_SUBST([APR_LIBS])
-m4trace:configure.in:132: -1- AC_SUBST_TRACE([APR_LIBS])
-m4trace:configure.in:132: -1- m4_pattern_allow([^APR_LIBS$])
-m4trace:configure.in:142: -1- AC_SUBST([APU_LIBS])
-m4trace:configure.in:142: -1- AC_SUBST_TRACE([APU_LIBS])
-m4trace:configure.in:142: -1- m4_pattern_allow([^APU_LIBS$])
-m4trace:configure.in:149: -1- AH_OUTPUT([HAVE_MBSRTOWCS], [/* Define to 1 if you have the `mbsrtowcs\' function. */
-@%:@undef HAVE_MBSRTOWCS])
-m4trace:configure.in:149: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MBSRTOWCS])
-m4trace:configure.in:149: -1- m4_pattern_allow([^HAVE_MBSRTOWCS$])
-m4trace:configure.in:152: -1- AC_SUBST([HAS_MBSRTOWCS], [1])
-m4trace:configure.in:152: -1- AC_SUBST_TRACE([HAS_MBSRTOWCS])
-m4trace:configure.in:152: -1- m4_pattern_allow([^HAS_MBSRTOWCS$])
-m4trace:configure.in:154: -1- AC_SUBST([HAS_MBSRTOWCS], [0])
-m4trace:configure.in:154: -1- AC_SUBST_TRACE([HAS_MBSRTOWCS])
-m4trace:configure.in:154: -1- m4_pattern_allow([^HAS_MBSRTOWCS$])
-m4trace:configure.in:157: -1- AH_OUTPUT([HAVE_WCSTOMBS], [/* Define to 1 if you have the `wcstombs\' function. */
-@%:@undef HAVE_WCSTOMBS])
-m4trace:configure.in:157: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WCSTOMBS])
-m4trace:configure.in:157: -1- m4_pattern_allow([^HAVE_WCSTOMBS$])
-m4trace:configure.in:160: -1- AC_SUBST([HAS_WCSTOMBS], [1])
-m4trace:configure.in:160: -1- AC_SUBST_TRACE([HAS_WCSTOMBS])
-m4trace:configure.in:160: -1- m4_pattern_allow([^HAS_WCSTOMBS$])
-m4trace:configure.in:162: -1- AC_SUBST([HAS_WCSTOMBS], [0])
-m4trace:configure.in:162: -1- AC_SUBST_TRACE([HAS_WCSTOMBS])
-m4trace:configure.in:162: -1- m4_pattern_allow([^HAS_WCSTOMBS$])
-m4trace:configure.in:166: -1- AH_OUTPUT([HAVE_SYSLOG], [/* Define to 1 if you have the `syslog\' function. */
-@%:@undef HAVE_SYSLOG])
-m4trace:configure.in:166: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSLOG])
-m4trace:configure.in:166: -1- m4_pattern_allow([^HAVE_SYSLOG$])
-m4trace:configure.in:169: -1- AC_SUBST([HAS_SYSLOG], [1])
-m4trace:configure.in:169: -1- AC_SUBST_TRACE([HAS_SYSLOG])
-m4trace:configure.in:169: -1- m4_pattern_allow([^HAS_SYSLOG$])
-m4trace:configure.in:171: -1- AC_SUBST([HAS_SYSLOG], [0])
-m4trace:configure.in:171: -1- AC_SUBST_TRACE([HAS_SYSLOG])
-m4trace:configure.in:171: -1- m4_pattern_allow([^HAS_SYSLOG$])
-m4trace:configure.in:177: -1- AC_SUBST([HAS_STD_LOCALE], [1])
-m4trace:configure.in:177: -1- AC_SUBST_TRACE([HAS_STD_LOCALE])
-m4trace:configure.in:177: -1- m4_pattern_allow([^HAS_STD_LOCALE$])
-m4trace:configure.in:179: -1- AC_SUBST([HAS_STD_LOCALE], [0])
-m4trace:configure.in:179: -1- AC_SUBST_TRACE([HAS_STD_LOCALE])
-m4trace:configure.in:179: -1- m4_pattern_allow([^HAS_STD_LOCALE$])
-m4trace:configure.in:183: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2590: _AC_COMPILE_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2606: AC_COMPILE_IFELSE is expanded from...
-configure.in:183: the top level])
-m4trace:configure.in:189: -1- AC_SUBST([HAS_WCHAR_T], [1])
-m4trace:configure.in:189: -1- AC_SUBST_TRACE([HAS_WCHAR_T])
-m4trace:configure.in:189: -1- m4_pattern_allow([^HAS_WCHAR_T$])
-m4trace:configure.in:191: -1- AC_SUBST([HAS_WCHAR_T], [0])
-m4trace:configure.in:191: -1- AC_SUBST_TRACE([HAS_WCHAR_T])
-m4trace:configure.in:191: -1- m4_pattern_allow([^HAS_WCHAR_T$])
-m4trace:configure.in:194: -1- AH_OUTPUT([HAVE_FWIDE], [/* Define to 1 if you have the `fwide\' function. */
-@%:@undef HAVE_FWIDE])
-m4trace:configure.in:194: -1- AC_DEFINE_TRACE_LITERAL([HAVE_FWIDE])
-m4trace:configure.in:194: -1- m4_pattern_allow([^HAVE_FWIDE$])
-m4trace:configure.in:197: -1- AC_SUBST([HAS_FWIDE], [1])
-m4trace:configure.in:197: -1- AC_SUBST_TRACE([HAS_FWIDE])
-m4trace:configure.in:197: -1- m4_pattern_allow([^HAS_FWIDE$])
-m4trace:configure.in:199: -1- AC_SUBST([HAS_FWIDE], [0])
-m4trace:configure.in:199: -1- AC_SUBST_TRACE([HAS_FWIDE])
-m4trace:configure.in:199: -1- m4_pattern_allow([^HAS_FWIDE$])
-m4trace:configure.in:206: -1- AC_SUBST([RANLIB])
-m4trace:configure.in:206: -1- AC_SUBST_TRACE([RANLIB])
-m4trace:configure.in:206: -1- m4_pattern_allow([^RANLIB$])
-m4trace:configure.in:212: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:212: the top level])
-m4trace:configure.in:218: -1- AC_SUBST([HAS_ODBC], [1], [ODBC support])
-m4trace:configure.in:218: -1- AC_SUBST_TRACE([HAS_ODBC])
-m4trace:configure.in:218: -1- m4_pattern_allow([^HAS_ODBC$])
-m4trace:configure.in:225: -1- AC_SUBST([HAS_ODBC], [1], [ODBC support])
-m4trace:configure.in:225: -1- AC_SUBST_TRACE([HAS_ODBC])
-m4trace:configure.in:225: -1- m4_pattern_allow([^HAS_ODBC$])
-m4trace:configure.in:230: -1- AC_SUBST([IODBC_CONFIG])
-m4trace:configure.in:230: -1- AC_SUBST_TRACE([IODBC_CONFIG])
-m4trace:configure.in:230: -1- m4_pattern_allow([^IODBC_CONFIG$])
-m4trace:configure.in:233: -1- AC_SUBST([HAS_ODBC], [1], [ODBC support])
-m4trace:configure.in:233: -1- AC_SUBST_TRACE([HAS_ODBC])
-m4trace:configure.in:233: -1- m4_pattern_allow([^HAS_ODBC$])
-m4trace:configure.in:241: -1- AC_SUBST([HAS_ODBC], [0], [No ODBC support])
-m4trace:configure.in:241: -1- AC_SUBST_TRACE([HAS_ODBC])
-m4trace:configure.in:241: -1- m4_pattern_allow([^HAS_ODBC$])
-m4trace:configure.in:249: -1- AC_SUBST([LIBS_ODBC])
-m4trace:configure.in:249: -1- AC_SUBST_TRACE([LIBS_ODBC])
-m4trace:configure.in:249: -1- m4_pattern_allow([^LIBS_ODBC$])
-m4trace:configure.in:250: -1- AC_SUBST([CPPFLAGS_ODBC])
-m4trace:configure.in:250: -1- AC_SUBST_TRACE([CPPFLAGS_ODBC])
-m4trace:configure.in:250: -1- m4_pattern_allow([^CPPFLAGS_ODBC$])
-m4trace:configure.in:256: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:256: the top level])
-m4trace:configure.in:263: -1- AH_OUTPUT([HAVE_LIBESMTP], [/* Define to 1 if you have the `esmtp\' library (-lesmtp). */
-@%:@undef HAVE_LIBESMTP])
-m4trace:configure.in:263: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBESMTP])
-m4trace:configure.in:263: -1- m4_pattern_allow([^HAVE_LIBESMTP$])
-m4trace:configure.in:266: -1- AC_SUBST([HAS_LIBESMTP], [1], [SMTP support through libesmtp library.])
-m4trace:configure.in:266: -1- AC_SUBST_TRACE([HAS_LIBESMTP])
-m4trace:configure.in:266: -1- m4_pattern_allow([^HAS_LIBESMTP$])
-m4trace:configure.in:271: -1- AC_SUBST([HAS_LIBESMTP], [0], [SMTP support through libesmtp library.])
-m4trace:configure.in:271: -1- AC_SUBST_TRACE([HAS_LIBESMTP])
-m4trace:configure.in:271: -1- m4_pattern_allow([^HAS_LIBESMTP$])
-m4trace:configure.in:281: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:281: the top level])
-m4trace:configure.in:291: -1- AC_SUBST([CHAR_API], [1])
-m4trace:configure.in:291: -1- AC_SUBST_TRACE([CHAR_API])
-m4trace:configure.in:291: -1- m4_pattern_allow([^CHAR_API$])
-m4trace:configure.in:293: -1- AC_SUBST([CHAR_API], [0])
-m4trace:configure.in:293: -1- AC_SUBST_TRACE([CHAR_API])
-m4trace:configure.in:293: -1- m4_pattern_allow([^CHAR_API$])
-m4trace:configure.in:298: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:298: the top level])
-m4trace:configure.in:313: -1- AC_SUBST([WCHAR_T_API], [1])
-m4trace:configure.in:313: -1- AC_SUBST_TRACE([WCHAR_T_API])
-m4trace:configure.in:313: -1- m4_pattern_allow([^WCHAR_T_API$])
-m4trace:configure.in:315: -1- AC_SUBST([WCHAR_T_API], [0])
-m4trace:configure.in:315: -1- AC_SUBST_TRACE([WCHAR_T_API])
-m4trace:configure.in:315: -1- m4_pattern_allow([^WCHAR_T_API$])
-m4trace:configure.in:320: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:320: the top level])
-m4trace:configure.in:324: -1- AC_SUBST([UNICHAR_API], [1])
-m4trace:configure.in:324: -1- AC_SUBST_TRACE([UNICHAR_API])
-m4trace:configure.in:324: -1- m4_pattern_allow([^UNICHAR_API$])
-m4trace:configure.in:326: -1- AC_SUBST([UNICHAR_API], [0])
-m4trace:configure.in:326: -1- AC_SUBST_TRACE([UNICHAR_API])
-m4trace:configure.in:326: -1- m4_pattern_allow([^UNICHAR_API$])
-m4trace:configure.in:331: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:331: the top level])
-m4trace:configure.in:336: -1- _m4_warn([syntax], [AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body], [../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
-../../lib/autoconf/general.m4:2590: _AC_COMPILE_IFELSE is expanded from...
-../../lib/autoconf/general.m4:2606: AC_COMPILE_IFELSE is expanded from...
-configure.in:336: the top level])
-m4trace:configure.in:346: -1- AC_SUBST([CFSTRING_API], [1])
-m4trace:configure.in:346: -1- AC_SUBST_TRACE([CFSTRING_API])
-m4trace:configure.in:346: -1- m4_pattern_allow([^CFSTRING_API$])
-m4trace:configure.in:348: -1- AC_SUBST([CFSTRING_API], [0])
-m4trace:configure.in:348: -1- AC_SUBST_TRACE([CFSTRING_API])
-m4trace:configure.in:348: -1- m4_pattern_allow([^CFSTRING_API$])
-m4trace:configure.in:354: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:354: the top level])
-m4trace:configure.in:362: -1- AC_SUBST([CHARSET_UTF8], [1])
-m4trace:configure.in:362: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:362: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:363: -1- AC_SUBST([CHARSET_ISO88591], [0])
-m4trace:configure.in:363: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:363: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:364: -1- AC_SUBST([CHARSET_USASCII], [0])
-m4trace:configure.in:364: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:364: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:365: -1- AC_SUBST([CHARSET_EBCDIC], [0])
-m4trace:configure.in:365: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:365: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:370: -1- AC_SUBST([CHARSET_UTF8], [0])
-m4trace:configure.in:370: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:370: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:371: -1- AC_SUBST([CHARSET_ISO88591], [1])
-m4trace:configure.in:371: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:371: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:372: -1- AC_SUBST([CHARSET_USASCII], [0])
-m4trace:configure.in:372: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:372: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:373: -1- AC_SUBST([CHARSET_EBCDIC], [0])
-m4trace:configure.in:373: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:373: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:378: -1- AC_SUBST([CHARSET_UTF8], [0])
-m4trace:configure.in:378: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:378: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:379: -1- AC_SUBST([CHARSET_ISO88591], [0])
-m4trace:configure.in:379: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:379: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:380: -1- AC_SUBST([CHARSET_USASCII], [1])
-m4trace:configure.in:380: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:380: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:381: -1- AC_SUBST([CHARSET_EBCDIC], [0])
-m4trace:configure.in:381: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:381: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:386: -1- AC_SUBST([CHARSET_UTF8], [0])
-m4trace:configure.in:386: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:386: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:387: -1- AC_SUBST([CHARSET_ISO88591], [0])
-m4trace:configure.in:387: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:387: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:388: -1- AC_SUBST([CHARSET_USASCII], [0])
-m4trace:configure.in:388: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:388: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:389: -1- AC_SUBST([CHARSET_EBCDIC], [1])
-m4trace:configure.in:389: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:389: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:394: -1- AC_SUBST([CHARSET_UTF8], [0])
-m4trace:configure.in:394: -1- AC_SUBST_TRACE([CHARSET_UTF8])
-m4trace:configure.in:394: -1- m4_pattern_allow([^CHARSET_UTF8$])
-m4trace:configure.in:395: -1- AC_SUBST([CHARSET_ISO88591], [0])
-m4trace:configure.in:395: -1- AC_SUBST_TRACE([CHARSET_ISO88591])
-m4trace:configure.in:395: -1- m4_pattern_allow([^CHARSET_ISO88591$])
-m4trace:configure.in:396: -1- AC_SUBST([CHARSET_USASCII], [0])
-m4trace:configure.in:396: -1- AC_SUBST_TRACE([CHARSET_USASCII])
-m4trace:configure.in:396: -1- m4_pattern_allow([^CHARSET_USASCII$])
-m4trace:configure.in:397: -1- AC_SUBST([CHARSET_EBCDIC], [0])
-m4trace:configure.in:397: -1- AC_SUBST_TRACE([CHARSET_EBCDIC])
-m4trace:configure.in:397: -1- m4_pattern_allow([^CHARSET_EBCDIC$])
-m4trace:configure.in:411: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
-You should run autoupdate.], [../../lib/autoconf/general.m4:207: AC_HELP_STRING is expanded from...
-configure.in:411: the top level])
-m4trace:configure.in:419: -1- AC_SUBST([LOGCHAR_IS_UTF8], [1])
-m4trace:configure.in:419: -1- AC_SUBST_TRACE([LOGCHAR_IS_UTF8])
-m4trace:configure.in:419: -1- m4_pattern_allow([^LOGCHAR_IS_UTF8$])
-m4trace:configure.in:420: -1- AC_SUBST([LOGCHAR_IS_WCHAR], [0])
-m4trace:configure.in:420: -1- AC_SUBST_TRACE([LOGCHAR_IS_WCHAR])
-m4trace:configure.in:420: -1- m4_pattern_allow([^LOGCHAR_IS_WCHAR$])
-m4trace:configure.in:421: -1- AC_SUBST([LOGCHAR_IS_UNICHAR], [0])
-m4trace:configure.in:421: -1- AC_SUBST_TRACE([LOGCHAR_IS_UNICHAR])
-m4trace:configure.in:421: -1- m4_pattern_allow([^LOGCHAR_IS_UNICHAR$])
-m4trace:configure.in:426: -1- AC_SUBST([LOGCHAR_IS_UTF8], [0])
-m4trace:configure.in:426: -1- AC_SUBST_TRACE([LOGCHAR_IS_UTF8])
-m4trace:configure.in:426: -1- m4_pattern_allow([^LOGCHAR_IS_UTF8$])
-m4trace:configure.in:427: -1- AC_SUBST([LOGCHAR_IS_WCHAR], [1])
-m4trace:configure.in:427: -1- AC_SUBST_TRACE([LOGCHAR_IS_WCHAR])
-m4trace:configure.in:427: -1- m4_pattern_allow([^LOGCHAR_IS_WCHAR$])
-m4trace:configure.in:428: -1- AC_SUBST([LOGCHAR_IS_UNICHAR], [0])
-m4trace:configure.in:428: -1- AC_SUBST_TRACE([LOGCHAR_IS_UNICHAR])
-m4trace:configure.in:428: -1- m4_pattern_allow([^LOGCHAR_IS_UNICHAR$])
-m4trace:configure.in:433: -1- AC_SUBST([LOGCHAR_IS_UTF8], [0])
-m4trace:configure.in:433: -1- AC_SUBST_TRACE([LOGCHAR_IS_UTF8])
-m4trace:configure.in:433: -1- m4_pattern_allow([^LOGCHAR_IS_UTF8$])
-m4trace:configure.in:434: -1- AC_SUBST([LOGCHAR_IS_WCHAR], [0])
-m4trace:configure.in:434: -1- AC_SUBST_TRACE([LOGCHAR_IS_WCHAR])
-m4trace:configure.in:434: -1- m4_pattern_allow([^LOGCHAR_IS_WCHAR$])
-m4trace:configure.in:435: -1- AC_SUBST([LOGCHAR_IS_UNICHAR], [1])
-m4trace:configure.in:435: -1- AC_SUBST_TRACE([LOGCHAR_IS_UNICHAR])
-m4trace:configure.in:435: -1- m4_pattern_allow([^LOGCHAR_IS_UNICHAR$])
-m4trace:configure.in:449: -1- AC_CONFIG_FILES([
-Makefile
-liblog4cxx.pc
-src/Makefile
-src/main/Makefile
-src/main/cpp/Makefile
-src/main/include/Makefile
-src/main/include/log4cxx/log4cxx.h
-src/main/include/log4cxx/private/log4cxx_private.h
-src/main/include/log4cxx/private/Makefile
-src/main/include/log4cxx/Makefile
-src/main/include/log4cxx/helpers/Makefile
-src/main/include/log4cxx/net/Makefile
-src/main/include/log4cxx/nt/Makefile
-src/main/include/log4cxx/spi/Makefile
-src/main/include/log4cxx/spi/location/Makefile
-src/main/include/log4cxx/varia/Makefile
-src/main/include/log4cxx/xml/Makefile
-src/main/include/log4cxx/config/Makefile
-src/main/include/log4cxx/db/Makefile
-src/main/include/log4cxx/rolling/Makefile
-src/main/include/log4cxx/pattern/Makefile
-src/main/include/log4cxx/filter/Makefile
-src/site/Makefile
-src/site/doxy/Makefile
-src/site/doxy/Doxyfile
-src/test/Makefile
-src/test/resources/Makefile
-src/test/resources/input/Makefile
-src/test/resources/input/ndc/Makefile
-src/test/resources/input/rolling/Makefile
-src/test/resources/input/xml/Makefile
-src/test/cpp/Makefile
-src/test/resources/witness/Makefile
-src/test/resources/witness/encoding/Makefile
-src/test/resources/witness/ndc/Makefile
-src/test/resources/witness/rolling/Makefile
-src/examples/Makefile
-src/examples/cpp/Makefile
-])
-m4trace:configure.in:489: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
-m4trace:configure.in:489: -1- m4_pattern_allow([^LIB@&t@OBJS$])
-m4trace:configure.in:489: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([LTLIBOBJS])
-m4trace:configure.in:489: -1- m4_pattern_allow([^LTLIBOBJS$])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([top_builddir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([top_build_prefix])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([srcdir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([abs_srcdir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([top_srcdir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([abs_top_srcdir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([builddir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([abs_builddir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([abs_top_builddir])
-m4trace:configure.in:489: -1- AC_SUBST_TRACE([INSTALL])
diff --git a/src/appMain/CMakeLists.txt b/src/appMain/CMakeLists.txt
index a1f7b6e115..88c2d75dad 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)
@@ -211,6 +219,11 @@ install(
DESTINATION bin
)
+install(
+ FILES sdl_preloaded_pt.json
+ DESTINATION bin
+)
+
if (${QT_HMI})
if (CMAKE_SYSTEM_NAME STREQUAL "QNX")
install(FILES start-qml.sh DESTINATION bin
diff --git a/src/appMain/hmi_capabilities.json b/src/appMain/hmi_capabilities.json
index 6e9a9e3194..bef4d1e896 100755
--- a/src/appMain/hmi_capabilities.json
+++ b/src/appMain/hmi_capabilities.json
@@ -312,6 +312,159 @@
"codec": "H264"
}],
"hapticSpatialDataSupported": false
+ },
+ "remoteControlCapability": {
+ "buttonCapabilities": [
+ {
+ "longPressAvailable": true,
+ "name": "AC_MAX",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "AC",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "RECIRCULATE",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "FAN_UP",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "FAN_DOWN",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "TEMP_UP",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "TEMP_DOWN",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "DEFROST_MAX",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "DEFROST",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "DEFROST_REAR",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "UPPER_VENT",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "LOWER_VENT",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "VOLUME_UP",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "VOLUME_DOWN",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "EJECT",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "SOURCE",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "SHUFFLE",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ },
+ {
+ "longPressAvailable": true,
+ "name": "REPEAT",
+ "shortPressAvailable": true,
+ "upDownAvailable": false
+ }
+ ],
+ "climateControlCapabilities": [
+ {
+ "acEnableAvailable": true,
+ "acMaxEnableAvailable": true,
+ "autoModeEnableAvailable": true,
+ "circulateAirEnableAvailable": true,
+ "currentTemperatureAvailable": true,
+ "defrostZone": [
+ "FRONT",
+ "REAR",
+ "ALL",
+ "NONE"
+ ],
+ "defrostZoneAvailable": true,
+ "desiredTemperatureAvailable": true,
+ "dualModeEnableAvailable": true,
+ "fanSpeedAvailable": true,
+ "moduleName": "primary_climate",
+ "ventilationMode": [
+ "UPPER",
+ "LOWER",
+ "BOTH",
+ "NONE"
+ ],
+ "ventilationModeAvailable": true
+ }
+ ],
+ "radioControlCapabilities": [
+ {
+ "availableHDsAvailable": true,
+ "hdChannelAvailable": true,
+ "moduleName": "radio",
+ "radioBandAvailable": true,
+ "radioEnableAvailable": true,
+ "radioFrequencyAvailable": true,
+ "rdsDataAvailable": true,
+ "signalChangeThresholdAvailable": true,
+ "signalStrengthAvailable": true,
+ "stateAvailable": true
+ }
+ ]
}
}
},
diff --git a/src/appMain/life_cycle.cc b/src/appMain/life_cycle.cc
index 9b4910585f..3bf0e62f87 100644
--- a/src/appMain/life_cycle.cc
+++ b/src/appMain/life_cycle.cc
@@ -127,6 +127,9 @@ bool LifeCycle::StartComponents() {
DCHECK(!hmi_handler_);
hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(profile_);
+ hmi_handler_->set_message_observer(app_manager_);
+ app_manager_->set_hmi_message_handler(hmi_handler_);
+
media_manager_ = new media_manager::MediaManagerImpl(*app_manager_, profile_);
app_manager_->set_connection_handler(connection_handler_);
if (!app_manager_->Init(*last_state_, media_manager_)) {
@@ -157,8 +160,6 @@ bool LifeCycle::StartComponents() {
transport_manager_->AddEventListener(protocol_handler_);
transport_manager_->AddEventListener(connection_handler_);
- hmi_handler_->set_message_observer(app_manager_);
-
protocol_handler_->AddProtocolObserver(media_manager_);
protocol_handler_->AddProtocolObserver(app_manager_);
@@ -178,7 +179,6 @@ bool LifeCycle::StartComponents() {
// It's important to initialise TM after setting up listener chain
// [TM -> CH -> AM], otherwise some events from TM could arrive at nowhere
app_manager_->set_protocol_handler(protocol_handler_);
- app_manager_->set_hmi_message_handler(hmi_handler_);
transport_manager_->Init(*last_state_);
// start transport manager
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/appMain/sdl_preloaded_pt.json b/src/appMain/sdl_preloaded_pt.json
index a1718c97f7..68c2de0b6b 100644
--- a/src/appMain/sdl_preloaded_pt.json
+++ b/src/appMain/sdl_preloaded_pt.json
@@ -1,6 +1,7 @@
{
"policy_table": {
"module_config": {
+ "equipment": {},
"preloaded_pt": true,
"exchange_after_x_ignition_cycles": 100,
"exchange_after_x_kilometers": 1800,
@@ -307,6 +308,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 +512,36 @@
}
}
},
+ "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"]
+ }
+ }
+ },
"Emergency-1": {
"rpcs": {
"GetVehicleData": {
@@ -2286,7 +2345,11 @@
"steal_focus": false,
"priority": "NONE",
"default_hmi": "NONE",
- "groups": ["Base-4"]
+ "groups": ["Base-4", "RemoteControl"],
+ "moduleType": [
+ "RADIO",
+ "CLIMATE"
+ ]
},
"device": {
"keep_context": false,
diff --git a/src/appMain/smartDeviceLink.ini b/src/appMain/smartDeviceLink.ini
index c64e409e29..4557944048 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
@@ -270,4 +271,3 @@ MaxNumberOfiOSDevice = 10
WaitTimeBetweenApps = 4000
; App Launch on iOS devices SDL feature enabler/disabler
EnableAppLaunchIOS = true
-
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/CMakeLists.txt b/src/components/application_manager/CMakeLists.txt
index 348bd5975e..7a49ce6b81 100644
--- a/src/components/application_manager/CMakeLists.txt
+++ b/src/components/application_manager/CMakeLists.txt
@@ -41,6 +41,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/
@@ -337,6 +338,10 @@ 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/rc_is_ready_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/rc_is_ready_response.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_request.cc
+ ${COMMANDS_SOURCE_DIR}/hmi/rc_get_capabilities_response.cc
${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_request.cc
${COMMANDS_SOURCE_DIR}/hmi/ui_send_haptic_data_response.cc
)
@@ -394,6 +399,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
@@ -409,6 +419,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/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<AppExtension> 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/application.h b/src/components/application_manager/include/application_manager/application.h
index aa0227efda..3a03cb5343 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,60 @@ 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;
+
+ /**
+ * @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;
+
+ /**
+ * @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;
+
+ /**
+ * @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<uint32_t>& SubscribesIVI() const = 0;
+#endif // SDL_REMOTE_CONTROL
+
protected:
mutable sync_primitives::Lock hmi_states_lock_;
@@ -800,6 +854,7 @@ class Application : public virtual InitialApplicationData,
typedef utils::SharedPtr<Application> ApplicationSharedPtr;
typedef utils::SharedPtr<const Application> 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..dc2d8ce528 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 <vector>
#include <utility>
#include <list>
+#include <forward_list>
#include <stdint.h>
#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(
@@ -191,7 +193,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
/**
* @brief ResetDataInNone reset data counters in NONE
*/
- virtual void ResetDataInNone();
+ virtual void ResetDataInNone() OVERRIDE;
virtual DataAccessor<ButtonSubscriptions> SubscribedButtons() const OVERRIDE;
@@ -306,6 +308,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<uint32_t>& 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 +370,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 +440,10 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl,
Timer video_stream_suspend_timer_;
Timer audio_stream_suspend_timer_;
+#ifdef SDL_REMOTE_CONTROL
+ std::list<AppExtensionPtr> extensions_;
+#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..6d5c365a99 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,40 @@ class ApplicationManagerImpl
void SendHMIStatusNotification(
const utils::SharedPtr<Application> app) OVERRIDE;
+
+#ifdef SDL_REMOTE_CONTROL
+ ApplicationSharedPtr application(
+ const std::string& device_id,
+ const std::string& policy_app_id) const 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);
+
+ void Erase(ApplicationSharedPtr app_to_remove) {
+ DCHECK(app_to_remove);
+ app_to_remove->RemoveExtensions();
+ applications_.erase(app_to_remove);
+ }
+
+ virtual functional_modules::PluginManager& GetPluginManager() OVERRIDE {
+ return plugin_manager_;
+ }
+
+ std::vector<std::string> 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
@@ -700,6 +735,12 @@ class ApplicationManagerImpl
void OnUpdateHMIAppType(
std::map<std::string, std::vector<std::string> > app_hmi_types) OVERRIDE;
+ /**
+ * @brief OnPTUFinished is called on policy table update coming
+ * @param ptu_result True if PTU is succeeded, otherwise - false
+ */
+ void OnPTUFinished(const bool ptu_result) FINAL;
+
/*
* @brief Starts audio pass thru thread
*
@@ -763,6 +804,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 +1260,10 @@ class ApplicationManagerImpl
smart_objects::SmartObject& output);
bool ConvertSOtoMessage(const smart_objects::SmartObject& message,
Message& output);
+
+ MessageValidationResult ValidateMessageBySchema(
+ const Message& message) OVERRIDE;
+
utils::SharedPtr<Message> ConvertRawMsgToMessage(
const ::protocol_handler::RawMessagePtr message);
@@ -1499,6 +1547,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/commands/hmi/rc_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h
new file mode 100644
index 0000000000..58654d81d9
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_request.h
@@ -0,0 +1,73 @@
+/*
+ * 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_HMI_RC_GET_CAPABILITIES_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief RCGetCapabilitiesRequest command class
+ **/
+class RCGetCapabilitiesRequest : public RequestToHMI {
+ public:
+ /**
+ * @brief RCGetCapabilitiesRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCGetCapabilitiesRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief RCGetCapabilitiesRequest class destructor
+ **/
+ virtual ~RCGetCapabilitiesRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h
new file mode 100644
index 0000000000..006f38cbb5
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_get_capabilities_response.h
@@ -0,0 +1,73 @@
+/*
+ * 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_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief RCGetCapabilitiesResponse command class
+ **/
+class RCGetCapabilitiesResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief RCGetCapabilitiesResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCGetCapabilitiesResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief RCGetCapabilitiesResponse class destructor
+ **/
+ virtual ~RCGetCapabilitiesResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCGetCapabilitiesResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_GET_CAPABILITIES_RESPONSE_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h
new file mode 100644
index 0000000000..40e05c2b1f
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_request.h
@@ -0,0 +1,90 @@
+/*
+ * 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_HMI_RC_IS_READY_REQUEST_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
+
+#include "application_manager/commands/hmi/request_to_hmi.h"
+#include "application_manager/message_helper.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief RCIsReadyRequest command class
+ **/
+class RCIsReadyRequest : public RequestToHMI,
+ public event_engine::EventObserver {
+ public:
+ /**
+ * @brief RCIsReadyRequest class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCIsReadyRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief RCIsReadyRequest class destructor
+ **/
+ virtual ~RCIsReadyRequest();
+
+ /**
+ * @brief Execute command
+ **/
+ void Run() OVERRIDE;
+
+ /**
+ * @brief On event callback
+ **/
+ void on_event(const event_engine::Event& event) OVERRIDE;
+
+ /**
+ * @brief onTimeOut from requrst Controller
+ */
+ void onTimeOut() OVERRIDE;
+
+ /**
+ * @brief Send request to HMI for fetching of cappabilities
+ */
+ void SendMessageToHMI();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCIsReadyRequest);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_REQUEST_H_
diff --git a/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h
new file mode 100644
index 0000000000..547b89a30d
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/commands/hmi/rc_is_ready_response.h
@@ -0,0 +1,73 @@
+/*
+ * 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_HMI_RC_IS_READY_RESPONSE_H_
+#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
+
+#include "application_manager/commands/hmi/response_from_hmi.h"
+
+namespace application_manager {
+
+namespace commands {
+
+/**
+ * @brief RCIsReadyResponse command class
+ **/
+class RCIsReadyResponse : public ResponseFromHMI {
+ public:
+ /**
+ * @brief RCIsReadyResponse class constructor
+ *
+ * @param message Incoming SmartObject message
+ **/
+ RCIsReadyResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager);
+
+ /**
+ * @brief RCIsReadyResponse class destructor
+ **/
+ virtual ~RCIsReadyResponse();
+
+ /**
+ * @brief Execute command
+ **/
+ virtual void Run();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RCIsReadyResponse);
+};
+
+} // namespace commands
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_RC_IS_READY_RESPONSE_H_
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
index a7c491f6bd..b697176a36 100644
--- 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
@@ -51,7 +51,7 @@ class UISendHapticDataRequest : public RequestToHMI {
* @param application_manager Reference of application manager
**/
UISendHapticDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager);
/**
* @brief UISendHapticDataRequest class destructor
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
index 3c5714ef89..96abe4665d 100644
--- 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
@@ -51,7 +51,7 @@ class UISendHapticDataResponse : public ResponseFromHMI {
* @param application_manager Reference of application manager
**/
UISendHapticDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager);
/**
* @brief UISendHapticDataResponse class destructor
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
index 18703e84c7..13ed06cce6 100644
--- 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
@@ -33,7 +33,6 @@
#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 <string>
#include "application_manager/commands/command_request_impl.h"
#include "application_manager/application_manager.h"
@@ -56,7 +55,7 @@ class SendHapticDataRequest : public CommandRequestImpl {
* @param application_manager Reference of application manager
**/
SendHapticDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager);
/**
* @brief SendHapticDataRequest class destructor
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
index d7bb76f669..2a60746c61 100644
--- 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
@@ -33,7 +33,6 @@
#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 {
@@ -52,7 +51,7 @@ class SendHapticDataResponse : public CommandResponseImpl {
* @param application_manager Reference of application manager
**/
SendHapticDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager);
+ ApplicationManager& application_manager);
/**
* @brief SendHapticDataResponse class destructor
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..5e95ecd245
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/core_service.h
@@ -0,0 +1,214 @@
+/**
+ * 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 <string>
+#include <vector>
+#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 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 ApplicationId& app_id,
+ const std::string& module) 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;
+
+ /**
+ * @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
+ */
+ 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<ApplicationSharedPtr> GetApplications(AppExtensionUID uid) 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;
+
+ const smart_objects::SmartObject* GetRCCapabilities() const 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<std::string>* 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) FINAL;
+
+ /**
+ * @brief Gets application manager settings structure
+ * @return reference to application manager settings structure
+ */
+ const ApplicationManagerSettings& GetSettings() const FINAL;
+
+ 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);
+
+ 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/hmi_capabilities_impl.h b/src/components/application_manager/include/application_manager/hmi_capabilities_impl.h
index bdc1b0c633..cbab1fcc80 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
@@ -91,6 +91,9 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool is_ivi_cooperating() const OVERRIDE;
void set_is_ivi_cooperating(const bool value) OVERRIDE;
+ bool is_rc_cooperating() const OVERRIDE;
+ void set_is_rc_cooperating(const bool value) OVERRIDE;
+
/*
* @brief Interface used to store information about software version of the
*target
@@ -471,6 +474,11 @@ class HMICapabilitiesImpl : public HMICapabilities {
*/
const smart_objects::SmartObject* video_streaming_capability() const OVERRIDE;
+ void set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) OVERRIDE;
+
+ const smart_objects::SmartObject* rc_capability() const OVERRIDE;
+
void Init(resumption::LastState* last_state) OVERRIDE;
/*
@@ -526,6 +534,7 @@ class HMICapabilitiesImpl : public HMICapabilities {
bool is_ui_cooperating_;
bool is_navi_cooperating_;
bool is_ivi_cooperating_;
+ bool is_rc_cooperating_;
bool attenuated_supported_;
hmi_apis::Common_Language::eType ui_language_;
@@ -552,6 +561,7 @@ class HMICapabilitiesImpl : public HMICapabilities {
smart_objects::SmartObject* navigation_capability_;
smart_objects::SmartObject* phone_capability_;
smart_objects::SmartObject* video_streaming_capability_;
+ smart_objects::SmartObject* rc_capability_;
ApplicationManager& app_mngr_;
HMILanguageHandler hmi_language_handler_;
diff --git a/src/components/application_manager/include/application_manager/hmi_interfaces.h b/src/components/application_manager/include/application_manager/hmi_interfaces.h
index df1e2a9067..59ec32694a 100644
--- a/src/components/application_manager/include/application_manager/hmi_interfaces.h
+++ b/src/components/application_manager/include/application_manager/hmi_interfaces.h
@@ -59,7 +59,8 @@ class HmiInterfaces {
HMI_INTERFACE_UI,
HMI_INTERFACE_Navigation,
HMI_INTERFACE_VehicleInfo,
- HMI_INTERFACE_SDL
+ HMI_INTERFACE_SDL,
+ HMI_INTERFACE_RC
};
/**
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<application_manager::Message> MobileMessage;
+typedef utils::SharedPtr<application_manager::Message> 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..c0a3f37c34 100644
--- a/src/components/application_manager/include/application_manager/message_helper.h
+++ b/src/components/application_manager/include/application_manager/message_helper.h
@@ -702,6 +702,31 @@ 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);
+
+ /**
+ * @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,
+ 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..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
@@ -112,6 +112,73 @@ 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 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;
+
+ /**
+ * @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;
+
+ /**
+ * 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<std::string>* 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 +415,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 +574,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<std::string> GetDevicesIds(
+ const std::string& policy_app_id) OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+
/**
* @brief Sets days after epoch on successful policy update
*/
@@ -644,7 +724,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/include/application_manager/service.h b/src/components/application_manager/include/application_manager/service.h
new file mode 100644
index 0000000000..da08957afa
--- /dev/null
+++ b/src/components/application_manager/include/application_manager/service.h
@@ -0,0 +1,183 @@
+/*
+ * 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 <string>
+#include <sstream>
+#include <vector>
+#include "application_manager/application.h"
+#include "application_manager/application_manager_settings.h"
+#include "application_manager/message.h"
+#include "application_manager/hmi_interfaces.h"
+
+namespace application_manager {
+
+enum TypeAccess { kDisallowed, kAllowed };
+
+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 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 ApplicationId& app_id,
+ const std::string& module) = 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 parameters not listed in HMI API from HMI request
+ * @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<ApplicationSharedPtr> GetApplications(
+ AppExtensionUID uid) = 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;
+
+ virtual const smart_objects::SmartObject* GetRCCapabilities() const = 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;
+
+ /**
+ * @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
+ * @param list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* 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;
+
+ /**
+ * @brief Gets application manager settings structure
+ * @return reference to application manager settings structure
+ */
+ virtual const ApplicationManagerSettings& GetSettings() const = 0;
+};
+
+typedef utils::SharedPtr<Service> ServicePtr;
+
+} // namespace application_manager
+
+#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_SERVICE_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 09b21db155..ccac1ec67b 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
@@ -176,6 +176,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* rc_capability;
// PutFile
extern const char* sync_file_name;
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc
index 5764a7c5f7..4a752febf8 100644
--- a/src/components/application_manager/src/application_impl.cc
+++ b/src/components/application_manager/src/application_impl.cc
@@ -1008,4 +1008,81 @@ 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);
+}
+
+const std::set<uint32_t>& ApplicationImpl::SubscribesIVI() const {
+ return subscribed_vehicle_info_;
+}
+
+AppExtensionPtr ApplicationImpl::QueryInterface(AppExtensionUID uid) {
+ std::list<AppExtensionPtr>::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<AppExtensionPtr>::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..d6c2aa6d7a 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 <time.h>
+#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<ApplicationSharedPtr> ApplicationManagerImpl::IviInfoUpdated(
VehicleDataType vehicle_info, int value) {
// Notify Policy Manager if available about info it's interested in,
@@ -705,6 +725,13 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() {
hmi_apis::FunctionID::VehicleInfo_IsReady, *this));
ManageHMICommand(is_ivi_ready);
+#ifdef SDL_REMOTE_CONTROL
+ utils::SharedPtr<smart_objects::SmartObject> is_rc_ready(
+ MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady,
+ *this));
+ ManageHMICommand(is_rc_ready);
+#endif
+
utils::SharedPtr<smart_objects::SmartObject> button_capabilities(
MessageHelper::CreateModuleInfoSO(
hmi_apis::FunctionID::Buttons_GetCapabilities, *this));
@@ -1578,6 +1605,19 @@ 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
+ const mobile_apis::FunctionID::eType function_id =
+ static_cast<mobile_apis::FunctionID::eType>(
+ (*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.");
+ }
+#endif // SDL_REMOTE_CONTROL
} else if (app) {
mobile_apis::FunctionID::eType function_id =
static_cast<mobile_apis::FunctionID::eType>(
@@ -1810,6 +1850,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<hmi_apis::FunctionID::eType,
+ hmi_apis::messageType::eType>(
+ 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 +2013,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<CoreService>(*this));
+ plugin_manager_.LoadPlugins(settings_.plugins_folder());
+ plugin_manager_.OnServiceStateChanged(
+ functional_modules::ServiceState::HMI_ADAPTER_INITIALIZED);
+#endif // SDL_REMOTE_CONTROL
+
return true;
}
@@ -2059,24 +2129,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;
}
@@ -2118,8 +2171,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() << ".");
@@ -2234,6 +2285,60 @@ bool ApplicationManagerImpl::ConvertSOtoMessage(
return true;
}
+MessageValidationResult ApplicationManagerImpl::ValidateMessageBySchema(
+ const Message& message) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ smart_objects::SmartObject so;
+ using namespace protocol_handler;
+ switch (message.protocol_version()) {
+ case MajorProtocolVersion::PROTOCOL_VERSION_5:
+ case MajorProtocolVersion::PROTOCOL_VERSION_4:
+ case MajorProtocolVersion::PROTOCOL_VERSION_3:
+ case MajorProtocolVersion::PROTOCOL_VERSION_2: {
+ 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 MajorProtocolVersion::PROTOCOL_VERSION_HMI: {
+ const int32_t conversion_result = formatters::FormatterJsonRpc::
+ FromString<hmi_apis::FunctionID::eType, hmi_apis::messageType::eType>(
+ 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<Message> ApplicationManagerImpl::ConvertRawMsgToMessage(
const ::protocol_handler::RawMessagePtr message) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -2309,8 +2414,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 +2966,11 @@ void ApplicationManagerImpl::UnregisterApplication(
MessageHelper::SendStopAudioPathThru(*this);
}
+#ifdef SDL_REMOTE_CONTROL
+ plugin_manager_.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationUnregistered, app_id);
+#endif
+
MessageHelper::SendOnAppUnregNotificationToHMI(
app_to_remove, is_unexpected_disconnect, *this);
request_ctrl_.terminateAppRequests(app_id);
@@ -2875,6 +2994,15 @@ void ApplicationManagerImpl::Handle(const impl::MessageFromMobile message) {
LOG4CXX_INFO(logger_, "Application manager is stopping");
return;
}
+#ifdef SDL_REMOTE_CONTROL
+ if (plugin_manager_.IsMessageForPlugin(message)) {
+ if (functional_modules::ProcessResult::PROCESSED ==
+ plugin_manager_.ProcessMessage(message)) {
+ LOG4CXX_INFO(logger_, "Message is processed by plugin.");
+ return;
+ }
+ }
+#endif
ProcessMessageFromMobile(message);
}
@@ -2920,6 +3048,18 @@ void ApplicationManagerImpl::Handle(const impl::MessageFromHmi message) {
return;
}
+#ifdef SDL_REMOTE_CONTROL
+ if (plugin_manager_.IsHMIMessageForPlugin(message)) {
+ functional_modules::ProcessResult result =
+ plugin_manager_.ProcessHMIMessage(message);
+ if (functional_modules::ProcessResult::PROCESSED == result ||
+ functional_modules::ProcessResult::FAILED == result) {
+ LOG4CXX_INFO(logger_, "Message is processed by plugin.");
+ return;
+ }
+ }
+#endif
+
ProcessMessageFromHMI(message);
}
@@ -3685,6 +3825,16 @@ void ApplicationManagerImpl::OnUpdateHMIAppType(
}
}
+void ApplicationManagerImpl::OnPTUFinished(const bool ptu_result) {
+#ifdef SDL_REMOTE_CONTROL
+ if (!ptu_result) {
+ return;
+ }
+ plugin_manager_.OnPolicyEvent(
+ functional_modules::PolicyEvent::kApplicationPolicyUpdated);
+#endif // SDL_REMOTE_CONTROL
+}
+
protocol_handler::MajorProtocolVersion
ApplicationManagerImpl::SupportedSDLVersion() const {
LOG4CXX_AUTO_TRACE(logger_);
@@ -3889,5 +4039,88 @@ 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) {
+ DCHECK_OR_RETURN(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;
+ if (!connection_handler().GetDeviceID(device_id, &device_handle)) {
+ LOG4CXX_DEBUG(logger_, "No such device : " << device_id);
+ return ApplicationSharedPtr();
+ }
+
+ DataAccessor<ApplicationSet> 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<std::string> ApplicationManagerImpl::devices(
+ const std::string& policy_app_id) const {
+ MobileAppIdPredicate matcher(policy_app_id);
+ AppSharedPtrs apps = FindAllApps(applications(), matcher);
+ std::vector<std::string> devices;
+ std::transform(apps.begin(),
+ apps.end(),
+ std::back_inserter(devices),
+ TakeDeviceHandle(*this));
+ return devices;
+}
+
+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::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/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc
index 6aeeea7c9a..3f9a1d13b3 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -89,6 +89,9 @@ const std::string CreateInfoForUnsupportedResult(
case (HmiInterfaces::InterfaceID::HMI_INTERFACE_VehicleInfo): {
return "VehicleInfo is not supported by system";
}
+ case (HmiInterfaces::InterfaceID::HMI_INTERFACE_RC): {
+ return "Remote control is not supported by system";
+ }
default:
#ifdef ENABLE_LOG
CREATE_LOGGERPTR_LOCAL(logger, "Commands");
@@ -148,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() {
@@ -155,7 +159,6 @@ CommandRequestImpl::~CommandRequestImpl() {
}
bool CommandRequestImpl::Init() {
- hash_update_mode_ = kSkipHashUpdate;
return true;
}
diff --git a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
index 0553fbba94..9f4c6e5b5d 100644
--- a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
+++ b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc
@@ -37,6 +37,9 @@
#include "application_manager/message_helper.h"
#include "interfaces/MOBILE_API.h"
#include "interfaces/HMI_API.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "functional_module/plugin_manager.h"
+#endif // SDL_REMOTE_CONTROL
namespace application_manager {
@@ -62,6 +65,11 @@ void OnExitApplicationNotification::Run() {
return;
}
+#ifdef SDL_REMOTE_CONTROL
+ application_manager_.GetPluginManager().OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationExit, app_id);
+#endif // SDL_REMOTE_CONTROL
+
Common_ApplicationExitReason::eType reason;
reason = static_cast<Common_ApplicationExitReason::eType>(
(*message_)[strings::msg_params][strings::reason].asInt());
diff --git a/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc
new file mode 100644
index 0000000000..32b296a3b9
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_request.cc
@@ -0,0 +1,53 @@
+/*
+ * 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 "application_manager/commands/hmi/rc_get_capabilities_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RCGetCapabilitiesRequest::RCGetCapabilitiesRequest(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : RequestToHMI(message, application_manager) {}
+
+RCGetCapabilitiesRequest::~RCGetCapabilitiesRequest() {}
+
+void RCGetCapabilitiesRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SendRequest();
+}
+
+} // namespace commands
+
+} // namespace application_manager
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
new file mode 100644
index 0000000000..3ff6edd125
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/rc_get_capabilities_response.cc
@@ -0,0 +1,55 @@
+/*
+ * 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 "application_manager/commands/hmi/rc_get_capabilities_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RCGetCapabilitiesResponse::RCGetCapabilitiesResponse(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
+ : ResponseFromHMI(message, application_manager) {}
+
+RCGetCapabilitiesResponse::~RCGetCapabilitiesResponse() {}
+
+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]);
+}
+
+} // namespace commands
+
+} // namespace application_manager
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
new file mode 100644
index 0000000000..71b803d198
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/rc_is_ready_request.cc
@@ -0,0 +1,95 @@
+/*
+ * 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 "application_manager/commands/hmi/rc_is_ready_request.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RCIsReadyRequest::RCIsReadyRequest(const MessageSharedPtr& message,
+ ApplicationManager& application_manager)
+ : RequestToHMI(message, application_manager)
+ , EventObserver(application_manager.event_dispatcher()) {}
+
+RCIsReadyRequest::~RCIsReadyRequest() {}
+
+void RCIsReadyRequest::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ subscribe_on_event(hmi_apis::FunctionID::RC_IsReady, correlation_id());
+ SendRequest();
+}
+
+void RCIsReadyRequest::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::RC_IsReady: {
+ LOG4CXX_DEBUG(logger_, "Received RC_IsReady event");
+ unsubscribe_from_event(hmi_apis::FunctionID::RC_IsReady);
+ const bool is_available = ChangeInterfaceState(
+ application_manager_, message, HmiInterfaces::HMI_INTERFACE_RC);
+
+ HMICapabilities& hmi_capabilities =
+ application_manager_.hmi_capabilities();
+ hmi_capabilities.set_is_rc_cooperating(is_available);
+ if (!CheckAvailabilityHMIInterfaces(application_manager_,
+ HmiInterfaces::HMI_INTERFACE_RC)) {
+ LOG4CXX_INFO(logger_,
+ "HmiInterfaces::HMI_INTERFACE_VR isn't available");
+ return;
+ }
+ SendMessageToHMI();
+ break;
+ }
+ default: {
+ LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
+ return;
+ }
+ }
+}
+
+void RCIsReadyRequest::onTimeOut() {
+ // Note(dtrunov): According to new requirment APPLINK-27956
+ SendMessageToHMI();
+}
+
+void RCIsReadyRequest::SendMessageToHMI() {
+ utils::SharedPtr<smart_objects::SmartObject> get_capabilities(
+ MessageHelper::CreateModuleInfoSO(
+ hmi_apis::FunctionID::RC_GetCapabilities, application_manager_));
+ application_manager_.ManageHMICommand(get_capabilities);
+}
+
+} // namespace commands
+
+} // namespace application_manager
diff --git a/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc
new file mode 100644
index 0000000000..6756b294f3
--- /dev/null
+++ b/src/components/application_manager/src/commands/hmi/rc_is_ready_response.cc
@@ -0,0 +1,53 @@
+/*
+ * 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 "application_manager/commands/hmi/rc_is_ready_response.h"
+
+namespace application_manager {
+
+namespace commands {
+
+RCIsReadyResponse::RCIsReadyResponse(const MessageSharedPtr& message,
+ ApplicationManager& application_manager)
+ : ResponseFromHMI(message, application_manager) {}
+
+RCIsReadyResponse::~RCIsReadyResponse() {}
+
+void RCIsReadyResponse::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ event_engine::Event event(hmi_apis::FunctionID::RC_IsReady);
+ 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/hmi/ui_send_haptic_data_response.cc b/src/components/application_manager/src/commands/hmi/ui_send_haptic_data_response.cc
index 03a2ce69e2..a8239a40e8 100644
--- 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
@@ -46,8 +46,7 @@ UISendHapticDataResponse::~UISendHapticDataResponse() {}
void UISendHapticDataResponse::Run() {
LOG4CXX_AUTO_TRACE(logger_);
- event_engine::Event event(
- hmi_apis::FunctionID::UI_SendHapticData);
+ event_engine::Event event(hmi_apis::FunctionID::UI_SendHapticData);
event.set_smart_object(*message_);
event.raise(application_manager_.event_dispatcher());
}
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 ca0fb1b355..d19e2ecbb0 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
@@ -59,6 +59,16 @@ void GetSystemCapabilityRequest::Run() {
}
break;
}
+ case mobile_apis::SystemCapabilityType::REMOTE_CONTROL: {
+ if (hmi_capabilities.rc_capability()) {
+ response_params[strings::system_capability][strings::rc_capability] =
+ *hmi_capabilities.rc_capability();
+ } else {
+ SendResponse(false, mobile_apis::Result::DATA_NOT_AVAILABLE);
+ return;
+ }
+ break;
+ }
case mobile_apis::SystemCapabilityType::VIDEO_STREAMING:
if (hmi_capabilities.video_streaming_capability()) {
response_params[strings::system_capability]
@@ -85,4 +95,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/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<mobile_apis::AppHMIType::eType, std::string> 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/commands/mobile/send_haptic_data_request.cc b/src/components/application_manager/src/commands/mobile/send_haptic_data_request.cc
index 4f50ff20b0..cabfef15f6 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
@@ -39,8 +39,8 @@ namespace commands {
namespace custom_str = utils::custom_string;
-SendHapticDataRequest::SendHapticDataRequest(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
+SendHapticDataRequest::SendHapticDataRequest(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandRequestImpl(message, application_manager) {}
SendHapticDataRequest::~SendHapticDataRequest() {}
@@ -49,9 +49,7 @@ 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);
+ SendHMIRequest(hmi_apis::FunctionID::UI_SendHapticData, &msg_params, true);
}
void SendHapticDataRequest::on_event(const event_engine::Event& event) {
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
index cb7cd9f3ec..c8649d34af 100644
--- 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
@@ -36,8 +36,8 @@ namespace application_manager {
namespace commands {
-SendHapticDataResponse::SendHapticDataResponse(const MessageSharedPtr& message,
- ApplicationManager& application_manager)
+SendHapticDataResponse::SendHapticDataResponse(
+ const MessageSharedPtr& message, ApplicationManager& application_manager)
: CommandResponseImpl(message, application_manager) {}
SendHapticDataResponse::~SendHapticDataResponse() {}
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..2a96502cde
--- /dev/null
+++ b/src/components/application_manager/src/core_service.cc
@@ -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.
+ */
+
+#include <vector>
+#include <algorithm>
+#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, &params);
+
+ 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
+}
+
+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;
+}
+
+bool CoreService::IsRemoteControlApplication(ApplicationSharedPtr app) const {
+#ifdef SDL_REMOTE_CONTROL
+ DCHECK_OR_RETURN(app, false);
+ return application_manager_.GetPolicyHandler().CheckHMIType(
+ app->policy_app_id(),
+ mobile_apis::AppHMIType::eType::REMOTE_CONTROL,
+ app->app_types());
+#endif // SDL_REMOTE_CONTROL
+ 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);
+}
+
+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<ApplicationSharedPtr> CoreService::GetApplications(
+ AppExtensionUID uid) {
+ ApplicationSet accessor = application_manager_.applications().GetData();
+ AppExtensionPredicate predicate;
+ predicate.uid = uid;
+
+ std::vector<ApplicationSharedPtr> 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::ChangeNotifyHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) {
+ DCHECK_OR_RETURN_VOID(app);
+ application_manager_.ChangeAppsHMILevel(app->app_id(), level);
+}
+
+const smart_objects::SmartObject* CoreService::GetRCCapabilities() const {
+ return application_manager_.hmi_capabilities().rc_capability();
+}
+
+void CoreService::NotifyHMIAboutHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) {
+ DCHECK_OR_RETURN_VOID(app);
+ if (app->hmi_level() != mobile_apis::HMILevel::eType::HMI_FULL) {
+ MessageHelper::SendActivateAppToHMI(
+ app->app_id(),
+ application_manager_,
+ static_cast<hmi_apis::Common_HMILevel::eType>(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<std::string>* 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;
+}
+
+const ApplicationManagerSettings& CoreService::GetSettings() const {
+ return application_manager_.get_settings();
+}
+
+} // 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 99a77d5ba7..1c6e439ee8 100644
--- a/src/components/application_manager/src/hmi_capabilities_impl.cc
+++ b/src/components/application_manager/src/hmi_capabilities_impl.cc
@@ -369,6 +369,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
, is_ui_cooperating_(false)
, is_navi_cooperating_(false)
, is_ivi_cooperating_(false)
+ , is_rc_cooperating_(false)
, attenuated_supported_(false)
, ui_language_(hmi_apis::Common_Language::INVALID_ENUM)
, vr_language_(hmi_apis::Common_Language::INVALID_ENUM)
@@ -393,6 +394,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
, navigation_capability_(NULL)
, phone_capability_(NULL)
, video_streaming_capability_(NULL)
+ , rc_capability_(NULL)
, app_mngr_(app_mngr)
, hmi_language_handler_(app_mngr) {
InitCapabilities();
@@ -402,6 +404,7 @@ HMICapabilitiesImpl::HMICapabilitiesImpl(ApplicationManager& app_mngr)
is_ui_cooperating_ = true;
is_navi_cooperating_ = true;
is_ivi_cooperating_ = true;
+ is_rc_cooperating_ = true;
}
}
@@ -423,6 +426,7 @@ HMICapabilitiesImpl::~HMICapabilitiesImpl() {
delete navigation_capability_;
delete phone_capability_;
delete video_streaming_capability_;
+ delete rc_capability_;
}
bool HMICapabilitiesImpl::VerifyImageType(const int32_t image_type) const {
@@ -463,6 +467,10 @@ void HMICapabilitiesImpl::set_is_ivi_cooperating(const bool value) {
is_ivi_cooperating_ = value;
}
+void HMICapabilitiesImpl::set_is_rc_cooperating(const bool value) {
+ is_rc_cooperating_ = value;
+}
+
void HMICapabilitiesImpl::set_attenuated_supported(const bool state) {
attenuated_supported_ = state;
}
@@ -668,6 +676,14 @@ void HMICapabilitiesImpl::set_video_streaming_capability(
new smart_objects::SmartObject(video_streaming_capability);
}
+void HMICapabilitiesImpl::set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) {
+ if (rc_capability_) {
+ delete rc_capability_;
+ }
+ rc_capability_ = new smart_objects::SmartObject(rc_capability);
+}
+
void HMICapabilitiesImpl::Init(resumption::LastState* last_state) {
hmi_language_handler_.Init(last_state);
if (false == load_capabilities_from_file()) {
@@ -699,6 +715,10 @@ bool HMICapabilitiesImpl::is_ivi_cooperating() const {
return is_ivi_cooperating_;
}
+bool HMICapabilitiesImpl::is_rc_cooperating() const {
+ return is_rc_cooperating_;
+}
+
const smart_objects::SmartObject* HMICapabilitiesImpl::ui_supported_languages()
const {
return ui_supported_languages_;
@@ -798,6 +818,10 @@ HMICapabilitiesImpl::video_streaming_capability() const {
return video_streaming_capability_;
}
+const smart_objects::SmartObject* HMICapabilitiesImpl::rc_capability() const {
+ return rc_capability_;
+}
+
bool HMICapabilitiesImpl::load_capabilities_from_file() {
std::string json_string;
std::string file_name = app_mngr_.get_settings().hmi_capabilities_file_name();
@@ -1109,6 +1133,15 @@ 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);
+ }
}
} // UI end
diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc
index a512e57596..ffaa8d9b5f 100644
--- a/src/components/application_manager/src/hmi_command_factory.cc
+++ b/src/components/application_manager/src/hmi_command_factory.cc
@@ -284,6 +284,11 @@
#include "application_manager/commands/hmi/ui_send_haptic_data_request.h"
#include "application_manager/commands/hmi/ui_send_haptic_data_response.h"
+#include "application_manager/commands/hmi/rc_is_ready_request.h"
+#include "application_manager/commands/hmi/rc_is_ready_response.h"
+#include "application_manager/commands/hmi/rc_get_capabilities_request.h"
+#include "application_manager/commands/hmi/rc_get_capabilities_response.h"
+
CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager")
namespace application_manager {
@@ -2269,6 +2274,26 @@ CommandSharedPtr HMICommandFactory::CreateCommand(
message, application_manager));
break;
}
+ case hmi_apis::FunctionID::RC_IsReady: {
+ if (is_response) {
+ command.reset(
+ new commands::RCIsReadyResponse(message, application_manager));
+ } else {
+ command.reset(
+ new commands::RCIsReadyRequest(message, application_manager));
+ }
+ break;
+ }
+ case hmi_apis::FunctionID::RC_GetCapabilities: {
+ if (is_response) {
+ command.reset(new commands::RCGetCapabilitiesResponse(
+ message, application_manager));
+ } else {
+ command.reset(new commands::RCGetCapabilitiesRequest(
+ message, application_manager));
+ }
+ break;
+ }
case hmi_apis::FunctionID::UI_SendHapticData: {
if (is_response) {
command.reset(new commands::UISendHapticDataResponse(
diff --git a/src/components/application_manager/src/hmi_interfaces_impl.cc b/src/components/application_manager/src/hmi_interfaces_impl.cc
index 281c522d18..4479665f64 100644
--- a/src/components/application_manager/src/hmi_interfaces_impl.cc
+++ b/src/components/application_manager/src/hmi_interfaces_impl.cc
@@ -220,6 +220,8 @@ generate_function_to_interface_convert_map() {
convert_map[SDL_OnSystemError] = HmiInterfaces::HMI_INTERFACE_SDL;
convert_map[SDL_AddStatisticsInfo] = HmiInterfaces::HMI_INTERFACE_SDL;
convert_map[SDL_GetURLS] = HmiInterfaces::HMI_INTERFACE_SDL;
+ convert_map[RC_IsReady] = HmiInterfaces::HMI_INTERFACE_RC;
+ convert_map[RC_GetCapabilities] = HmiInterfaces::HMI_INTERFACE_RC;
return convert_map;
}
@@ -241,6 +243,8 @@ HmiInterfacesImpl::HmiInterfacesImpl() {
HmiInterfaces::STATE_NOT_RESPONSE;
interfaces_states_[HmiInterfaces::HMI_INTERFACE_VR] =
HmiInterfaces::STATE_NOT_RESPONSE;
+ interfaces_states_[HmiInterfaces::HMI_INTERFACE_RC] =
+ HmiInterfaces::STATE_NOT_RESPONSE;
}
HmiInterfaces::InterfaceState HmiInterfacesImpl::GetInterfaceState(
diff --git a/src/components/application_manager/src/message.cc b/src/components/application_manager/src/message.cc
index 41a7eea0b6..b211b270b8 100644
--- a/src/components/application_manager/src/message.cc
+++ b/src/components/application_manager/src/message.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
@@ -68,7 +68,16 @@ Message::Message(protocol_handler::MessagePriority priority)
protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN) {}
Message::Message(const Message& message)
- : priority_(message.priority_), binary_data_(NULL) {
+ : function_id_(0)
+ , correlation_id_(0)
+ , type_(kUnknownType)
+ , priority_(message.priority_)
+ , connection_key_(0)
+ , binary_data_(NULL)
+ , data_size_(0)
+ , payload_size_(0)
+ , version_(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN) {
*this = message;
}
@@ -89,7 +98,7 @@ Message& Message::operator=(const Message& message) {
return *this;
}
-bool Message::operator==(const Message& message) {
+bool Message::operator==(const Message& message) const {
bool function_id = function_id_ == message.function_id_;
bool correlation_id = correlation_id_ == message.correlation_id_;
bool connection_key = connection_key_ == message.connection_key_;
@@ -98,14 +107,17 @@ bool Message::operator==(const Message& message) {
bool version = version_ == message.version_;
bool data_size = data_size_ == message.data_size_;
bool payload_size = payload_size_ == message.payload_size_;
-
- bool binary_data = std::equal(binary_data_->begin(),
- binary_data_->end(),
- message.binary_data_->begin(),
- BinaryDataPredicate);
+ bool binary_data_available = true;
+ if (binary_data_) {
+ binary_data_available = std::equal(binary_data_->begin(),
+ binary_data_->end(),
+ message.binary_data_->begin(),
+ BinaryDataPredicate);
+ }
return function_id && correlation_id && connection_key && type &&
- binary_data && json_message && version && data_size && payload_size;
+ binary_data_available && json_message && version && data_size &&
+ payload_size;
}
Message::~Message() {
@@ -118,6 +130,12 @@ int32_t Message::function_id() const {
return function_id_;
}
+#ifdef SDL_REMOTE_CONTROL
+std::string Message::function_name() const {
+ return function_name_;
+}
+#endif // SDL_REMOTE_CONTROL
+
int32_t Message::correlation_id() const {
return correlation_id_;
}
@@ -158,6 +176,12 @@ void Message::set_function_id(int32_t id) {
function_id_ = id;
}
+#ifdef SDL_REMOTE_CONTROL
+void Message::set_function_name(const std::string& name) {
+ function_name_ = name;
+}
+#endif // SDL_REMOTE_CONTROL
+
void Message::set_correlation_id(int32_t id) {
correlation_id_ = id;
}
@@ -180,7 +204,7 @@ void Message::set_binary_data(BinaryData* data) {
delete binary_data_;
}
- binary_data_ = data;
+ binary_data_ = new BinaryData(*data);
}
void Message::set_json_message(const std::string& json_message) {
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..01d180b4b5 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,95 @@ hmi_apis::Common_Result::eType MessageHelper::MobileToHMIResult(
return HMIResultFromString(result);
}
+#ifdef SDL_REMOTE_CONTROL
+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<int32_t>(mobile_api::FunctionID::OnHMIStatusID);
+
+ message[strings::params][strings::message_type] =
+ static_cast<int32_t>(application_manager::MessageType::kNotification);
+
+ message[strings::params][strings::connection_key] =
+ static_cast<int32_t>(application_impl.app_id());
+
+ message[strings::msg_params][strings::hmi_level] =
+ static_cast<int32_t>(application_impl.hmi_level());
+
+ message[strings::msg_params][strings::audio_streaming_state] =
+ static_cast<int32_t>(application_impl.audio_streaming_state());
+
+ message[strings::msg_params][strings::system_context] =
+ static_cast<int32_t>(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<smart_objects::SmartObject> 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;
+ 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;
@@ -1445,8 +1534,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/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index ec8b36477c..ad21f533a1 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -55,6 +55,9 @@
#include "utils/scope_guard.h"
#include "utils/make_shared.h"
#include "policy/policy_manager.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "functional_module/plugin_manager.h"
+#endif // SDL_REMOTE_CONTROL
namespace policy {
@@ -541,6 +544,12 @@ void PolicyHandler::GetAvailableApps(std::queue<std::string>& 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) {
@@ -1178,6 +1187,10 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
accessor.GetData().end(),
DeactivateApplication(device_handle,
application_manager_.state_controller()));
+#ifdef SDL_REMOTE_CONTROL
+ application_manager_.GetPluginManager().OnPolicyEvent(
+ functional_modules::PolicyEvent::kApplicationsDisabled);
+#endif // SDL_REMOTE_CONTROL
} else {
std::for_each(
accessor.GetData().begin(),
@@ -1186,7 +1199,6 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification(
policy_manager_.get(),
application_manager_.state_controller()));
}
-
#endif // EXTERNAL_PROPRIETARY_MODE
}
}
@@ -1941,4 +1953,141 @@ bool PolicyHandler::IsUrlAppIdValid(const uint32_t app_idx,
return ((is_registered && !is_empty_urls) || is_default);
}
+
+#ifdef SDL_REMOTE_CONTROL
+
+std::vector<std::string> PolicyHandler::GetDevicesIds(
+ const std::string& policy_app_id) {
+ return application_manager_.devices(policy_app_id);
+}
+
+void PolicyHandler::UpdateHMILevel(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ DCHECK_OR_RETURN_VOID(app);
+ 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_);
+ }
+ }
+}
+
+bool PolicyHandler::CheckModule(const PTString& app_id,
+ const PTString& module) {
+ POLICY_LIB_CHECK(false);
+ return policy_manager_->CheckModule(app_id, module);
+}
+
+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_);
+}
+
+bool PolicyHandler::GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* 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<int> 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<int> policy_hmi_types;
+ bool ret = policy_manager_->GetHMITypes(application_id, &policy_hmi_types);
+
+ std::vector<int> 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<int>& 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/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index 77a1853a39..1b9bd7ffb9 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -63,8 +63,11 @@ RequestController::RequestController(const RequestControlerSettings& settings)
RequestController::~RequestController() {
LOG4CXX_AUTO_TRACE(logger_);
- timer_stop_flag_ = true;
- timer_condition_.Broadcast();
+ {
+ sync_primitives::AutoLock auto_lock(timer_lock);
+ timer_stop_flag_ = true;
+ timer_condition_.Broadcast();
+ }
timer_.Stop();
if (pool_state_ != TPoolState::STOPPED) {
DestroyThreadpool();
@@ -370,11 +373,11 @@ void RequestController::TimeoutThread() {
LOG4CXX_DEBUG(
logger_,
"ENTER Waiting fore response count: " << waiting_for_response_.Size());
+ sync_primitives::AutoLock auto_lock(timer_lock);
while (!timer_stop_flag_) {
RequestInfoPtr probably_expired =
waiting_for_response_.FrontWithNotNullTimeout();
if (!probably_expired) {
- sync_primitives::AutoLock auto_lock(timer_lock);
timer_condition_.Wait(auto_lock);
continue;
}
@@ -388,7 +391,6 @@ void RequestController::TimeoutThread() {
<< " request id: " << probably_expired->requestId()
<< " connection_key: " << probably_expired->app_id()
<< " NOT expired");
- sync_primitives::AutoLock auto_lock(timer_lock);
const TimevalStruct current_time = date_time::DateTime::getCurrentTime();
const TimevalStruct end_time = probably_expired->end_time();
if (current_time < end_time) {
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index e53688044e..d5041ef836 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* rc_capability = "remoteControlCapability";
// 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/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/hmi/hmi_notifications/hmi_notifications_test.cc b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
index ecdb698c56..9af72a7925 100644
--- a/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
+++ b/src/components/application_manager/test/commands/hmi/hmi_notifications/hmi_notifications_test.cc
@@ -130,6 +130,9 @@
#include "application_manager/policies/mock_policy_handler_interface.h"
#include "application_manager/mock_message_helper.h"
#include "protocol_handler/mock_session_observer.h"
+#ifdef SDL_REMOTE_CONTROL
+#include "functional_module/plugin_manager.h"
+#endif // SDL_REMOTE_CONTROL
namespace am = application_manager;
@@ -1106,6 +1109,12 @@ TEST_F(HMICommandsNotificationsTest,
(*notification)[am::strings::msg_params][am::strings::reason] =
static_cast<int32_t>(*it_mobile_reason);
+#ifdef SDL_REMOTE_CONTROL
+ functional_modules::PluginManager plugin_mng;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillRepeatedly(ReturnRef(plugin_mng));
+#endif // SDL_REMOTE_CONTROL
+
EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
EXPECT_CALL(*message_helper_mock_,
GetOnAppInterfaceUnregisteredNotificationToMobile(
@@ -1130,6 +1139,12 @@ TEST_F(HMICommandsNotificationsTest,
utils::SharedPtr<Command> command =
CreateCommand<OnExitApplicationNotification>(message);
+#ifdef SDL_REMOTE_CONTROL
+ functional_modules::PluginManager plugin_mng;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillRepeatedly(ReturnRef(plugin_mng));
+#endif // SDL_REMOTE_CONTROL
+
EXPECT_CALL(app_mngr_, application(_)).Times(0);
EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
@@ -1184,6 +1199,12 @@ TEST_F(HMICommandsNotificationsTest,
utils::SharedPtr<Command> command =
CreateCommand<OnExitApplicationNotification>(message);
+#ifdef SDL_REMOTE_CONTROL
+ functional_modules::PluginManager plugin_mng;
+ EXPECT_CALL(app_mngr_, GetPluginManager())
+ .WillRepeatedly(ReturnRef(plugin_mng));
+#endif // SDL_REMOTE_CONTROL
+
EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_));
EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0);
EXPECT_CALL(app_mngr_, UnregisterApplication(_, _, _, _)).Times(0);
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
new file mode 100644
index 0000000000..f851bd644a
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/rc_get_capabilities_response_test.cc
@@ -0,0 +1,108 @@
+/*
+ * 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 <stdint.h>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "interfaces/MOBILE_API.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/smart_object_keys.h"
+#include "application_manager/commands/commands_test.h"
+#include "application_manager/commands/command_impl.h"
+#include "application_manager/commands/hmi/rc_get_capabilities_response.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_get_capabilities_response {
+
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = am::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::RCGetCapabilitiesResponse;
+using am::commands::CommandImpl;
+
+typedef SharedPtr<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr;
+typedef NiceMock<
+ ::test::components::application_manager_test::MockHMICapabilities>
+ MockHMICapabilities;
+
+namespace {
+const uint32_t kConnectionKey = 2u;
+} // namespace
+
+class RCGetCapabilitiesResponseTest
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
+ public:
+ MessageSharedPtr CreateCommandMsg() {
+ MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map));
+ (*command_msg)[strings::msg_params][strings::number] = "123";
+ (*command_msg)[strings::params][strings::connection_key] = kConnectionKey;
+ (*command_msg)[strings::params][hmi_response::code] =
+ hmi_apis::Common_Result::SUCCESS;
+ (*command_msg)[strings::msg_params][strings::rc_capability] =
+ (capabilities_);
+
+ return command_msg;
+ }
+
+ MockHMICapabilities mock_hmi_capabilities_;
+ SmartObject capabilities_;
+};
+
+TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) {
+ MessageSharedPtr command_msg = CreateCommandMsg();
+
+ RCGetCapabilitiesResponsePtr command(
+ CreateCommand<RCGetCapabilitiesResponse>(command_msg));
+
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+
+ smart_objects::SmartObject rc_capability_so =
+ (*command_msg)[strings::msg_params][strings::rc_capability];
+
+ EXPECT_CALL(mock_hmi_capabilities_, set_rc_capability(rc_capability_so));
+
+ command->Run();
+}
+
+} // namespace rc_get_capabilities_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
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
new file mode 100644
index 0000000000..af54321ca7
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/rc_is_ready_request_test.cc
@@ -0,0 +1,172 @@
+/*
+ * 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 "application_manager/commands/hmi/rc_is_ready_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/mock_hmi_capabilities.h"
+#include "application_manager/mock_message_helper.h"
+#include "application_manager/event_engine/event.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_is_ready_request {
+
+using ::testing::_;
+using ::testing::ReturnRef;
+namespace am = ::application_manager;
+using am::commands::MessageSharedPtr;
+using am::commands::RCIsReadyRequest;
+using am::MockMessageHelper;
+using am::event_engine::Event;
+
+typedef SharedPtr<RCIsReadyRequest> RCIsReadyRequestPtr;
+
+class RCIsReadyRequestTest
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ RCIsReadyRequestTest() : command_(CreateCommand<RCIsReadyRequest>()) {}
+
+ void SetUpExpectations(bool is_rc_cooperating_available,
+ bool is_send_message_to_hmi,
+ bool is_message_contain_param,
+ am::HmiInterfaces::InterfaceState state) {
+ if (is_send_message_to_hmi) {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillRepeatedly(ReturnRef(mock_hmi_capabilities_));
+ ExpectSendMessagesToHMI();
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_capabilities())
+ .WillOnce(ReturnRef(mock_hmi_capabilities_));
+ }
+ EXPECT_CALL(mock_hmi_capabilities_,
+ set_is_rc_cooperating(is_rc_cooperating_available));
+
+ if (is_message_contain_param) {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillRepeatedly(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(
+ mock_hmi_interfaces_,
+ SetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC, state));
+ } else {
+ EXPECT_CALL(app_mngr_, hmi_interfaces())
+ .WillOnce(ReturnRef(mock_hmi_interfaces_));
+ EXPECT_CALL(mock_hmi_interfaces_, SetInterfaceState(_, _)).Times(0);
+ }
+ EXPECT_CALL(mock_hmi_interfaces_,
+ GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_RC))
+ .WillOnce(Return(state));
+ }
+
+ void ExpectSendMessagesToHMI() {
+ smart_objects::SmartObjectSPtr capabilities(
+ new smart_objects::SmartObject(smart_objects::SmartType_Map));
+ EXPECT_CALL(*(MockMessageHelper::message_helper_mock()),
+ CreateModuleInfoSO(hmi_apis::FunctionID::RC_GetCapabilities, _))
+ .WillOnce(Return(capabilities));
+ EXPECT_CALL(app_mngr_, ManageHMICommand(capabilities));
+ }
+
+ void PrepareEvent(bool is_message_contain_param,
+ Event& event,
+ bool is_rc_cooperating_available = false) {
+ MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map);
+ if (is_message_contain_param) {
+ (*msg)[am::strings::msg_params][am::strings::available] =
+ is_rc_cooperating_available;
+ }
+ event.set_smart_object(*msg);
+ }
+
+ RCIsReadyRequestPtr command_;
+ am::MockHmiInterfaces mock_hmi_interfaces_;
+ application_manager_test::MockHMICapabilities mock_hmi_capabilities_;
+};
+
+TEST_F(RCIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) {
+ const bool is_rc_cooperating_available = false;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = false;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_RESPONSE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToFalse_StateNotAvailable) {
+ const bool is_rc_cooperating_available = false;
+ const bool is_send_message_to_hmi = false;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_NOT_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_KeyAvailableEqualToTrue_StateAvailable) {
+ const bool is_rc_cooperating_available = true;
+ const bool is_send_message_to_hmi = true;
+ const bool is_message_contain_param = true;
+ Event event(hmi_apis::FunctionID::RC_IsReady);
+ PrepareEvent(is_message_contain_param, event, is_rc_cooperating_available);
+ SetUpExpectations(is_rc_cooperating_available,
+ is_send_message_to_hmi,
+ is_message_contain_param,
+ am::HmiInterfaces::STATE_AVAILABLE);
+ command_->on_event(event);
+}
+
+TEST_F(RCIsReadyRequestTest, Run_HMIDoestRespond_SendMessageToHMIByTimeout) {
+ ExpectSendMessagesToHMI();
+ command_->onTimeOut();
+}
+
+} // namespace rc_is_ready_request
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
diff --git a/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc
new file mode 100644
index 0000000000..157dff6216
--- /dev/null
+++ b/src/components/application_manager/test/commands/hmi/rc_is_ready_response_test.cc
@@ -0,0 +1,79 @@
+/*
+ * 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 <stdint.h>
+#include <string>
+
+#include "gtest/gtest.h"
+#include "utils/shared_ptr.h"
+#include "smart_objects/smart_object.h"
+#include "commands/commands_test.h"
+#include "application_manager/mock_hmi_capabilities.h"
+#include "application_manager/commands/hmi/rc_is_ready_response.h"
+#include "application_manager/mock_event_dispatcher.h"
+
+namespace test {
+namespace components {
+namespace commands_test {
+namespace hmi_commands_test {
+namespace rc_is_ready_response {
+
+using ::testing::Return;
+using ::utils::SharedPtr;
+using ::testing::NiceMock;
+namespace am = ::application_manager;
+namespace strings = ::application_manager::strings;
+namespace hmi_response = am::hmi_response;
+using am::commands::RCIsReadyResponse;
+using test::components::event_engine_test::MockEventDispatcher;
+
+typedef SharedPtr<RCIsReadyResponse> RCIsReadyResponsePtr;
+
+class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {
+};
+
+TEST_F(RCIsReadyResponseTest, RUN_SUCCESS) {
+ RCIsReadyResponsePtr command(CreateCommand<RCIsReadyResponse>());
+
+ 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 rc_is_ready_response
+} // namespace hmi_commands_test
+} // namespace commands_test
+} // namespace components
+} // namespace test
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 f257a41624..f55b2e5835 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
@@ -238,8 +238,7 @@ typedef Types<
CommandData<commands::UIScrollableMessageResponse,
hmi_apis::FunctionID::UI_ScrollableMessage>,
CommandData<commands::UISendHapticDataResponse,
- hmi_apis::FunctionID::UI_SendHapticData> >
- ResponseCommandsList;
+ hmi_apis::FunctionID::UI_SendHapticData> > ResponseCommandsList;
typedef Types<commands::AudioStopStreamResponse,
commands::NaviStopStreamResponse,
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/alert_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_request_test.cc
index ed20ff94d6..f83a40843c 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
@@ -263,6 +263,9 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) {
event.set_smart_object(*msg);
MessageSharedPtr ui_command_result;
+ ON_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE))
+ .WillByDefault(Return(am::mobile_api::Result::UNSUPPORTED_RESOURCE));
EXPECT_CALL(
app_mngr_,
ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL))
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<DeleteInteractionChoiceSetRequest>(message_);
+ command->Init();
command->Run();
}
@@ -247,6 +248,7 @@ TEST_F(DeleteInteractionChoiceSetRequestTest, Run_SendVrDeleteCommand_SUCCESS) {
DeleteInteractionChoiceSetRequestPtr command =
CreateCommand<DeleteInteractionChoiceSetRequest>(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 8373601480..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
@@ -58,6 +58,7 @@ 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;
@@ -142,6 +143,12 @@ 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));
@@ -234,9 +241,11 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_UnknownEventId_UNSUCCESS) {
TEST_F(DeleteSubMenuRequestTest, OnEvent_InvalidApp_UNSUCCESS) {
Event event(hmi_apis::FunctionID::UI_DeleteSubMenu);
(*message_)[am::strings::params][am::hmi_response::code] =
- am::mobile_api::Result::SUCCESS;
+ hmi_apis::Common_Result::eType::SUCCESS;
event.set_smart_object(*message_);
-
+ ON_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::eType::SUCCESS))
+ .WillByDefault(Return(am::mobile_api::Result::SUCCESS));
MockAppPtr invalid_app;
EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app));
EXPECT_CALL(*app_, RemoveSubMenu(_)).Times(0);
@@ -280,6 +289,7 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) {
DeleteSubMenuRequestPtr command =
CreateCommand<DeleteSubMenuRequest>(message_);
+ command->Init();
command->on_event(event);
}
@@ -308,8 +318,9 @@ TEST_F(DeleteSubMenuRequestTest,
commands_map_.insert(
std::make_pair(0, &((*message_)[am::strings::msg_params])));
- EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_))
- .WillRepeatedly(Return(am::mobile_api::Result::SUCCESS));
+ ON_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::SUCCESS))
+ .WillByDefault(Return(am::mobile_api::Result::SUCCESS));
EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_));
EXPECT_CALL(app_mngr_, ManageHMICommand(_)).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 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 8d0363294d..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
@@ -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<GetDTCsRequest> GetDTCsRequestPtr;
class GetDTCsRequestTest
- : public CommandRequestTest<CommandsTestMocks::kIsNice> {};
+ : public CommandRequestTest<CommandsTestMocks::kIsNice> {
+ public:
+ GetDTCsRequestTest() : CommandRequestTest<CommandsTestMocks::kIsNice>() {
+ Mock::VerifyAndClearExpectations(message_helper_mock_);
+ }
+};
TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) {
GetDTCsRequestPtr command(CreateCommand<GetDTCsRequest>());
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 e80f53a8e1..d886a2b1bd 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,6 +57,7 @@ using ::testing::Mock;
using ::testing::_;
using application_manager::commands::GetWayPointsRequest;
using application_manager::MockMessageHelper;
+using application_manager::MockHmiInterfaces;
typedef SharedPtr<GetWayPointsRequest> CommandPtr;
typedef mobile_apis::Result::eType MobileResult;
@@ -151,6 +152,7 @@ class GetWayPointsRequestOnEventTest
protected:
MockMessageHelper& message_helper_mock_;
MockAppPtr app_;
+ MockHmiInterfaces hmi_interfaces_;
};
TEST_F(GetWayPointsRequestTest,
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/send_haptic_data_test.cc b/src/components/application_manager/test/commands/mobile/send_haptic_data_test.cc
index 1e14f46555..49483209b6 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
@@ -68,13 +68,13 @@ class SendHapticDataRequestTest
: public CommandRequestTest<CommandsTestMocks::kIsNice> {
public:
SendHapticDataRequestTest()
- : msg_(CreateMessage(::smart_objects::SmartType_Map))
- , mock_app_(CreateMockApp()) {}
+ : msg_(CreateMessage(::smart_objects::SmartType_Map))
+ , mock_app_(CreateMockApp()) {}
void SetUp() OVERRIDE {
(*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey;
ON_CALL(app_mngr_, application(kConnectionKey))
- .WillByDefault(Return(mock_app_));
+ .WillByDefault(Return(mock_app_));
}
MessageSharedPtr msg_;
@@ -82,7 +82,7 @@ class SendHapticDataRequestTest
};
class SendHapticDataResponseTest
- : public CommandsTest<CommandsTestMocks::kIsNice> {
+ : public CommandsTest<CommandsTestMocks::kIsNice> {
public:
SendHapticDataResponseTest() : message_(CreateMessage()) {}
@@ -95,11 +95,10 @@ class SendHapticDataResponseTest
};
TEST_F(SendHapticDataRequestTest, Run_SUCCESS) {
- EXPECT_CALL(
- app_mngr_,
- ManageHMICommand(HMIResultCodeIs(
- hmi_apis::FunctionID::UI_SendHapticData)))
- .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_,
+ ManageHMICommand(
+ HMIResultCodeIs(hmi_apis::FunctionID::UI_SendHapticData)))
+ .WillOnce(Return(true));
SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
@@ -108,14 +107,14 @@ TEST_F(SendHapticDataRequestTest, Run_SUCCESS) {
}
TEST_F(SendHapticDataRequestTest, OnEvent_SUCCESS) {
- EXPECT_CALL(app_mngr_,
- ManageMobileCommand(
- MobileResultCodeIs(mobile_apis::Result::SUCCESS),
- am::commands::Command::ORIGIN_SDL));
+ EXPECT_CALL(
+ app_mngr_,
+ ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS),
+ am::commands::Command::ORIGIN_SDL));
(*msg_)[am::strings::msg_params] = 0;
(*msg_)[am::strings::params][am::hmi_response::code] =
- hmi_apis::Common_Result::eType::SUCCESS;
+ hmi_apis::Common_Result::eType::SUCCESS;
Event event(hmi_apis::FunctionID::UI_SendHapticData);
event.set_smart_object(*msg_);
SendHapticDataRequestPtr command(CreateCommand<SendHapticDataRequest>(msg_));
@@ -127,13 +126,11 @@ TEST_F(SendHapticDataRequestTest, OnEvent_SUCCESS) {
TEST_F(SendHapticDataResponseTest, Run_Success) {
::smart_objects::SmartObject& message_ref = *message_;
message_ref[am::strings::msg_params][am::strings::result_code] =
- mobile_apis::Result::SUCCESS;
+ mobile_apis::Result::SUCCESS;
EXPECT_CALL(
- app_mngr_,
- SendMessageToMobile(
- MobileResultCodeIs(mobile_apis::Result::SUCCESS),
- _));
+ app_mngr_,
+ SendMessageToMobile(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _));
command_sptr_->Init();
command_sptr_->Run();
}
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 ec069e4825..68aa76010f 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
@@ -253,7 +253,9 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) {
EXPECT_CALL(hmi_capabilities, display_capabilities())
.WillOnce(Return(dispaly_capabilities_msg.get()));
-
+ ON_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::eType::SUCCESS))
+ .WillByDefault(Return(am::mobile_api::Result::SUCCESS));
EXPECT_CALL(
app_mngr_,
ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS),
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 e0ba409957..86889ac5cd 100644
--- a/src/components/application_manager/test/commands/mobile/show_test.cc
+++ b/src/components/application_manager/test/commands/mobile/show_test.cc
@@ -752,12 +752,17 @@ TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) {
TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) {
MessageSharedPtr msg = CreateMessage();
(*msg)[am::strings::params][am::hmi_response::code] =
- mobile_apis::Result::SUCCESS;
+ hmi_apis::Common_Result::eType::SUCCESS;
(*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map);
SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
- EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
+ ON_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::eType::SUCCESS))
+ .WillByDefault(Return(am::mobile_api::Result::SUCCESS));
+ EXPECT_CALL(app_mngr_,
+ ManageMobileCommand(
+ MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), _));
Event event(hmi_apis::FunctionID::UI_Show);
event.set_smart_object(*msg);
@@ -776,6 +781,9 @@ TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) {
SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg));
+ EXPECT_CALL(mock_message_helper_,
+ HMIToMobileResult(hmi_apis::Common_Result::WARNINGS))
+ .WillOnce(Return(mobile_apis::Result::WARNINGS));
EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _));
Event event(hmi_apis::FunctionID::UI_Show);
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 ecc2f8e8a5..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(
@@ -279,9 +280,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), _));
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);
}
diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json
index 7c6cdd7dcd..9db6ee78ae 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,42 +357,242 @@
"phoneCapability": {
"dialNumberEnabled": true
},
- "videoStreamingCapability": {
- "preferredResolution": {
- "resolutionWidth": 800,
- "resolutionHeight": 350
+
+ "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
},
- "maxBitrate": 10000,
- "supportedFormats": [{
- "protocol": "RAW",
- "codec": "H264"
+ {
+ "name": "AC",
+ "shortPressAvailable": true,
+ "longPressAvailable": true,
+ "upDownAvailable": false
},
{
- "protocol": "RTP",
- "codec": "Theora"
- }],
- "hapticSpatialDataSupported": true
- }
+ "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
+ }
+ ]
+ },
+ "videoStreamingCapability": {
+ "preferredResolution": {
+ "resolutionWidth": 800,
+ "resolutionHeight": 350
+ },
+ "maxBitrate": 10000,
+ "supportedFormats": [
+ {
+ "protocol": "RAW",
+ "codec": "H264"
+ },
+ {
+ "protocol": "RTP",
+ "codec": "Theora"
+ }
+ ],
+ "hapticSpatialDataSupported": true
}
+ }
},
"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/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc
index ad84daf829..5c3830d5a5 100644
--- a/src/components/application_manager/test/hmi_capabilities_test.cc
+++ b/src/components/application_manager/test/hmi_capabilities_test.cc
@@ -422,8 +422,51 @@ 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());
+
+ EXPECT_TRUE(
+ vs_capability_so.keyExists(strings::haptic_spatial_data_supported));
+ EXPECT_TRUE(
+ vs_capability_so[strings::haptic_spatial_data_supported].asBool());
+
+ // Check remote control capabilites
+ const smart_objects::SmartObject rc_capability_so =
+ *(hmi_capabilities_test->rc_capability());
+
+ EXPECT_TRUE(rc_capability_so.keyExists("climateControlCapabilities"));
+ EXPECT_TRUE(rc_capability_so.keyExists("radioControlCapabilities"));
+ EXPECT_TRUE(rc_capability_so.keyExists("buttonCapabilities"));
+
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["fanSpeedAvailable"]
+ .asBool());
+ EXPECT_TRUE(rc_capability_so["climateControlCapabilities"][0]
+ ["desiredTemperatureAvailable"].asBool());
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["acEnableAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["climateControlCapabilities"][0]["acMaxEnableAvailable"]
+ .asBool());
+
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["radioBandAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["radioFrequencyAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["hdChannelAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["radioControlCapabilities"][0]["rdsDataAvailable"]
+ .asBool());
+
+ EXPECT_TRUE(rc_capability_so["buttonCapabilities"][0]["shortPressAvailable"]
+ .asBool());
+ EXPECT_TRUE(
+ rc_capability_so["buttonCapabilities"][0]["longPressAvailable"].asBool());
+ EXPECT_FALSE(
+ rc_capability_so["buttonCapabilities"][0]["upDownAvailable"].asBool());
}
TEST_F(HMICapabilitiesTest, VerifyImageType) {
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 <string>
#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<uint32_t>&());
+
+#endif // SDL_REMOTE_CONTROL
};
} // namespace application_manager_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 2f18b1ceb9..dd7ec5f0d5 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
@@ -61,6 +61,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_CONST_METHOD0(is_ivi_cooperating, bool());
MOCK_METHOD1(set_is_ivi_cooperating, void(const bool value));
+ MOCK_CONST_METHOD0(is_rc_cooperating, bool());
+ MOCK_METHOD1(set_is_rc_cooperating, void(const bool value));
+
MOCK_CONST_METHOD0(attenuated_supported, bool());
MOCK_METHOD1(set_attenuated_supported, void(const bool state));
@@ -171,6 +174,9 @@ class MockHMICapabilities : public ::application_manager::HMICapabilities {
MOCK_METHOD1(
set_video_streaming_capability,
void(const smart_objects::SmartObject& video_streaming_capability));
+ MOCK_CONST_METHOD0(rc_capability, const smart_objects::SmartObject*());
+ MOCK_METHOD1(set_rc_capability,
+ void(const smart_objects::SmartObject& rc_capability));
MOCK_METHOD1(Init, void(resumption::LastState* last_state));
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..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
@@ -113,7 +113,14 @@ 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_METHOD4(SendPolicyUpdate,
void(const std::string& file_path,
const uint32_t timeout,
diff --git a/src/components/application_manager/test/message_helper/CMakeLists.txt b/src/components/application_manager/test/message_helper/CMakeLists.txt
index d115ad8b40..e4a77aa00a 100755
--- a/src/components/application_manager/test/message_helper/CMakeLists.txt
+++ b/src/components/application_manager/test/message_helper/CMakeLists.txt
@@ -47,6 +47,13 @@ set(LIBRARIES
Utils
)
+if(REMOTE_CONTROL)
+ SET (LIBRARIES
+ ${LIBRARIES}
+ FunctionalModule
+ )
+endif(REMOTE_CONTROL)
+
set(SOURCES
${COMPONENTS_DIR}/application_manager/test/message_helper/message_helper_test.cc
)
diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc
index 3039e1f677..5f221a105b 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,25 @@ 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);
+}
+
+#endif // SDL_REMOTE_CONTROL
+
void MessageHelper::SendUpdateSDLResponse(const std::string& result,
uint32_t correlation_id,
ApplicationManager& app_mngr) {
@@ -247,7 +268,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO(
}
MockMessageHelper* MockMessageHelper::message_helper_mock() {
- static MockMessageHelper message_helper_mock;
+ static ::testing::NiceMock<MockMessageHelper> 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..7faf3e36cb
--- /dev/null
+++ b/src/components/application_manager/test/rc_policy_handler_test.cc
@@ -0,0 +1,400 @@
+/*
+ * 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 <string>
+#include <vector>
+#include <fstream>
+#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_handler_test::MockPolicySettings> policy_settings_;
+ utils::SharedPtr<application_manager_test::MockApplication> 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<policy_manager_test::MockPolicyManager> 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<ApplicationSet> 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<policy_manager_test::MockPolicyManager>();
+ 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<application_manager_test::MockApplication>();
+ }
+
+ 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<application_manager_test::MockApplication> 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, 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));
+}
+
+ACTION_P(SetDeviceHandle, handle) {
+ *arg1 = handle;
+}
+
+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<application_manager_test::MockApplication> 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_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_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));
+
+ 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, GetModuleTypes_GetModuleTypes_SUCCESS) {
+ EnablePolicyAndPolicyManagerMock();
+ std::vector<std::string> 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::SmartObject>(
+ 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<int> 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/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h
index 8a25bcf648..ea1b3764ac 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
@@ -212,6 +212,11 @@ class Profile : public protocol_handler::ProtocolHandlerSettings,
const std::vector<std::string>& vr_commands() const;
/**
+ * @brief Returns folder containing all plugins
+ */
+ const std::string& plugins_folder() const OVERRIDE;
+
+ /**
* @brief Maximum command id available for mobile app
*/
const uint32_t& max_cmd_id() const;
@@ -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<uint32_t>& 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/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index daca42d3c2..6dd4fe06d7 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -174,12 +174,12 @@ void ConnectionHandlerImpl::OnDeviceRemoved(
RemoveConnection(*it);
}
- device_list_.erase(device_info.device_handle());
sync_primitives::AutoReadLock read_lock(connection_handler_observer_lock_);
if (connection_handler_observer_) {
connection_handler_observer_->RemoveDevice(device_info.device_handle());
connection_handler_observer_->OnDeviceListUpdated(device_list_);
}
+ device_list_.erase(device_info.device_handle());
}
void ConnectionHandlerImpl::OnScanDevicesFinished() {
@@ -296,6 +296,7 @@ uint32_t ConnectionHandlerImpl::OnSessionStartedCallback(
if (hash_id) {
*hash_id = protocol_handler::HASH_ID_WRONG;
}
+
#ifdef ENABLE_SECURITY
if (!AllowProtection(get_settings(), service_type, is_protected)) {
return 0;
@@ -844,6 +845,7 @@ security_manager::SSLContext::HandshakeContext
ConnectionHandlerImpl::GetHandshakeContext(uint32_t key) const {
return connection_handler_observer_->GetHandshakeContext(key);
}
+
#endif // ENABLE_SECURITY
void ConnectionHandlerImpl::StartDevicesDiscovery() {
diff --git a/src/components/formatters/test/meta_formatter_test.cc b/src/components/formatters/test/meta_formatter_test.cc
index 293f881c4a..87f05ab50e 100644
--- a/src/components/formatters/test/meta_formatter_test.cc
+++ b/src/components/formatters/test/meta_formatter_test.cc
@@ -68,20 +68,6 @@ TEST_F(CMetaFormatterTestHelper,
CMetaFormatter::CreateObjectByPattern(object2, schema, result_object2);
EXPECT_TRUE(creationresult);
- // Uncomment code to print objects in console
- // std::string formatted_string;
- // CFormatterJsonSDLRPCv1::toString(object1, formatted_string);
- // printf("object1 %s\n", formatted_string.c_str());
- //
- // CFormatterJsonSDLRPCv1::toString(result_object1, formatted_string);
- // printf("result_object1 %s\n", formatted_string.c_str());
- //
- // CFormatterJsonSDLRPCv1::toString(object2, formatted_string);
- // printf("object2 %s\n", formatted_string.c_str());
- //
- // CFormatterJsonSDLRPCv1::toString(result_object2, formatted_string);
- // printf("result_object2 %s\n", formatted_string.c_str());
-
CompareObjects(object1, result_object1);
CompareObjects(object2, result_object2);
@@ -112,13 +98,6 @@ TEST_F(CMetaFormatterTestHelper, NormalSchemaWithEmptyObject) {
FillObjectWithDefaultValues(expected_object);
CompareObjects(expected_object, result_object);
-
- // Uncomment code to print objects in console
- // std::string str;
- // AnyObjectToJsonString(result_object, str);
- // printf("result_object(default) %s", str.c_str());
- // AnyObjectToJsonString(expected_object, str);
- // printf("expected_object %s", str.c_str());
}
TEST_F(CMetaFormatterTestHelper,
@@ -140,11 +119,6 @@ TEST_F(CMetaFormatterTestHelper,
0, result_object[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"].asInt());
EXPECT_EQ(
0, result_object[S_MSG_PARAMS]["syncMsgVersion"]["patchVersion"].asInt());
-
- // Uncomment code to print object in console
- // std::string str;
- // AnyObjectToJsonString(result_object, str);
- // printf("result_object %s", str.c_str());
}
TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyMap) {
@@ -191,11 +165,6 @@ TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyMap) {
EXPECT_EQ(SmartType_Map, result_object_empty_map.getType())
<< "smartObject is not map type";
EXPECT_EQ(0u, result_object_empty_map.length()) << "non empty map";
-
- // Uncomment code to print object in console
- // std::string str;
- // AnyObjectToJsonString(result_object_empty_map, str);
- // printf("result_object(empty map) %s", str.c_str());
}
TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyArray) {
@@ -233,11 +202,6 @@ TEST_F(CMetaFormatterTestHelper, ObjectWithEmptyArray) {
EXPECT_EQ(SmartType_Array, result_object_empty_array.getType())
<< "smartObject is not array type";
EXPECT_EQ(0u, result_object_empty_array.length()) << "non empty array";
-
- // Uncomment code to print object in console
- // std::string str;
- // AnyObjectToJsonString(result_object_empty_array, str);
- // printf("result_object(empty array) %s", str.c_str());
}
TEST_F(CMetaFormatterTestHelper,
@@ -325,13 +289,6 @@ TEST_F(CMetaFormatterTestHelper,
CMetaFormatter::CreateObjectByPattern(object, schema, result_object);
- // Uncomment code to print object in console
- // std::string str;
- // AnyObjectToJsonString(object, str);
- // printf("object %s", str.c_str());
- // AnyObjectToJsonString(result_object, str);
- // printf("result_object %s", str.c_str());
-
// Assert
EXPECT_EQ(500, result_object[S_PARAMS][S_FUNCTION_ID].asInt());
EXPECT_EQ(-1, result_object[S_PARAMS][S_MESSAGE_TYPE].asInt());
diff --git a/src/components/formatters/test/src/create_smartSchema.cc b/src/components/formatters/test/src/create_smartSchema.cc
index 4ae692429c..1497fbf281 100644
--- a/src/components/formatters/test/src/create_smartSchema.cc
+++ b/src/components/formatters/test/src/create_smartSchema.cc
@@ -339,7 +339,6 @@ CSmartSchema initSchemaForMetaFormatter() {
ISchemaItemPtr majorVersion_SchemaItem = TNumberSchemaItem<int>::create();
ISchemaItemPtr minorVersion_SchemaItem = TNumberSchemaItem<int>::create();
ISchemaItemPtr patchVersion_SchemaItem = TNumberSchemaItem<int>::create();
-
ISchemaItemPtr syncMsg_SchemaItem =
CStringSchemaItem::create(TSchemaItemParameter<size_t>(0),
TSchemaItemParameter<size_t>(1000),
diff --git a/src/components/formatters/test/src/meta_formatter_test_helper.cc b/src/components/formatters/test/src/meta_formatter_test_helper.cc
index a29c1bceb3..897c8d364d 100644
--- a/src/components/formatters/test/src/meta_formatter_test_helper.cc
+++ b/src/components/formatters/test/src/meta_formatter_test_helper.cc
@@ -109,17 +109,6 @@ void CMetaFormatterTestHelper::
obj[S_MSG_PARAMS]["languageDesired"] = Language::EN_EU;
obj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = Language::RU_RU;
obj[S_MSG_PARAMS]["appID"] = "APP ID";
-
- // Commented not mandatory params for check creation object without them
- // obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
- // obj[S_MSG_PARAMS]["ttsName"][0]["type"] =
- // SpeechCapabilities::SC_TEXT;
-
- // obj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
- // obj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
-
- // obj[S_MSG_PARAMS]["appType"][0] = AppTypeTest::SYSTEM; // not mandatory
- // obj[S_MSG_PARAMS]["appType"][1] = AppTypeTest::MEDIA;
}
void CMetaFormatterTestHelper::FillObjectWithoutSomeMandatoryFields(
@@ -130,11 +119,6 @@ void CMetaFormatterTestHelper::FillObjectWithoutSomeMandatoryFields(
obj[S_PARAMS][S_PROTOCOL_VERSION] = 1;
obj[S_PARAMS][S_PROTOCOL_TYPE] = 0;
- // Commented mandatory params for check creation object without them
- // obj[S_PARAMS][S_CORRELATION_ID] = 12;
- // obj[S_MSG_PARAMS]["syncMsgVersion"]["majorVersion"] = 2;
- // obj[S_MSG_PARAMS]["syncMsgVersion"]["minorVersion"] = 10;
-
obj[S_MSG_PARAMS]["appName"] = "APP NAME";
obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
obj[S_MSG_PARAMS]["ttsName"][0]["type"] = SpeechCapabilities::SC_TEXT;
@@ -200,17 +184,6 @@ void CMetaFormatterTestHelper::FillObjectWithDefaultValues(SmartObject& obj) {
obj[S_MSG_PARAMS]["languageDesired"] = -1;
obj[S_MSG_PARAMS]["hmiDisplayLanguageDesired"] = -1;
obj[S_MSG_PARAMS]["appID"] = "";
-
- // Commented params for check creation object with only default values
- // obj[S_MSG_PARAMS]["ttsName"][0]["text"] = "ABC";
- // obj[S_MSG_PARAMS]["ttsName"][0]["type"] =
- // SpeechCapabilities::SC_TEXT;
-
- // obj[S_MSG_PARAMS]["vrSynonyms"][0] = "Synonym1";
- // obj[S_MSG_PARAMS]["vrSynonyms"][1] = "Synonym2";
-
- // obj[S_MSG_PARAMS]["appType"][0] = AppTypeTest::SYSTEM;
- // obj[S_MSG_PARAMS]["appType"][1] = AppTypeTest::MEDIA;
}
} // namespace formatters
diff --git a/src/components/functional_module/CMakeLists.txt b/src/components/functional_module/CMakeLists.txt
new file mode 100644
index 0000000000..07db91fc38
--- /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/timer/timer_director.cc
+)
+set (LIBRARIES
+ ApplicationManager
+ jsoncpp
+)
+
+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..1a504df6c9
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/function_ids.h
@@ -0,0 +1,63 @@
+/*
+ * 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_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_FUNCTION_IDS_H_
+#include "interfaces/MOBILE_API.h"
+#include "interfaces/HMI_API.h"
+
+namespace functional_modules {
+
+enum RCFunctionID {
+ // Remote SDL functions ids
+ BUTTON_PRESS = mobile_apis::FunctionID::ButtonPressID,
+ GET_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::GetInteriorVehicleDataID,
+ SET_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::SetInteriorVehicleDataID,
+ ON_INTERIOR_VEHICLE_DATA = mobile_apis::FunctionID::OnInteriorVehicleDataID,
+ ON_REMOTE_CONTROL_SETTINGS = hmi_apis::FunctionID::RC_OnRemoteControlSettings,
+};
+
+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..0c686d3501
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/generic_module.h
@@ -0,0 +1,179 @@
+/*
+ * 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_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_GENERIC_MODULE_H_
+
+#include <deque>
+#include <string>
+#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 {
+
+/**
+ * @brief The PolicyEvent enum defines events related to policy
+ */
+enum PolicyEvent { kApplicationPolicyUpdated = 0, kApplicationsDisabled };
+
+/**
+ * @brief The ApplicationEvent enum defines events related to single application
+ */
+enum ApplicationEvent { kApplicationExit = 0, kApplicationUnregistered };
+
+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<GenericModule> ModulePtr;
+
+struct PluginInfo {
+ std::string name;
+ int version;
+ std::deque<RCFunctionID> rc_function_list;
+ std::deque<HMIFunctionID> hmi_function_list;
+};
+
+class GenericModule {
+ public:
+ typedef std::deque<ModuleObserver*> Observers;
+
+ virtual ~GenericModule();
+ ModuleID GetModuleID() const {
+ return kModuleId_;
+ }
+ virtual PluginInfo GetPluginInfo() const = 0;
+
+ /**
+ * @brief Setter for service (interface for plugin t access SDL functionality)
+ * @param service pointer to new service instance
+ */
+ 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 OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application_id Application id
+ */
+ virtual void OnApplicationEvent(ApplicationEvent event,
+ const uint32_t application_id) = 0;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(PolicyEvent event) = 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..a5e34db040
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/module_observer.h
@@ -0,0 +1,54 @@
+/*
+ * 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_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() {}
+
+ /**
+ * @brief OnError callback for module to notify SDL about internal error
+ * @param error error type
+ * @param module_id module that triggered error
+ */
+ 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..1fb5ac9838
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/plugin_manager.h
@@ -0,0 +1,158 @@
+/*
+ * 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_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_PLUGIN_MANAGER_H_
+
+#include <map>
+#include <string>
+#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<ModuleID, ModulePtr> Modules;
+
+ /**
+ * @brief LoadPlugins initialize loading plugins
+ * @param plugin_path path to search to plugin shared libraries
+ * @return count of loaded plugins
+ */
+ int LoadPlugins(const std::string& plugin_path);
+
+ /**
+ * @brief UnloadPlugins unload from memory all plugins
+ */
+ void UnloadPlugins();
+
+ /**
+ * @brief IsMessageForPlugin Verifies whether mobile message will be processed
+ * by plugins
+ * @param msg Mobile message
+ * @return True if any of plugins will process the message, otherwise - false
+ */
+ bool IsMessageForPlugin(application_manager::MessagePtr msg);
+
+ /**
+ * @brief IsHMIMessageForPlugin Verifies whether HMI message will be processed
+ * by plugins
+ * @param msg HMI message
+ * @return True if any of plugins will process the message, otherwise - false
+ */
+ bool IsHMIMessageForPlugin(application_manager::MessagePtr msg);
+
+ /**
+ * @brief ProcessMessage forwards mobile message to modules if any is
+ * subsribed for the message.
+ * @param msg Mobile message to process
+ * @return Result of processing
+ */
+ ProcessResult ProcessMessage(application_manager::MessagePtr msg);
+
+ /**
+ * @brief ProcessHMIMessage forwards HMI message to modules if any is
+ * subscribed for the message
+ * @param msg HMI message to process
+ * @return Result of processing
+ */
+ ProcessResult ProcessHMIMessage(application_manager::MessagePtr msg);
+ void SetServiceHandler(application_manager::ServicePtr service) {
+ service_ = service;
+ }
+ void OnServiceStateChanged(ServiceState state);
+ void OnError(ModuleObserver::Errors error, ModuleID module_id) FINAL;
+
+ /**
+ * @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 OnApplicationEvent Notifies modules on certain application events
+ * @param event Event
+ * @param application_id Application id of particular application
+ */
+ void OnApplicationEvent(functional_modules::ApplicationEvent event,
+ const uint32_t application_id);
+
+ /**
+ * @brief OnPolicyEvent Notifies modules on certain events from policy
+ * @param event Policy event
+ */
+ void OnPolicyEvent(functional_modules::PolicyEvent event);
+
+ Modules& plugins();
+
+ private:
+ Modules plugins_;
+ std::map<ModuleID, void*> dlls_;
+ std::map<RCFunctionID, ModulePtr> mobile_subscribers_;
+ std::map<HMIFunctionID, ModulePtr> 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/timer/module_timer.h b/src/components/functional_module/include/functional_module/timer/module_timer.h
new file mode 100644
index 0000000000..e24259241b
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/timer/module_timer.h
@@ -0,0 +1,246 @@
+/*
+ * 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_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_MODULE_TIMER_H_
+
+#include <list>
+#include <deque>
+#include <algorithm>
+#include <time.h>
+#include "utils/lock.h"
+
+namespace functional_modules {
+
+typedef unsigned int TimeUnit; // seconds
+
+class Trackable {
+ public:
+ Trackable() : start_time_(0) {}
+ virtual ~Trackable() {}
+
+ /**
+ * @brief custom_interval getter for custom interval
+ * @return return timer interval for trackable message
+ */
+ virtual TimeUnit custom_interval() const {
+ return 0;
+ }
+
+ /**
+ * @brief start_time getter for start time of message
+ * @return start time of message
+ */
+ virtual TimeUnit start_time() const {
+ return start_time_;
+ }
+
+ /**
+ * @brief set_start_time setting start time of message
+ * @param start_time start time
+ */
+ virtual void set_start_time(TimeUnit start_time) {
+ start_time_ = start_time;
+ }
+
+ private:
+ TimeUnit start_time_;
+};
+
+template <class Trackable>
+class TimerObserver {
+ public:
+ virtual ~TimerObserver() {}
+ virtual void OnTimeoutTriggered(const Trackable& expired) = 0;
+};
+
+template <class Trackable>
+class ModuleTimer {
+ public:
+ ModuleTimer();
+ ~ModuleTimer();
+ void set_period(TimeUnit period) {
+ period_ = period;
+ }
+ TimeUnit period() const {
+ return period_;
+ }
+ void AddObserver(TimerObserver<Trackable>* observer);
+ void RemoveObserver(TimerObserver<Trackable>* 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<Trackable> trackables_;
+ volatile TimeUnit period_;
+
+ private:
+ std::deque<TimerObserver<Trackable>*> observers_;
+ mutable sync_primitives::Lock trackables_lock_;
+ friend class ModuleTimerTest;
+};
+
+template <class Trackable>
+ModuleTimer<Trackable>::ModuleTimer()
+ : period_(10) {}
+
+template <class Trackable>
+ModuleTimer<Trackable>::~ModuleTimer() {
+ observers_.clear();
+ sync_primitives::AutoLock auto_lock(trackables_lock_);
+ trackables_.clear();
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::AddObserver(TimerObserver<Trackable>* observer) {
+ DCHECK(observer);
+ if (!observer) {
+ return;
+ }
+ observers_.push_back(observer);
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::RemoveObserver(
+ TimerObserver<Trackable>* observer) {
+ DCHECK(observer);
+ if (!observer) {
+ return;
+ }
+ for (typename std::deque<TimerObserver<Trackable>*>::iterator it =
+ observers_.begin();
+ observers_.end() != it;
+ ++it) {
+ if (*it == observer) {
+ observers_.erase(it);
+ return;
+ }
+ }
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::CheckTimeout() {
+ sync_primitives::AutoLock trackables_lock(trackables_lock_);
+ for (typename std::list<Trackable>::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 <class Trackable>
+TimeUnit ModuleTimer<Trackable>::GetSecondsToNearestTimeout() {
+ sync_primitives::AutoLock trackables_lock(trackables_lock_);
+ TimeUnit result = period_;
+ for (typename std::list<Trackable>::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 <class Trackable>
+void ModuleTimer<Trackable>::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 <class Trackable>
+void ModuleTimer<Trackable>::RemoveTrackable(const Trackable& object) {
+ sync_primitives::AutoLock trackables_lock(trackables_lock_);
+ trackables_.remove(object);
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::Notify(const Trackable& object) {
+ for (typename std::deque<TimerObserver<Trackable>*>::const_iterator it =
+ observers_.begin();
+ observers_.end() != it;
+ ++it) {
+ (*it)->OnTimeoutTriggered(object);
+ }
+}
+
+template <class Trackable>
+void ModuleTimer<Trackable>::OnTimeout(const Trackable& object) {
+ Notify(object);
+}
+
+template <class Trackable>
+TimeUnit ModuleTimer<Trackable>::CurrentTime() const {
+ // TODO(PV): move outside to platform-dependant parts
+ struct timespec current_time;
+ if (0 == clock_gettime(CLOCK_MONOTONIC, &current_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..fb67b9b5de
--- /dev/null
+++ b/src/components/functional_module/include/functional_module/timer/timer_director.h
@@ -0,0 +1,92 @@
+/*
+ * 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_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_
+#define SRC_COMPONENTS_FUNCTIONAL_MODULE_INCLUDE_FUNCTIONAL_MODULE_TIMER_TIMER_DIRECTOR_H_
+
+#include <map>
+#include "utils/threads/thread.h"
+#include "utils/conditional_variable.h"
+#include "functional_module/timer/module_timer.h"
+
+namespace functional_modules {
+
+template <class T>
+class TimerThreadDelegate : public threads::ThreadDelegate {
+ public:
+ explicit TimerThreadDelegate(ModuleTimer<T>& timer);
+ void threadMain();
+ void exitThreadMain();
+
+ /**
+ * @brief Reset awaiting timer by notifying cond var
+ */
+ void ResetTimer();
+
+ private:
+ ModuleTimer<T>& 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 <class T>
+ void RegisterTimer(ModuleTimer<T>& timer);
+ template <class T>
+ void UnregisterTimer(const ModuleTimer<T>& timer);
+ void UnregisterAllTimers();
+ /**
+ * @brief Reset awaiting timeout for specified module timer
+ * @param timer timer to reset awaiting timeout
+ */
+ template <class T>
+ void ResetTimer(ModuleTimer<T>& timer);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TimerDirector);
+ std::map<std::string, threads::Thread*> 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..142b1ef58c
--- /dev/null
+++ b/src/components/functional_module/src/generic_module.cc
@@ -0,0 +1,54 @@
+#include "functional_module/generic_module.h"
+namespace functional_modules {
+
+typedef std::deque<ModuleObserver*>::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;
+}
+
+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..b38048f843
--- /dev/null
+++ b/src/components/functional_module/src/plugin_manager.cc
@@ -0,0 +1,393 @@
+/*
+ * 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 <dlfcn.h>
+#include <algorithm>
+#include "functional_module/plugin_manager.h"
+#include "functional_module/function_ids.h"
+#include "protocol/common.h"
+#include "utils/file_system.h"
+#include "utils/logger.h"
+#include "json/json.h"
+
+namespace functional_modules {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "PluginManager")
+
+namespace {
+const std::string ExtractMethodName(application_manager::MessagePtr msg) {
+ DCHECK_OR_RETURN(msg, "");
+ Json::Value value;
+ Json::Reader reader;
+ reader.parse(msg->json_message(), 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();
+ }
+ 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();
+ }
+
+ return std::string();
+}
+} // namespace
+
+typedef std::map<ModuleID, ModulePtr>::iterator PluginsIterator;
+typedef std::map<RCFunctionID, ModulePtr>::iterator PluginFunctionsIterator;
+typedef std::map<HMIFunctionID, ModulePtr>::iterator PluginHMIFunctionsIterator;
+
+PluginManager::PluginManager() : service_() {
+ LOG4CXX_DEBUG(logger_, "Creating plugin mgr");
+}
+
+PluginManager::~PluginManager() {
+ 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<std::string> 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<Create>(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<ModuleID, void*>(module->GetModuleID(),
+ generic_plugin_dll));
+ plugins_.insert(
+ std::pair<ModuleID, ModulePtr>(module->GetModuleID(), module));
+ std::deque<RCFunctionID> subscribers =
+ module->GetPluginInfo().rc_function_list;
+ for (size_t i = 0; i < subscribers.size(); ++i) {
+ mobile_subscribers_.insert(
+ std::pair<RCFunctionID, ModulePtr>(subscribers[i], module));
+ }
+
+ std::deque<HMIFunctionID> hmi_subscribers =
+ module->GetPluginInfo().hmi_function_list;
+ for (size_t i = 0; i < hmi_subscribers.size(); ++i) {
+ hmi_subscribers_.insert(
+ std::pair<HMIFunctionID, ModulePtr>(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<ModuleID, void*>::iterator it = dlls_.begin();
+ dlls_.end() != it;
+ ++it) {
+ dlclose(it->second);
+ }
+ dlls_.clear();
+}
+
+bool PluginManager::IsMessageForPlugin(application_manager::MessagePtr msg) {
+ DCHECK(msg);
+ if (!msg) {
+ LOG4CXX_ERROR(logger_, "Null pointer message was received.");
+ return false;
+ }
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN !=
+ msg->protocol_version() &&
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI !=
+ msg->protocol_version()) {
+ RCFunctionID id = static_cast<RCFunctionID>(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 (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI ==
+ 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;
+}
+
+ProcessResult PluginManager::ProcessMessage(
+ application_manager::MessagePtr msg) {
+ DCHECK(msg);
+ if (!msg) {
+ LOG4CXX_ERROR(logger_, "Null pointer message was received.");
+ return ProcessResult::CANNOT_PROCESS;
+ }
+
+ protocol_handler::MajorProtocolVersion version = msg->protocol_version();
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN ==
+ version ||
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI == version) {
+ return ProcessResult::CANNOT_PROCESS;
+ }
+
+ ProcessResult result = ProcessResult::CANNOT_PROCESS;
+ PluginFunctionsIterator subscribed_plugin_itr =
+ mobile_subscribers_.find(static_cast<RCFunctionID>(msg->function_id()));
+ if (mobile_subscribers_.end() != subscribed_plugin_itr) {
+ result = subscribed_plugin_itr->second->ProcessMessage(msg);
+ if (ProcessResult::PROCESSED != result) {
+ LOG4CXX_ERROR(logger_, "Plugin failed to process message.");
+ }
+ }
+
+ return result;
+}
+
+ProcessResult PluginManager::ProcessHMIMessage(
+ application_manager::MessagePtr msg) {
+ DCHECK_OR_RETURN(msg, ProcessResult::CANNOT_PROCESS);
+
+ if (protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI !=
+ msg->protocol_version()) {
+ return ProcessResult::CANNOT_PROCESS;
+ }
+
+ const std::string& msg_method = ExtractMethodName(msg);
+ if (msg_method.empty()) {
+ 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 ProcessResult::CANNOT_PROCESS;
+ }
+
+ LOG4CXX_DEBUG(logger_, "Parsed method name is " << msg_method);
+
+ ProcessResult result = ProcessResult::CANNOT_PROCESS;
+ PluginHMIFunctionsIterator subscribed_plugin_itr =
+ hmi_subscribers_.find(msg_method);
+ if (hmi_subscribers_.end() != subscribed_plugin_itr) {
+ result = subscribed_plugin_itr->second->ProcessHMIMessage(msg);
+ }
+
+ return result;
+}
+
+void PluginManager::OnServiceStateChanged(ServiceState state) {
+ for (PluginsIterator it = plugins_.begin(); plugins_.end() != it; ++it) {
+ it->second->OnServiceStateChanged(state);
+ }
+}
+
+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: {
+ LOG4CXX_ERROR(logger_,
+ "Error " << error_string << " was received from module "
+ << module_id);
+ } break;
+ }
+}
+
+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 {
+ DCHECK_OR_RETURN(app, false);
+ 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_OR_RETURN_VOID(app);
+ 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);
+ }
+ }
+}
+
+typedef std::map<ModuleID, ModulePtr>::value_type PluginsValueType;
+
+struct HandleApplicationEvent {
+ private:
+ const functional_modules::ApplicationEvent event_;
+ const uint32_t app_id_;
+
+ public:
+ HandleApplicationEvent(functional_modules::ApplicationEvent e,
+ const uint32_t app_id)
+ : event_(e), app_id_(app_id) {}
+ void operator()(PluginsValueType& p) {
+ p.second->OnApplicationEvent(event_, app_id_);
+ }
+};
+
+struct HandlePolicyEvent {
+ private:
+ const functional_modules::PolicyEvent event_;
+
+ public:
+ HandlePolicyEvent(functional_modules::PolicyEvent e) : event_(e) {}
+ void operator()(PluginsValueType& p) {
+ p.second->OnPolicyEvent(event_);
+ }
+};
+
+void PluginManager::OnApplicationEvent(
+ functional_modules::ApplicationEvent event, const uint32_t application_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::for_each(plugins_.begin(),
+ plugins_.end(),
+ HandleApplicationEvent(event, application_id));
+}
+
+void PluginManager::OnPolicyEvent(PolicyEvent event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ std::for_each(plugins_.begin(), plugins_.end(), HandlePolicyEvent(event));
+}
+
+PluginManager::Modules& PluginManager::plugins() {
+ return plugins_;
+}
+
+} // 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..81ce117851
--- /dev/null
+++ b/src/components/functional_module/src/timer/timer_director.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 <typeinfo>
+#include "functional_module/timer/timer_director.h"
+#include "remote_control/rc_module_timer.h"
+#include "utils/logger.h"
+
+namespace functional_modules {
+
+template <class T>
+TimerThreadDelegate<T>::TimerThreadDelegate(ModuleTimer<T>& timer)
+ : timer_(timer), keep_running_(false) {}
+
+template <class T>
+void TimerThreadDelegate<T>::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 <class T>
+void TimerThreadDelegate<T>::exitThreadMain() {
+ if (keep_running_) {
+ sync_primitives::AutoLock run_lock(keep_running_lock_);
+ keep_running_ = false;
+ keep_running_cond_.NotifyOne();
+ }
+}
+
+template <class T>
+void TimerThreadDelegate<T>::ResetTimer() {
+ if (keep_running_) {
+ sync_primitives::AutoLock run_lock(keep_running_lock_);
+ keep_running_cond_.NotifyOne();
+ }
+}
+
+TimerDirector::TimerDirector() {}
+
+TimerDirector::~TimerDirector() {
+ UnregisterAllTimers();
+}
+
+template <class T>
+void TimerDirector::RegisterTimer(ModuleTimer<T>& timer) {
+ std::string type_name = typeid(timer).name();
+ std::map<std::string, threads::Thread*>::iterator it =
+ timer_threads_.find(type_name);
+ if (timer_threads_.end() != it) {
+ // Attempt to register timer of already existing type fail.
+ return;
+ }
+ TimerThreadDelegate<T>* delegate = new TimerThreadDelegate<T>(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<remote_control::TrackableMessage>(
+ ModuleTimer<remote_control::TrackableMessage>& timer);
+
+template <class T>
+void TimerDirector::UnregisterTimer(const ModuleTimer<T>& timer) {
+ std::string type_name = typeid(timer).name();
+ std::map<std::string, threads::Thread*>::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<remote_control::TrackableMessage>(
+ const ModuleTimer<remote_control::TrackableMessage>& timer);
+
+template <class T>
+void TimerDirector::ResetTimer(ModuleTimer<T>& timer) {
+ const std::string type_name = typeid(timer).name();
+ std::map<std::string, threads::Thread*>::iterator it =
+ timer_threads_.find(type_name);
+ if (timer_threads_.end() == it) {
+ return;
+ }
+ TimerThreadDelegate<T>* delegate =
+ static_cast<TimerThreadDelegate<T>*>(it->second->delegate());
+ delegate->ResetTimer();
+}
+
+template void TimerDirector::ResetTimer<remote_control::TrackableMessage>(
+ ModuleTimer<remote_control::TrackableMessage>& timer);
+
+void TimerDirector::UnregisterAllTimers() {
+ for (std::map<std::string, threads::Thread*>::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..c4e966c84e
--- /dev/null
+++ b/src/components/functional_module/test/CMakeLists.txt
@@ -0,0 +1,53 @@
+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
+)
+
+# 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}")
+
+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..0d5aae1f37
--- /dev/null
+++ b/src/components/functional_module/test/include/driver_generic_module_test.h
@@ -0,0 +1,80 @@
+/*
+ * 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 OnApplicationEvent(functional_modules::ApplicationEvent event,
+ const uint32_t application_id) {}
+
+ void OnPolicyEvent(functional_modules::PolicyEvent event) {}
+
+ 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<mobile_apis::ButtonName::eType>&());
+ MOCK_CONST_METHOD0(SubscribesIVI, const std::set<uint32_t>&());
+ 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<PerformChoiceSetMap>());
+ MOCK_CONST_METHOD1(FindPerformInteractionChoiceSet,
+ smart_objects::SmartObject*(uint32_t choice_set_id));
+ MOCK_CONST_METHOD0(commands_map, DataAccessor<CommandsMap>());
+ MOCK_CONST_METHOD0(sub_menu_map, DataAccessor<SubMenuMap>());
+ MOCK_CONST_METHOD0(choice_set_map, DataAccessor<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_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..d1fa7f2747
--- /dev/null
+++ b/src/components/functional_module/test/include/mock_service.h
@@ -0,0 +1,76 @@
+/*
+ * 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<ApplicationSharedPtr>(AppExtensionUID));
+ MOCK_METHOD2(ChangeNotifyHMILevel,
+ void(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level));
+ MOCK_METHOD2(NotifyHMIAboutHMILevel,
+ void(ApplicationSharedPtr app,
+ mobile_apis::HMILevel::eType level));
+ MOCK_CONST_METHOD0(GetRCCapabilities, const smart_objects::SmartObject*());
+ MOCK_METHOD2(CheckModule,
+ bool(const ApplicationId& app_id, const std::string& module));
+ MOCK_METHOD1(RemoveHMIFakeParameters,
+ void(application_manager::MessagePtr& message));
+ 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<std::string>* modules));
+ MOCK_METHOD1(ValidateMessageBySchema,
+ application_manager::MessageValidationResult(
+ const application_manager::Message& message));
+ MOCK_CONST_METHOD0(GetSettings, const ApplicationManagerSettings&());
+};
+}
+// 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<TestTrackable>& 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<TestTrackable>& timer_;
+};
+
+class MockTimerObserver : public TimerObserver<TestTrackable> {
+ 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<RCFunctionID>(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..0139866d67
--- /dev/null
+++ b/src/components/functional_module/test/plugins/mock_generic_module.h
@@ -0,0 +1,71 @@
+/*
+ * 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(OnUnregisterApplication, void(const uint32_t app_id));
+ MOCK_METHOD2(OnApplicationEvent,
+ void(functional_modules::ApplicationEvent event,
+ const uint32_t application_id));
+ MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
+ 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..71d8325f6d
--- /dev/null
+++ b/src/components/functional_module/test/src/generic_module_test.cc
@@ -0,0 +1,106 @@
+#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, 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<TestTrackable> timer;
+ timer.set_period(10000);
+ ModuleTimerTest test(timer);
+ EXPECT_EQ(10000u, test.period());
+}
+
+TEST(ModuleTimerTest, add_observer) {
+ ModuleTimer<TestTrackable> 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<TestTrackable> 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<TestTrackable> 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<TestTrackable> 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<TestTrackable> 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<TestTrackable> 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..5c251113a8
--- /dev/null
+++ b/src/components/functional_module/test/src/plugin_manager_test.cc
@@ -0,0 +1,146 @@
+#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 protocol_handler::MajorProtocolVersion;
+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<PluginManager>())
+ , service(utils::MakeShared<MockService>()) {}
+
+ protected:
+ utils::SharedPtr<PluginManager> manager;
+ utils::SharedPtr<MockService> 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<MockGenericModule*>(i->second.get());
+ }
+};
+
+TEST_F(PluginManagerTest, ChangePluginsState) {
+ ServiceState kState = ServiceState::SUSPENDED;
+ EXPECT_CALL(*module, OnServiceStateChanged(kState));
+ manager->OnServiceStateChanged(kState);
+}
+
+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(MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN);
+ 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(MajorProtocolVersion::PROTOCOL_VERSION_3);
+ msg->set_function_id(101); // see MockGenericModule
+ EXPECT_CALL(*module, ProcessMessage(message))
+ .Times(1)
+ .WillOnce(Return(ProcessResult::PROCESSED));
+ manager->ProcessMessage(message);
+}
+
+TEST_F(PluginManagerTest, SDL_events_triggers_module) {
+ using namespace functional_modules;
+ std::vector<ApplicationEvent> app_events;
+ app_events.push_back(ApplicationEvent::kApplicationExit);
+ app_events.push_back(ApplicationEvent::kApplicationUnregistered);
+
+ std::vector<ApplicationEvent>::const_iterator ev = app_events.begin();
+ const uint32_t kDummyAppId = 1;
+ for (; app_events.end() != ev; ++ev) {
+ EXPECT_CALL(*module, OnApplicationEvent(*ev, kDummyAppId));
+ manager->OnApplicationEvent(*ev, kDummyAppId);
+ }
+
+ std::vector<PolicyEvent> policy_events;
+ policy_events.push_back(PolicyEvent::kApplicationPolicyUpdated);
+ policy_events.push_back(PolicyEvent::kApplicationsDisabled);
+
+ std::vector<PolicyEvent>::const_iterator ev_policy = policy_events.begin();
+ for (; policy_events.end() != ev_policy; ++ev_policy) {
+ EXPECT_CALL(*module, OnPolicyEvent(*ev_policy));
+ manager->OnPolicyEvent(*ev_policy);
+ }
+}
+
+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(MajorProtocolVersion::PROTOCOL_VERSION_UNKNOWN);
+ 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(MajorProtocolVersion::PROTOCOL_VERSION_HMI);
+ 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<MockApplication>* app = new NiceMock<MockApplication>();
+ 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);
+}
+
+} // namespace functional_modules
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..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
@@ -51,7 +51,7 @@ class HMIMessageAdapterImpl : public HMIMessageAdapter {
/**
* \brief Destructor
*/
- virtual ~HMIMessageAdapterImpl();
+ ~HMIMessageAdapterImpl();
protected:
virtual HMIMessageHandler* handler() const {
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..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
@@ -89,14 +89,14 @@ 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);
+ void OnErrorSending(MessageSharedPointer message) OVERRIDE;
+ void AddHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE;
+ void RemoveHMIMessageAdapter(HMIMessageAdapter* adapter) OVERRIDE;
- virtual const HMIMessageHandlerSettings& get_settings() const OVERRIDE;
+ const HMIMessageHandlerSettings& get_settings() const OVERRIDE;
#ifdef BUILD_TESTS
std::set<HMIMessageAdapter*> message_adapters() const {
@@ -120,15 +120,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<HMIMessageAdapter*> 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/src/hmi_message_handler_impl.cc b/src/components/hmi_message_handler/src/hmi_message_handler_impl.cc
index 1c774b9efe..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
@@ -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,6 +125,7 @@ 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<HMIMessageAdapter*>::iterator it = message_adapters_.begin();
it != message_adapters_.end();
++it) {
diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc
index 39cae7ea76..abefbe3e24 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
@@ -135,6 +135,8 @@ void MessageBrokerAdapter::SubscribeTo() {
MessageBrokerController::subscribeTo("SDL.OnDeviceStateChanged");
MessageBrokerController::subscribeTo("SDL.OnPolicyUpdate");
MessageBrokerController::subscribeTo("BasicCommunication.OnEventChanged");
+ MessageBrokerController::subscribeTo("RC.OnInteriorVehicleData");
+ MessageBrokerController::subscribeTo("RC.OnRemoteControlSettings");
LOG4CXX_INFO(logger_, "Subscribed to notifications.");
}
diff --git a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
index b0f63c6a0c..eead7106c6 100644
--- a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc
@@ -42,7 +42,7 @@ namespace test {
namespace components {
namespace hmi_message_handler_test {
-using ::testing::ReturnRef;
+using ::testing::Return;
using hmi_message_handler::HMIMessageHandlerImpl;
typedef utils::SharedPtr<MockHMIMessageAdapterImpl>
@@ -53,7 +53,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) {
mock_hmi_message_handler_settings;
const uint64_t stack_size = 1000u;
ON_CALL(mock_hmi_message_handler_settings, thread_min_stack_size())
- .WillByDefault(ReturnRef(stack_size));
+ .WillByDefault(Return(stack_size));
HMIMessageHandler* message_handler =
new hmi_message_handler::HMIMessageHandlerImpl(
mock_hmi_message_handler_settings);
diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
index 09f20ed75d..33be4a9228 100644
--- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
+++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@ namespace test {
namespace components {
namespace hmi_message_handler_test {
-using ::testing::ReturnRef;
+using ::testing::Return;
using ::testing::_;
class HMIMessageHandlerImplTest : public ::testing::Test {
@@ -63,7 +63,7 @@ class HMIMessageHandlerImplTest : public ::testing::Test {
virtual void SetUp() OVERRIDE {
ON_CALL(mock_hmi_message_handler_settings, thread_min_stack_size())
- .WillByDefault(ReturnRef(stack_size));
+ .WillByDefault(Return(stack_size));
hmi_handler_ = new hmi_message_handler::HMIMessageHandlerImpl(
mock_hmi_message_handler_settings);
ASSERT_TRUE(NULL != hmi_handler_);
diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h
index 7875c12ff5..c1a37a24f1 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<ApplicationSharedPtr> AppSharedPtrs;
struct ApplicationsAppIdSorter {
bool operator()(const ApplicationSharedPtr lhs,
const ApplicationSharedPtr rhs) const {
@@ -153,9 +157,32 @@ class ApplicationManager {
virtual ApplicationSharedPtr application_by_policy_id(
const std::string& policy_app_id) const = 0;
- virtual std::vector<ApplicationSharedPtr> applications_by_button(
- uint32_t button) = 0;
- virtual std::vector<ApplicationSharedPtr> applications_with_navi() = 0;
+ virtual AppSharedPtrs applications_by_button(uint32_t button) = 0;
+ virtual AppSharedPtrs applications_with_navi() = 0;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief application find application by device and policy identifier
+ * @param device_id device id
+ * @param policy_app_id poilcy identifier
+ * @return pointer to application in case if application exist, in other case
+ * return empty shared pointer
+ */
+ virtual ApplicationSharedPtr application(
+ const std::string& device_id, const std::string& policy_app_id) const = 0;
+
+ virtual void ChangeAppsHMILevel(uint32_t app_id,
+ mobile_apis::HMILevel::eType level) = 0;
+
+ virtual std::vector<std::string> 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<ApplicationSharedPtr>
applications_with_mobile_projection() = 0;
@@ -264,9 +291,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 +374,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<ApplicationSharedPtr> 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 +643,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/hmi_capabilities.h b/src/components/include/application_manager/hmi_capabilities.h
index 03c0fdedb8..fb40367b00 100644
--- a/src/components/include/application_manager/hmi_capabilities.h
+++ b/src/components/include/application_manager/hmi_capabilities.h
@@ -90,6 +90,9 @@ class HMICapabilities {
virtual bool is_ivi_cooperating() const = 0;
virtual void set_is_ivi_cooperating(const bool value) = 0;
+ virtual bool is_rc_cooperating() const = 0;
+ virtual void set_is_rc_cooperating(const bool value) = 0;
+
/*
* @brief Interface used to store information about software version of the
*target
@@ -473,6 +476,15 @@ class HMICapabilities {
virtual const smart_objects::SmartObject* video_streaming_capability()
const = 0;
+ /**
+ * @brief Sets available RC capabilities for further usage by RC functionality
+ * @param rc_capability capabilities to set
+ */
+ virtual void set_rc_capability(
+ const smart_objects::SmartObject& rc_capability) = 0;
+
+ virtual const smart_objects::SmartObject* rc_capability() const = 0;
+
virtual void Init(resumption::LastState* last_state) = 0;
/**
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..4d2d09b412 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 <queue>
#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,73 @@ 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 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;
+
+ /**
+ * @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;
+
+ /**
+ * 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<std::string>* 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..704cc619be 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,12 @@ namespace hmi_message_handler {
* SDL with HMI has to implement this interface.
*/
class HMIMessageAdapter : public HMIMessageSender {
+ public:
+ /**
+ * \brief Destructor
+ */
+ virtual ~HMIMessageAdapter() {}
+
protected:
/**
* \brief Interface for subscriptions.
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/hmi_message_handler/hmi_message_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h
index aef1e33379..0676615b53 100644
--- a/src/components/include/hmi_message_handler/hmi_message_observer.h
+++ b/src/components/include/hmi_message_handler/hmi_message_observer.h
@@ -43,6 +43,7 @@ namespace hmi_message_handler {
class HMIMessageObserver {
public:
+ virtual ~HMIMessageObserver() {}
virtual void OnMessageReceived(
utils::SharedPtr<application_manager::Message> message) = 0;
virtual void OnErrorSending(
diff --git a/src/components/include/hmi_message_handler/hmi_message_sender.h b/src/components/include/hmi_message_handler/hmi_message_sender.h
index 95ed2c63c4..91c20a1986 100644
--- a/src/components/include/hmi_message_handler/hmi_message_sender.h
+++ b/src/components/include/hmi_message_handler/hmi_message_sender.h
@@ -40,6 +40,7 @@ typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
class HMIMessageSender {
public:
+ virtual ~HMIMessageSender() {}
virtual void SendMessageToHMI(MessageSharedPointer message) = 0;
};
}
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..e850a3fa2b 100644
--- a/src/components/include/policy/policy_external/policy/policy_listener.h
+++ b/src/components/include/policy/policy_external/policy/policy_listener.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_LISTENER_H_
-#define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_LISTENER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_LISTENER_H_
#include <queue>
@@ -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<std::string> GetDevicesIds(const std::string&)
- */
+ * Gets device ID
+ * @param policy_app_id
+ * @return device ID
+ * @deprecated see std::vector<std::string> 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<std::string, StringArray> 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,51 @@ 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<std::string, std::string>& 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<std::string> 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 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;
+
+#endif // SDL_REMOTE_CONTROL
};
-} // namespace policy
-#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_LISTENER_H_
+} // namespace policy
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_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..adf195e3a9 100644
--- a/src/components/include/policy/policy_external/policy/policy_manager.h
+++ b/src/components/include/policy/policy_external/policy/policy_manager.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
#include <vector>
@@ -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;
@@ -55,12 +59,17 @@ class PolicyManager : public usage_statistics::StatisticsManager {
enum NotificationMode { kSilentMode, kNotifyApplicationMode };
virtual ~PolicyManager() {}
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
virtual void set_listener(PolicyListener* listener) = 0;
/**
- * Inits Policy Table
- * @param file_name Path to preloaded PT file
- * @return true if successfully
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
*/
virtual bool InitPT(const std::string& file_name,
const PolicySettings* settings) = 0;
@@ -71,26 +80,30 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* sent in snapshot and received Policy Table.
* @param file name of file with update policy table
* @param pt_content PTU as binary string
- * @return bool Success of operation
+ * @return true if successfully
*/
virtual bool LoadPT(const std::string& file,
const BinaryMessage& pt_content) = 0;
/**
- * Resets Policy Table
+ * @brief Resets Policy Table
* @param file_name Path to preloaded PT file
* @return true if successfully
*/
virtual bool ResetPT(const std::string& file_name) = 0;
+ /**
+ * @brief Gets last URL for sending PTS to from PT itself
+ * @param service_type Service specifies user of URL
+ * @return last URL or empty string if endpoint entry is empty
+ */
virtual std::string GetUpdateUrl(int service_type) = 0;
/**
- * @brief Gets all URLs for sending PTS to from PT itself.
- * @param service_type Service specifies user of URL
- * @return vector of urls
- */
-
+ * @brief Gets all URLs for sending PTS to from PT itself.
+ * @param service_type Service specifies user of URL
+ * @return vector of urls
+ */
virtual void GetUpdateUrls(const uint32_t service_type,
EndpointUrls& out_end_points) = 0;
virtual void GetUpdateUrls(const std::string& service_type,
@@ -98,7 +111,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief GetLockScreenIcon allows to obtain lock screen icon url;
- *
* @return url which point to the resourse where lock screen icon could be
*obtained.
*/
@@ -116,6 +128,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @param app_id Id of application provided during registration
* @param hmi_level Current HMI Level of application
* @param rpc Name of RPC
+ * @param rpc_params List of RPC params
* @param CheckPermissionResult containing flag if HMI Level is allowed
* and list of allowed params.
*/
@@ -138,41 +151,43 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual std::string GetPolicyTableStatus() const = 0;
/**
- * Checks is PT exceeded kilometers
+ * @brief Checks is PT exceeded kilometers
* @param kilometers current kilometers at odometer
* @return true if exceeded
*/
virtual void KmsChanged(int kilometers) = 0;
/**
- * Increments counter of ignition cycles
+ * @brief Increments counter of ignition cycles
*/
virtual void IncrementIgnitionCycles() = 0;
/**
* @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
*/
virtual std::string ForcePTExchange() = 0;
/**
- * @brief ExchangeByUserRequest
+ * @brief Exchange by user request
+ * @return Current status of policy table
*/
virtual std::string ForcePTExchangeAtUserRequest() = 0;
/**
- * Resets retry sequence
+ * @brief Resets retry sequence
*/
virtual void ResetRetrySequence() = 0;
/**
- * Gets timeout to wait before next retry updating PT
+ * @brief Gets timeout to wait before next retry updating PT
* If timeout is less or equal to zero then the retry sequence is not need.
* @return timeout in seconds
*/
virtual int NextRetryTimeout() = 0;
/**
- * Gets timeout to wait until receive response
+ * @brief Gets timeout to wait until receive response
* @return timeout in seconds
*/
virtual uint32_t TimeoutExchangeMSec() = 0;
@@ -185,7 +200,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0;
/**
- * Handler of exceeding timeout of exchanging policy table
+ * @brief Handler of exceeding timeout of exchanging policy table
*/
virtual void OnExceededTimeout() = 0;
@@ -224,21 +239,24 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Update Application Policies as reaction
* on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
*/
virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
const bool is_device_allowed) = 0;
/**
- * Sets counter value that passed for receiving PT UPdate.
+ * @brief Sets counter value that passed for receiving PT UPdate.
*/
virtual void PTUpdatedAt(Counters counter, int value) = 0;
/**
* @brief Retrieves data from app_policies about app on its registration:
- * @param app_id - id of registered app
- * @param app_types Section on HMI where app can appear (Navigation, Phone
- * etc)
+ * @param application_id - id of registered app
* @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
*/
virtual bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
@@ -267,6 +285,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* The permissions is not const reference because it may contains
* valid data as well as invalid. So we will remove all invalid data
* from this structure.
+ * @param mode notification mode
*/
virtual void SetUserConsentForApp(const PermissionConsent& permissions,
const NotificationMode mode) = 0;
@@ -294,6 +313,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @brief Get user friendly messages for given RPC messages and language
* @param message_codes RPC message codes
* @param language Language
+ * @param active_hmi_language Currently active language
* @return Array of structs with appropriate message parameters
*/
virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
@@ -302,7 +322,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& active_hmi_language) = 0;
/**
- * Checks if the application is revoked
+ * @brief Checks if the application is revoked
* @param app_id application id
* @return true if application is revoked
*/
@@ -329,11 +349,15 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual AppPermissions GetAppPermissionsChanges(
const std::string& policy_app_id) = 0;
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0;
/**
* @brief Return device id, which hosts specific application
- * @param Application id, which is required to update device id
+ * @param policy_app_id Application id, which is required to update device id
*/
virtual std::string& GetCurrentDeviceId(
const std::string& policy_app_id) const = 0;
@@ -356,13 +380,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Send OnPermissionsUpdated for choosen application
- * @param application_id
+ * @param application_id Unique application id
*/
virtual void SendNotificationOnPermissionsUpdated(
const std::string& application_id) = 0;
/**
- * Marks device as upaired
+ * @brief Marks device as upaired
* @param device_id id device
*/
virtual void MarkUnpairedDevice(const std::string& device_id) = 0;
@@ -370,7 +394,8 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Adds, application to the db or update existed one
* run PTU if policy update is necessary for application.
- * @param Application id assigned by Ford to the application
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
* @return function that will notify update manager about new application
*/
virtual StatusNotifier AddApplication(
@@ -379,18 +404,21 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Removes unpaired device records and related records from DB
- * @param device_ids List of device_id, which should be removed
* @return true, if succedeed, otherwise - false
*/
virtual bool CleanupUnpairedDevices() = 0;
/**
* @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
*/
virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
/**
* @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
*/
virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
@@ -402,9 +430,9 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void OnSystemReady() = 0;
/**
- * @brief GetNotificationNumber
- * @param priority
- * @return
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
*/
virtual uint32_t GetNotificationsNumber(
const std::string& priority) const = 0;
@@ -423,7 +451,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual bool IsPredataPolicy(const std::string& policy_app_id) const = 0;
/**
- * Returns heart beat timeout
+ * @brief Returns heart beat timeout
* @param app_id application id
* @return if timeout was set then value in milliseconds greater zero
* otherwise heart beat for specific application isn't set
@@ -431,7 +459,8 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0;
/**
- * @brief SaveUpdateStatusRequired alows to save update status.
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
*/
virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0;
@@ -442,14 +471,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
*/
virtual void OnAppsSearchCompleted(const bool trigger_ptu) = 0;
/**
* @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
- * It will send OnAppPermissionSend notification and will try to start PTU.
- *
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
* @param application_id registered application.
*/
virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
@@ -457,13 +486,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Gets request types for application
* @param policy_app_id Unique application id
- * @return request_types Request types of application
+ * @return request types of application
*/
virtual const std::vector<std::string> GetAppRequestTypes(
const std::string policy_app_id) const = 0;
/**
* @brief Get information about vehicle
+ * @return vehicle information
*/
virtual const VehicleInfo GetVehicleInfo() const = 0;
@@ -476,7 +506,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief RetrieveCertificate Allows to obtain certificate in order
* to start secure connection.
- *
* @return The certificate in PKCS#7 format.
*/
virtual std::string RetrieveCertificate() const = 0;
@@ -484,7 +513,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief HasCertificate check whether policy table has certificate
* int module_config section.
- *
* @return true in case certificate exists, false otherwise
*/
virtual bool HasCertificate() const = 0;
@@ -495,6 +523,10 @@ class PolicyManager : public usage_statistics::StatisticsManager {
*/
virtual void SetDecryptedCertificate(const std::string& certificate) = 0;
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
virtual const PolicySettings& get_settings() const = 0;
/**
@@ -505,6 +537,57 @@ class PolicyManager : public usage_statistics::StatisticsManager {
*/
virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ virtual void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) = 0;
+ /**
+ * @brief 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<int>* app_types) = 0;
+
+ /**
+ * @brief 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;
+
+ /**
+ * @brief 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;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ virtual void set_access_remote(
+ utils::SharedPtr<AccessRemote> 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
@@ -518,11 +601,11 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const EndpointUrls& urls) const = 0;
/**
- * @brief Checks, if SDL needs to update it's policy table "external consent
- * status" section
- * @param status ExternalConsent status
- * @return true if there's such a need, otherwise - false
- */
+ * @brief Checks, if SDL needs to update it's policy table section
+ "external_consent_status"
+ * @param ExternalConsent status
+ * @return true if such check is needed, false - if not.
+ */
virtual bool IsNeedToUpdateExternalConsentStatus(
const ExternalConsentStatus& status) const = 0;
@@ -536,19 +619,19 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Gets customer connectivity settings status
- * @return external consent status
+ * @return ExternalConsent status
*/
virtual ExternalConsentStatus GetExternalConsentStatus() = 0;
protected:
/**
- * Checks is PT exceeded IgnitionCycles
+ * @brief Checks is PT exceeded IgnitionCycles
* @return true if exceeded
*/
virtual bool ExceededIgnitionCycles() = 0;
/**
- * Checks is PT exceeded days
+ * @brief Checks is PT exceeded days
* @return true if exceeded
*/
virtual bool ExceededDays() = 0;
@@ -566,4 +649,4 @@ class PolicyManager : public usage_statistics::StatisticsManager {
extern "C" policy::PolicyManager* CreateManager();
extern "C" void DeleteManager(policy::PolicyManager*);
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_POLICY_MANAGER_H_
diff --git a/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h b/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h
index 45883163c4..3f01a30a62 100644
--- a/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h
+++ b/src/components/include/policy/policy_external/policy/usage_statistics/app_stopwatch.h
@@ -30,10 +30,10 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
-#include "statistics_manager.h"
+#include "policy/usage_statistics/statistics_manager.h"
namespace usage_statistics {
@@ -47,4 +47,4 @@ class AppStopwatch {
} // namespace usage_statistics
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
diff --git a/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h
index 8cf3beaa55..7186400ff4 100644
--- a/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h
+++ b/src/components/include/policy/policy_external/policy/usage_statistics/statistics_manager.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
#include <stdint.h>
#include <string>
@@ -71,11 +71,36 @@ enum AppCounterId {
class StatisticsManager {
public:
virtual ~StatisticsManager() {}
+
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
virtual void Increment(GlobalCounterId type) = 0;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
virtual void Increment(const std::string& app_id, AppCounterId type) = 0;
+
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
virtual void Set(const std::string& app_id,
AppInfoId type,
const std::string& value) = 0;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
virtual void Add(const std::string& app_id,
AppStopwatchId type,
int32_t timespan_seconds) = 0;
@@ -83,4 +108,4 @@ class StatisticsManager {
} // namespace usage_statistics
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_EXTERNAL_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
diff --git a/src/components/policy/policy_regular/include/policy/policy_listener.h b/src/components/include/policy/policy_regular/policy/policy_listener.h
index 0170f421e4..e8de37d5de 100644
--- a/src/components/policy/policy_regular/include/policy/policy_listener.h
+++ b/src/components/include/policy/policy_regular/policy/policy_listener.h
@@ -30,8 +30,8 @@
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_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_LISTENER_H_
#include <queue>
@@ -111,6 +111,45 @@ class PolicyListener {
* @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<std::string> 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 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;
+
+#endif // SDL_REMOTE_CONTROL
};
} // namespace policy
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_LISTENER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_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..510e35e699 100644
--- a/src/components/include/policy/policy_regular/policy/policy_manager.h
+++ b/src/components/include/policy/policy_regular/policy/policy_manager.h
@@ -30,8 +30,8 @@
POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
#include <vector>
#include <cstdint>
@@ -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;
@@ -50,12 +53,17 @@ class PolicyManager : public usage_statistics::StatisticsManager {
public:
virtual ~PolicyManager() {}
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
virtual void set_listener(PolicyListener* listener) = 0;
/**
- * Inits Policy Table
- * @param file_name Path to preloaded PT file
- * @return true if successfully
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
*/
virtual bool InitPT(const std::string& file_name,
const PolicySettings* settings) = 0;
@@ -66,13 +74,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* sent in snapshot and received Policy Table.
* @param file name of file with update policy table
* @param pt_content PTU as binary string
- * @return bool Success of operation
+ * @return true if successfully
*/
virtual bool LoadPT(const std::string& file,
const BinaryMessage& pt_content) = 0;
/**
- * Resets Policy Table
+ * @brief Resets Policy Table
* @param file_name Path to preloaded PT file
* @return true if successfully
*/
@@ -80,7 +88,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief GetLockScreenIcon allows to obtain lock screen icon url;
- *
* @return url which point to the resourse where lock screen icon could be
*obtained.
*/
@@ -89,7 +96,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Gets all URLs for sending PTS to from PT itself.
* @param service_type Service specifies user of URL
- * @return vector of urls
+ * @param out_end_points output vector of urls
*/
virtual void GetUpdateUrls(const std::string& service_type,
EndpointUrls& out_end_points) = 0;
@@ -105,11 +112,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* @brief Check if specified RPC for specified application
* has permission to be executed in specified HMI Level
* and also its permitted params.
+ * @param device_id Id of device of application
* @param app_id Id of application provided during registration
* @param hmi_level Current HMI Level of application
* @param rpc Name of RPC
- * @param CheckPermissionResult containing flag if HMI Level is allowed
- * and list of allowed params.
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed and list of
+ * allowed params.
*/
virtual void CheckPermissions(const PTString& device_id,
const PTString& app_id,
@@ -118,6 +127,12 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const RPCParams& rpc_params,
CheckPermissionResult& result) = 0;
+ /**
+ * @brief Changes isConsentNeeded for app pending permissions, in case
+ * user set permissions before app activation.
+ * @param Unique app id
+ * @param Current permissions for app
+ */
virtual void CheckPendingPermissionsChanges(
const std::string& policy_app_id,
const std::vector<FunctionalGroupPermission>& current_permissions) = 0;
@@ -135,36 +150,38 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual std::string GetPolicyTableStatus() const = 0;
/**
- * Checks is PT exceeded kilometers
+ * @brief Checks is PT exceeded kilometers
* @param kilometers current kilometers at odometer
* @return true if exceeded
*/
virtual void KmsChanged(int kilometers) = 0;
/**
- * Increments counter of ignition cycles
+ * @brief Increments counter of ignition cycles
*/
virtual void IncrementIgnitionCycles() = 0;
/**
* @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
*/
virtual std::string ForcePTExchange() = 0;
/**
- * @brief ExchangeByUserRequest
+ * @brief Exchange by user request
+ * @return Current status of policy table
*/
virtual std::string ForcePTExchangeAtUserRequest() = 0;
/**
- * Gets timeout to wait before next retry updating PT
- * If timeout is equal to zero then the retry sequence is not need.
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
* @return timeout in seconds
*/
virtual uint32_t NextRetryTimeout() = 0;
/**
- * Gets timeout to wait until receive response
+ * @brief Gets timeout to wait until receive response
* @return timeout in seconds
*/
virtual uint32_t TimeoutExchangeMSec() = 0;
@@ -177,7 +194,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0;
/**
- * Handler of exceeding timeout of exchanging policy table
+ * @brief Handler of exceeding timeout of exchanging policy table
*/
virtual void OnExceededTimeout() = 0;
@@ -187,7 +204,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void OnUpdateStarted() = 0;
/**
- * @brief Check user consent for mobile device data connection
+ * @brief Gets user consent for mobile device data connection
* @param device_id Unique device identifier
* @return status of device consent
*/
@@ -195,7 +212,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& device_id) const = 0;
/**
- * @brief Get user consent for application
+ * @brief Gets user consent for application
* @param device_id Device id
* @param policy_app_id Unique application id
* @param permissions Array of functional groups permissions
@@ -216,20 +233,24 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Update Application Policies as reaction
* on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
*/
virtual bool ReactOnUserDevConsentForApp(const std::string app_id,
bool is_device_allowed) = 0;
+
/**
- * Sets counter value that passed for receiving PT UPdate.
+ * @brief Sets counter value that passed for receiving PT UPdate.
*/
virtual void PTUpdatedAt(Counters counter, int value) = 0;
/**
* @brief Retrieves data from app_policies about app on its registration:
- * @param app_id - id of registered app
- * @param app_types Section on HMI where app can appear (Navigation, Phone
- * etc)
+ * @param application_id - id of registered app
* @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
*/
virtual bool GetInitialAppData(const std::string& application_id,
StringArray* nicknames = NULL,
@@ -291,7 +312,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
const std::string& language) = 0;
/**
- * Checks if the application is revoked
+ * @brief Checks if the application is revoked
* @param app_id application id
* @return true if application is revoked
*/
@@ -318,11 +339,15 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual AppPermissions GetAppPermissionsChanges(
const std::string& policy_app_id) = 0;
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0;
/**
* @brief Return device id, which hosts specific application
- * @param Application id, which is required to update device id
+ * @param policy_app_id Application id, which is required to update device id
*/
virtual std::string& GetCurrentDeviceId(
const std::string& policy_app_id) const = 0;
@@ -345,13 +370,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Send OnPermissionsUpdated for choosen application
- * @param application_id
+ * @param application_id Unique application id
*/
virtual void SendNotificationOnPermissionsUpdated(
const std::string& application_id) = 0;
/**
- * Marks device as upaired
+ * @brief Marks device as upaired
* @param device_id id device
*/
virtual void MarkUnpairedDevice(const std::string& device_id) = 0;
@@ -359,26 +384,31 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Adds, application to the db or update existed one
* run PTU if policy update is necessary for application.
- * @param Application id assigned by Ford to the application
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
* @return function that will notify update manager about new application
*/
virtual StatusNotifier AddApplication(
const std::string& application_id,
const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) = 0;
+
/**
* @brief Removes unpaired device records and related records from DB
- * @param device_ids List of device_id, which should be removed
* @return true, if succedeed, otherwise - false
*/
virtual bool CleanupUnpairedDevices() = 0;
/**
* @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
*/
virtual bool CanAppKeepContext(const std::string& app_id) const = 0;
/**
* @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
*/
virtual bool CanAppStealFocus(const std::string& app_id) const = 0;
@@ -390,9 +420,9 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual void OnSystemReady() = 0;
/**
- * @brief GetNotificationNumber
- * @param priority
- * @return
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
*/
virtual uint32_t GetNotificationsNumber(
const std::string& priority) const = 0;
@@ -411,7 +441,7 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual bool IsPredataPolicy(const std::string& policy_app_id) const = 0;
/**
- * Returns heart beat timeout
+ * @brief Returns heart beat timeout
* @param app_id application id
* @return if timeout was set then value in milliseconds greater zero
* otherwise heart beat for specific application isn't set
@@ -419,7 +449,8 @@ class PolicyManager : public usage_statistics::StatisticsManager {
virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0;
/**
- * @brief SaveUpdateStatusRequired alows to save update status.
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
*/
virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0;
@@ -430,26 +461,28 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
*/
virtual void OnAppsSearchCompleted(const bool trigger_ptu) = 0;
+
/**
* @brief Gets request types for application
* @param policy_app_id Unique application id
- * @return request_types Request types of application
+ * @return request types of application
*/
virtual const std::vector<std::string> GetAppRequestTypes(
const std::string policy_app_id) const = 0;
/**
* @brief Get information about vehicle
+ * @return vehicle information
*/
virtual const VehicleInfo GetVehicleInfo() const = 0;
/**
- * @brief OnAppRegisteredOnMobile alows to handle event when application were
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
* succesfully registered on mobile device.
- * It will send OnAppPermissionSend notification and will try to start PTU.
- *
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
* @param application_id registered application.
*/
virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0;
@@ -457,7 +490,6 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief RetrieveCertificate Allows to obtain certificate in order
* to start secure connection.
- *
* @return The certificate in PKCS#7 format.
*/
virtual std::string RetrieveCertificate() const = 0;
@@ -465,11 +497,14 @@ class PolicyManager : public usage_statistics::StatisticsManager {
/**
* @brief HasCertificate check whether policy table has certificate
* int module_config section.
- *
* @return true in case certificate exists, false otherwise
*/
virtual bool HasCertificate() const = 0;
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
virtual const PolicySettings& get_settings() const = 0;
/**
@@ -479,6 +514,57 @@ class PolicyManager : public usage_statistics::StatisticsManager {
* urls vector
*/
virtual AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) = 0;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ virtual void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief 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<int>* app_types) = 0;
+
+ /**
+ * @brief 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;
+
+ /**
+ * @brief 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;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const = 0;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ virtual void set_access_remote(
+ utils::SharedPtr<AccessRemote> access_remote) = 0;
+#endif // SDL_REMOTE_CONTROL
/**
* @brief Checks if there is existing URL in the EndpointUrls vector with
@@ -494,13 +580,13 @@ class PolicyManager : public usage_statistics::StatisticsManager {
protected:
/**
- * Checks is PT exceeded IgnitionCycles
+ * @brief Checks is PT exceeded IgnitionCycles
* @return true if exceeded
*/
virtual bool ExceededIgnitionCycles() = 0;
/**
- * Checks is PT exceeded days
+ * @brief Checks is PT exceeded days
* @return true if exceeded
*/
virtual bool ExceededDays() = 0;
@@ -518,4 +604,4 @@ class PolicyManager : public usage_statistics::StatisticsManager {
extern "C" policy::PolicyManager* CreateManager();
extern "C" void DeleteManager(policy::PolicyManager*);
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_POLICY_MANAGER_H_
diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h b/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h
index 8093c11467..0bcd585737 100644
--- a/src/components/policy/policy_regular/include/policy/usage_statistics/app_stopwatch.h
+++ b/src/components/include/policy/policy_regular/policy/usage_statistics/app_stopwatch.h
@@ -30,8 +30,8 @@
* 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_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
#include "policy/usage_statistics/statistics_manager.h"
@@ -47,4 +47,4 @@ class AppStopwatch {
} // namespace usage_statistics
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_APP_STOPWATCH_H_
diff --git a/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h
index 8cf3beaa55..23df30510b 100644
--- a/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h
+++ b/src/components/include/policy/policy_regular/policy/usage_statistics/statistics_manager.h
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
#include <stdint.h>
#include <string>
@@ -71,11 +71,36 @@ enum AppCounterId {
class StatisticsManager {
public:
virtual ~StatisticsManager() {}
+
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
virtual void Increment(GlobalCounterId type) = 0;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
virtual void Increment(const std::string& app_id, AppCounterId type) = 0;
+
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
virtual void Set(const std::string& app_id,
AppInfoId type,
const std::string& value) = 0;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
virtual void Add(const std::string& app_id,
AppStopwatchId type,
int32_t timespan_seconds) = 0;
@@ -83,4 +108,4 @@ class StatisticsManager {
} // namespace usage_statistics
-#endif // SRC_COMPONENTS_INCLUDE_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_POLICY_POLICY_REGULAR_POLICY_USAGE_STATISTICS_STATISTICS_MANAGER_H_
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..e94d9b4b3a 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,23 @@ 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_METHOD2(ChangeAppsHMILevel,
+ void(uint32_t app_id, mobile_apis::HMILevel::eType level));
+ MOCK_METHOD0(GetPluginManager, functional_modules::PluginManager&());
+ MOCK_CONST_METHOD1(
+ devices, std::vector<std::string>(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 +128,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));
@@ -266,6 +286,9 @@ class MockApplicationManager : public application_manager::ApplicationManager {
protocol_handler::ServiceType service_type,
bool result,
std::vector<std::string>& rejected_params));
+ MOCK_METHOD1(ValidateMessageBySchema,
+ application_manager::MessageValidationResult(
+ const application_manager::Message& message));
};
} // namespace application_manager_test
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<uint32_t, int32_t>&());
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/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h
index 2fad7b757e..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
@@ -227,6 +227,36 @@ 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_METHOD2(CheckModule,
+ bool(const policy::PTString& app_id,
+ const policy::PTString& module));
+
+ 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_CONST_METHOD2(GetModuleTypes,
+ bool(const std::string& policy_app_id,
+ std::vector<std::string>* 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/policy/policy_external/test/include/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
index 617e99358e..e90fa63075 100644
--- a/src/components/policy/policy_external/test/include/policy/mock_cache_manager.h
+++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h
@@ -29,8 +29,8 @@
* 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_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_CACHE_MANAGER_H_
#include <string>
#include <vector>
@@ -253,4 +253,4 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface {
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_TEST_INCLUDE_POLICY_MOCK_CACHE_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_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..ad2f1fd56c 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
@@ -29,8 +29,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_LISTENER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_LISTENER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
#include <string>
#include <map>
@@ -92,10 +92,20 @@ class MockPolicyListener : public ::policy::PolicyListener {
const std::string& hmi_level));
MOCK_CONST_METHOD1(GetRegisteredLinks,
void(std::map<std::string, std::string>&));
+#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));
+#endif // SDL_REMOTE_CONTROL
};
} // namespace policy_test
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_LISTENER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_LISTENER_H_
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..6227e7e85c 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
#include <string>
#include <vector>
@@ -148,6 +148,25 @@ 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<int>& hmi_types));
+ MOCK_METHOD2(GetHMITypes,
+ bool(const std::string& application_id,
+ std::vector<int>* app_types));
+ MOCK_METHOD2(CheckModule,
+ bool(const PTString& app_id, const PTString& module));
+ 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<std::string>* modules));
+ MOCK_METHOD1(set_access_remote,
+ void(utils::SharedPtr<AccessRemote> 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));
@@ -201,4 +220,4 @@ class MockPolicyManager : public PolicyManager {
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_EXTERNAL_POLICY_MOCK_POLICY_MANAGER_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
index 7569e2195d..39876cf713 100644
--- a/src/components/policy/policy_regular/test/include/policy/mock_cache_manager.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h
@@ -29,8 +29,8 @@
* 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_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
#include <string>
#include <vector>
@@ -202,7 +202,9 @@ class MockCacheManagerInterface : public CacheManagerInterface {
bool(const std::string& device_id,
const std::string& policy_app_id,
policy::Permissions& permission));
- MOCK_CONST_METHOD0(GetPT, utils::SharedPtr<policy_table::Table>());
+ MOCK_CONST_METHOD0(pt, utils::SharedPtr<policy_table::Table>());
+ 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));
@@ -215,4 +217,4 @@ class MockCacheManagerInterface : public CacheManagerInterface {
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_CACHE_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_CACHE_MANAGER_H_
diff --git a/src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
index 2e4073aae9..d98a0279d7 100644
--- a/src/components/policy/policy_regular/test/include/policy/mock_policy_listener.h
+++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_listener.h
@@ -29,8 +29,8 @@
* 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_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_LISTENER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_LISTENER_H_
#include <string>
@@ -43,19 +43,21 @@
namespace policy_table = ::rpc::policy_table_interface_base;
-namespace policy {
+namespace test {
+namespace components {
+namespace policy_test {
namespace custom_str = utils::custom_string;
-class MockPolicyListener : public PolicyListener {
+class MockPolicyListener : public ::policy::PolicyListener {
public:
MOCK_METHOD3(OnPermissionsUpdated,
void(const std::string& policy_app_id,
- const Permissions& permissions,
+ const policy::Permissions& permissions,
const policy::HMILevel& default_hmi));
MOCK_METHOD2(OnPermissionsUpdated,
void(const std::string& policy_app_id,
- const Permissions& permissions));
+ const policy::Permissions& permissions));
MOCK_METHOD1(OnPendingPermissionChange,
void(const std::string& policy_app_id));
MOCK_METHOD1(OnUpdateStatusChanged, void(const std::string& status));
@@ -67,17 +69,36 @@ class MockPolicyListener : public PolicyListener {
MOCK_METHOD0(OnUserRequestedUpdateCheckRequired, void());
MOCK_METHOD2(OnDeviceConsentChanged,
void(const std::string& device_id, bool is_allowed));
- MOCK_METHOD1(OnUpdateHMIAppType, void(std::map<std::string, StringArray>));
+ MOCK_METHOD1(OnUpdateHMIAppType,
+ void(std::map<std::string, policy::StringArray>));
MOCK_METHOD1(GetAvailableApps, void(std::queue<std::string>&));
- MOCK_METHOD1(OnSnapshotCreated, void(const BinaryMessage& pt_string));
+ 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 AppPermissions&, const std::string&));
+ 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<std::string>(const std::string& policy_app_id));
MOCK_CONST_METHOD1(GetRegisteredLinks,
void(std::map<std::string, std::string>&));
+#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));
+#endif // SDL_REMOTE_CONTROL
};
-} // namespace policy
+} // namespace policy_test
+} // namespace components
+} // namespace test
-#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_MOCK_POLICY_LISTENER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_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..cfe41ee64c 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
@@ -30,8 +30,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
-#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
+#ifndef SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
+#define SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
#include <string>
#include <vector>
@@ -147,6 +147,24 @@ 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<int>& hmi_types));
+ MOCK_METHOD2(GetHMITypes,
+ bool(const std::string& application_id,
+ std::vector<int>* app_types));
+ MOCK_METHOD2(CheckModule,
+ bool(const PTString& app_id, const PTString& module));
+ 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<std::string>* modules));
+ MOCK_METHOD1(set_access_remote,
+ void(utils::SharedPtr<AccessRemote> 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));
@@ -210,4 +228,4 @@ class MockPolicyManager : public PolicyManager {
} // namespace components
} // namespace test
-#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_MOCK_POLICY_MANAGER_H_
+#endif // SRC_COMPONENTS_INCLUDE_TEST_POLICY_POLICY_REGULAR_POLICY_MOCK_POLICY_MANAGER_H_
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_
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index 495c449e85..554461cc86 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -66,6 +66,7 @@
<element name="USER_DISALLOWED" value="23"/>
<element name="TRUNCATED_DATA" value="24"/>
<element name="SAVED" value="25"/>
+ <element name="READ_ONLY" value="26"/>
</enum>
<enum name="TransportType">
@@ -95,6 +96,27 @@
<element name="PRESET_9"/>
<element name="CUSTOM_BUTTON"/>
<element name="SEARCH"/>
+ <!-- Climate Buttons -->
+ <element name="AC_MAX" />
+ <element name="AC" />
+ <element name="RECIRCULATE" />
+ <element name="FAN_UP" />
+ <element name="FAN_DOWN" />
+ <element name="TEMP_UP" />
+ <element name="TEMP_DOWN" />
+ <element name="DEFROST_MAX" />
+ <element name="DEFROST" />
+ <element name="DEFROST_REAR" />
+ <element name="UPPER_VENT" />
+ <element name="LOWER_VENT" />
+
+ <!-- Radio Buttons -->
+ <element name="VOLUME_UP" />
+ <element name="VOLUME_DOWN" />
+ <element name="EJECT" />
+ <element name="SOURCE" />
+ <element name="SHUFFLE" />
+ <element name="REPEAT" />
</enum>
<enum name="ButtonEventMode">
@@ -268,6 +290,7 @@
<element name="TESTING" />
<element name="SYSTEM" />
<element name="PROJECTION" />
+ <element name="REMOTE_CONTROL" />
</enum>
<enum name="WayPointType">
@@ -1393,6 +1416,288 @@
</struct>
<!-- End of Policies -->
+<!-- Remote Control -->
+<enum name="ModuleType">
+ <element name="CLIMATE"/>
+ <element name="RADIO"/>
+ </enum>
+
+ <enum name="RadioBand">
+ <element name="AM"/>
+ <element name="FM"/>
+ <element name="XM"/>
+ </enum>
+
+ <struct name="RdsData">
+ <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false">
+ <description>Program Service Name</description>
+ </param>
+ <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false">
+ <description>Radio Text</description>
+ </param>
+ <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
+ <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
+ </param>
+ <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false">
+ <description>Program Identification - the call sign for the radio station</description>
+ </param>
+ <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false">
+ <description>The program type - The region should be used to differentiate between EU and North America program types</description>
+ </param>
+ <param name="TP" type="Boolean" mandatory="false">
+ <description>Traffic Program Identification - Identifies a station that offers traffic</description>
+ </param>
+ <param name="TA" type="Boolean" mandatory="false">
+ <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
+ </param>
+ <param name="REG" type="String" mandatory="false">
+ <description>Region</description>
+ </param>
+ </struct>
+
+ <enum name="RadioState">
+ <element name="ACQUIRING"/>
+ <element name="ACQUIRED"/>
+ <element name="MULTICAST"/>
+ <element name="NOT_FOUND"/>
+ </enum>
+
+ <struct name="RadioControlData">
+ <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
+ <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
+ </param>
+ <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
+ <description>The fractional part of the frequency for 101.7 is 7</description>
+ </param>
+ <param name="band" type="Common.RadioBand" mandatory="false">
+ </param>
+ <param name="rdsData" type="Common.RdsData" mandatory="false">
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>number of HD sub-channels if available</description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>Current HD sub-channel if available</description>
+ </param>
+ <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>If the signal strength falls below the set value for this parameter, the radio will tune to an alternative frequency</description>
+ </param>
+ <param name="radioEnable" type="Boolean" mandatory="false">
+ <description> True if the radio is on, false is the radio is off</description>
+ </param>
+ <param name="state" type="Common.RadioState" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="RadioControlCapabilities">
+ <description>Contains information about a radio control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the radio control module.</description>
+ </param>
+ <param name="radioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioBandAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio band.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioFrequencyAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio frequency.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdChannelAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of HD radio channel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="rdsDataAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting Radio Data System (RDS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the number of available HD channels.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="stateAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the Radio state.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalStrengthAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal strength.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal Change Threshold.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <enum name="DefrostZone">
+ <element name="FRONT"/>
+ <element name="REAR"/>
+ <element name="ALL"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="VentilationMode">
+ <element name="UPPER"/>
+ <element name="LOWER"/>
+ <element name="BOTH"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="TemperatureUnit">
+ <element name="FAHRENHEIT"/>
+ <element name="CELSIUS"/>
+ </enum>
+
+ <struct name="Temperature">
+ <param name="unit" type="TemperatureUnit" mandatory="true" >
+ <description>Temperature Unit</description>
+ </param>
+ <param name="value" type="Float" mandatory="true" >
+ <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlData">
+ <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="currentTemperature" type="Common.Temperature" mandatory="false">
+ </param>
+ <param name="desiredTemperature" type="Common.Temperature" mandatory="false">
+ </param>
+ <param name="acEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="circulateAirEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="autoModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="defrostZone" type="DefrostZone" mandatory="false">
+ </param>
+ <param name="dualModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="acMaxEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="ventilationMode" type="Common.VentilationMode" mandatory="false">
+ </param>
+ </struct>
+
+ <struct name="ClimateControlCapabilities">
+ <description>Contains information about a climate control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the climate control module.</description>
+ </param>
+ <param name="currentTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the reading of current temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of fan speed.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of desired temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of turn on/off AC.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable circulate Air mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable auto mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable dual mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of defrost zones.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZone" type="Common.DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all defrost zones that are controllable.
+ </description>
+ </param>
+ <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of air ventilation mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="ventilationMode" type="Common.VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all ventilation modes that are controllable.
+ </description>
+ </param>
+ </struct>
+
+ <struct name="ModuleData">
+ <description>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</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ </param>
+ <param name="radioControlData" type="Common.RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="Common.ClimateControlData" mandatory="false">
+ </param>
+ </struct>
+
+<enum name="RCAccessMode">
+ <description>Enumeration that describes possible remote control access mode the application might be in on HU.</description>
+ <element name="AUTO_ALLOW"/>
+ <element name="AUTO_DENY"/>
+ <element name="ASK_DRIVER"/>
+</enum>
+
+<!-- End Remote Control -->
<struct name="TextField">
<param name="name" type="Common.TextFieldName" mandatory="true">
<description>The name that identifies the field. See TextFieldName.</description>
@@ -2273,6 +2578,18 @@
</param>
</struct>
+ <struct name="RemoteControlCapabilities">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC climate controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>If included, the platform supports RC radio controls. For this baseline version, maxsize=1. i.e. only one climate control module is supported.</description >
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
+ <description>If included, the platform supports RC button controls with the included button names.</description >
+ </param>
+ </struct>
+
<struct name="Rectangle">
<param name="x" type="Float" mandatory="true">
<description>The X-coordinate of the user control</description>
@@ -2312,6 +2629,23 @@
<description>Must be returned if the platform supports custom on-screen Presets</description>
</param>
</function>
+
+ <function name="ButtonPress" messagetype="request">
+ <description>Method is invoked when the application tries to press a button</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ <description>The module where the button should be pressed</description>
+ </param>
+ <param name="buttonName" type="Common.ButtonName" mandatory="true" />
+ <param name="buttonPressMode" type="Common.ButtonPressMode" mandatory="true" >
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application that triggers the permission prompt.</description>
+ </param>
+ </function>
+ <function name="ButtonPress" messagetype="response">
+ </function>
+
<function name="OnButtonEvent" messagetype="notification">
<description>HU system must notify about every UP/DOWN event for buttons</description>
<param name="name" type="Common.ButtonName" mandatory="true"/>
@@ -4507,4 +4841,94 @@
<param name="deviceId" type="Common.DeviceInfo" mandatory="false"/>
</function>
</interface>
+
+<interface name="RC" version="1.1" date="2017-07-18">
+ <function name="IsReady" messagetype="request">
+ <description>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.</description>
+ </function>
+ <function name="IsReady" messagetype="response">
+ <param name="available" type="Boolean" mandatory="true">
+ <description>Must be true if vehicle RC modules are present and ready to communicate with SDL.</description>
+ </param>
+ </function>
+
+ <function name="GetCapabilities" messagetype="request">
+ <description>Method is invoked at system startup by SDL to request information about Remote Control capabilities of HMI.</description>
+ </function>
+ <function name="GetCapabilities" messagetype="response">
+ <param name="remoteControlCapability" type="Common.RemoteControlCapabilities" mandatory="false">
+ <description>See RemoteControlCapabilities, all available RC modules and buttons shall be returned.</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ <description>The module type and data to set</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal SDL-assigned ID of the related application</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" messagetype="response">
+ <description>Used to set the values of one zone and one data type within that zone</description>
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+ </function>
+
+<function name="GetInteriorVehicleData" messagetype="request">
+ <param name="moduleType" type="Common.ModuleType" mandatory="true" >
+ <description>The module data to retrieve from the vehicle for that type</description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false">
+ <description>If subscribe is true, the head unit will send onInteriorVehicleData notifications for the module type</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>Internal SDL-assigned ID of the related application</description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleData" messagetype="response">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+ <param name="isSubscribed" type="Boolean" mandatory="false" >
+ <description>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.</description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleDataConsent" messagetype="request">
+ <description>Sender: SDL->HMI. </description>
+ <description>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.</description>
+ <param name="moduleType" type="Common.ModuleType" mandatory="true">
+ <description>The module type that the app requests to control.</description>
+ </param>
+ <param name="appID" type="Integer" mandatory="true">
+ <description>ID of the application that triggers the permission prompt.</description>
+ </param>
+ </function>
+ <function name="GetInteriorVehicleDataConsent" messagetype="response">
+ <param name="allowed" type="Boolean" mandatory="true">
+ <description>"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.</description>
+ </param>
+</function>
+
+<function name="OnInteriorVehicleData" messagetype="notification">
+ <param name="moduleData" type="Common.ModuleData" mandatory="true" >
+ </param>
+</function>
+
+<function name="OnRemoteControlSettings" messagetype="notification">
+ <description>Sender: vehicle -> RSDL. Notification about remote-control settings changed. Sent after User`s choice through HMI.</description>
+ <param name="allowed" type="Boolean" mandatory="false" >
+ <description>If "true" - RC is allowed; if "false" - RC is disallowed.</description>
+ </param>
+ <param name="accessMode" type="Common.RCAccessMode" mandatory="false" >
+ <description>The remote control access mode specified by the driver via HMI.</description>
+ </param>
+</function>
+</interface>
</interfaces>
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 873148d8d8..2d550f04f2 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -135,6 +135,9 @@
<element name="DATA_NOT_AVAILABLE">
<description>The requested data is not available on this vehicle or is not published for the connected app </description>
</element>
+ <element name="READ_ONLY">
+ <description>The value being set is read only</description>
+ </element>
</enum>
<enum name="ButtonPressMode">
@@ -538,6 +541,28 @@
<element name="PRESET_9" />
<element name="CUSTOM_BUTTON" />
<element name="SEARCH" />
+
+ <!-- Climate Buttons -->
+ <element name="AC_MAX" />
+ <element name="AC" />
+ <element name="RECIRCULATE" />
+ <element name="FAN_UP" />
+ <element name="FAN_DOWN" />
+ <element name="TEMP_UP" />
+ <element name="TEMP_DOWN" />
+ <element name="DEFROST_MAX" />
+ <element name="DEFROST" />
+ <element name="DEFROST_REAR" />
+ <element name="UPPER_VENT" />
+ <element name="LOWER_VENT" />
+
+ <!-- Radio Buttons -->
+ <element name="VOLUME_UP" />
+ <element name="VOLUME_DOWN" />
+ <element name="EJECT" />
+ <element name="SOURCE" />
+ <element name="SHUFFLE" />
+ <element name="REPEAT" />
</enum>
<enum name="MediaClockFormat">
@@ -1420,6 +1445,284 @@
</param>
</struct>
+ <enum name="ModuleType">
+ <element name="CLIMATE"/>
+ <element name="RADIO"/>
+ </enum>
+
+ <enum name="RadioBand">
+ <element name="AM"/>
+ <element name="FM"/>
+ <element name="XM"/>
+ </enum>
+
+ <struct name="RdsData">
+ <param name="PS" type="String" minlength="0" maxlength="8" mandatory="false" >
+ <description>Program Service Name</description>
+ </param>
+ <param name="RT" type="String" minlength="0" maxlength="64" mandatory="false" >
+ <description>Radio Text</description>
+ </param>
+ <param name="CT" type="String" minlength="24" maxlength="24" mandatory="false">
+ <description>The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD</description>
+ </param>
+ <param name="PI" type="String" minlength="0" maxlength="6" mandatory="false" >
+ <description>Program Identification - the call sign for the radio station</description>
+ </param>
+ <param name="PTY" type="Integer" minvalue="0" maxvalue="31" mandatory="false" >
+ <description>The program type - The region should be used to differentiate between EU and North America program types</description>
+ </param>
+ <param name="TP" type="Boolean" mandatory="false" >
+ <description>Traffic Program Identification - Identifies a station that offers traffic</description>
+ </param>
+ <param name="TA" type="Boolean" mandatory="false" >
+ <description>Traffic Announcement Identification - Indicates an ongoing traffic announcement</description>
+ </param>
+ <param name="REG" type="String" mandatory="false" >
+ <description>Region</description>
+ </param>
+ </struct>
+
+ <enum name="RadioState">
+ <element name="ACQUIRING"/>
+ <element name="ACQUIRED"/>
+ <element name="MULTICAST"/>
+ <element name="NOT_FOUND"/>
+ </enum>
+
+ <struct name="RadioControlData">
+ <param name="frequencyInteger" type="Integer" minvalue="0" maxvalue="1710" mandatory="false">
+ <description>The integer part of the frequency ie for 101.7 this value should be 101</description>
+ </param>
+ <param name="frequencyFraction" type="Integer" minvalue="0" maxvalue="9" mandatory="false">
+ <description>The fractional part of the frequency for 101.7 is 7</description>
+ </param>
+ <param name="band" type="RadioBand" mandatory="false">
+ </param>
+ <param name="rdsData" type="RdsData" mandatory="false">
+ <description> Read only parameter.</description>
+ </param>
+ <param name="availableHDs" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>number of HD sub-channels if available. Read only parameter.</description>
+ </param>
+ <param name="hdChannel" type="Integer" minvalue="1" maxvalue="3" mandatory="false">
+ <description>Current HD sub-channel if available</description>
+ </param>
+ <param name="signalStrength" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description> Read only parameter.</description>
+ </param>
+ <param name="signalChangeThreshold" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ <description>If the signal strength falls below the set value for this parameter,
+ the radio will tune to an alternative frequency. Read only parameter.</description>
+ </param>
+ <param name="radioEnable" type="Boolean" mandatory="false">
+ <description> True if the radio is on, false is the radio is off.</description>
+ </param>
+ <param name="state" type="RadioState" mandatory="false">
+ <description> Read only parameter.</description>
+ </param>
+ </struct>
+
+ <struct name="RadioControlCapabilities">
+ <description>Contains information about a radio control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the radio control module.</description>
+ </param>
+ <param name="radioEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable radio.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioBandAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio band.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="radioFrequencyAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of radio frequency.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="hdChannelAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the control of HD radio channel.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="rdsDataAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting Radio Data System (RDS) data.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="availableHDsAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the number of available HD channels.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="stateAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the Radio state.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalStrengthAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal strength.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="signalChangeThresholdAvailable" type="Boolean" mandatory="false" >
+ <description>
+ Availability of the getting the signal Change Threshold.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ </struct>
+
+ <enum name="DefrostZone">
+ <element name="FRONT"/>
+ <element name="REAR"/>
+ <element name="ALL"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="VentilationMode">
+ <element name="UPPER"/>
+ <element name="LOWER"/>
+ <element name="BOTH"/>
+ <element name="NONE"/>
+ </enum>
+
+ <enum name="TemperatureUnit">
+ <element name="FAHRENHEIT"/>
+ <element name="CELSIUS"/>
+ </enum>
+
+ <struct name="Temperature">
+ <param name="unit" type="TemperatureUnit" mandatory="true" >
+ <description>Temperature Unit</description>
+ </param>
+ <param name="value" type="Float" mandatory="true" >
+ <description>Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.</description>
+ </param>
+ </struct>
+
+ <struct name="ClimateControlData">
+ <param name="fanSpeed" type="Integer" minvalue="0" maxvalue="100" mandatory="false">
+ </param>
+ <param name="currentTemperature" type="Temperature" mandatory="false">
+ <description> Read only parameter.</description>
+ </param>
+ <param name="desiredTemperature" type="Temperature" mandatory="false">
+ </param>
+ <param name="acEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="circulateAirEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="autoModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="defrostZone" type="DefrostZone" mandatory="false">
+ </param>
+ <param name="dualModeEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="acMaxEnable" type="Boolean" mandatory="false">
+ </param>
+ <param name="ventilationMode" type="VentilationMode" mandatory="false">
+ </param>
+ </struct>
+
+<struct name="ClimateControlCapabilities">
+ <description>Contains information about a climate control module's capabilities.</description>
+ <param name="moduleName" type="String" maxlength="100" mandatory="true" >
+ <description>The short name or a short description of the climate control module.</description>
+ </param>
+ <param name="currentTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the reading of current temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="fanSpeedAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of fan speed.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="desiredTemperatureAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of desired temperature.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of turn on/off AC.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="acMaxEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable air conditioning is ON on the maximum level.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="circulateAirEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable circulate Air mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="autoModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable auto mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="dualModeEnableAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of enable/disable dual mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZoneAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of defrost zones.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="defrostZone" type="DefrostZone" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all defrost zones that are controllable.
+ </description>
+ </param>
+ <param name="ventilationModeAvailable" type="Boolean" mandatory="false">
+ <description>
+ Availability of the control of air ventilation mode.
+ True: Available, False: Not Available, Not present: Not Available.
+ </description>
+ </param>
+ <param name="ventilationMode" type="VentilationMode" minsize="1" maxsize="100" array="true" mandatory="false">
+ <description>
+ A set of all ventilation modes that are controllable.
+ </description>
+ </param>
+</struct>
+
+ <struct name="ModuleData">
+ <description>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</description>
+ <param name="moduleType" type="ModuleType" mandatory="true" >
+ </param>
+ <param name="radioControlData" type="RadioControlData" mandatory="false">
+ </param>
+ <param name="climateControlData" type="ClimateControlData" mandatory="false">
+ </param>
+ </struct>
+
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Ford Specific Data Items -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
@@ -1954,6 +2257,24 @@
</param>
</struct>
+ <struct name="RemoteControlCapabilities">
+ <param name="climateControlCapabilities" type="ClimateControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>
+ If included, the platform supports RC climate controls.
+ For this baseline version, maxsize=1. i.e. only one climate control module is supported.
+ </description >
+ </param>
+ <param name="radioControlCapabilities" type="RadioControlCapabilities" mandatory="false" minsize="1" maxsize="100" array="true">
+ <description>
+ If included, the platform supports RC radio controls.
+ For this baseline version, maxsize=1. i.e. only one radio control module is supported.
+ </description >
+ </param>
+ <param name="buttonCapabilities" type="ButtonCapabilities" mandatory="false" minsize="1" maxsize="100" array="true" >
+ <description>If included, the platform supports RC button controls with the included button names.</description >
+ </param>
+ </struct>
+
<struct name="SoftButtonCapabilities">
<description>Contains information about a SoftButton's capabilities.</description>
<param name="shortPressAvailable" type="Boolean" mandatory="true">
@@ -2179,6 +2500,7 @@
<element name="TESTING" />
<element name="SYSTEM" />
<element name="PROJECTION" />
+ <element name="REMOTE_CONTROL" />
</enum>
<enum name="PredefinedLayout" platform="documentation">
@@ -2354,6 +2676,9 @@
<element name="SystemRequestID" value="38" hexvalue="26" />
<element name="SendLocationID" value="39" hexvalue="27" />
<element name="DialNumberID" value="40" hexvalue="28" />
+ <element name="ButtonPressID" value="41" hexvalue="29" />
+ <element name="GetInteriorVehicleDataID" value="43" hexvalue="2B" />
+ <element name="SetInteriorVehicleDataID" value="44" hexvalue="2C" />
<element name="GetWayPointsID" value="45" hexvalue="2D" />
<element name="SubscribeWayPointsID" value="46" hexvalue="2E"/>
<element name="UnsubscribeWayPointsID" value="47" hexvalue="2F"/>
@@ -2380,6 +2705,7 @@
<element name="OnTouchEventID" value="32780" hexvalue="800C" />
<element name="OnSystemRequestID" value="32781" hexvalue="800D" />
<element name="OnHashChangeID" value="32782" hexvalue="800E" />
+ <element name="OnInteriorVehicleDataID" value="32783" hexvalue="800F" />
<element name="OnWayPointChangeID" value="32784" hexvalue="8010" />
<!--
@@ -2397,7 +2723,6 @@
<element name="OnEncodedSyncPDataID" value="98304" hexvalue="18000" />
<element name="OnSyncPDataID" value="98305" hexvalue="18001" />
-
</enum>
<enum name="messageType">
@@ -2514,6 +2839,7 @@
<element name="PHONE_CALL"/>
<element name="VIDEO_STREAMING"/>
<element name="AUDIO_STREAMING"/>
+ <element name="REMOTE_CONTROL"/>
</enum>
<struct name="NavigationCapability">
@@ -2563,6 +2889,8 @@
</param>
<param name="videoStreamingCapability" type="VideoStreamingCapability" mandatory="false">
</param>
+ <param name="remoteControlCapability" type="RemoteControlCapabilities" mandatory="false">
+ </param>
</struct>
<struct name="Rectangle">
@@ -5274,7 +5602,6 @@
</param>
</function>
-
<!-- Notifications -->
<function name="OnHMIStatus" functionID="OnHMIStatusID" messagetype="notification">
@@ -5614,6 +5941,123 @@
</param>
</function>
+<function name="ButtonPress" functionID="ButtonPressID" messagetype="request">
+ <param name="moduleType" type="ModuleType" mandatory="true" >
+ <description>The module where the button should be pressed</description>
+ </param>
+ <param name="buttonName" type="ButtonName" mandatory="true" >
+ <description>The name of supported RC climate or radio button.</description>
+ </param>
+ <param name="buttonPressMode" type="ButtonPressMode" mandatory="true" >
+ <description>Indicates whether this is a LONG or SHORT button press event.</description>
+ </param>
+</function>
+
+<function name="ButtonPress" functionID="ButtonPressID" messagetype="response">
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true" >
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="IN_USE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true" >
+ <description> true if successful; false, if failed </description>
+ </param>
+</function>
+
+<function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="request">
+ <param name="moduleType" type="ModuleType" mandatory="true" >
+ <description>
+ The type of a RC module to retrieve module data from the vehicle.
+ In the future, this should be the Identification of a module.
+ </description>
+ </param>
+ <param name="subscribe" type="Boolean" mandatory="false" defvalue="false">
+ <description>
+ 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.
+ </description>
+ </param>
+</function>
+
+ <function name="GetInteriorVehicleData" functionID="GetInteriorVehicleDataID" messagetype="response">
+ <param name="moduleData" type="ModuleData" mandatory="true" >
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true" >
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true" >
+ <description> true if successful; false, if failed </description>
+ </param>
+ <param name="isSubscribed" type="Boolean" mandatory="false" >
+ <description>
+ 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.
+ </description>
+ </param>
+
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="request">
+ <param name="moduleData" type="ModuleData" mandatory="true" >
+ <description>The module data to set for the requested RC module.</description>
+ </param>
+ </function>
+
+ <function name="SetInteriorVehicleData" functionID="SetInteriorVehicleDataID" messagetype="response">
+ <description>Used to set the values of one remote control module </description>
+ <param name="moduleData" type="ModuleData" mandatory="true" >
+ </param>
+ <param name="resultCode" type="Result" platform="documentation" mandatory="true" >
+ <description>See Result</description>
+ <element name="SUCCESS"/>
+ <element name="INVALID_DATA"/>
+ <element name="OUT_OF_MEMORY"/>
+ <element name="TOO_MANY_PENDING_REQUESTS"/>
+ <element name="APPLICATION_NOT_REGISTERED"/>
+ <element name="GENERIC_ERROR"/>
+ <element name="REJECTED"/>
+ <element name="IGNORED"/>
+ <element name="DISALLOWED"/>
+ <element name="USER_DISALLOWED"/>
+ <element name="READ_ONLY"/>
+ <element name="UNSUPPORTED_RESOURCE"/>
+ </param>
+ <param name="info" type="String" maxlength="1000" mandatory="false">
+ </param>
+ <param name="success" type="Boolean" platform="documentation" mandatory="true" >
+ <description> true if successful; false, if failed </description>
+ </param>
+ </function>
+
+
+ <function name="OnInteriorVehicleData" functionID="OnInteriorVehicleDataID" messagetype="notification">
+ <param name="moduleData" type="ModuleData" mandatory="true">
+ </param>
+ </function>
<!-- Deprecating - covered by OnSystemRequest
<function name="OnSyncPData" functionID="OnSyncPDataID" messagetype="notification" >
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/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h
index c84a5a884f..7fbd4f2f6f 100644
--- a/src/components/media_manager/include/media_manager/media_manager_impl.h
+++ b/src/components/media_manager/include/media_manager/media_manager_impl.h
@@ -86,9 +86,10 @@ class MediaManagerImpl : public MediaManager,
void set_mock_mic_listener(MediaListenerPtr media_listener);
void set_mock_mic_recorder(MediaAdapterImpl* media_adapter);
void set_mock_streamer(protocol_handler::ServiceType stype,
- MediaAdapterImpl* mock_stream);
- void set_mock_streamer_listener(protocol_handler::ServiceType stype,
- MediaAdapterListener* mock_stream);
+ ::utils::SharedPtr<MediaAdapterImpl> mock_stream);
+ void set_mock_streamer_listener(
+ protocol_handler::ServiceType stype,
+ ::utils::SharedPtr<MediaAdapterListener> mock_stream);
#endif // BUILD_TESTS
protected:
diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc
index b89fc4c71f..6a9ded9029 100644
--- a/src/components/media_manager/src/media_manager_impl.cc
+++ b/src/components/media_manager/src/media_manager_impl.cc
@@ -96,13 +96,15 @@ void MediaManagerImpl::set_mock_mic_recorder(MediaAdapterImpl* media_adapter) {
#endif // EXTENDED_MEDIA_MODE
-void MediaManagerImpl::set_mock_streamer(protocol_handler::ServiceType stype,
- MediaAdapterImpl* mock_stream) {
+void MediaManagerImpl::set_mock_streamer(
+ protocol_handler::ServiceType stype,
+ ::utils::SharedPtr<MediaAdapterImpl> mock_stream) {
streamer_[stype] = mock_stream;
}
void MediaManagerImpl::set_mock_streamer_listener(
- protocol_handler::ServiceType stype, MediaAdapterListener* mock_stream) {
+ protocol_handler::ServiceType stype,
+ ::utils::SharedPtr<MediaAdapterListener> mock_stream) {
streamer_listener_[stype] = mock_stream;
}
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 f9618c7fb8..7d0226fa67 100644
--- a/src/components/media_manager/test/media_manager_impl_test.cc
+++ b/src/components/media_manager/test/media_manager_impl_test.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Ford Motor Company
+ * Copyright (c) 2017, Ford Motor Company
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,147 +33,376 @@
#include "gmock/gmock.h"
#include "media_manager/media_manager_impl.h"
#include "media_manager/mock_media_adapter.h"
-#include "media_manager/mock_media_adapter_listener.h"
#include "media_manager/mock_media_adapter_impl.h"
-#include "protocol_handler/mock_protocol_handler.h"
+#include "media_manager/mock_media_adapter_listener.h"
#include "media_manager/mock_media_manager_settings.h"
-#include "application_manager/mock_application_manager.h"
-#include "utils/shared_ptr.h"
-#include "utils/make_shared.h"
#include "application_manager/event_engine/event_dispatcher.h"
-#include "application_manager/state_controller.h"
+#include "application_manager/message.h"
+#include "application_manager/mock_application.h"
+#include "application_manager/mock_application_manager.h"
#include "application_manager/resumption/resume_ctrl.h"
-#include "resumption/last_state.h"
+#include "application_manager/state_controller.h"
+#include "protocol_handler/mock_protocol_handler.h"
+#include "protocol/common.h"
+#include "utils/make_shared.h"
+#include "utils/shared_ptr.h"
+#include "utils/file_system.h"
+#include "utils/scope_guard.h"
namespace test {
namespace components {
namespace media_manager_test {
+using namespace file_system;
+using namespace ::media_manager;
using ::testing::_;
+using ::testing::Return;
using ::testing::ReturnRef;
-using protocol_handler::ServiceType;
+using ::utils::SharedPtr;
+using ::utils::ScopeGuard;
+using ::utils::MakeGuard;
+using ::testing::NiceMock;
+using ::protocol_handler::ServiceType;
+using ::protocol_handler::RawMessagePtr;
+using application_manager::ApplicationSharedPtr;
+using application_manager::BinaryData;
+
+namespace {
+const uint16_t kVideoStreamingPort = 8901u;
+const uint16_t kAudioStreamingPort = 8000u;
+const int32_t kApplicationKey = 1;
+const int32_t kDuration = 1000;
+const std::string kStorageFolder = "test_storage_folder";
+const std::string kOutputFile = "test_output_file";
+const std::string kResourceFolder = "test_resource_folder";
+const std::string kRecordingFileSource = "test_recording_file_source";
+const std::string kNamedVideoPipePath = "named_video_pipe_path";
+const std::string kNamedAudioPipePath = "named_audio_pipe_path";
+const std::string kVideoStreamFile = "video_stream_file";
+const std::string kAudioStreamFile = "audio_stream_file";
+const std::string kServerAddress = "server_address";
+const std::string kSocketValue = "socket";
+const std::string kPipeValue = "pipe";
+const std::string kFileValue = "file";
+const std::string kDefaultValue = "";
+const std::string kOutputFilePath = kStorageFolder + "/" + kOutputFile;
+const uint32_t kProtocolVersion = ::protocol_handler::PROTOCOL_VERSION_2;
+const uint32_t kConnectionKey = 1u;
+
+void dealloc_data(uint8_t* data) {
+ delete[] data;
+}
+
+void dealloc_file(std::ofstream* test_file) {
+ delete test_file;
+}
+} // namespace
+
+typedef NiceMock<application_manager_test::MockApplication> MockApp;
+typedef SharedPtr<MockApp> MockAppPtr;
+typedef SharedPtr<MockMediaAdapterImpl> MockMediaAdapterImplPtr;
class MediaManagerImplTest : public ::testing::Test {
+ public:
+ // media_adapter_mock_ will be deleted in media_manager_impl (dtor)
+ MediaManagerImplTest() : media_adapter_mock_(new MockMediaAdapter()) {
+ media_adapter_listener_mock_ =
+ utils::MakeShared<MockMediaAdapterListener>();
+ ON_CALL(mock_media_manager_settings_, video_server_type())
+ .WillByDefault(ReturnRef(kDefaultValue));
+ ON_CALL(mock_media_manager_settings_, audio_server_type())
+ .WillByDefault(ReturnRef(kDefaultValue));
+ mock_app_ = ::utils::MakeShared<MockApp>();
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
protected:
+ void StartMicrophoneCheckHelper() {
+ EXPECT_CALL(app_mngr_, application(kApplicationKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillOnce(ReturnRef(kStorageFolder));
+ EXPECT_CALL(mock_media_manager_settings_, app_resource_folder())
+ .WillOnce(ReturnRef(kResourceFolder));
+ EXPECT_CALL(mock_media_manager_settings_, recording_file_source())
+ .WillOnce(ReturnRef(kRecordingFileSource));
+ }
+
+ void InitMediaManagerPrecondition(const std::string& server_type) {
+ EXPECT_CALL(mock_media_manager_settings_, video_server_type())
+ .WillRepeatedly(ReturnRef(server_type));
+ EXPECT_CALL(mock_media_manager_settings_, audio_server_type())
+ .WillRepeatedly(ReturnRef(server_type));
+ }
+
+ void InitMediaManagerSocketServerType() {
+ InitMediaManagerPrecondition(kSocketValue);
+ EXPECT_CALL(mock_media_manager_settings_, server_address())
+ .WillRepeatedly(ReturnRef(kServerAddress));
+ EXPECT_CALL(mock_media_manager_settings_, video_streaming_port())
+ .WillOnce(Return(kVideoStreamingPort));
+ EXPECT_CALL(mock_media_manager_settings_, audio_streaming_port())
+ .WillOnce(Return(kAudioStreamingPort));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void InitMediaManagerPipeServerType() {
+ InitMediaManagerPrecondition(kPipeValue);
+ EXPECT_CALL(mock_media_manager_settings_, named_video_pipe_path())
+ .WillOnce(ReturnRef(kNamedAudioPipePath));
+ EXPECT_CALL(mock_media_manager_settings_, named_audio_pipe_path())
+ .WillOnce(ReturnRef(kNamedAudioPipePath));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillRepeatedly(ReturnRef(kStorageFolder));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void InitMediaManagerFileServerType() {
+ InitMediaManagerPrecondition(kFileValue);
+ EXPECT_CALL(mock_media_manager_settings_, video_stream_file())
+ .WillOnce(ReturnRef(kVideoStreamFile));
+ EXPECT_CALL(mock_media_manager_settings_, audio_stream_file())
+ .WillOnce(ReturnRef(kAudioStreamFile));
+ EXPECT_CALL(mock_media_manager_settings_, app_storage_folder())
+ .WillRepeatedly(ReturnRef(kStorageFolder));
+ media_manager_impl_.reset(
+ new MediaManagerImpl(app_mngr_, mock_media_manager_settings_));
+ }
+
+ void ReceivedMessage(const ServiceType service_type) {
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, service_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(mock_app_));
+ EXPECT_CALL(*mock_app_, WakeUpStreaming(service_type));
+ MockMediaAdapterImplPtr mock_media_streamer =
+ utils::MakeShared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(service_type, mock_media_streamer);
+ media_manager_impl_->set_mock_streamer_listener(
+ service_type, media_adapter_listener_mock_);
+ EXPECT_CALL(*mock_media_streamer, SendData(kConnectionKey, _));
+ EmulateMobileMessage(service_type);
+ }
+
+ void EmulateMobileMessage(const ServiceType serviceType) {
+ const uint32_t data_sending_size = 3u;
+ unsigned char data_sending[data_sending_size] = {0x20, 0x07, 0x01};
+ const RawMessagePtr raw_message_ptr(
+ new ::protocol_handler::RawMessage(kConnectionKey,
+ kProtocolVersion,
+ data_sending,
+ data_sending_size,
+ serviceType));
+ media_manager_impl_->OnMessageReceived(raw_message_ptr);
+ media_manager_impl_->OnMobileMessageSent(raw_message_ptr);
+ }
+
+ application_manager_test::MockApplicationManager app_mngr_;
+ MockAppPtr mock_app_;
+ SharedPtr<MockMediaAdapterListener> media_adapter_listener_mock_;
+ MockMediaAdapter* media_adapter_mock_;
const ::testing::NiceMock<MockMediaManagerSettings>
mock_media_manager_settings_;
- const std::string kDefaultValue_ = "";
+ SharedPtr<MediaManagerImpl> media_manager_impl_;
};
-TEST_F(MediaManagerImplTest, PlayA2DPSource) {
- MockMediaAdapter* media_mock_ = new MockMediaAdapter();
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithUnsupportedServiceType_Cancelled) {
+ EXPECT_CALL(app_mngr_, CanAppStream(_, _)).Times(0);
+ EXPECT_CALL(app_mngr_, application(_)).Times(0);
+ EmulateMobileMessage(ServiceType::kInvalidServiceType);
+}
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithAudioServiceType_ApplicationNotFound_Cancelled) {
+ const ServiceType audio_type = ServiceType::kAudio;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, audio_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EmulateMobileMessage(audio_type);
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithVideoServiceType_ApplicationNotFound_Cancelled) {
+ const ServiceType video_type = ServiceType::kMobileNav;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, video_type))
+ .WillOnce(Return(true));
+ EXPECT_CALL(app_mngr_, application(kConnectionKey))
+ .WillOnce(Return(ApplicationSharedPtr()));
+ EmulateMobileMessage(video_type);
+}
- mediaManagerImpl.set_mock_a2dp_player(media_mock_);
- EXPECT_CALL(*media_mock_, StartActivity(application_key));
- mediaManagerImpl.PlayA2DPSource(application_key);
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithAudioServiceType_ForbidStreaming_Cancelled) {
+ const ServiceType audio_type = ServiceType::kAudio;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, audio_type))
+ .WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, ForbidStreaming(kConnectionKey));
+ EmulateMobileMessage(audio_type);
}
-TEST_F(MediaManagerImplTest, StopA2DPSource) {
- MockMediaAdapter* media_mock_ = new MockMediaAdapter();
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest,
+ OnMessageReceived_WithVideoServiceType_ForbidStreaming_Cancelled) {
+ const ServiceType video_type = ServiceType::kMobileNav;
+ EXPECT_CALL(app_mngr_, CanAppStream(kConnectionKey, video_type))
+ .WillOnce(Return(false));
+ EXPECT_CALL(app_mngr_, ForbidStreaming(kConnectionKey));
+ EmulateMobileMessage(video_type);
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest, OnMessageReceived_WithAudioServiceType_SUCCESS) {
+ ReceivedMessage(ServiceType::kAudio);
+}
- mediaManagerImpl.set_mock_a2dp_player(media_mock_);
- EXPECT_CALL(*media_mock_, StopActivity(application_key));
- mediaManagerImpl.StopA2DPSource(application_key);
+TEST_F(MediaManagerImplTest, OnMessageReceived_WithVideoServiceType_SUCCESS) {
+ ReceivedMessage(ServiceType::kMobileNav);
}
-TEST_F(MediaManagerImplTest, StopMicrophoneRecording) {
- MockMediaAdapterListener* media_adapter_listener_mock_ =
- new MockMediaAdapterListener();
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectSocketValue) {
+ InitMediaManagerSocketServerType();
+}
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
- int32_t application_key = 1;
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectPipeValue) {
+ InitMediaManagerPipeServerType();
+}
+
+TEST_F(MediaManagerImplTest, Init_Settings_ExpectFileValue) {
+ InitMediaManagerFileServerType();
+}
+
+TEST_F(MediaManagerImplTest, PlayA2DPSource_WithCorrectA2DP_SUCCESS) {
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_);
+ EXPECT_CALL(*media_adapter_mock_, StartActivity(kApplicationKey));
+ media_manager_impl_->PlayA2DPSource(kApplicationKey);
+}
+
+TEST_F(MediaManagerImplTest, StopA2DPSource_WithCorrectA2DP_SUCCESS) {
+ media_manager_impl_->set_mock_a2dp_player(media_adapter_mock_);
+ EXPECT_CALL(*media_adapter_mock_, StopActivity(kApplicationKey));
+ media_manager_impl_->StopA2DPSource(kApplicationKey);
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_SourceFileIsWritable_ExpectTrue) {
+ StartMicrophoneCheckHelper();
+ if (!DirectoryExists(kStorageFolder)) {
+ CreateDirectory(kStorageFolder);
+ }
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ EXPECT_TRUE(CreateFile(kOutputFilePath));
- mediaManagerImpl.set_mock_mic_listener(media_adapter_listener_mock_);
+ const std::string record_file_path =
+ kResourceFolder + "/" + kRecordingFileSource;
+ if (!DirectoryExists(kResourceFolder)) {
+ CreateDirectory(kResourceFolder);
+ }
+ EXPECT_FALSE(FileExists(record_file_path));
+ EXPECT_TRUE(CreateFile(record_file_path));
+ std::ofstream* test_file = Open(record_file_path);
+ ScopeGuard file_guard = MakeGuard(dealloc_file, test_file);
+ UNUSED(file_guard);
+ EXPECT_TRUE(test_file->is_open());
+ const uint32_t data_size = 4u;
+ uint8_t* data = new uint8_t[data_size];
+ ScopeGuard data_guard = MakeGuard(dealloc_data, data);
+ UNUSED(data_guard);
+ for (uint32_t i = 0u; i < data_size; ++i) {
+ data[i] = i;
+ }
+ EXPECT_TRUE(Write(test_file, data, data_size));
+ Close(test_file);
+ EXPECT_FALSE(test_file->is_open());
+ BinaryData result;
+ EXPECT_TRUE(ReadBinaryFile(record_file_path, result));
+ EXPECT_FALSE(result.empty());
+ for (uint32_t i = 0u; i < data_size; ++i) {
+ EXPECT_EQ(data[i], result[i]);
+ }
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+ EXPECT_TRUE(RemoveDirectory(kResourceFolder, true));
+ EXPECT_TRUE(RemoveDirectory(kStorageFolder, true));
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_OutputFileNotExists_ExpectFalse) {
+ StartMicrophoneCheckHelper();
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+}
+
+TEST_F(MediaManagerImplTest,
+ StartMicrophoneRecording_OutputFileCouldNotDeleted_ExpectTrue) {
+ StartMicrophoneCheckHelper();
+ if (!DirectoryExists(kStorageFolder)) {
+ CreateDirectory(kStorageFolder);
+ }
+ EXPECT_FALSE(FileExists(kOutputFilePath));
+ EXPECT_TRUE(CreateFile(kOutputFilePath));
+ chmod(kOutputFilePath.c_str(), S_IRUSR);
+ EXPECT_FALSE(DeleteFile(kOutputFilePath));
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
+ EXPECT_TRUE(FileExists(kOutputFilePath));
+ media_manager_impl_->StartMicrophoneRecording(
+ kApplicationKey, kOutputFile, kDuration);
+ chmod(kOutputFilePath.c_str(), S_IWUSR);
+ EXPECT_TRUE(RemoveDirectory(kStorageFolder, true));
+}
+
+TEST_F(MediaManagerImplTest, StopMicrophoneRecording_SUCCESS) {
+ media_manager_impl_->set_mock_mic_listener(media_adapter_listener_mock_);
#ifdef EXTENDED_MEDIA_MODE
MockMediaAdapterImpl* media_adapter_recorder_mock =
new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_mic_recorder(media_adapter_recorder_mock);
- EXPECT_CALL(*media_adapter_recorder_mock, StopActivity(application_key));
+ media_manager_impl_->set_mock_mic_recorder(media_adapter_recorder_mock);
+ EXPECT_CALL(*media_adapter_recorder_mock, StopActivity(kApplicationKey));
#endif // EXTENDED_MEDIA_MODE
- EXPECT_CALL(*media_adapter_listener_mock_, OnActivityEnded(application_key));
+ EXPECT_CALL(*media_adapter_listener_mock_, OnActivityEnded(kApplicationKey));
#ifdef EXTENDED_MEDIA_MODE
EXPECT_CALL(*media_adapter_recorder_mock, RemoveListener(_));
#endif // EXTENDED_MEDIA_MODE
- mediaManagerImpl.StopMicrophoneRecording(application_key);
+ media_manager_impl_->StopMicrophoneRecording(kApplicationKey);
}
-TEST_F(MediaManagerImplTest, StartStopStreaming) {
- application_manager_test::MockApplicationManager mock_application_manager;
+TEST_F(MediaManagerImplTest,
+ StartStopStreaming_AudioAndVideoServiceType_SUCCESS) {
+ MockMediaAdapterImplPtr mock_audio_media_streamer =
+ utils::MakeShared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(ServiceType::kAudio,
+ mock_audio_media_streamer);
+ MockMediaAdapterImplPtr mock_nav_media_streamer =
+ utils::MakeShared<MockMediaAdapterImpl>();
+ media_manager_impl_->set_mock_streamer(ServiceType::kMobileNav,
+ mock_nav_media_streamer);
- ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
-
- int32_t application_key = 1;
- MockMediaAdapterImpl* mock_audio_media_streamer = new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kAudio,
- mock_audio_media_streamer);
- MockMediaAdapterImpl* mock_nav_media_streamer = new MockMediaAdapterImpl();
- mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kMobileNav,
- mock_nav_media_streamer);
-
- EXPECT_CALL(*mock_audio_media_streamer, StartActivity(application_key));
- mediaManagerImpl.StartStreaming(application_key,
- protocol_handler::ServiceType::kAudio);
-
- EXPECT_CALL(*mock_nav_media_streamer, StartActivity(application_key));
- mediaManagerImpl.StartStreaming(application_key,
- protocol_handler::ServiceType::kMobileNav);
-
- EXPECT_CALL(*mock_audio_media_streamer, StopActivity(application_key));
- mediaManagerImpl.StopStreaming(application_key,
- protocol_handler::ServiceType::kAudio);
-
- EXPECT_CALL(*mock_nav_media_streamer, StopActivity(application_key));
- mediaManagerImpl.StopStreaming(application_key,
- protocol_handler::ServiceType::kMobileNav);
+ EXPECT_CALL(*mock_audio_media_streamer, StartActivity(kApplicationKey));
+ media_manager_impl_->StartStreaming(kApplicationKey, ServiceType::kAudio);
+ EXPECT_CALL(*mock_nav_media_streamer, StartActivity(kApplicationKey));
+ media_manager_impl_->StartStreaming(kApplicationKey, ServiceType::kMobileNav);
+ EXPECT_CALL(*mock_audio_media_streamer, StopActivity(kApplicationKey));
+ media_manager_impl_->StopStreaming(kApplicationKey, ServiceType::kAudio);
+ EXPECT_CALL(*mock_nav_media_streamer, StopActivity(kApplicationKey));
+ media_manager_impl_->StopStreaming(kApplicationKey, ServiceType::kMobileNav);
}
-TEST_F(MediaManagerImplTest, CheckFramesProcessed) {
- application_manager_test::MockApplicationManager mock_application_manager;
-
+TEST_F(MediaManagerImplTest,
+ CheckFramesProcessed_WithCorrectFramesNumber_SUCCESS) {
ON_CALL(mock_media_manager_settings_, video_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
+ .WillByDefault(ReturnRef(kDefaultValue));
ON_CALL(mock_media_manager_settings_, audio_server_type())
- .WillByDefault(ReturnRef(kDefaultValue_));
- MediaManagerImpl mediaManagerImpl(mock_application_manager,
- mock_media_manager_settings_);
+ .WillByDefault(ReturnRef(kDefaultValue));
protocol_handler_test::MockProtocolHandler mock_protocol_handler;
- mediaManagerImpl.SetProtocolHandler(&mock_protocol_handler);
- int32_t application_key = 1;
- int32_t frame_number = 10;
-
+ media_manager_impl_->SetProtocolHandler(&mock_protocol_handler);
+ const int32_t frame_number = 10;
EXPECT_CALL(mock_protocol_handler,
- SendFramesNumber(application_key, frame_number));
- mediaManagerImpl.FramesProcessed(application_key, frame_number);
+ SendFramesNumber(kApplicationKey, frame_number));
+ media_manager_impl_->FramesProcessed(kApplicationKey, frame_number);
}
} // namespace media_manager_test
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..fd185af075
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/access_remote.h
@@ -0,0 +1,139 @@
+/*
+ * 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 <vector>
+#include <ostream>
+#include <string>
+#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 };
+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 ApplicationOnDevice {
+ PTString dev_id;
+ PTString app_id;
+};
+inline bool operator<(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id < y.dev_id || (x.dev_id == y.dev_id && x.app_id < y.app_id);
+}
+inline bool operator==(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id == y.dev_id && x.app_id == y.app_id;
+}
+inline std::ostream& operator<<(std::ostream& output,
+ const ApplicationOnDevice& who) {
+ output << "Subject(dev:" << who.dev_id << ", app:" << who.app_id << ")";
+ return output;
+}
+
+typedef std::vector<PTString> RemoteControlParams;
+
+class AccessRemote {
+ public:
+ virtual ~AccessRemote() {}
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ virtual bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const = 0;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ virtual void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ virtual const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) = 0;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ virtual bool IsAppRemoteControl(const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* 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..0fa53b0237
--- /dev/null
+++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h
@@ -0,0 +1,174 @@
+/*
+ * 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 <map>
+#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<CacheManager> cache);
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const OVERRIDE;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) OVERRIDE;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) OVERRIDE;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ bool IsAppRemoteControl(const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) OVERRIDE;
+
+ private:
+ inline void set_enabled(bool value);
+ inline bool country_consent() const;
+ /**
+ * @brief HmiTypes get list of hmi types for application
+ * @param who application on specific device
+ * @return list of hmi types
+ */
+ const policy_table::AppHMITypes& HmiTypes(const ApplicationOnDevice& who);
+
+ /**
+ * @brief GetGroupsIds get list of groups for application
+ * @param device_id device id
+ * @param app_id application id
+ * @param grops_ids output parameter for group ids storing
+ */
+ void GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& grops_ids);
+
+ /**
+ * @brief IsAllowed check if modulename and rpc is allowed for application
+ * @param modules list of access modules
+ * @param module_name module name to check
+ * @param rpc_name rpc name to check
+ * @param input list of rpc parameters
+ * @return true if allowed otherwise return false
+ */
+ bool IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief CompareParameters check if app parameters allowed
+ * @param parameters list of allowed parameters
+ * @param input list of parameters to check
+ * @return true if allowed otherwise return false
+ */
+ bool CompareParameters(const policy_table::Strings& parameters,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief cache_ contains pointer to cache manager instance
+ */
+ utils::SharedPtr<CacheManager> cache_;
+
+ /**
+ * @brief hmi_types_ contains list of default HMI types for applications
+ */
+ typedef std::map<ApplicationOnDevice, policy_table::AppHMITypes> HMIList;
+ HMIList hmi_types_;
+
+#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/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
index 66631f32cf..ae1f8922ba 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h
@@ -36,8 +36,10 @@
#include <string>
#include <vector>
+#include "policy/policy_table/types.h"
+#include "policy/pt_representation.h"
#include "utils/shared_ptr.h"
-#include "usage_statistics/counter.h"
+#include "policy/usage_statistics/counter.h"
#include "policy/policy_types.h"
#include "policy/policy_settings.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..42c1ec0b46 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,7 @@ FunctionalGroupIDs FindSame(const FunctionalGroupIDs& first,
* @return true, if succeded, otherwise - false
*/
bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies);
-}
+
+} // 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..f8d226c86a 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 {
@@ -52,172 +57,557 @@ class PolicyManagerImpl : public PolicyManager {
public:
PolicyManagerImpl();
explicit PolicyManagerImpl(bool in_memory);
- virtual void set_listener(PolicyListener* listener);
+
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
+ void set_listener(PolicyListener* listener) OVERRIDE;
+
+ /**
+ * @brief listener get current policy listener instance
+ * @return current policy listener
+ */
PolicyListener* listener() const {
return listener_;
}
- virtual bool InitPT(const std::string& file_name,
- const PolicySettings* settings);
- virtual bool LoadPT(const std::string& file, const BinaryMessage& pt_content);
- virtual bool ResetPT(const std::string& file_name);
-
- virtual std::string GetUpdateUrl(int service_type);
- virtual void GetUpdateUrls(const uint32_t service_type,
- EndpointUrls& out_end_points);
- virtual void GetUpdateUrls(const std::string& service_type,
- EndpointUrls& out_end_points);
- virtual void RequestPTUpdate();
- virtual void CheckPermissions(const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result);
- virtual bool ResetUserConsent();
- virtual void KmsChanged(int kilometers);
- virtual void IncrementIgnitionCycles();
- virtual std::string ForcePTExchange();
- virtual std::string ForcePTExchangeAtUserRequest();
- virtual std::string GetPolicyTableStatus() const;
- virtual void ResetRetrySequence();
- virtual int NextRetryTimeout();
- virtual uint32_t TimeoutExchangeMSec();
- virtual const std::vector<int> RetrySequenceDelaysSeconds();
- virtual void OnExceededTimeout();
- virtual std::string GetLockScreenIconUrl() const OVERRIDE;
- virtual void OnUpdateStarted();
- virtual void PTUpdatedAt(Counters counter, int value);
-
- /**
- * Refresh data about retry sequence from policy table
+
+ /**
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
+ */
+ bool InitPT(const std::string& file_name,
+ const PolicySettings* settings) OVERRIDE;
+
+ /**
+ * @brief Updates Policy Table from binary message received from
+ * mobile device. Saves to Policy Table diff between Policy Table
+ * sent in snapshot and received Policy Table.
+ * @param file name of file with update policy table
+ * @param pt_content PTU as binary string
+ * @return true if successfully
+ */
+ bool LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) OVERRIDE;
+
+ /**
+ * @brief Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ bool ResetPT(const std::string& file_name) OVERRIDE;
+
+ /**
+ * @brief Gets last URL for sending PTS to from PT itself
+ * @param service_type Service specifies user of URL
+ * @return last URL or empty string if endpoint entry is empty
+ */
+ std::string GetUpdateUrl(int service_type) OVERRIDE;
+
+ /**
+ * @brief Gets all URLs for sending PTS to from PT itself.
+ * @param service_type Service specifies user of URL
+ * @param out_end_points output vector of urls
+ */
+ void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+ void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+
+ /**
+ * @brief PTU is needed, for this PTS has to be formed and sent.
+ */
+ void RequestPTUpdate() OVERRIDE;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed
+ * and list of allowed params.
+ */
+ void CheckPermissions(const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
+
+ /**
+ * @brief Clear all record of user consents. Used during Factory Reset.
+ * @return bool Success of operation
+ */
+ bool ResetUserConsent() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded kilometers
+ * @param kilometers current kilometers at odometer
+ * @return true if exceeded
+ */
+ void KmsChanged(int kilometers) OVERRIDE;
+
+ /**
+ * @brief Increments counter of ignition cycles
+ */
+ void IncrementIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchange() OVERRIDE;
+
+ /**
+ * @brief Exchange by user request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchangeAtUserRequest() OVERRIDE;
+
+ /**
+ * @brief Returns current status of policy table for HMI
+ * @return Current status of policy table
+ */
+ std::string GetPolicyTableStatus() const OVERRIDE;
+
+ /**
+ * @brief Resets retry sequence
+ */
+ void ResetRetrySequence() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
+ * @return timeout in seconds
+ */
+ int NextRetryTimeout() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ uint32_t TimeoutExchangeMSec() OVERRIDE;
+
+ /**
+ * @brief List of timeouts in seconds between retries
+ * when attempt to update PT fails
+ * @return List of delays between attempts.
+ */
+ const std::vector<int> RetrySequenceDelaysSeconds() OVERRIDE;
+
+ /**
+ * @brief Handler of exceeding timeout of exchanging policy table
+ */
+ void OnExceededTimeout() OVERRIDE;
+
+ /**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ * @return url which point to the resourse where lock screen icon could be
+ *obtained.
+ */
+ std::string GetLockScreenIconUrl() const OVERRIDE;
+
+ /**
+ * @brief Handler of PTS sending out
+ */
+ void OnUpdateStarted() OVERRIDE;
+
+ /**
+ * @brief Sets counter value that passed for receiving PT UPdate.
+ */
+ void PTUpdatedAt(Counters counter, int value) OVERRIDE;
+
+ /**
+ * @brief Refresh data about retry sequence from policy table
*/
virtual void RefreshRetrySequence();
- virtual DeviceConsent GetUserConsentForDevice(
+
+ /**
+ * @brief Gets user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @return status of device consent
+ */
+ DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const OVERRIDE;
- virtual void GetUserConsentForApp(
+
+ /**
+ * @brief Gets user consent for application
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetUserConsentForApp(
const std::string& device_id,
const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
- virtual void SetUserConsentForDevice(const std::string& device_id,
- const bool is_allowed);
- virtual bool ReactOnUserDevConsentForApp(const std::string& app_id,
- const bool is_device_allowed);
- virtual bool GetInitialAppData(const std::string& application_id,
- StringArray* nicknames = NULL,
- StringArray* app_hmi_types = NULL);
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
+
+ /**
+ * @brief Set user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @param is_allowed User consent for usage device data connection
+ */
+ void SetUserConsentForDevice(const std::string& device_id,
+ const bool is_allowed) OVERRIDE;
- virtual void AddDevice(const std::string& device_id,
- const std::string& connection_type);
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
+ */
+ bool ReactOnUserDevConsentForApp(const std::string& app_id,
+ const bool is_device_allowed) OVERRIDE;
+
+ /**
+ * @brief Retrieves data from app_policies about app on its registration:
+ * @param application_id - id of registered app
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
+ */
+ bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL) OVERRIDE;
+
+ /**
+ * @brief Add's device to policy table
+ * @param device_id Device mac address
+ * @param connection_type Device connection type
+ */
+ void AddDevice(const std::string& device_id,
+ const std::string& connection_type) OVERRIDE;
- virtual void SetDeviceInfo(const std::string& device_id,
- const DeviceInfo& device_info);
+ /**
+ * @brief Stores device parameters received during application registration
+ * to policy table
+ * @param device_id Device mac address
+ * @param device_info Received device parameters
+ */
+ void SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) OVERRIDE;
+ /**
+ * @brief Set user consent for application functional groups
+ * @param permissions User-defined application group pemissions.
+ * The permissions is not const reference because it may contains
+ * valid data as well as invalid. So we will remove all invalid data
+ * from this structure.
+ * @param mode notification mode
+ */
void SetUserConsentForApp(const PermissionConsent& permissions,
const NotificationMode mode) OVERRIDE;
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
- std::string* default_hmi) const;
+ /**
+ * @brief Get default HMI level for application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value
+ * was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const OVERRIDE;
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string* priority) const;
+ /**
+ * @brief Get priority for application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) const OVERRIDE;
- virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
+ /**
+ * @brief Get user friendly messages for given RPC messages and language
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @param active_hmi_language Currently active language
+ * @return Array of structs with appropriate message parameters
+ */
+ std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
const std::vector<std::string>& message_code,
const std::string& language,
- const std::string& active_hmi_language);
+ const std::string& active_hmi_language) OVERRIDE;
- virtual bool IsApplicationRevoked(const std::string& app_id) const;
+ /**
+ * @brief Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id) const OVERRIDE;
- virtual void GetPermissionsForApp(
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetPermissionsForApp(
const std::string& device_id,
const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
- virtual std::string& GetCurrentDeviceId(
- const std::string& policy_app_id) const;
+ /**
+ * @brief Return device id, which hosts specific application
+ * @param policy_app_id Application id, which is required to update device id
+ */
+ std::string& GetCurrentDeviceId(
+ const std::string& policy_app_id) const OVERRIDE;
- virtual void SetSystemLanguage(const std::string& language);
+ /**
+ * @brief Set current system language
+ * @param language Language
+ */
+ void SetSystemLanguage(const std::string& language) OVERRIDE;
- virtual void SetSystemInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
- virtual void OnSystemReady();
+ /**
+ * @brief Set data from GetSystemInfo response to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) OVERRIDE;
- virtual uint32_t GetNotificationsNumber(
- const std::string& priority) const OVERRIDE;
+ /**
+ * @brief Runs necessary operations, which is depends on external system
+ * state, e.g. getting system-specific parameters which are need to be
+ * filled into policy table
+ */
+ void OnSystemReady() OVERRIDE;
- virtual void SetVINValue(const std::string& value);
+ /**
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
+ */
+ uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE;
- // Interface StatisticsManager (begin)
- virtual void Increment(usage_statistics::GlobalCounterId type);
- virtual void Increment(const std::string& app_id,
- usage_statistics::AppCounterId type);
- virtual void Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value);
- virtual void Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int32_t timespan_seconds);
- // Interface StatisticsManager (end)
+ /**
+ * @brief Allows to update Vehicle Identification Number in policy table.
+ * @param new value for the parameter.
+ */
+ void SetVINValue(const std::string& value) OVERRIDE;
- AppPermissions GetAppPermissionsChanges(const std::string& policy_app_id);
- void RemovePendingPermissionChanges(const std::string& app_id);
+ /**
+ * @brief Gets specific application permissions changes since last policy
+ * table update
+ * @param policy_app_id Unique application id
+ * @return Permissions changes
+ */
+ AppPermissions GetAppPermissionsChanges(
+ const std::string& policy_app_id) OVERRIDE;
- void SendNotificationOnPermissionsUpdated(const std::string& application_id);
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
+ void RemovePendingPermissionChanges(const std::string& app_id) OVERRIDE;
- bool CleanupUnpairedDevices();
+ /**
+ * @brief Send OnPermissionsUpdated for choosen application
+ * @param application_id Unique application id
+ */
+ void SendNotificationOnPermissionsUpdated(
+ const std::string& application_id) OVERRIDE;
- bool CanAppKeepContext(const std::string& app_id) const;
- bool CanAppStealFocus(const std::string& app_id) const;
- void MarkUnpairedDevice(const std::string& device_id);
+ /**
+ * @brief Removes unpaired device records and related records from DB
+ * @return true, if succedeed, otherwise - false
+ */
+ bool CleanupUnpairedDevices() OVERRIDE;
+ /**
+ * @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
+ */
+ bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
+ */
+ bool CanAppStealFocus(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief Marks device as upaired
+ * @param device_id id device
+ */
+ void MarkUnpairedDevice(const std::string& device_id) OVERRIDE;
+
+ /**
+ * @brief Adds, application to the db or update existed one
+ * run PTU if policy update is necessary for application.
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
+ * @return function that will notify update manager about new application
+ */
StatusNotifier AddApplication(
const std::string& application_id,
- const rpc::policy_table_interface_base::AppHmiTypes& hmi_types);
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
+
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) OVERRIDE;
+
+ /**
+ * @brief 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
+ */
+ bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) OVERRIDE;
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ void set_access_remote(utils::SharedPtr<AccessRemote> access_remote) OVERRIDE;
+
+ /**
+ * @brief Sends notification about application HMI level changed
+ * @param who application information structure
+ */
+ void SendHMILevelChanged(const ApplicationOnDevice& who);
+
+ /**
+ * @brief Sends notification if application permissions were changed
+ * @param application_id Unique id of application
+ */
+ void OnPrimaryGroupsChanged(const std::string& application_id);
+#endif // SDL_REMOTE_CONTROL
+
+ /**
+ * @brief Removes consent for application functional group
+ * @param application_id Unique id of application
+ * @param group_name application functional group name
+ */
virtual void RemoveAppConsentForGroup(const std::string& app_id,
const std::string& group_name);
- virtual uint32_t HeartBeatTimeout(const std::string& app_id) const;
+ /**
+ * @brief Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint32_t HeartBeatTimeout(const std::string& app_id) const OVERRIDE;
- virtual void SaveUpdateStatusRequired(bool is_update_needed);
+ /**
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
+ */
+ void SaveUpdateStatusRequired(bool is_update_needed) OVERRIDE;
- virtual bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
- void set_cache_manager(CacheManagerInterface* cache_manager);
+ /**
+ * @brief Checks, if application has policy assigned w/o data consent
+ * @param policy_app_id Unique application id
+ * @return true, if policy assigned w/o data consent, otherwise -false
+ */
+ bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
- virtual void OnAppsSearchStarted();
+ /**
+ * @brief Setter for cache_manager instance
+ * @param cache_manager pointer to new cache_manager instance
+ */
+ void set_cache_manager(CacheManagerInterface* cache_manager);
- virtual void OnAppsSearchCompleted(const bool trigger_ptu);
+ /**
+ * @brief Handler on applications search started
+ */
+ void OnAppsSearchStarted() OVERRIDE;
-#ifdef BUILD_TESTS
- inline CacheManagerInterfaceSPtr GetCache() {
- return cache_;
- }
- inline void SetSendOnUpdateFlags(const bool send_on_update_sent_out,
- const bool wrong_ptu_update_received) {
- send_on_update_sent_out_ = send_on_update_sent_out;
- wrong_ptu_update_received_ = wrong_ptu_update_received;
- }
-#endif // BUILD_TESTS
+ /**
+ * @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
- virtual const std::vector<std::string> GetAppRequestTypes(
- const std::string policy_app_id) const;
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request types of application
+ */
+ const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const OVERRIDE;
- virtual const VehicleInfo GetVehicleInfo() const;
+ /**
+ * @brief Get information about vehicle
+ * @return vehicle information
+ */
+ const VehicleInfo GetVehicleInfo() const OVERRIDE;
- virtual void OnAppRegisteredOnMobile(const std::string& application_id);
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * @param application_id registered application.
+ */
+ void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
- virtual const MetaInfo GetMetaInfo() const OVERRIDE;
+ /**
+ * @brief Gets meta information
+ * @return meta information
+ */
+ const MetaInfo GetMetaInfo() const OVERRIDE;
- virtual std::string RetrieveCertificate() const OVERRIDE;
+ /**
+ * @brief RetrieveCertificate Allows to obtain certificate in order
+ * to start secure connection.
+ * @return The certificate in PKCS#7 format.
+ */
+ std::string RetrieveCertificate() const OVERRIDE;
- virtual bool HasCertificate() const OVERRIDE;
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ bool HasCertificate() const OVERRIDE;
- virtual void SetDecryptedCertificate(const std::string& certificate) OVERRIDE;
+ /**
+ * @brief Sets decrypted certificate in policy table
+ * @param certificate content of certificate
+ */
+ void SetDecryptedCertificate(const std::string& certificate) OVERRIDE;
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
const PolicySettings& get_settings() const OVERRIDE;
+ /**
+ * @brief Finds the next URL that must be sent on OnSystemRequest retry
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of policy application id and application url id from the
+ * urls vector
+ */
AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+ /**
+ * @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
+ * application index
+ * @param rs contains the application index and url index from the
+ * urls vector that are to be sent on the next OnSystemRequest
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of application index and url index
+ */
AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
const EndpointUrls& urls) const OVERRIDE;
@@ -228,20 +618,90 @@ class PolicyManagerImpl : public PolicyManager {
* @return true if such check is needed, false - if not.
*/
bool IsNeedToUpdateExternalConsentStatus(
- const ExternalConsentStatus& status) const;
+ const ExternalConsentStatus& status) const OVERRIDE;
+
+ /**
+ * @brief Saves customer connectivity settings status
+ * @param status ExternalConsent status
+ * @return true if succeeded, otherwise - false
+ */
+ bool SetExternalConsentStatus(const ExternalConsentStatus& status) OVERRIDE;
/**
* @brief Gets customer connectivity settings status
* @return ExternalConsent status
*/
- bool SetExternalConsentStatus(const ExternalConsentStatus& status) OVERRIDE;
ExternalConsentStatus GetExternalConsentStatus() OVERRIDE;
+#ifdef BUILD_TESTS
+ /**
+ * @brief Getter for cache_manager instance
+ * @return cache_manager instance
+ */
+ inline CacheManagerInterfaceSPtr GetCache() {
+ return cache_;
+ }
+
+ /**
+ * @brief Setter for send_on_update_sent_out and wrong_ptu_update_received
+ * @param send_on_update_sent_out new value of this flag
+ * @param wrong_ptu_update_received new value of this flag
+ */
+ inline void SetSendOnUpdateFlags(const bool send_on_update_sent_out,
+ const bool wrong_ptu_update_received) {
+ send_on_update_sent_out_ = send_on_update_sent_out;
+ wrong_ptu_update_received_ = wrong_ptu_update_received;
+ }
+#endif // BUILD_TESTS
+
+ // Interface StatisticsManager (begin)
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
+ void Increment(usage_statistics::GlobalCounterId type) OVERRIDE;
+
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) OVERRIDE;
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) OVERRIDE;
+
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) OVERRIDE;
+ // Interface StatisticsManager (end)
+
protected:
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
virtual utils::SharedPtr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
private:
+ /**
+ * @brief Checks if PT update should be started and schedules it if needed
+ */
void CheckTriggers();
/**
@@ -339,12 +799,73 @@ class PolicyManagerImpl : public PolicyManager {
const std::string& policy_app_id,
const std::vector<FunctionalGroupPermission>& current_permissions);
- virtual void StartPTExchange();
- virtual bool ExceededDays();
- virtual bool ExceededIgnitionCycles();
+ /**
+ * @brief StartPTExchange allows to start PTU. The function will check
+ * if one is required and starts the update flow in only case when previous
+ * condition is true.
+ */
+ void StartPTExchange() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded days
+ * @return true if exceeded
+ */
+ bool ExceededDays() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ bool ExceededIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Checks is specified policy table valid
+ * @param policy_table pointer to policy table to check
+ * @param type policy table type
+ * @return true if policy table valid, otherwise false
+ */
bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of RPC param/HMI permissions
+ */
+ void GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data);
+
+ /**
+ * @brief 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;
+
+ /**
+ * @brief 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
+ */
+ void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+
/**
* @brief Notify application about its permissions changes by preparing and
* sending OnPermissionsChanged notification
@@ -445,11 +966,35 @@ class PolicyManagerImpl : public PolicyManager {
GroupsNames& out_allowed_groups,
GroupsNames& out_disallowed_groups) const;
+ /**
+ * @brief pointer to policy table listener for callbacks
+ */
PolicyListener* listener_;
+ /**
+ * @brief UpdateStatusManager instance for controlling PT status
+ */
UpdateStatusManager update_status_manager_;
+
+ /**
+ * @brief pointer to CacheManagerInterface instance for getting policy data
+ */
CacheManagerInterfaceSPtr cache_;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief pointer to AccessRemote instance for working with RC applications
+ */
+ utils::SharedPtr<AccessRemote> access_remote_;
+#endif
+
+ /**
+ * @brief lock guard for protecting applications list access
+ */
sync_primitives::Lock apps_registration_lock_;
+
+ /**
+ * @brief lock guard for protecting application permissions access
+ */
sync_primitives::Lock app_permissions_diff_lock_;
/**
@@ -461,22 +1006,22 @@ class PolicyManagerImpl : public PolicyManager {
PendingPermissions app_permissions_diff_;
/**
- * Timeout to wait response with UpdatePT
+ * @brief Timeout to wait response with UpdatePT
*/
- int retry_sequence_timeout_;
+ uint32_t retry_sequence_timeout_;
/**
- * Seconds between retries to update PT
+ * @brief Seconds between retries to update PT
*/
std::vector<int> retry_sequence_seconds_;
/**
- * Current index trying of retry sequence
+ * @brief Current index trying of retry sequence
*/
uint32_t retry_sequence_index_;
/**
- * Lock for guarding retry sequence
+ * @brief Lock for guarding retry sequence
*/
sync_primitives::Lock retry_sequence_lock_;
@@ -486,8 +1031,14 @@ class PolicyManagerImpl : public PolicyManager {
*/
mutable std::string last_device_id_;
+ /**
+ * @brief Flag for checking first ignition cycle
+ */
bool ignition_check;
+ /**
+ * @brief Pointer to current policy settings structure
+ */
const PolicySettings* settings_;
friend struct CheckAppPolicy;
@@ -498,8 +1049,19 @@ class PolicyManagerImpl : public PolicyManager {
RetrySequenceURL retry_sequence_url_;
friend struct ProccessAppGroups;
+ /**
+ * @brief Flag for notifying that invalid PTU was received
+ */
bool wrong_ptu_update_received_;
+
+ /**
+ * @brief Flag for notifying that PTU was started
+ */
bool send_on_update_sent_out_;
+
+ /**
+ * @brief Flag for notifying that invalid PTU should be triggered
+ */
bool trigger_ptu_;
};
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..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
@@ -102,6 +102,12 @@ typedef Map<DeviceParams, 0, 255> DeviceData;
typedef Array<Enum<RequestType>, 0, 255> RequestsTypeArray;
+#ifdef SDL_REMOTE_CONTROL
+typedef Map<Strings, 0, 255> RemoteRpcs;
+typedef Map<RemoteRpcs, 0, 255> AccessModules;
+typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
+#endif // SDL_REMOTE_CONTROL
+
typedef AppHMIType AppHmiType;
typedef std::vector<AppHMIType> AppHmiTypes;
@@ -169,6 +175,9 @@ struct ApplicationParams : PolicyBase {
Optional<RequestTypes> RequestType;
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
+#ifdef SDL_REMOTE_CONTROL
+ mutable Optional<ModuleTypes> moduleType;
+#endif // SDL_REMOTE_CONTROL
public:
ApplicationParams();
@@ -188,6 +197,9 @@ struct ApplicationParams : PolicyBase {
private:
bool Validate() const;
+#ifdef SDL_REMOTE_CONTROL
+ bool ValidateModuleTypes() const;
+#endif // SDL_REMOTE_CONTROL
};
struct ApplicationPoliciesSection : CompositeType {
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/include/policy/sql_pt_queries.h b/src/components/policy/policy_external/include/policy/sql_pt_queries.h
index 685c84742f..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,27 +117,15 @@ 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 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;
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 b3ce0a69be..54dfb9f0b7 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,23 @@ class SQLPTRepresentation : public virtual PTRepresentation {
}
#endif // BUILD_TESTS
protected:
+#ifdef SDL_REMOTE_CONTROL
+ enum TypeAccess { kAllowed, kManual };
+ 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 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..d042d8c402
--- /dev/null
+++ b/src/components/policy/policy_external/src/access_remote_impl.cc
@@ -0,0 +1,261 @@
+/*
+ * 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 <algorithm>
+#include <iterator>
+#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 ToHMIType {
+ policy_table::AppHMITypes::value_type operator()(int item) const {
+ policy_table::AppHMIType type = static_cast<policy_table::AppHMIType>(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<std::string>(item);
+ }
+ };
+};
+
+struct ToModuleType {
+ std::string operator()(policy_table::ModuleTypes::value_type item) const {
+ policy_table::ModuleType type = static_cast<policy_table::ModuleType>(item);
+ return EnumToJsonString(type);
+ }
+};
+
+AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
+
+AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
+ : cache_(cache) {}
+
+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::SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& 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 ApplicationOnDevice& 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 ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetGroups(who.app_id);
+}
+
+bool AccessRemoteImpl::IsAppRemoteControl(const ApplicationOnDevice& 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<FunctionalGroupIDs::value_type>(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) {
+ ApplicationOnDevice 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<std::string>* 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<policy_table::ModuleTypes> 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..3041323489 100644
--- a/src/components/policy/policy_external/src/policy_helper.cc
+++ b/src/components/policy/policy_external/src/policy_helper.cc
@@ -865,4 +865,5 @@ bool UnwrapAppPolicies(policy_table::ApplicationPolicies& app_policies) {
return true;
}
-}
+
+} // 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..db858cd2e4 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<CacheManager>(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<CacheManager>(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;
@@ -268,6 +283,9 @@ std::string PolicyManagerImpl::GetLockScreenIconUrl() const {
bool PolicyManagerImpl::LoadPT(const std::string& file,
const BinaryMessage& pt_content) {
LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
// Parse message into table struct
utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content);
@@ -578,7 +596,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
+ ApplicationOnDevice 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 +781,14 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
LOG4CXX_INFO(logger_,
"Send notification for application_id:" << application_id);
+#ifdef SDL_REMOTE_CONTROL
+ const ApplicationOnDevice who = {device_id, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+ return;
+ }
+#endif // SDL_REMOTE_CONTROL
+
std::string default_hmi;
GetDefaultHmi(application_id, &default_hmi);
@@ -1135,7 +1167,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;
@@ -1880,4 +1922,122 @@ 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<std::string>(*i) << " ";
+ }
+ return output;
+}
+
+#ifdef SDL_REMOTE_CONTROL
+void PolicyManagerImpl::SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) {
+ LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ ApplicationOnDevice 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<int>* 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;
+}
+
+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);
+}
+
+void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
+ std::string default_hmi("NONE");
+ if (GetDefaultHmi(who.app_id, &default_hmi)) {
+ 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<FunctionalGroupPermission> 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<FunctionalGroupPermission>::const_iterator it =
+ app_group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::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, &notification_data);
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+}
+
+void PolicyManagerImpl::OnPrimaryGroupsChanged(
+ const std::string& application_id) {
+ const std::vector<std::string> devices =
+ listener()->GetDevicesIds(application_id);
+ for (std::vector<std::string>::const_iterator i = devices.begin();
+ i != devices.end();
+ ++i) {
+ const ApplicationOnDevice who = {*i, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ SendAppPermissionsChanged(who.dev_id, who.app_id);
+ }
+ }
+}
+
+bool PolicyManagerImpl::GetModuleTypes(
+ const std::string& application_id,
+ std::vector<std::string>* modules) const {
+ return access_remote_->GetModuleTypes(application_id, modules);
+}
+
+void PolicyManagerImpl::set_access_remote(
+ utils::SharedPtr<AccessRemote> 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..168ff86b27 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;
}
@@ -468,6 +469,8 @@ const char* EnumToJsonString(AppHMIType val) {
return "SYSTEM";
case AHT_PROJECTION:
return "PROJECTION";
+ case AHT_REMOTE_CONTROL:
+ return "REMOTE_CONTROL";
default:
return "";
}
@@ -506,6 +509,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;
}
@@ -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..e66b2cb561 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,12 @@ 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
+ , moduleType(impl::ValueMember(value__, "moduleType"))
+#endif // SDL_REMOTE_CONTROL
+{
+}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -250,6 +254,9 @@ 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("moduleType", moduleType, &result__);
+#endif // SDL_REMOTE_CONTROL
return result__;
}
@@ -271,6 +278,11 @@ bool ApplicationParams::is_valid() const {
if (!heart_beat_timeout_ms.is_valid()) {
return false;
}
+#ifdef SDL_REMOTE_CONTROL
+ if (!moduleType.is_valid()) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
return Validate();
}
@@ -297,6 +309,11 @@ bool ApplicationParams::struct_empty() const {
if (heart_beat_timeout_ms.is_initialized()) {
return false;
}
+#ifdef SDL_REMOTE_CONTROL
+ if (moduleType.is_initialized()) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
return true;
}
@@ -339,6 +356,12 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
heart_beat_timeout_ms.ReportErrors(
&report__->ReportSubobject("heart_beat_timeout_ms"));
}
+
+#ifdef SDL_REMOTE_CONTROL
+ if (!moduleType.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
+ }
+#endif // SDL_REMOTE_CONTROL
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -347,6 +370,9 @@ 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
+ moduleType.SetPolicyTableType(pt_type);
+#endif // SDL_REMOTE_CONTROL
}
// RpcParameters 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<T>::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<ModuleType> 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<ModuleTypes>(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..e3e1029692 100644
--- a/src/components/policy/policy_external/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_external/src/sql_pt_queries.cc
@@ -76,9 +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,"
- " `country_consent_passengersRC` BOOL "
+ " `certificate` VARCHAR (45) "
"); "
"CREATE TABLE IF NOT EXISTS `functional_group`( "
" `id` INTEGER PRIMARY KEY NOT NULL, "
@@ -353,70 +351,12 @@ 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`); "
-
- "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`); "
-
- /* 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`( "
@@ -486,71 +426,27 @@ 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 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 =
- "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 `zone_id` = ? AND `user_consent_needed` = ?";
+ " WHERE `user_consent_needed` = ?";
const std::string kInsertRemoteRpc =
"INSERT INTO `remote_rpc` (`module_id`, `name`, `parameter`) "
@@ -606,22 +502,7 @@ 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 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 `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`; "
@@ -672,9 +553,6 @@ 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 `interior_zone`; "
"DELETE FROM `access_module`; "
"DELETE FROM `version`; "
"DELETE FROM `message_type`; "
@@ -776,8 +654,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` = ? ";
const std::string kInsertEndpoint =
"INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
@@ -828,8 +705,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` , `country_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 1732f3c774..7f67ed82f6 100644
--- a/src/components/policy/policy_external/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_external/src/sql_pt_representation.cc
@@ -764,6 +764,19 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
+
+#ifdef SDL_REMOTE_CONTROL
+ 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 +966,7 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
return false;
}
+
if (!query_delete.Exec(sql_pt::kDeleteApplication)) {
LOG4CXX_WARN(logger_, "Incorrect delete from application.");
return false;
@@ -1033,6 +1047,16 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
+
+#ifdef SDL_REMOTE_CONTROL
+
+ 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;
}
@@ -1596,6 +1620,199 @@ bool SQLPTRepresentation::GatherAppGroup(
return true;
}
+#ifdef SDL_REMOTE_CONTROL
+
+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::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,
@@ -1699,8 +1916,9 @@ 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));
+ 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..486c27590d
--- /dev/null
+++ b/src/components/policy/policy_external/test/include/policy/mock_access_remote.h
@@ -0,0 +1,73 @@
+/*
+ * 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 MockAccessRemote : public policy::AccessRemote {
+ public:
+ MOCK_CONST_METHOD3(
+ FindGroup,
+ policy::PTString(const policy::ApplicationOnDevice& who,
+ const policy::PTString& rpc,
+ const policy::RemoteControlParams& params));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const policy::ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD1(
+ GetGroups,
+ const policy_table::Strings&(const policy::ApplicationOnDevice& 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::ApplicationOnDevice& who));
+ MOCK_METHOD2(GetModuleTypes,
+ bool(const std::string& application_id,
+ std::vector<std::string>* 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/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
index ce34ca4400..0608799535 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc
@@ -243,7 +243,7 @@ PolicyManagerImplTest2::PolicyManagerImplTest2()
, device_id_1_("XXX123456789ZZZ")
, device_id_2_("08-00-27-CE-76-FE")
, application_id_("1234")
- , app_storage_folder_("storage1")
+ , app_storage_folder_("storage_PolicyManagerImplTest2")
, preloaded_pt_filename_(kSdlPreloadedPtJson)
, in_memory_(true)
, policy_manager_(NULL)
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..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
@@ -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<policy_handler_test::MockPolicySettings>(
@@ -407,7 +407,7 @@ TEST_F(SQLPTRepresentationTest,
query.Prepare(query_select);
query.Next();
- const int policy_tables_number = 35;
+ const int policy_tables_number = 32;
ASSERT_EQ(policy_tables_number, query.GetInteger(0));
const std::string query_select_count_of_iap_buffer_full =
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..c4de9b7e1f
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/access_remote.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_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_H_
+
+#include <vector>
+#include <ostream>
+#include <string>
+#include "policy/policy_table/types.h"
+#include "policy/policy_types.h"
+
+namespace policy_table = ::rpc::policy_table_interface_base;
+
+namespace policy {
+struct ApplicationOnDevice {
+ PTString dev_id;
+ PTString app_id;
+};
+inline bool operator<(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id < y.dev_id || (x.dev_id == y.dev_id && x.app_id < y.app_id);
+}
+inline bool operator==(const ApplicationOnDevice& x,
+ const ApplicationOnDevice& y) {
+ return x.dev_id == y.dev_id && x.app_id == y.app_id;
+}
+inline std::ostream& operator<<(std::ostream& output,
+ const ApplicationOnDevice& who) {
+ output << "Subject(dev:" << who.dev_id << ", app:" << who.app_id << ")";
+ return output;
+}
+
+typedef std::vector<PTString> RemoteControlParams;
+
+class AccessRemote {
+ public:
+ virtual ~AccessRemote() {}
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ virtual bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const = 0;
+
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ virtual void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) = 0;
+
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ virtual const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ virtual bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) = 0;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ virtual bool IsAppRemoteControl(const ApplicationOnDevice& who) = 0;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ virtual bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) = 0;
+};
+
+} // namespace policy
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_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..933690dc49
--- /dev/null
+++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h
@@ -0,0 +1,169 @@
+/*
+ * 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_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_ACCESS_REMOTE_IMPL_H_
+
+#include <map>
+#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<CacheManager> cache);
+ /**
+ * @brief CheckModuleType check if module type is allowed for application
+ * @param app_id application id
+ * @param module module
+ * @return true if allowed, if not - false
+ */
+ bool CheckModuleType(const PTString& app_id,
+ policy_table::ModuleType module) const OVERRIDE;
+ /**
+ * @brief SetDefaultHmiTypes setup default hmi typed for application
+ * @param who application on specific device
+ * @param hmi_types hmi types list
+ */
+ void SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types) OVERRIDE;
+ /**
+ * @brief GetGroups return list of groups for applicaiton
+ * @param who application on specific device
+ * @return list of groups
+ */
+ const policy_table::Strings& GetGroups(
+ const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetPermissionsForApp read list of permissions for application
+ * @param device_id device
+ * @param app_id application
+ * @param group_types output parameter for permissions
+ * @return true
+ */
+ bool GetPermissionsForApp(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalIdType& group_types) OVERRIDE;
+
+ /**
+ * @brief IsAppRemoteControl check is app is remote controll
+ * @param who application on specific device
+ * @return true is remote controll aotherwise return false
+ */
+ bool IsAppRemoteControl(const ApplicationOnDevice& who) OVERRIDE;
+
+ /**
+ * @brief GetModuleTypes get list of module types of application
+ * @param policy_app_id application id
+ * @param modules output parameter for module types
+ * @return true on success otherwise false
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) OVERRIDE;
+
+ private:
+ /**
+ * @brief HmiTypes get list of hmi types for application
+ * @param who application on specific device
+ * @return list of hmi types
+ */
+ const policy_table::AppHMITypes& HmiTypes(const ApplicationOnDevice& who);
+
+ /**
+ * @brief GetGroupsIds get list of groups for application
+ * @param device_id device id
+ * @param app_id application id
+ * @param grops_ids output parameter for group ids storing
+ */
+ void GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& grops_ids);
+
+ /**
+ * @brief IsAllowed check if modulename and rpc is allowed for application
+ * @param modules list of access modules
+ * @param module_name module name to check
+ * @param rpc_name rpc name to check
+ * @param input list of rpc parameters
+ * @return true if allowed otherwise return false
+ */
+ bool IsAllowed(const policy_table::AccessModules& modules,
+ const std::string& module_name,
+ const std::string& rpc_name,
+ RemoteControlParams* input) const;
+ /**
+ * @brief CompareParameters check if app parameters allowed
+ * @param parameters list of allowed parameters
+ * @param input list of parameters to check
+ * @return true if allowed otherwise return false
+ */
+ bool CompareParameters(const policy_table::Strings& parameters,
+ RemoteControlParams* input) const;
+
+ /**
+ * @brief cache_ contains pointer to cache manager instance
+ */
+ utils::SharedPtr<CacheManager> cache_;
+
+ /**
+ * @brief hmi_types_ contains list of default HMI types for applications
+ */
+ typedef std::map<ApplicationOnDevice, policy_table::AppHMITypes> HMIList;
+ HMIList hmi_types_;
+
+#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_REGULAR_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
@@ -325,6 +325,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<policy_table::Table> GetPT() const {
+ utils::SharedPtr<policy_table::Table> 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
@@ -323,6 +323,14 @@ class CacheManagerInterface {
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<policy_table::Table> GetPT() const = 0;
-#endif
+ virtual utils::SharedPtr<policy_table::Table> pt() const = 0;
};
typedef utils::SharedPtr<CacheManagerInterface> CacheManagerInterfaceSPtr;
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..1b39392c0c 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;
@@ -56,185 +60,626 @@ struct CheckAppPolicy;
class PolicyManagerImpl : public PolicyManager {
public:
PolicyManagerImpl();
- virtual void set_listener(PolicyListener* listener);
+
+ /**
+ * @brief set_listener set new policy listener instance
+ * @param listener new policy listener
+ */
+ void set_listener(PolicyListener* listener) OVERRIDE;
+
+ /**
+ * @brief listener get current policy listener instance
+ * @return current policy listener
+ */
PolicyListener* listener() const {
return listener_;
}
- virtual bool InitPT(const std::string& file_name,
- const PolicySettings* settings);
- virtual bool LoadPT(const std::string& file, const BinaryMessage& pt_content);
- virtual bool ResetPT(const std::string& file_name);
-
- virtual void GetUpdateUrls(const uint32_t service_type,
- EndpointUrls& out_end_points);
- virtual void GetUpdateUrls(const std::string& service_type,
- EndpointUrls& out_end_points);
-
- virtual std::string GetLockScreenIconUrl() const;
- virtual bool RequestPTUpdate();
- virtual void CheckPermissions(const PTString& device_id,
- const PTString& app_id,
- const PTString& hmi_level,
- const PTString& rpc,
- const RPCParams& rpc_params,
- CheckPermissionResult& result) OVERRIDE;
- virtual bool ResetUserConsent();
- virtual void KmsChanged(int kilometers);
- virtual void IncrementIgnitionCycles();
- virtual std::string ForcePTExchange();
- virtual std::string ForcePTExchangeAtUserRequest();
- virtual std::string GetPolicyTableStatus() const;
- virtual void ResetRetrySequence();
- virtual uint32_t NextRetryTimeout();
- virtual uint32_t TimeoutExchangeMSec();
- virtual const std::vector<int> RetrySequenceDelaysSeconds();
- virtual void OnExceededTimeout();
- virtual void OnUpdateStarted();
- virtual void PTUpdatedAt(Counters counter, int value);
-
- /**
- * Refresh data about retry sequence from policy table
+
+ /**
+ * @brief Inits Policy Table
+ * @param file_name path to preloaded PT file
+ * @param settings pointer to policy init settings
+ * @return true if init is successful
+ */
+ bool InitPT(const std::string& file_name,
+ const PolicySettings* settings) OVERRIDE;
+
+ /**
+ * @brief Updates Policy Table from binary message received from
+ * mobile device. Saves to Policy Table diff between Policy Table
+ * sent in snapshot and received Policy Table.
+ * @param file name of file with update policy table
+ * @param pt_content PTU as binary string
+ * @return true if successfully
+ */
+ bool LoadPT(const std::string& file,
+ const BinaryMessage& pt_content) OVERRIDE;
+
+ /**
+ * @brief Resets Policy Table
+ * @param file_name Path to preloaded PT file
+ * @return true if successfully
+ */
+ bool ResetPT(const std::string& file_name) OVERRIDE;
+
+ /**
+ * @brief Gets all URLs for sending PTS to from PT itself.
+ * @param service_type Service specifies user of URL
+ * @param out_end_points output vector of urls
+ */
+ void GetUpdateUrls(const uint32_t service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+ void GetUpdateUrls(const std::string& service_type,
+ EndpointUrls& out_end_points) OVERRIDE;
+
+ /**
+ * @brief GetLockScreenIcon allows to obtain lock screen icon url;
+ * @return url which point to the resourse where lock screen icon could be
+ *obtained.
+ */
+ std::string GetLockScreenIconUrl() const OVERRIDE;
+
+ /**
+ * @brief PTU is needed, for this PTS has to be formed and sent.
+ */
+ bool RequestPTUpdate() OVERRIDE;
+
+ /**
+ * @brief Check if specified RPC for specified application
+ * has permission to be executed in specified HMI Level
+ * and also its permitted params.
+ * @param device_id Id of device of application
+ * @param app_id Id of application provided during registration
+ * @param hmi_level Current HMI Level of application
+ * @param rpc Name of RPC
+ * @param rpc_params List of RPC params
+ * @param result containing flag if HMI Level is allowed and list of
+ * allowed params.
+ */
+ void CheckPermissions(const PTString& device_id,
+ const PTString& app_id,
+ const PTString& hmi_level,
+ const PTString& rpc,
+ const RPCParams& rpc_params,
+ CheckPermissionResult& result) OVERRIDE;
+
+ /**
+ * @brief Clear all record of user consents. Used during Factory Reset.
+ * @return bool Success of operation
+ */
+ bool ResetUserConsent() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded kilometers
+ * @param kilometers current kilometers at odometer
+ * @return true if exceeded
+ */
+ void KmsChanged(int kilometers) OVERRIDE;
+
+ /**
+ * @brief Increments counter of ignition cycles
+ */
+ void IncrementIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Exchange by hmi or mobile request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchange() OVERRIDE;
+
+ /**
+ * @brief Exchange by user request
+ * @return Current status of policy table
+ */
+ std::string ForcePTExchangeAtUserRequest() OVERRIDE;
+
+ /**
+ * @brief Returns current status of policy table for HMI
+ * @return Current status of policy table
+ */
+ std::string GetPolicyTableStatus() const OVERRIDE;
+
+ /**
+ * @brief Resets retry sequence
+ */
+ void ResetRetrySequence();
+
+ /**
+ * @brief Gets timeout to wait before next retry updating PT
+ * If timeout is less or equal to zero then the retry sequence is not need.
+ * @return timeout in seconds
+ */
+ uint32_t NextRetryTimeout() OVERRIDE;
+
+ /**
+ * @brief Gets timeout to wait until receive response
+ * @return timeout in seconds
+ */
+ uint32_t TimeoutExchangeMSec() OVERRIDE;
+
+ /**
+ * @brief List of timeouts in seconds between retries
+ * when attempt to update PT fails
+ * @return List of delays between attempts.
+ */
+ const std::vector<int> RetrySequenceDelaysSeconds() OVERRIDE;
+
+ /**
+ * @brief Handler of exceeding timeout of exchanging policy table
+ */
+ void OnExceededTimeout() OVERRIDE;
+
+ /**
+ * @brief Handler of PTS sending out
+ */
+ void OnUpdateStarted() OVERRIDE;
+
+ /**
+ * @brief Sets counter value that passed for receiving PT UPdate.
+ */
+ void PTUpdatedAt(Counters counter, int value) OVERRIDE;
+
+ /**
+ * @brief Refresh data about retry sequence from policy table
*/
virtual void RefreshRetrySequence();
- virtual DeviceConsent GetUserConsentForDevice(
+
+ /**
+ * @brief Gets user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @return status of device consent
+ */
+ DeviceConsent GetUserConsentForDevice(
const std::string& device_id) const OVERRIDE;
- virtual void GetUserConsentForApp(
+
+ /**
+ * @brief Gets user consent for application
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetUserConsentForApp(
const std::string& device_id,
const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
- virtual void SetUserConsentForDevice(const std::string& device_id,
- bool is_allowed);
- virtual bool ReactOnUserDevConsentForApp(const std::string app_id,
- bool is_device_allowed);
- virtual bool GetInitialAppData(const std::string& application_id,
- StringArray* nicknames = NULL,
- StringArray* app_hmi_types = NULL);
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
- virtual void AddDevice(const std::string& device_id,
- const std::string& connection_type);
+ /**
+ * @brief Set user consent for mobile device data connection
+ * @param device_id Unique device identifier
+ * @param is_allowed User consent for usage device data connection
+ */
+ void SetUserConsentForDevice(const std::string& device_id,
+ const bool is_allowed) OVERRIDE;
- virtual void SetDeviceInfo(const std::string& device_id,
- const DeviceInfo& device_info);
+ /**
+ * @brief Update Application Policies as reaction
+ * on User allowing/disallowing device this app is running on.
+ * @param app_id Unique application id
+ * @param is_device_allowed true if user allowing device otherwise false
+ * @return true if operation was successful
+ */
+ bool ReactOnUserDevConsentForApp(const std::string app_id,
+ const bool is_device_allowed) OVERRIDE;
+
+ /**
+ * @brief Retrieves data from app_policies about app on its registration:
+ * @param application_id - id of registered app
+ * @param nicknames Synonyms for application
+ * @param app_hmi_types Section on HMI where app can appear (Navigation, Phone
+ * etc)
+ */
+ bool GetInitialAppData(const std::string& application_id,
+ StringArray* nicknames = NULL,
+ StringArray* app_hmi_types = NULL) OVERRIDE;
+
+ /**
+ * @brief Add's device to policy table
+ * @param device_id Device mac address
+ * @param connection_type Device connection type
+ */
+ void AddDevice(const std::string& device_id,
+ const std::string& connection_type) OVERRIDE;
+
+ /**
+ * @brief Stores device parameters received during application registration
+ * to policy table
+ * @param device_id Device mac address
+ * @param device_info Received device parameters
+ */
+ void SetDeviceInfo(const std::string& device_id,
+ const DeviceInfo& device_info) OVERRIDE;
- virtual void SetUserConsentForApp(const PermissionConsent& permissions);
+ /**
+ * @brief Set user consent for application functional groups
+ * @param permissions User-defined application group pemissions.
+ * The permissions is not const reference because it may contains
+ * valid data as well as invalid. So we will remove all invalid data
+ * from this structure.
+ */
+ void SetUserConsentForApp(const PermissionConsent& permissions) OVERRIDE;
- virtual bool GetDefaultHmi(const std::string& policy_app_id,
- std::string* default_hmi) const;
+ /**
+ * @brief Get default HMI level for application
+ * @param policy_app_id Unique application id
+ * @param default_hmi Default HMI level for application or empty, if value
+ * was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetDefaultHmi(const std::string& policy_app_id,
+ std::string* default_hmi) const OVERRIDE;
- virtual bool GetPriority(const std::string& policy_app_id,
- std::string* priority) const;
+ /**
+ * @brief Get priority for application
+ * @param policy_app_id Unique application id
+ * @param priority Priority for application or empty, if value was not set
+ * @return true, if succedeed, otherwise - false
+ */
+ bool GetPriority(const std::string& policy_app_id,
+ std::string* priority) const OVERRIDE;
- virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
+ /**
+ * @brief Get user friendly messages for given RPC messages and language
+ * @param message_codes RPC message codes
+ * @param language Language
+ * @return Array of structs with appropriate message parameters
+ */
+ std::vector<UserFriendlyMessage> GetUserFriendlyMessages(
const std::vector<std::string>& message_code,
- const std::string& language);
+ const std::string& language) OVERRIDE;
- virtual bool IsApplicationRevoked(const std::string& app_id) const;
+ /**
+ * @brief Checks if the application is revoked
+ * @param app_id application id
+ * @return true if application is revoked
+ */
+ bool IsApplicationRevoked(const std::string& app_id) const OVERRIDE;
- virtual void GetPermissionsForApp(
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of functional groups permissions
+ */
+ void GetPermissionsForApp(
const std::string& device_id,
const std::string& policy_app_id,
- std::vector<FunctionalGroupPermission>& permissions);
+ std::vector<FunctionalGroupPermission>& permissions) OVERRIDE;
+
+ /**
+ * @brief Return device id, which hosts specific application
+ * @param policy_app_id Application id, which is required to update device id
+ */
+ std::string& GetCurrentDeviceId(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Set current system language
+ * @param language Language
+ */
+ void SetSystemLanguage(const std::string& language) OVERRIDE;
- virtual std::string& GetCurrentDeviceId(
- const std::string& policy_app_id) const;
+ /**
+ * @brief Set data from GetSystemInfo response to policy table
+ * @param ccpu_version CCPU version
+ * @param wers_country_code WERS country code
+ * @param language System language
+ */
+ void SetSystemInfo(const std::string& ccpu_version,
+ const std::string& wers_country_code,
+ const std::string& language) OVERRIDE;
- virtual void SetSystemLanguage(const std::string& language);
+ /**
+ * @brief Runs necessary operations, which is depends on external system
+ * state, e.g. getting system-specific parameters which are need to be
+ * filled into policy table
+ */
+ void OnSystemReady() OVERRIDE;
- virtual void SetSystemInfo(const std::string& ccpu_version,
- const std::string& wers_country_code,
- const std::string& language);
- virtual void OnSystemReady();
+ /**
+ * @brief Get number of notification by priority
+ * @param priority Specified priority
+ * @return notification number
+ */
+ uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE;
- virtual uint32_t GetNotificationsNumber(
- const std::string& priority) const OVERRIDE;
+ /**
+ * @brief Allows to update Vehicle Identification Number in policy table.
+ * @param new value for the parameter.
+ */
+ void SetVINValue(const std::string& value) OVERRIDE;
- virtual void SetVINValue(const std::string& value);
+ /**
+ * @brief Gets specific application permissions changes since last policy
+ * table update
+ * @param policy_app_id Unique application id
+ * @return Permissions changes
+ */
+ AppPermissions GetAppPermissionsChanges(
+ const std::string& policy_app_id) OVERRIDE;
- // Interface StatisticsManager (begin)
- virtual void Increment(usage_statistics::GlobalCounterId type);
- virtual void Increment(const std::string& app_id,
- usage_statistics::AppCounterId type);
- virtual void Set(const std::string& app_id,
- usage_statistics::AppInfoId type,
- const std::string& value);
- virtual void Add(const std::string& app_id,
- usage_statistics::AppStopwatchId type,
- int32_t timespan_seconds);
- // Interface StatisticsManager (end)
+ /**
+ * @brief Removes specific application permissions changes
+ * @param app_id Unique application id
+ */
+ void RemovePendingPermissionChanges(const std::string& app_id) OVERRIDE;
+
+ /**
+ * @brief Send OnPermissionsUpdated for choosen application
+ * @param application_id Unique application id
+ */
+ void SendNotificationOnPermissionsUpdated(
+ const std::string& application_id) OVERRIDE;
- AppPermissions GetAppPermissionsChanges(const std::string& policy_app_id);
- void RemovePendingPermissionChanges(const std::string& app_id);
+ /**
+ * @brief Removes unpaired device records and related records from DB
+ * @return true, if succedeed, otherwise - false
+ */
+ bool CleanupUnpairedDevices() OVERRIDE;
- void SendNotificationOnPermissionsUpdated(const std::string& application_id);
+ /**
+ * @brief Check if app can keep context.
+ * @param app_id Unique application id
+ * @return true if app can keep context, otherwise - false
+ */
+ bool CanAppKeepContext(const std::string& app_id) const OVERRIDE;
- bool CleanupUnpairedDevices();
+ /**
+ * @brief Check if app can steal focus.
+ * @param app_id Unique application id
+ * @return true if app can steal focus, otherwise - false
+ */
+ bool CanAppStealFocus(const std::string& app_id) const OVERRIDE;
- bool CanAppKeepContext(const std::string& app_id) const;
- bool CanAppStealFocus(const std::string& app_id) const;
- void MarkUnpairedDevice(const std::string& device_id);
+ /**
+ * @brief Marks device as upaired
+ * @param device_id id device
+ */
+ void MarkUnpairedDevice(const std::string& device_id) OVERRIDE;
+ /**
+ * @brief Adds, application to the db or update existed one
+ * run PTU if policy update is necessary for application.
+ * @param application_id Unique application id
+ * @param hmi_types application HMI types
+ * @return function that will notify update manager about new application
+ */
StatusNotifier AddApplication(
const std::string& application_id,
- const rpc::policy_table_interface_base::AppHmiTypes& hmi_types);
+ const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) OVERRIDE;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Assigns new HMI types for specified application
+ * @param application_id Unique application id
+ * @param hmi_types new HMI types list
+ */
+ void SetDefaultHmiTypes(const std::string& application_id,
+ const std::vector<int>& hmi_types) OVERRIDE;
+
+ /**
+ * @brief 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
+ */
+ bool GetHMITypes(const std::string& application_id,
+ std::vector<int>* app_types) OVERRIDE;
+
+ /**
+ * @brief Setter for access_remote instance
+ * @param access_remote pointer to new access_remote instance
+ */
+ void set_access_remote(utils::SharedPtr<AccessRemote> access_remote) OVERRIDE;
+
+ /**
+ * @brief Sends notification about application HMI level changed
+ * @param who application information structure
+ */
+ void SendHMILevelChanged(const ApplicationOnDevice& who);
+
+ /**
+ * @brief Sends notification if application permissions were changed
+ * @param application_id Unique id of application
+ */
+ void OnPrimaryGroupsChanged(const std::string& application_id);
+#endif // SDL_REMOTE_CONTROL
+
+ /**
+ * @brief Removes consent for application functional group
+ * @param application_id Unique id of application
+ * @param group_name application functional group name
+ */
virtual void RemoveAppConsentForGroup(const std::string& app_id,
const std::string& group_name);
- virtual uint32_t HeartBeatTimeout(const std::string& app_id) const;
+ /**
+ * @brief Returns heart beat timeout
+ * @param app_id application id
+ * @return if timeout was set then value in milliseconds greater zero
+ * otherwise heart beat for specific application isn't set
+ */
+ uint32_t HeartBeatTimeout(const std::string& app_id) const OVERRIDE;
+
+ /**
+ * @brief SaveUpdateStatusRequired allows to save update status.
+ * @param is_update_needed true if update needed
+ */
+ void SaveUpdateStatusRequired(bool is_update_needed) OVERRIDE;
- virtual void SaveUpdateStatusRequired(bool is_update_needed);
+ /**
+ * @brief Checks, if application has policy assigned w/o data consent
+ * @param policy_app_id Unique application id
+ * @return true, if policy assigned w/o data consent, otherwise -false
+ */
+ bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
- virtual bool IsPredataPolicy(const std::string& policy_app_id) const OVERRIDE;
+ /**
+ * @brief Setter for cache_manager instance
+ * @param cache_manager pointer to new cache_manager instance
+ */
void set_cache_manager(CacheManagerInterface* cache_manager);
- virtual void OnAppsSearchStarted();
+ /**
+ * @brief Handler on applications search started
+ */
+ void OnAppsSearchStarted() OVERRIDE;
+
+ /**
+ * @brief Handler on applications search completed
+ * @param trigger_ptu contains true if PTU should be triggered
+ */
+ void OnAppsSearchCompleted(const bool trigger_ptu) OVERRIDE;
+
+ /**
+ * @brief Gets request types for application
+ * @param policy_app_id Unique application id
+ * @return request types of application
+ */
+ const std::vector<std::string> GetAppRequestTypes(
+ const std::string policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get information about vehicle
+ * @return vehicle information
+ */
+ const VehicleInfo GetVehicleInfo() const OVERRIDE;
+
+ /**
+ * @brief OnAppRegisteredOnMobile allows to handle event when application were
+ * succesfully registered on mobile device.
+ * It will send OnAppPermissionSend notification and will try to start PTU. *
+ * @param application_id registered application.
+ */
+ void OnAppRegisteredOnMobile(const std::string& application_id) OVERRIDE;
- virtual void OnAppsSearchCompleted(const bool trigger_ptu);
+ /**
+ * @brief RetrieveCertificate Allows to obtain certificate in order
+ * to start secure connection.
+ * @return The certificate in PKCS#7 format.
+ */
+ std::string RetrieveCertificate() const OVERRIDE;
+
+ /**
+ * @brief HasCertificate check whether policy table has certificate
+ * int module_config section.
+ * @return true in case certificate exists, false otherwise
+ */
+ bool HasCertificate() const OVERRIDE;
+
+ /**
+ * @brief Finds the next URL that must be sent on OnSystemRequest retry
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of policy application id and application url id from the
+ * urls vector
+ */
+ AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+
+ /**
+ * @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
+ * application index
+ * @param rs contains the application index and url index from the
+ * urls vector that are to be sent on the next OnSystemRequest
+ * @param urls vector of vectors that contain urls for each application
+ * @return Pair of application index and url index
+ */
+ AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
+ const EndpointUrls& urls) const OVERRIDE;
#ifdef BUILD_TESTS
+ /**
+ * @brief Getter for cache_manager instance
+ * @return cache_manager instance
+ */
inline CacheManagerInterfaceSPtr GetCache() {
return cache_;
}
+ /**
+ * @brief Setter for send_on_update_sent_out
+ * @param send_on_update_sent_out new value of this flag
+ */
inline void SetSendOnUpdateSentOut(const bool send_on_update_sent_out) {
send_on_update_sent_out_ = send_on_update_sent_out;
}
#endif // BUILD_TESTS
- virtual const std::vector<std::string> GetAppRequestTypes(
- const std::string policy_app_id) const;
- virtual const VehicleInfo GetVehicleInfo() const;
-
- virtual void OnAppRegisteredOnMobile(
- const std::string& application_id) OVERRIDE;
-
- virtual std::string RetrieveCertificate() const OVERRIDE;
+ // Interface StatisticsManager (begin)
+ /**
+ * @brief Increments global counter
+ * @param type counter type
+ */
+ void Increment(usage_statistics::GlobalCounterId type) OVERRIDE;
- virtual bool HasCertificate() const OVERRIDE;
+ /**
+ * @brief Increments specified application counter
+ * @param app_id Unique ID of application
+ * @param type application counter type
+ */
+ void Increment(const std::string& app_id,
+ usage_statistics::AppCounterId type) OVERRIDE;
- AppIdURL GetNextUpdateUrl(const EndpointUrls& urls) OVERRIDE;
+ /**
+ * @brief Sets specified application info value
+ * @param app_id Unique ID of application
+ * @param type application info type
+ * @param value new value for counter
+ */
+ void Set(const std::string& app_id,
+ usage_statistics::AppInfoId type,
+ const std::string& value) OVERRIDE;
- AppIdURL RetrySequenceUrl(const struct RetrySequenceURL& rs,
- const EndpointUrls& urls) const OVERRIDE;
+ /**
+ * @brief Add seconds for specified application stopwatch
+ * @param app_id Unique ID of application
+ * @param type application stopwatch type
+ * @param timespan_seconds seconds to add
+ */
+ void Add(const std::string& app_id,
+ usage_statistics::AppStopwatchId type,
+ int32_t timespan_seconds) OVERRIDE;
+ // Interface StatisticsManager (end)
protected:
#ifdef USE_HMI_PTU_DECRYPTION
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
virtual utils::SharedPtr<policy_table::Table> Parse(
const BinaryMessage& pt_content);
#else
+ /**
+ * @brief Parse policy table content and convert to PT object
+ * @param pt_content binary content of PT
+ * @return pointer to converted PT
+ */
virtual utils::SharedPtr<policy_table::Table> ParseArray(
const BinaryMessage& pt_content);
#endif
+ /**
+ * @brief Getter for policy settings
+ * @return policy settings instance
+ */
const PolicySettings& get_settings() const OVERRIDE;
private:
+ /**
+ * @brief Checks if PT update should be started and schedules it if needed
+ */
void CheckTriggers();
- /*
- * @brief Checks policy table update along with current data for any changes
- * in assigned functional group list of application
- *
- * @param Policy table update struct
+
+ /**
+ * @brief Compares current applications policies to the updated one and
+ * returns apporopriate result codes per application, which that are being
+ * processed by sending notification to applications registered and to the
+ * system
+ * @param update Shared pointer to policy table udpate
+ * @param snapshot Shared pointer to current copy of policy table
+ * @return Collection per-application results
*/
void CheckPermissionsChanges(
const utils::SharedPtr<policy_table::Table> update,
@@ -310,46 +755,140 @@ class PolicyManagerImpl : public PolicyManager {
const std::string& policy_app_id,
const std::vector<FunctionalGroupPermission>& current_permissions);
- virtual void StartPTExchange();
- virtual bool ExceededDays();
- virtual bool ExceededIgnitionCycles();
+ /**
+ * @brief StartPTExchange allows to start PTU. The function will check
+ * if one is required and starts the update flow in only case when previous
+ * condition is true.
+ */
+ void StartPTExchange() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded days
+ * @return true if exceeded
+ */
+ bool ExceededDays() OVERRIDE;
+
+ /**
+ * @brief Checks is PT exceeded IgnitionCycles
+ * @return true if exceeded
+ */
+ bool ExceededIgnitionCycles() OVERRIDE;
+
+ /**
+ * @brief Checks is specified policy table valid
+ * @param policy_table pointer to policy table to check
+ * @param type policy table type
+ * @return true if policy table valid, otherwise false
+ */
bool IsPTValid(utils::SharedPtr<policy_table::Table> policy_table,
policy_table::PolicyTableType type) const;
+ /**
+ * @brief Starts new retry sequence
+ */
void RetrySequence();
private:
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief Get resulting RPCs permissions for application which started on
+ * specific device
+ * @param device_id Device id
+ * @param policy_app_id Unique application id
+ * @param permissions Array of RPC param/HMI permissions
+ */
+ void GetPermissions(const std::string device_id,
+ const std::string application_id,
+ Permissions* data);
+
+ /**
+ * @brief 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;
+
+ /**
+ * @brief 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
+ */
+ void SendAppPermissionsChanged(const std::string& device_id,
+ const std::string& application_id) OVERRIDE;
+
+ /**
+ * @brief Gets all allowed module types
+ * @param policy_app_id unique identifier of application
+ * @param modules list of allowed module types
+ * @return true if application has allowed modules
+ */
+ bool GetModuleTypes(const std::string& policy_app_id,
+ std::vector<std::string>* modules) const OVERRIDE;
+#endif // SDL_REMOTE_CONTROL
+ /**
+ * @brief pointer to policy table listener for callbacks
+ */
PolicyListener* listener_;
+ /**
+ * @brief UpdateStatusManager instance for controlling PT status
+ */
UpdateStatusManager update_status_manager_;
+
+ /**
+ * @brief pointer to CacheManagerInterface instance for getting policy data
+ */
CacheManagerInterfaceSPtr cache_;
+#ifdef SDL_REMOTE_CONTROL
+ /**
+ * @brief pointer to AccessRemote instance for working with RC applications
+ */
+ utils::SharedPtr<AccessRemote> access_remote_;
+#endif
+
+ /**
+ * @brief lock guard for protecting applications list access
+ */
sync_primitives::Lock apps_registration_lock_;
+
+ /**
+ * @brief lock guard for protecting application permissions access
+ */
sync_primitives::Lock app_permissions_diff_lock_;
- std::map<std::string, AppPermissions> app_permissions_diff_;
/**
- * Timeout to wait response with UpdatePT (msec)
+ * @brief Collection of parameters to be reported to the system with
+ * SDL.ActivateApp response or OnAppPermissionsChanged notification
+ * Being set during policy table update processing
+ */
+ typedef std::map<std::string, AppPermissions> PendingPermissions;
+ PendingPermissions app_permissions_diff_;
+
+ /**
+ * @brief Timeout to wait response with UpdatePT
*/
uint32_t retry_sequence_timeout_;
/**
- * Seconds between retries to update PT
+ * @brief Seconds between retries to update PT
*/
std::vector<int> retry_sequence_seconds_;
/**
- * Current index trying of retry sequence
+ * @brief Current index trying of retry sequence
*/
uint32_t retry_sequence_index_;
/**
- * Lock for guarding retry sequence
+ * @brief Lock for guarding retry sequence
*/
sync_primitives::Lock retry_sequence_lock_;
/**
- * Timer to retry UpdatePT
- */
+ * @brief Timer to retry UpdatePT
+ */
timer::Timer timer_retry_sequence_;
/**
@@ -358,8 +897,14 @@ class PolicyManagerImpl : public PolicyManager {
*/
mutable std::string last_device_id_;
+ /**
+ * @brief Flag for checking first ignition cycle
+ */
bool ignition_check;
+ /**
+ * @brief Pointer to current policy settings structure
+ */
const PolicySettings* settings_;
friend struct CheckAppPolicy;
friend struct ProccessAppGroups;
@@ -370,8 +915,19 @@ class PolicyManagerImpl : public PolicyManager {
*/
RetrySequenceURL retry_sequence_url_;
+ /**
+ * @brief Flag for notifying that invalid PTU was received
+ */
bool wrong_ptu_update_received_;
+
+ /**
+ * @brief Flag for notifying that PTU was started
+ */
bool send_on_update_sent_out_;
+
+ /**
+ * @brief Flag for notifying that invalid PTU should be triggered
+ */
bool trigger_ptu_;
};
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);
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..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
@@ -96,6 +96,12 @@ typedef Map<DeviceParams, 0, 255> DeviceData;
typedef Array<Enum<RequestType>, 0, 255> RequestTypes;
+#ifdef SDL_REMOTE_CONTROL
+typedef Map<Strings, 0, 255> RemoteRpcs;
+typedef Map<RemoteRpcs, 0, 255> AccessModules;
+typedef Array<Enum<ModuleType>, 0, 255> ModuleTypes;
+#endif // SDL_REMOTE_CONTROL
+
typedef AppHMIType AppHmiType;
typedef std::vector<AppHMIType> AppHmiTypes;
@@ -136,6 +142,9 @@ struct ApplicationParams : PolicyBase {
Optional<Integer<uint16_t, 0, 65225> > memory_kb;
Optional<Integer<uint32_t, 0, UINT_MAX> > heart_beat_timeout_ms;
Optional<String<0, 255> > certificate;
+#ifdef SDL_REMOTE_CONTROL
+ mutable Optional<ModuleTypes> moduleType;
+#endif // SDL_REMOTE_CONTROL
public:
ApplicationParams();
@@ -151,6 +160,9 @@ struct ApplicationParams : PolicyBase {
private:
bool Validate() const;
+#ifdef SDL_REMOTE_CONTROL
+ bool ValidateModuleTypes() const;
+#endif // SDL_REMOTE_CONTROL
};
struct ApplicationPoliciesSection : CompositeType {
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..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
@@ -114,6 +114,19 @@ 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 kCollectFriendlyMsg;
+extern const std::string kSelectModuleTypes;
+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 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..6b5d6111f1 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,23 @@ class SQLPTRepresentation : public virtual PTRepresentation {
}
#endif // BUILD_TESTS
protected:
+#ifdef SDL_REMOTE_CONTROL
+ enum TypeAccess { kAllowed, kManual };
+ 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 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/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc
new file mode 100644
index 0000000000..f99b226f2e
--- /dev/null
+++ b/src/components/policy/policy_regular/src/access_remote_impl.cc
@@ -0,0 +1,247 @@
+/*
+ * 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 <algorithm>
+#include <iterator>
+#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 ToHMIType {
+ policy_table::AppHMITypes::value_type operator()(int item) const {
+ policy_table::AppHMIType type = static_cast<policy_table::AppHMIType>(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<std::string>(item);
+ }
+ };
+};
+
+struct ToModuleType {
+ std::string operator()(policy_table::ModuleTypes::value_type item) const {
+ policy_table::ModuleType type = static_cast<policy_table::ModuleType>(item);
+ return EnumToJsonString(type);
+ }
+};
+
+AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {}
+
+AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr<CacheManager> cache)
+ : cache_(cache) {}
+
+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::SetDefaultHmiTypes(const ApplicationOnDevice& who,
+ const std::vector<int>& 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 ApplicationOnDevice& 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 ApplicationOnDevice& who) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ return cache_->GetGroups(who.app_id);
+}
+
+bool AccessRemoteImpl::IsAppRemoteControl(const ApplicationOnDevice& 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<FunctionalGroupIDs::value_type>(output, " "));
+ return output;
+}
+
+void AccessRemoteImpl::GetGroupsIds(const std::string& device_id,
+ const std::string& app_id,
+ FunctionalGroupIDs& groups_ids) {
+ ApplicationOnDevice 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<std::string>* 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<policy_table::ModuleTypes> 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..78674c81f3 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() {
@@ -222,6 +233,8 @@ bool CacheManager::ApplyUpdate(const policy_table::Table& update_pt) {
for (; iter != iter_end; ++iter) {
if (iter->second.is_null()) {
+ pt_->policy_table.app_policies_section.apps[iter->first] =
+ policy_table::ApplicationParams();
pt_->policy_table.app_policies_section.apps[iter->first].set_to_null();
pt_->policy_table.app_policies_section.apps[iter->first].set_to_string(
"");
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..93e831acda 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<CacheManager>(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;
@@ -142,6 +152,9 @@ void PolicyManagerImpl::CheckTriggers() {
bool PolicyManagerImpl::LoadPT(const std::string& file,
const BinaryMessage& pt_content) {
LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size());
+ LOG4CXX_DEBUG(
+ logger_,
+ "PTU content is: " << std::string(pt_content.begin(), pt_content.end()));
#ifdef USE_HMI_PTU_DECRYPTION
// Assuemes Policy Table was parsed, formatted, and/or decrypted by
@@ -381,7 +394,13 @@ void PolicyManagerImpl::CheckPermissions(const PTString& device_id,
"CheckPermissions for " << app_id << " and rpc " << rpc
<< " for " << hmi_level << " level.");
+#ifdef SDL_REMOTE_CONTROL
+ ApplicationOnDevice 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 +457,14 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated(
std::string default_hmi;
default_hmi = "NONE";
+#ifdef SDL_REMOTE_CONTROL
+ const ApplicationOnDevice who = {device_id, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+ return;
+ }
+#endif // SDL_REMOTE_CONTROL
+
listener()->OnPermissionsUpdated(
application_id, notification_data, default_hmi);
}
@@ -674,7 +701,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 +1056,7 @@ StatusNotifier PolicyManagerImpl::AddApplication(
return utils::MakeShared<utils::CallNothing>();
}
}
+
void PolicyManagerImpl::RemoveAppConsentForGroup(
const std::string& app_id, const std::string& group_name) {
cache_->RemoveAppConsentForGroup(app_id, group_name);
@@ -1127,4 +1164,112 @@ 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<int>& hmi_types) {
+ LOG4CXX_INFO(logger_, "SetDefaultHmiTypes");
+ const std::string device_id = GetCurrentDeviceId(application_id);
+ ApplicationOnDevice 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<int>* 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;
+}
+
+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);
+}
+
+void PolicyManagerImpl::SendHMILevelChanged(const ApplicationOnDevice& who) {
+ std::string default_hmi("NONE");
+ if (GetDefaultHmi(who.app_id, &default_hmi)) {
+ 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<FunctionalGroupPermission> 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<FunctionalGroupPermission>::const_iterator it =
+ app_group_permissions.begin();
+ std::vector<FunctionalGroupPermission>::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, &notification_data);
+ listener()->OnPermissionsUpdated(application_id, notification_data);
+}
+
+void PolicyManagerImpl::OnPrimaryGroupsChanged(
+ const std::string& application_id) {
+ const std::vector<std::string> devices =
+ listener()->GetDevicesIds(application_id);
+ for (std::vector<std::string>::const_iterator i = devices.begin();
+ i != devices.end();
+ ++i) {
+ const ApplicationOnDevice who = {*i, application_id};
+ if (access_remote_->IsAppRemoteControl(who)) {
+ SendAppPermissionsChanged(who.dev_id, who.app_id);
+ }
+ }
+}
+
+bool PolicyManagerImpl::GetModuleTypes(
+ const std::string& application_id,
+ std::vector<std::string>* modules) const {
+ return access_remote_->GetModuleTypes(application_id, modules);
+}
+
+void PolicyManagerImpl::set_access_remote(
+ utils::SharedPtr<AccessRemote> 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..45afd91419 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,12 @@ 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
+ , moduleType(impl::ValueMember(value__, "moduleType"))
+#endif // SDL_REMOTE_CONTROL
+{
+}
Json::Value ApplicationParams::ToJsonValue() const {
Json::Value result__(PolicyBase::ToJsonValue());
@@ -177,6 +182,9 @@ 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("moduleType", moduleType, &result__);
+#endif // SDL_REMOTE_CONTROL
return result__;
}
@@ -204,6 +212,11 @@ bool ApplicationParams::is_valid() const {
if (!certificate.is_valid()) {
return false;
}
+#ifdef SDL_REMOTE_CONTROL
+ if (!moduleType.is_valid()) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
return Validate();
}
@@ -236,6 +249,11 @@ bool ApplicationParams::struct_empty() const {
if (certificate.is_initialized()) {
return false;
}
+#ifdef SDL_REMOTE_CONTROL
+ if (moduleType.is_initialized()) {
+ return false;
+ }
+#endif // SDL_REMOTE_CONTROL
return true;
}
@@ -268,6 +286,11 @@ void ApplicationParams::ReportErrors(rpc::ValidationReport* report__) const {
if (!certificate.is_valid()) {
certificate.ReportErrors(&report__->ReportSubobject("certificate"));
}
+#ifdef SDL_REMOTE_CONTROL
+ if (!moduleType.is_valid()) {
+ moduleType.ReportErrors(&report__->ReportSubobject("moduleType"));
+ }
+#endif // SDL_REMOTE_CONTROL
}
void ApplicationParams::SetPolicyTableType(PolicyTableType pt_type) {
@@ -278,6 +301,9 @@ 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
+ moduleType.SetPolicyTableType(pt_type);
+#endif // SDL_REMOTE_CONTROL
}
// RpcParameters methods
@@ -559,7 +585,6 @@ bool ModuleConfig::struct_empty() const {
if (vehicle_year.is_initialized()) {
return false;
}
-
return true;
}
void ModuleConfig::ReportErrors(rpc::ValidationReport* report__) const {
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<T>::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<ModuleType> 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<ModuleTypes>(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..7938eb4085 100644
--- a/src/components/policy/policy_regular/src/sql_pt_queries.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_queries.cc
@@ -134,6 +134,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 +317,39 @@ const std::string kCreateSchema =
" FOREIGN KEY(`message_type_name`) "
" REFERENCES `message_type`(`name`) "
"); "
+
+ /* 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 +387,47 @@ const std::string kInsertInitData =
"INSERT OR IGNORE INTO `_internal_data` (`db_version_hash`) VALUES(0); "
"";
+const std::string kDeleteModuleTypes = "DELETE FROM `module_type`";
+
+const std::string kDeleteAllDevices = "DELETE FROM `device`;";
+
+const std::string kSelectRemoteControlDenied =
+ "SELECT `remote_control_denied` FROM `application` WHERE `id` = ? 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 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`; "
@@ -387,6 +460,8 @@ const std::string kDropSchema =
"`preconsented_group.fk_application_has_functional_group_functional_group2_"
"idx`; "
"DROP TABLE IF EXISTS `preconsented_group`; "
+ "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 "
@@ -409,6 +484,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 +496,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 +508,7 @@ const std::string kDeleteData =
"DELETE FROM `app_group`; "
"DELETE FROM `application`; "
"DELETE FROM `rpc`; "
+ "DELETE FROM `access_module`; "
"DELETE FROM `version`; "
"DELETE FROM `message_type`; "
"DELETE FROM `language`; "
@@ -439,6 +518,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 +602,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` = ?";
+ " `vehicle_model` = ?, `vehicle_year` = ? ";
const std::string kInsertEndpoint =
"INSERT INTO `endpoint` (`service`, `url`, `application_id`) "
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..9f529b7d78 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -705,6 +705,17 @@ bool SQLPTRepresentation::GatherApplicationPoliciesSection(
if (!GatherAppGroup(app_id, &params.groups)) {
return false;
}
+#ifdef SDL_REMOTE_CONTROL
+ 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 +870,12 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
LOG4CXX_WARN(logger_, "Incorrect delete from app_group.");
return false;
}
+#ifdef SDL_REMOTE_CONTROL
+ 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 +958,13 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy(
if (!SaveAppGroup(app.first, app.second.groups)) {
return false;
}
+#ifdef SDL_REMOTE_CONTROL
+ 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 +1135,6 @@ bool SQLPTRepresentation::SaveModuleConfig(
: query.Bind(7);
config.vehicle_year.is_initialized() ? query.Bind(8, *(config.vehicle_year))
: query.Bind(8);
-
if (!query.Exec()) {
LOG4CXX_WARN(logger_, "Incorrect update module config");
return false;
@@ -1506,6 +1529,199 @@ bool SQLPTRepresentation::GatherAppGroup(
return true;
}
+#ifdef SDL_REMOTE_CONTROL
+
+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::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,
@@ -1612,7 +1828,13 @@ 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));
+ 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..d086144d86
--- /dev/null
+++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc
@@ -0,0 +1,95 @@
+/*
+ * 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, 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, SetDefaultHmiTypes) {
+ AccessRemoteImpl access_remote;
+
+ std::vector<int> hmi_expected;
+ hmi_expected.push_back(2);
+ hmi_expected.push_back(6);
+ ApplicationOnDevice 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;
+ ApplicationOnDevice 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"].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]));
+}
+
+} // 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..0b64ff645e
--- /dev/null
+++ b/src/components/policy/policy_regular/test/include/policy/mock_access_remote.h
@@ -0,0 +1,73 @@
+/*
+ * 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_REGULAR_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_H_
+#define SRC_COMPONENTS_POLICY_POLICY_REGULAR_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 MockAccessRemote : public policy::AccessRemote {
+ public:
+ MOCK_CONST_METHOD3(
+ FindGroup,
+ policy::PTString(const policy::ApplicationOnDevice& who,
+ const policy::PTString& rpc,
+ const policy::RemoteControlParams& params));
+ MOCK_METHOD2(SetDefaultHmiTypes,
+ void(const policy::ApplicationOnDevice& who,
+ const std::vector<int>& hmi_types));
+ MOCK_METHOD1(
+ GetGroups,
+ const policy_table::Strings&(const policy::ApplicationOnDevice& 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::ApplicationOnDevice& who));
+ MOCK_METHOD2(GetModuleTypes,
+ bool(const std::string& application_id,
+ std::vector<std::string>* modules));
+};
+
+} // namespace access_remote_test
+} // namespace components
+} // namespace test
+
+#endif // SRC_COMPONENTS_POLICY_POLICY_REGULAR_TEST_INCLUDE_POLICY_MOCK_ACCESS_REMOTE_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 <string>
-#include <vector>
-#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<int>());
- 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<policy::FunctionalGroupPermission>& 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<policy::UserFriendlyMessage>(
- const std::vector<std::string>& 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<policy::FunctionalGroupPermission>& 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<std::string>(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..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
@@ -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<MockPolicyListener> listener;
const std::string device_id;
+#ifdef SDL_REMOTE_CONTROL
+ utils::SharedPtr<access_remote_test::MockAccessRemote> 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 {
@@ -189,10 +199,10 @@ class PolicyManagerImplTest2 : public ::testing::Test {
const std::string dev_id2;
Json::Value PTU_request_types;
NiceMock<policy_handler_test::MockPolicySettings> 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 +241,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 +365,8 @@ class PolicyManagerImplTest2 : public ::testing::Test {
void TearDown() OVERRIDE {
delete manager;
+ file_system::remove_directory_content(kAppStorageFolder);
+ file_system::RemoveDirectory(kAppStorageFolder, true);
}
};
@@ -1247,7 +1259,7 @@ TEST_F(PolicyManagerImplTest2,
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
GetPTU("valid_sdl_pt_update.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->GetPT();
+ utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->pt();
policy_table::ModuleConfig& module_config = pt->policy_table.module_config;
::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo();
@@ -1328,7 +1340,7 @@ TEST_F(
HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) {
// Arrange
CreateLocalPT("sdl_preloaded_pt.json");
- utils::SharedPtr<policy_table::Table> pt = (manager->GetCache())->GetPT();
+ utils::SharedPtr<policy_table::Table> 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..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
@@ -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_handler_test::MockPolicySettings>
- policy_settings_;
+ std::auto_ptr<NiceMock<MockPolicySettings> > 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<policy_handler_test::MockPolicySettings>(
- new policy_handler_test::MockPolicySettings());
+ policy_settings_ = std::auto_ptr<NiceMock<MockPolicySettings> >(
+ new NiceMock<MockPolicySettings>());
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<policy_handler_test::MockPolicySettings>
- 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_handler_test::MockPolicySettings> policy_settings_;
+ NiceMock<MockPolicySettings> 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_handler_test::MockPolicySettings> policy_settings_;
+ NiceMock<MockPolicySettings> policy_settings_;
const std::string kAppStorageFolder;
};
@@ -424,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(25, dbms->FetchOneInt(query_select));
+ 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`";
const char* query_select_count_sync_out_of_memory =
@@ -1102,7 +1099,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/protocol_handler/test/protocol_packet_test.cc b/src/components/protocol_handler/test/protocol_packet_test.cc
index 60a984c17f..71c7726243 100644
--- a/src/components/protocol_handler/test/protocol_packet_test.cc
+++ b/src/components/protocol_handler/test/protocol_packet_test.cc
@@ -125,8 +125,9 @@ 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(static_cast<uint32_t>(PROTOCOL_VERSION_3),
- res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(serv_types[i], res->service_type());
EXPECT_EQ(PROTOCOL_HEADER_V2_SIZE, res->data_size());
}
@@ -147,8 +148,9 @@ 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(static_cast<uint32_t>(PROTOCOL_VERSION_3),
- res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(kInvalidServiceType, res->service_type());
}
}
@@ -158,8 +160,9 @@ 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(static_cast<uint32_t>(PROTOCOL_VERSION_3),
- res->protocol_version());
+ EXPECT_EQ(PROTOCOL_VERSION_3,
+ static_cast< ::protocol_handler::MajorProtocolVersion>(
+ res->protocol_version()));
EXPECT_EQ(kControl, res->service_type());
}
}
diff --git a/src/components/remote_control/CMakeLists.txt b/src/components/remote_control/CMakeLists.txt
new file mode 100644
index 0000000000..a320273a1e
--- /dev/null
+++ b/src/components/remote_control/CMakeLists.txt
@@ -0,0 +1,83 @@
+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}/protocol_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
+)
+
+install(
+ FILES ${FILES_FOR_COPY}
+ DESTINATION ${install_destination}
+)
+
+if(BUILD_TESTS)
+ add_subdirectory(test)
+endif()
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..578afad67b
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/base_command_notification.h
@@ -0,0 +1,110 @@
+/*
+ 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_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() {}
+
+ 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
+ */
+ virtual void Execute() = 0;
+
+ /**
+ * @brief Validates notification by xml schema
+ */
+ virtual bool Validate();
+
+ virtual std::string ModuleType(const Json::Value& message);
+ virtual std::vector<std::string> 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..64128b971e
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/base_command_request.h
@@ -0,0 +1,293 @@
+/*
+ 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_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<application_manager::MessagePtr,
+ std::string> {
+ 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();
+
+ void Run();
+ void on_event(const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& 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
+ */
+ 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<application_manager::MessagePtr,
+ std::string>& event) = 0;
+
+ virtual std::string ModuleType(const Json::Value& message);
+ virtual std::vector<std::string> ControlData(const Json::Value& message);
+ virtual application_manager::TypeAccess CheckModule(
+ 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:
+ /**
+ * @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 AcquireResources 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 AcquireResources();
+ inline bool IsAutoAllowed(application_manager::TypeAccess access) const;
+ void SendDisallowed(application_manager::TypeAccess access);
+ void SendGetUserConsent(const Json::Value& value);
+ void ProcessAccessResponse(
+ const rc_event_engine::Event<application_manager::MessagePtr,
+ std::string>& event);
+
+ const Json::Value msg_json_;
+ 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..945f98bdc8
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/button_press_request.h
@@ -0,0 +1,104 @@
+/*
+ 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_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<application_manager::MessagePtr,
+ std::string>& 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..0e03f8b330
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/command.h
@@ -0,0 +1,84 @@
+/*
+ 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_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<application_manager::MessagePtr,
+ std::string>& 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..220f7da979
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/get_interior_vehicle_data_request.h
@@ -0,0 +1,101 @@
+/*
+ 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_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<application_manager::MessagePtr,
+ std::string>& 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..4ee9ce4709
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/on_interior_vehicle_data_notification.h
@@ -0,0 +1,75 @@
+/*
+ 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_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..bc1e3942e5
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/commands/set_interior_vehicle_data_request.h
@@ -0,0 +1,127 @@
+/*
+ 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<application_manager::MessagePtr,
+ std::string>& 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<std::string> 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..0da248e5a7
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/event_engine/event.h
@@ -0,0 +1,127 @@
+/*
+ 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_EVENT_ENGINE_EVENT_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_H_
+
+#include <string>
+#include "remote_control/event_engine/event_dispatcher.h"
+#include "utils/shared_ptr.h"
+#include "application_manager/message.h"
+
+namespace rc_event_engine {
+
+template <typename EventMessage, typename EventID>
+class EventDispatcher;
+
+template <typename EventMessage, typename EventID>
+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<EventMessage, EventID>& event_dispatcher);
+
+ protected:
+ EventMessage event_message_;
+
+ private:
+ EventID id_;
+};
+
+template <typename EventMessage, typename EventID>
+const EventID& Event<EventMessage, EventID>::id() const {
+ return id_;
+}
+
+template <typename EventMessage, typename EventID>
+const EventMessage& Event<EventMessage, EventID>::event_message() const {
+ return event_message_;
+}
+
+template <typename EventMessage, typename EventID>
+Event<EventMessage, EventID>::Event(EventMessage& message, const EventID& id)
+ : event_message_(message), id_(id) {}
+
+template <typename EventMessage, typename EventID>
+void Event<EventMessage, EventID>::raise(
+ EventDispatcher<EventMessage, EventID>& 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..ddee6caccc
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/event_engine/event_dispatcher.h
@@ -0,0 +1,203 @@
+/*
+ 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_EVENT_ENGINE_EVENT_DISPATCHER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_DISPATCHER_H_
+
+#include <list>
+#include <map>
+
+#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 <typename EventMessage, typename EventID>
+class Event;
+
+template <typename EventMessage, typename EventID>
+class EventObserver;
+
+template <typename EventMessage, typename EventID>
+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<EventMessage, EventID>& 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<EventMessage, EventID>* 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<EventMessage, EventID>* const observer);
+
+ /*
+ * @brief Unsubscribes the observer from all events
+ *
+ * @param observer The observer to be unsubscribed
+ */
+ void remove_observer(
+ const EventObserver<EventMessage, EventID>* const observer);
+
+ protected:
+ private:
+ DISALLOW_COPY_AND_ASSIGN(EventDispatcher);
+
+ // Data types section
+ typedef std::list<EventObserver<EventMessage, EventID>*> ObserverList;
+ typedef std::map<int32_t, ObserverList> ObserversMap;
+ typedef std::map<EventID, ObserversMap> EventObserverMap;
+
+ // Members section
+ sync_primitives::Lock state_lock_;
+ EventObserverMap observers_;
+};
+
+template <typename EventMessage, typename EventID>
+EventDispatcher<EventMessage, EventID>::EventDispatcher()
+ : observers_() {}
+
+template <typename EventMessage, typename EventID>
+EventDispatcher<EventMessage, EventID>::~EventDispatcher() {}
+
+template <typename EventMessage, typename EventID>
+void EventDispatcher<EventMessage, EventID>::raise_event(
+ const Event<EventMessage, EventID>& 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 <typename EventMessage, typename EventID>
+void EventDispatcher<EventMessage, EventID>::add_observer(
+ const EventID& event_id,
+ int32_t hmi_correlation_id,
+ EventObserver<EventMessage, EventID>* const observer) {
+ sync_primitives::AutoLock auto_lock(state_lock_);
+ observers_[event_id][hmi_correlation_id].push_back(observer);
+}
+
+template <typename EventMessage, typename EventID>
+void EventDispatcher<EventMessage, EventID>::remove_observer(
+ const EventID& event_id,
+ const EventObserver<EventMessage, EventID>* 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 <typename EventMessage, typename EventID>
+void EventDispatcher<EventMessage, EventID>::remove_observer(
+ const EventObserver<EventMessage, EventID>* 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..66a38da88b
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/event_engine/event_observer.h
@@ -0,0 +1,96 @@
+/*
+ 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_EVENT_ENGINE_EVENT_OBSERVER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_EVENT_ENGINE_EVENT_OBSERVER_H_
+
+#include <string>
+#include "remote_control/event_engine/event.h"
+
+namespace rc_event_engine {
+
+template <typename EventMessage, typename EventID>
+class Event;
+
+template <typename EventMessage, typename EventID>
+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<EventMessage, EventID>& event) = 0;
+
+ private:
+ ObserverID id_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventObserver);
+};
+
+template <typename EventMessage, typename EventID>
+EventObserver<EventMessage, EventID>::EventObserver()
+ : id_(0) {
+ // Get unique id based on this
+ id_ = reinterpret_cast<unsigned long>(this);
+}
+
+template <typename EventMessage, typename EventID>
+EventObserver<EventMessage, EventID>::~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..6358459da7
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/message_helper.h
@@ -0,0 +1,122 @@
+/*
+ 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_MESSAGE_HELPER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_MESSAGE_HELPER_H_
+
+#include <stdint.h>
+#include <string>
+#include <map>
+
+#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:
+ 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);
+
+ /**
+ * 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);
+
+ /**
+ * @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();
+
+ static const std::map<functional_modules::RCFunctionID, std::string>
+ 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..e69de29bb2
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/module_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..485514faba
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/rc_app_extension.h
@@ -0,0 +1,82 @@
+/*
+ * 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_RC_APP_EXTENSION_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_APP_EXTENSION_H_
+
+#include <string>
+#include <set>
+#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 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 UnsubscribeFromInteriorVehicleData removes all subscriptions for
+ * interior data
+ */
+ void UnsubscribeFromInteriorVehicleData();
+
+ /**
+ * @brief Check if application subscribed to OnInteriorVehicleDataNotification
+ * @param module interior data specification(zone, data type)
+ */
+ bool IsSubscibedToInteriorVehicleData(const Json::Value& module_type);
+
+ private:
+ std::set<Json::Value> subscribed_interior_vehicle_data_;
+};
+
+typedef utils::SharedPtr<RCAppExtension> 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..9463c4b1ef
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/rc_command_factory.h
@@ -0,0 +1,66 @@
+/*
+ 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_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<commands::Command> 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..021e3cd6f0
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/rc_module_constants.h
@@ -0,0 +1,233 @@
+/*
+ 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_RC_MODULE_CONSTANTS_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RC_MODULE_CONSTANTS_H_
+
+namespace remote_control {
+
+namespace strings {
+// RemoteControlCapabilities constants
+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 {
+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 kName[] = "name";
+
+// SetInteriorVehicleData request
+const char kModuleData[] = "moduleData";
+// SetInteriorVehicleData request
+
+// GetInteriorVehicleData request
+const char kSubscribe[] = "subscribe";
+// GetInteriorVehicleData request
+
+// GetInteriorVehicleData response
+const char kIsSubscribed[] = "isSubscribed";
+// GetInteriorVehicleData response
+
+// OnRemoteControlSettings notification
+const char kAccessMode[] = "accessMode";
+const char kAllowed[] = "allowed";
+// OnRemoteControlSettings 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 {
+
+// 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..813f26a885
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/rc_module_timer.h
@@ -0,0 +1,70 @@
+/*
+ * 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_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..3c98f971ac
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/remote_control_event.h
@@ -0,0 +1,82 @@
+/*
+ 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_REMOTE_CONTROL_EVENT_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_EVENT_H_
+
+#include <string>
+
+#include "application_manager/message.h"
+
+#include "remote_control/event_engine/event.h"
+
+namespace remote_control {
+
+class RCPluginEvent
+ : public rc_event_engine::Event<application_manager::MessagePtr,
+ std::string> {
+ 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..6e36470b06
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/remote_control_plugin.h
@@ -0,0 +1,163 @@
+/*
+ * 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_REMOTE_CONTROL_PLUGIN_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_CONTROL_PLUGIN_H_
+
+#include <queue>
+#include <string>
+
+#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<application_manager::MessagePtr,
+ std::string> 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 Sends HMI status notification to mobile
+ * @param app application with changed HMI status
+ **/
+ void SendHmiStatusNotification(
+ application_manager::ApplicationSharedPtr app) OVERRIDE;
+
+ /**
+ * @brief Getter for event_dispatcher
+ * @return reference to RCEventDispatcher instance
+ */
+ RCEventDispatcher& event_dispatcher() OVERRIDE;
+
+ /**
+ * @brief Getter for resource_allocation_manager
+ * @return reference to ResourceAllocationManager instance
+ */
+ ResourceAllocationManager& resource_allocation_manager() OVERRIDE;
+
+ /**
+ * @brief Overriden setter for service
+ * @param service pointer to new service instance
+ */
+ void set_service(application_manager::ServicePtr service) OVERRIDE;
+
+ /*
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application_id Application id
+ */
+ void OnApplicationEvent(functional_modules::ApplicationEvent event,
+ const uint32_t application_id) OVERRIDE;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ void OnPolicyEvent(functional_modules::PolicyEvent event) OVERRIDE;
+
+ protected:
+ /**
+ * @brief Remove extension for all applications
+ */
+ virtual void RemoveAppExtensions() OVERRIDE;
+
+ private:
+ /**
+ * @brief Trigger actions which should be done after plugin service instance
+ * have been changed
+ */
+ void OnPluginServiceChanged();
+
+ /**
+ * @brief Subscribes on all RC related functions
+ */
+ void SubscribeOnFunctions();
+
+ 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..51135d8a8a
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/remote_plugin_interface.h
@@ -0,0 +1,118 @@
+/*
+ * 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_REMOTE_PLUGIN_INTERFACE_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REMOTE_PLUGIN_INTERFACE_H_
+
+#include <queue>
+#include <string>
+#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<RCAppExtension> 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;
+
+ virtual void SendHmiStatusNotification(
+ application_manager::ApplicationSharedPtr app) = 0;
+
+ typedef rc_event_engine::EventDispatcher<application_manager::MessagePtr,
+ std::string> RCPluginEventDispatcher;
+
+ virtual RCPluginEventDispatcher& event_dispatcher() = 0;
+
+ virtual ResourceAllocationManager& resource_allocation_manager() = 0;
+
+ protected:
+ /**
+ * @brief Remove extension for all applications
+ */
+ virtual void RemoveAppExtensions() = 0;
+
+ 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..8a79d9ebc4
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/request_controller.h
@@ -0,0 +1,110 @@
+/**
+ * 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_REQUEST_CONTROLLER_H_
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_REQUEST_CONTROLLER_H_
+
+#include <map>
+
+#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 {
+
+namespace commands {
+class Command;
+}
+
+namespace request_controller {
+
+typedef utils::SharedPtr<commands::Command> MobileRequestPtr;
+typedef uint32_t correlation_id;
+
+/**
+ * @brief RequestController class is used to manage mobile requests lifetime.
+ */
+class RequestController
+ : public functional_modules::TimerObserver<TrackableMessage> {
+ 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);
+
+ /**
+ * @brief Sets timeout value for RC requests
+ * @param timeout_seconds new timeout value in seconds
+ */
+ void SetRequestTimeout(const functional_modules::TimeUnit timeout_seconds);
+
+ /**
+ * @brief Triggers actions when timeout for some request is expired
+ * @param expired reference to request which timeout was expired
+ */
+ void OnTimeoutTriggered(const TrackableMessage& expired) OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RequestController);
+
+ std::map<correlation_id, MobileRequestPtr> mobile_request_list_;
+ functional_modules::ModuleTimer<TrackableMessage> timer_;
+ functional_modules::TimerDirector time_director_;
+ sync_primitives::Lock mobile_request_lock_;
+};
+
+} // 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..e9712370d9
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/resource_allocation_manager.h
@@ -0,0 +1,114 @@
+#ifndef SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
+#define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H
+#include <string>
+#include "utils/macro.h"
+#include "utils/shared_ptr.h"
+#include "interfaces/HMI_API.h"
+#include "remote_control/event_engine/event.h"
+#include "functional_module/generic_module.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 Resources defines list of resources
+ */
+typedef std::vector<std::string> Resources;
+
+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 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 OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application_id Application id
+ */
+ virtual void OnApplicationEvent(functional_modules::ApplicationEvent event,
+ const uint32_t application_id) = 0;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ virtual void OnPolicyEvent(functional_modules::PolicyEvent event) = 0;
+
+ /**
+ * @brief Set current access mode for acquiring resource
+ * @param access_mode
+ */
+ 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
+ */
+ virtual void ResetAllAllocations() = 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..a62d1b091c
--- /dev/null
+++ b/src/components/remote_control/include/remote_control/resource_allocation_manager_impl.h
@@ -0,0 +1,136 @@
+#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"
+#include "utils/lock.h"
+
+namespace remote_control {
+
+typedef rc_event_engine::EventDispatcher<application_manager::MessagePtr,
+ std::string> 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 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) FINAL;
+
+ void OnDriverDisallowed(const std::string& module_type,
+ const uint32_t app_id) FINAL;
+
+ /**
+ * @brief OnApplicationEvent Processes application related events
+ * @param event Event
+ * @param application_id Application id
+ */
+ void OnApplicationEvent(functional_modules::ApplicationEvent event,
+ const uint32_t application_id) FINAL;
+
+ /**
+ * @brief OnPolicyEvent Processes policy related events
+ * @param event Policy event
+ */
+ void OnPolicyEvent(functional_modules::PolicyEvent event) FINAL;
+
+ void ResetAllAllocations() FINAL;
+
+ private:
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+
+ /**
+ * @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 ReleaseResource Releases resource acquired by application
+ * @param module_type Module name
+ * @param application_id Application id
+ */
+ void ReleaseResource(const std::string& module_type,
+ const uint32_t application_id);
+
+ /**
+ * @brief GetAcquiredResources Provides resources acquired by particular
+ * application currently
+ * @param application_id Application id
+ * @return List of acquired resources by specific application
+ */
+ Resources GetAcquiredResources(const uint32_t application_id) const;
+
+ /**
+ * @brief ProcessApplicationPolicyUpdate Checks if allowed modules list is
+ * changed for registered RC applications and releases in case some modules
+ * now out of the list
+ */
+ void ProcessApplicationPolicyUpdate();
+
+ /**
+ * @brief GetApplicationExtention Provides access to application RC extention
+ * @param application Application
+ * @return Pointer to RC extention of application or NULL if not available
+ */
+ RCAppExtensionPtr GetApplicationExtention(
+ application_manager::ApplicationSharedPtr application);
+
+ /**
+ * @brief RemoveAppsSubscriptions Removes subscriptions for interior data for
+ * applications in the list
+ * @param apps Application list
+ */
+ void RemoveAppsSubscriptions(const Apps& apps);
+
+ /**
+ * @brief AllocatedResources contains link between resource and application
+ * owning that resource
+ */
+ typedef std::map<std::string, uint32_t> AllocatedResources;
+ AllocatedResources allocated_resources_;
+ mutable sync_primitives::Lock allocated_resources_lock_;
+
+ /**
+ * @brief ResourcesState contains states of ALLOCATED resources
+ */
+ typedef std::map<std::string, ResourceState::eType> ResourcesState;
+ ResourcesState resources_state_;
+ mutable sync_primitives::Lock resources_state_lock_;
+
+ /**
+ * @brief RejectedResources type for connecting list of resources rejected by
+ * driver for application
+ * application_id : [vector of rejected resources]
+ */
+ typedef std::map<uint32_t, std::vector<std::string> > RejectedResources;
+ RejectedResources rejected_resources_for_application_;
+ mutable sync_primitives::Lock rejected_resources_for_application_lock_;
+
+ hmi_apis::Common_RCAccessMode::eType current_access_mode_;
+ RemotePluginInterface& rc_plugin_;
+};
+} // remote_control
+
+#endif // SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_IMPL_H
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..2de82abdef
--- /dev/null
+++ b/src/components/remote_control/src/commands/base_command_notification.cc
@@ -0,0 +1,154 @@
+/*
+ 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/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<RCAppExtension>(
+ app_extension);
+
+ return rc_app_extension;
+}
+
+void BaseCommandNotification::Run() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Execute();
+}
+
+void BaseCommandNotification::NotifyApplications() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ typedef std::vector<application_manager::ApplicationSharedPtr> 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<std::string> BaseCommandNotification::ControlData(
+ const Json::Value& message) {
+ return std::vector<std::string>();
+}
+
+} // 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..bc6202d2a8
--- /dev/null
+++ b/src/components/remote_control/src/commands/base_command_request.cc
@@ -0,0 +1,564 @@
+/*
+ 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/base_command_request.h"
+#include <cstring>
+#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;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+BaseCommandRequest::BaseCommandRequest(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : 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());
+}
+
+BaseCommandRequest::~BaseCommandRequest() {
+ rc_module_.event_dispatcher().remove_observer(this);
+}
+
+void BaseCommandRequest::OnTimeout() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ SetResourceState(msg_json_, ResourceState::FREE);
+
+ 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[json_keys::kSuccess] = success;
+ msg_params[json_keys::kResultCode] = result_code;
+ if (!info.empty()) {
+ msg_params[json_keys::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_);
+ SetResourceState(msg_json_, ResourceState::FREE);
+ PrepareResponse(success, result_code, info);
+ rc_module_.SendResponseToMobile(message_);
+}
+
+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();
+ LOG4CXX_DEBUG(logger_,
+ "Subsribing to response for function: "
+ << function_name
+ << " and correlation id: " << correlation_id);
+
+ rc_module_.event_dispatcher().add_observer(
+ function_name, correlation_id, this);
+
+ LOG4CXX_DEBUG(logger_, "HMI Request:\n " << message_to_send->json_message());
+
+ service_->SendMessageToHMI(message_to_send);
+}
+
+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<RCAppExtension>(
+ 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, json_keys::kResult) &&
+ IsMember(value[json_keys::kResult], json_keys::kCode)) {
+ result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ value[json_keys::kResult][json_keys::kCode].asInt()));
+ } else if (IsMember(value, json_keys::kError) &&
+ IsMember(value[json_keys::kError], json_keys::kCode)) {
+ result_code =
+ GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>(
+ value[json_keys::kError][json_keys::kCode].asInt()));
+
+ if (IsMember(value[json_keys::kError], json_keys::kMessage)) {
+ info = value[json_keys::kError][json_keys::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_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 (AcquireResources()) {
+ Execute(); // run child's logic
+ }
+ // If resource is not aqcuired, AcquireResources method will either
+ // send response to mobile or
+ // send additional request to HMI to ask driver consent
+ }
+}
+
+bool BaseCommandRequest::CheckPolicyPermissions() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_) {
+ LOG4CXX_ERROR(logger_, "Application doesn't registered!");
+ SendResponse(false, result_codes::kApplicationNotRegistered, "");
+ return false;
+ }
+
+ if (!service_->IsRemoteControlApplication(app_)) {
+ LOG4CXX_WARN(logger_, "Application has no remote control functions");
+ SendResponse(false, result_codes::kDisallowed, "");
+ return false;
+ }
+
+ mobile_apis::Result::eType ret = service_->CheckPolicyPermissions(message_);
+ if (ret != mobile_apis::Result::eType::SUCCESS) {
+ LOG4CXX_WARN(logger_,
+ "Function \"" << message_->function_name() << "\" (#"
+ << message_->function_id()
+ << ") not allowed by policy");
+
+ SendResponse(false, result_codes::kDisallowed, "");
+ return false;
+ }
+
+ return true;
+}
+
+application_manager::TypeAccess BaseCommandRequest::CheckModule(
+ const Json::Value& message) {
+ const std::string& module = ModuleType(message);
+ return service_->CheckModule(app_->app_id(), module)
+ ? application_manager::TypeAccess::kAllowed
+ : application_manager::TypeAccess::kDisallowed;
+}
+
+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 = CheckModule(value);
+
+ if (IsAutoAllowed(access)) {
+ set_auto_allowed(true);
+ return true;
+ } else {
+ SendDisallowed(access);
+ }
+ return false;
+}
+
+bool BaseCommandRequest::AcquireResources() {
+ 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(msg_json_, ResourceState::BUSY);
+ return true;
+ }
+ case AcquireResult::IN_USE: {
+ SendResponse(false, result_codes::kInUse, "");
+ return false;
+ }
+ case AcquireResult::ASK_DRIVER: {
+ SetResourceState(msg_json_, 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::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:
+ return;
+ case application_manager::kDisallowed:
+ info = disallowed_info_.empty()
+ ? "The RPC is disallowed by vehicle settings"
+ : disallowed_info_;
+ 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<std::string> BaseCommandRequest::ControlData(
+ const Json::Value& message) {
+ return std::vector<std::string>();
+}
+
+void BaseCommandRequest::on_event(
+ const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
+ event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+
+ SetResourceState(msg_json_, ResourceState::FREE);
+
+ if (event.id() == functional_modules::hmi_api::get_user_consent) {
+ ProcessAccessResponse(event);
+ } else {
+ OnEvent(event); // run child's logic
+ }
+}
+
+void BaseCommandRequest::ProcessAccessResponse(
+ const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
+ event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!app_) {
+ LOG4CXX_ERROR(logger_, "Application doesn't registered!");
+ 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;
+ const bool is_succeeded = ParseResultCode(value, result_code, info);
+
+ bool is_allowed = false;
+ if (is_succeeded) {
+ if (IsMember(value[json_keys::kResult], message_params::kAllowed) &&
+ value[json_keys::kResult][message_params::kAllowed].isBool()) {
+ is_allowed = value[json_keys::kResult][message_params::kAllowed].asBool();
+ }
+
+ const std::string module = ModuleType(msg_json_);
+
+ // Check the actual User's answer.
+ LOG4CXX_DEBUG(logger_,
+ "Setting allowed access for " << app_->app_id() << " for "
+ << module);
+ if (is_allowed) {
+ rc_module_.resource_allocation_manager().ForceAcquireResource(
+ module, app_->app_id());
+
+ Execute(); // run child's logic
+ } else {
+ rc_module_.resource_allocation_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);
+ }
+}
+
+} // 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..1e5eef1e64
--- /dev/null
+++ b/src/components/remote_control/src/commands/button_press_request.cc
@@ -0,0 +1,264 @@
+/*
+ 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"
+#include "utils/helpers.h"
+#include "interfaces/MOBILE_API.h"
+
+namespace remote_control {
+
+namespace commands {
+
+using namespace json_keys;
+using namespace message_params;
+
+typedef std::map<std::string, mobile_apis::ButtonName::eType> ButtonsMap;
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "ButtonPressRequest")
+
+ButtonPressRequest::ButtonPressRequest(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : BaseCommandRequest(message, rc_module) {}
+
+ButtonPressRequest::~ButtonPressRequest() {}
+
+const std::vector<std::string> buttons_climate() {
+ std::vector<std::string> 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<std::string> buttons_radio() {
+ std::vector<std::string> 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;
+}
+
+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 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;
+ 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<mobile_apis::ButtonName::eType>(current_id);
+ if (current_button == button) {
+ LOG4CXX_TRACE(logger_,
+ "Button id " << current_button
+ << " exist in capabilities");
+ return true;
+ }
+ }
+ }
+ LOG4CXX_TRACE(logger_,
+ "Button id " << button << " 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) {
+ 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) {
+ if (!helpers::in_range(buttons_climate(), button_name)) {
+ LOG4CXX_WARN(logger_,
+ "Trying to acceess radio button with module type climate");
+ return false;
+ }
+ }
+ return true;
+}
+
+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();
+
+ 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, rc_capabilities);
+ const bool button_id_exist_in_caps =
+ rc_capabilities &&
+ CheckIfButtonExistInRCCaps(*rc_capabilities, button_id);
+
+ if (button_name_matches_module_type && button_id_exist_in_caps) {
+ SendRequest(functional_modules::hmi_api::button_press, request_params);
+ } 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::kUnsupportedResource,
+ "Requested button is not exists in capabilities!");
+ }
+}
+
+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<application_manager::MessagePtr, std::string>&
+ 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..6a7e746aa5
--- /dev/null
+++ b/src/components/remote_control/src/commands/get_interior_vehicle_data_request.cc
@@ -0,0 +1,224 @@
+/*
+ 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 <map>
+
+#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) {}
+
+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);
+ }
+
+ SendRequest(functional_modules::hmi_api::get_interior_vehicle_data,
+ request_params);
+}
+
+void GetInteriorVehicleDataRequest::OnEvent(
+ const rc_event_engine::Event<application_manager::MessagePtr, std::string>&
+ 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[json_keys::kResult][message_params::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[json_keys::kResult], message_params::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 " << message_params::kIsSubscribed
+ << " is ignored due to absence '"
+ << message_params::kSubscribe
+ << "' parameter in request");
+ return;
+ }
+
+ const bool request_subscribe = request_params[kSubscribe].asBool();
+ const bool response_subscribe =
+ hmi_response[json_keys::kResult][message_params::kIsSubscribed].asBool();
+ response_params_[message_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..fccd8392c7
--- /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 <algorithm>
+#include <vector>
+#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<application_manager::ApplicationSharedPtr> 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<application_manager::Message>(*msg);
+ message->set_message_type(
+ application_manager::MessageType::kNotification);
+ message->set_protocol_version(app.protocol_version());
+ 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..f18180aa21
--- /dev/null
+++ b/src/components/remote_control/src/commands/on_remote_control_settings_notification.cc
@@ -0,0 +1,122 @@
+/*
+ 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 <algorithm>
+#include <vector>
+#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<application_manager::ApplicationSharedPtr> 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;
+ }
+ ResourceAllocationManager& allocation_manager =
+ 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");
+ 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();
+ allocation_manager.ResetAllAllocations();
+ }
+}
+
+} // 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..70fbd9280e
--- /dev/null
+++ b/src/components/remote_control/src/commands/set_interior_vehicle_data_request.cc
@@ -0,0 +1,350 @@
+/*
+ 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 <algorithm>
+#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<std::string> GetModuleReadOnlyParams(
+ const std::string& module_type) {
+ std::vector<std::string> 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;
+}
+
+const std::map<std::string, std::string> GetModuleDataToCapabilitiesMapping() {
+ std::map<std::string, std::string> 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["signalChangeThreshold"] = "signalChangeThresholdAvailable";
+ mapping["radioEnable"] = "radioEnableAvailable";
+ mapping["state"] = "stateAvailable";
+
+ return mapping;
+}
+} // namespace
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "SetInteriorVehicleDataRequest")
+
+SetInteriorVehicleDataRequest::SetInteriorVehicleDataRequest(
+ const application_manager::MessagePtr& message,
+ RemotePluginInterface& rc_module)
+ : BaseCommandRequest(message, rc_module) {}
+
+SetInteriorVehicleDataRequest::~SetInteriorVehicleDataRequest() {}
+
+bool CheckControlDataByCapabilities(
+ const smart_objects::SmartObject& module_caps,
+ const Json::Value& control_data) {
+ std::map<std::string, std::string> 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& 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);
+ 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;
+ }
+ }
+ return true;
+}
+
+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)) {
+ 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)) {
+ 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(
+ climate_caps, module_data[strings::kClimateControlData]);
+ }
+
+ return is_radio_data_valid && is_climate_data_valid;
+}
+
+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) {
+ 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,
+ "Accessing not supported module data");
+ return;
+ }
+ 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<std::string> module_type_params = ControlData(request_params);
+ std::vector<std::string>::iterator it = module_type_params.begin();
+ std::vector<std::string> 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<std::string> module_type_params = ControlData(request_params);
+ std::vector<std::string>::iterator it = module_type_params.begin();
+ const std::string module_type = ModuleType(request_params);
+ std::vector<std::string> 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<std::string> module_type_params = ControlData(request_params);
+ std::vector<std::string>::iterator it = module_type_params.begin();
+ std::vector<std::string> 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<application_manager::MessagePtr, std::string>&
+ 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());
+ 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 is_response_successful = ParseResultCode(value, result_code, info);
+
+ if (is_response_successful) {
+ response_params_[message_params::kModuleData] =
+ value[json_keys::kResult][message_params::kModuleData];
+ }
+
+ SendResponse(is_response_successful, 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<std::string> SetInteriorVehicleDataRequest::ControlData(
+ const Json::Value& message) {
+ Json::Value data =
+ message.get(message_params::kModuleData, Json::Value(Json::objectValue));
+ std::string module = ModuleType(message);
+ Json::Value params;
+ if (module == enums_value::kRadio) {
+ params = data.get(message_params::kRadioControlData,
+ Json::Value(Json::objectValue));
+ }
+ if (module == enums_value::kClimate) {
+ params = data.get(message_params::kClimateControlData,
+ 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..140e0a977a
--- /dev/null
+++ b/src/components/remote_control/src/message_helper.cc
@@ -0,0 +1,154 @@
+/*
+ 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 <string>
+#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<RCFunctionID, std::string> GenerateAPINames() {
+ std::map<RCFunctionID, std::string> result;
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::BUTTON_PRESS, "ButtonPress"));
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::GET_INTERIOR_VEHICLE_DATA, "GetInteriorVehicleData"));
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::SET_INTERIOR_VEHICLE_DATA, "SetInteriorVehicleData"));
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::ON_INTERIOR_VEHICLE_DATA, "OnInteriorVehicleData"));
+ result.insert(std::make_pair<RCFunctionID, std::string>(
+ RCFunctionID::ON_REMOTE_CONTROL_SETTINGS, "OnRemoteControlSettings"));
+ return result;
+}
+
+std::map<std::string, hmi_apis::Common_RCAccessMode::eType> 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}};
+}
+
+const std::map<RCFunctionID, std::string> MessageHelper::kMobileAPINames =
+ GenerateAPINames();
+
+const std::string MessageHelper::GetMobileAPIName(RCFunctionID func_id) {
+ std::map<RCFunctionID, std::string>::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;
+
+ return reader.parse(string, json) ? json
+ : Json::Value(Json::ValueType::nullValue);
+}
+
+bool IsMember(const Json::Value& value, const std::string& key) {
+ if (!value.isObject()) {
+ return false;
+ }
+
+ return value.isMember(key);
+}
+
+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[json_keys::kJsonrpc] = "2.0";
+ msg[json_keys::kMethod] = function_id;
+ if (!message_params.isNull()) {
+ msg[json_keys::kParams] = message_params;
+ }
+
+ msg[json_keys::kParams][json_keys::kAppId] = hmi_app_id;
+
+ Json::FastWriter writer;
+ application_manager::MessagePtr message_to_send =
+ utils::MakeShared<application_manager::Message>(
+ application_manager::Message(
+ protocol_handler::MessagePriority::kDefault));
+ message_to_send->set_protocol_version(
+ protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI);
+ message_to_send->set_correlation_id(msg[json_keys::kId].asInt());
+ message_to_send->set_function_name(msg[json_keys::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) {
+ std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::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<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator
+ it = access_modes.begin();
+ for (; access_modes.end() != it; ++it) {
+ if (access_mode == it->second) {
+ return it->first;
+ }
+ }
+ 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/module_helper.cc b/src/components/remote_control/src/module_helper.cc
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/src/components/remote_control/src/module_helper.cc
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..3431a713f9
--- /dev/null
+++ b/src/components/remote_control/src/rc_app_extension.cc
@@ -0,0 +1,62 @@
+/*
+ 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/rc_app_extension.h"
+
+namespace remote_control {
+RCAppExtension::RCAppExtension(application_manager::AppExtensionUID uid)
+ : AppExtension(uid) {}
+
+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);
+}
+
+void RCAppExtension::UnsubscribeFromInteriorVehicleData() {
+ subscribed_interior_vehicle_data_.clear();
+}
+
+bool RCAppExtension::IsSubscibedToInteriorVehicleData(
+ const Json::Value& module_type) {
+ std::set<Json::Value>::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..93b90b64ac
--- /dev/null
+++ b/src/components/remote_control/src/rc_command_factory.cc
@@ -0,0 +1,86 @@
+/*
+ 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 "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<commands::Command> RCCommandFactory::CreateCommand(
+ const application_manager::MessagePtr& msg,
+ RemotePluginInterface& rc_module) {
+ switch (msg->function_id()) {
+ case RCFunctionID::GET_INTERIOR_VEHICLE_DATA: {
+ return utils::MakeShared<commands::GetInteriorVehicleDataRequest>(
+ msg, rc_module);
+ break;
+ }
+ case RCFunctionID::SET_INTERIOR_VEHICLE_DATA: {
+ return utils::MakeShared<commands::SetInteriorVehicleDataRequest>(
+ msg, rc_module);
+ break;
+ }
+ case RCFunctionID::BUTTON_PRESS: {
+ return utils::MakeShared<commands::ButtonPressRequest>(msg, rc_module);
+ break;
+ }
+ case RCFunctionID::ON_INTERIOR_VEHICLE_DATA: {
+ return utils::MakeShared<commands::OnInteriorVehicleDataNotification>(
+ msg, rc_module);
+ break;
+ }
+ case RCFunctionID::ON_REMOTE_CONTROL_SETTINGS: {
+ return utils::MakeShared<commands::OnRemoteControlSettingsNotification>(
+ msg, rc_module);
+ break;
+ }
+ default: {
+ utils::SharedPtr<commands::Command> 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..e4f887ffc6
--- /dev/null
+++ b/src/components/remote_control/src/remote_control_event.cc
@@ -0,0 +1,56 @@
+/*
+ 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/remote_control_event.h"
+
+namespace remote_control {
+
+RCPluginEvent::RCPluginEvent(application_manager::MessagePtr& message,
+ const std::string& id)
+ : rc_event_engine::Event<application_manager::MessagePtr, std::string>(
+ 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..e5a073d15e
--- /dev/null
+++ b/src/components/remote_control/src/remote_control_plugin.cc
@@ -0,0 +1,334 @@
+/*
+ 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/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 "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<functional_modules::RCFunctionID>(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<commands::Command> 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(app->protocol_version());
+
+ msg_params["hmiLevel"] = static_cast<uint32_t>(app->hmi_level());
+
+ msg_params["audioStreamingState"] =
+ static_cast<uint32_t>(app->audio_streaming_state());
+
+ msg_params["systemContext"] = static_cast<uint32_t>(app->system_context());
+
+ msg->set_json_message(MessageHelper::ValueToString(msg_params));
+
+ service()->SendMessageToMobile(msg);
+}
+
+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<application_manager::ApplicationSharedPtr> applications =
+ service()->GetApplications(GetModuleID());
+
+ std::vector<application_manager::ApplicationSharedPtr>::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());
+ 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());
+}
+
+void RemoteControlPlugin::OnPluginServiceChanged() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const functional_modules::TimeUnit timeout_msec =
+ service()->GetSettings().default_timeout();
+ request_controller_.SetRequestTimeout(timeout_msec / 1000);
+}
+
+void RemoteControlPlugin::set_service(application_manager::ServicePtr service) {
+ RemotePluginInterface::set_service(service);
+ OnPluginServiceChanged();
+}
+
+RCEventDispatcher& RemoteControlPlugin::event_dispatcher() {
+ return event_dispatcher_;
+}
+
+ResourceAllocationManager& RemoteControlPlugin::resource_allocation_manager() {
+ return resource_allocation_manager_;
+}
+
+void RemoteControlPlugin::OnApplicationEvent(
+ functional_modules::ApplicationEvent event, const uint32_t application_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ resource_allocation_manager_.OnApplicationEvent(event, application_id);
+}
+
+void RemoteControlPlugin::OnPolicyEvent(functional_modules::PolicyEvent event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ resource_allocation_manager_.OnPolicyEvent(event);
+}
+
+} // 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..9ffc639898
--- /dev/null
+++ b/src/components/remote_control/src/request_controller.cc
@@ -0,0 +1,96 @@
+/*
+ * 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/request_controller.h"
+#include "json/json.h"
+#include "utils/logger.h"
+
+namespace remote_control {
+namespace request_controller {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RCRequestController")
+
+RequestController::RequestController() {
+ 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)
+ 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;
+ // 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) {
+ 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);
+ // TODO(VS): add app id
+ timer_.RemoveTrackable(TrackableMessage(0, 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());
+ std::map<correlation_id, MobileRequestPtr>::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);
+}
+
+void RequestController::SetRequestTimeout(
+ const functional_modules::TimeUnit timeout_seconds) {
+ LOG4CXX_DEBUG(logger_, "RC request timeout is set to " << timeout_seconds);
+ timer_.set_period(timeout_seconds);
+}
+
+} // 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..fd6c2d8fb8
--- /dev/null
+++ b/src/components/remote_control/src/resource_allocation_manager_impl.cc
@@ -0,0 +1,373 @@
+#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"
+#include "remote_control/rc_app_extension.h"
+
+namespace remote_control {
+
+CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule")
+
+ResourceAllocationManagerImpl::ResourceAllocationManagerImpl(
+ RemotePluginInterface& rc_plugin)
+ : current_access_mode_(hmi_apis::Common_RCAccessMode::AUTO_ALLOW)
+ , 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;
+ }
+
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ 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::ReleaseResource(
+ const std::string& module_type, const uint32_t application_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Release " << module_type << " by " << application_id);
+ AllocatedResources::const_iterator allocation =
+ allocated_resources_.find(module_type);
+ if (allocated_resources_.end() == allocation) {
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is not allocated.");
+ return;
+ }
+
+ if (application_id != allocation->second) {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type
+ << " is allocated by different application "
+ << allocation->second);
+ return;
+ }
+
+ allocated_resources_.erase(allocation);
+ LOG4CXX_DEBUG(logger_, "Resource " << module_type << " is released.");
+ return;
+}
+
+void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() {
+ typedef std::vector<application_manager::ApplicationSharedPtr> Apps;
+ Apps app_list =
+ rc_plugin_.service()->GetApplications(rc_plugin_.GetModuleID());
+ Apps::const_iterator app = app_list.begin();
+ for (; app_list.end() != app; ++app) {
+ application_manager::ApplicationSharedPtr app_ptr = *app;
+ const uint32_t application_id = app_ptr->app_id();
+ Resources acquired_modules = GetAcquiredResources(application_id);
+ std::sort(acquired_modules.begin(), acquired_modules.end());
+
+ Resources allowed_modules;
+ rc_plugin_.service()->GetModuleTypes((*app)->policy_app_id(),
+ &allowed_modules);
+ std::sort(allowed_modules.begin(), allowed_modules.end());
+
+ LOG4CXX_DEBUG(logger_,
+ "Acquired modules: " << acquired_modules.size()
+ << " , allowed modules: "
+ << allowed_modules.size());
+
+ Resources disallowed_modules;
+ std::set_difference(acquired_modules.begin(),
+ acquired_modules.end(),
+ allowed_modules.begin(),
+ allowed_modules.end(),
+ std::back_inserter(disallowed_modules));
+
+ RCAppExtensionPtr rc_extention = GetApplicationExtention(app_ptr);
+ Resources::const_iterator module = disallowed_modules.begin();
+ for (; disallowed_modules.end() != module; ++module) {
+ ReleaseResource(*module, application_id);
+ if (rc_extention) {
+ rc_extention->UnsubscribeFromInteriorVehicleData(Json::Value(*module));
+ }
+ }
+ }
+}
+
+RCAppExtensionPtr ResourceAllocationManagerImpl::GetApplicationExtention(
+ application_manager::ApplicationSharedPtr application) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ if (!application) {
+ return NULL;
+ }
+
+ RCAppExtensionPtr rc_app_extension;
+ application_manager::AppExtensionPtr app_extension =
+ application->QueryInterface(rc_plugin_.GetModuleID());
+ if (!app_extension) {
+ return NULL;
+ }
+
+ rc_app_extension =
+ application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>(
+ app_extension);
+
+ return rc_app_extension;
+}
+
+void ResourceAllocationManagerImpl::RemoveAppsSubscriptions(const Apps& apps) {
+ Apps::const_iterator app = apps.begin();
+ for (; apps.end() != app; ++app) {
+ application_manager::ApplicationSharedPtr app_ptr = *app;
+ if (!app_ptr) {
+ continue;
+ }
+ RCAppExtensionPtr rc_extention = GetApplicationExtention(app_ptr);
+ if (rc_extention) {
+ rc_extention->UnsubscribeFromInteriorVehicleData();
+ }
+ }
+}
+
+std::vector<std::string> ResourceAllocationManagerImpl::GetAcquiredResources(
+ const uint32_t application_id) const {
+ LOG4CXX_AUTO_TRACE(logger_);
+ Resources allocated_resources;
+ AllocatedResources::const_iterator allocation = allocated_resources_.begin();
+ for (; allocated_resources_.end() != allocation; ++allocation) {
+ if (application_id == allocation->second) {
+ allocated_resources.push_back(allocation->first);
+ }
+ }
+
+ LOG4CXX_DEBUG(logger_,
+ "Application " << application_id << " acquired "
+ << allocated_resources.size()
+ << " resource(s).");
+
+ return allocated_resources;
+}
+
+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);
+ {
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ const AllocatedResources::const_iterator allocated_it =
+ allocated_resources_.find(module_type);
+
+ const bool acquired = allocated_resources_.end() != allocated_it;
+ if (acquired) {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " is already acquired."
+ << " Owner application id is "
+ << allocated_it->second
+ << " Changing application id is " << app_id);
+ } else {
+ LOG4CXX_DEBUG(logger_,
+ "Resource " << module_type << " is not acquired yet");
+ }
+ }
+
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ 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_);
+
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ 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) {
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ rejected_resources_for_application_.clear();
+ }
+ 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);
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ allocated_resources_[module_type] = app_id;
+}
+
+bool ResourceAllocationManagerImpl::IsModuleTypeRejected(
+ const std::string& module_type, const uint32_t app_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ RejectedResources::iterator it =
+ rejected_resources_for_application_.find(app_id);
+
+ if (rejected_resources_for_application_.end() == it) {
+ return false;
+ }
+
+ const std::vector<std::string>& 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_);
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ 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::string>();
+ }
+ std::vector<std::string>& list_of_rejected_resources =
+ rejected_resources_for_application_[app_id];
+ list_of_rejected_resources.push_back(module_type);
+}
+
+void ResourceAllocationManagerImpl::OnApplicationEvent(
+ functional_modules::ApplicationEvent event, const uint32_t application_id) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Event " << event << " came for " << application_id);
+
+ if (functional_modules::ApplicationEvent::kApplicationExit == event ||
+ functional_modules::ApplicationEvent::kApplicationUnregistered == event) {
+ Resources acquired_modules = GetAcquiredResources(application_id);
+ Resources::const_iterator module = acquired_modules.begin();
+ for (; acquired_modules.end() != module; ++module) {
+ ReleaseResource(*module, application_id);
+ }
+
+ Apps app_list;
+ app_list.push_back(rc_plugin_.service()->GetApplication(application_id));
+ RemoveAppsSubscriptions(app_list);
+ }
+}
+
+void ResourceAllocationManagerImpl::OnPolicyEvent(
+ functional_modules::PolicyEvent event) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ LOG4CXX_DEBUG(logger_, "Event " << event);
+
+ if (functional_modules::PolicyEvent::kApplicationPolicyUpdated == event) {
+ ProcessApplicationPolicyUpdate();
+ return;
+ }
+
+ if (functional_modules::PolicyEvent::kApplicationsDisabled == event) {
+ ResetAllAllocations();
+ application_manager::ServicePtr s = rc_plugin_.service();
+ Apps app_list = s->GetApplications(rc_plugin_.GetModuleID());
+ RemoveAppsSubscriptions(app_list);
+ return;
+ }
+}
+
+void ResourceAllocationManagerImpl::ResetAllAllocations() {
+ LOG4CXX_AUTO_TRACE(logger_);
+ {
+ sync_primitives::AutoLock lock(resources_state_lock_);
+ resources_state_.clear();
+ }
+ {
+ sync_primitives::AutoLock lock(allocated_resources_lock_);
+ allocated_resources_.clear();
+ }
+ {
+ sync_primitives::AutoLock lock(rejected_resources_for_application_lock_);
+ rejected_resources_for_application_.clear();
+ }
+}
+
+} // 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..6457b56397
--- /dev/null
+++ b/src/components/remote_control/test/CMakeLists.txt
@@ -0,0 +1,67 @@
+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}")
+
+# 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..09c706fc2f
--- /dev/null
+++ b/src/components/remote_control/test/commands/CMakeLists.txt
@@ -0,0 +1,62 @@
+# 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(${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..06a48fc077
--- /dev/null
+++ b/src/components/remote_control/test/commands/button_press_request_test.cc
@@ -0,0 +1,344 @@
+/*
+ * 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 "remote_control/rc_module_constants.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()
+ : rc_capabilities_(smart_objects::SmartType_Map)
+ , mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(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);
+ }
+
+ 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;
+ }
+
+ void SetUp() OVERRIDE {
+ using namespace remote_control;
+ using namespace mobile_apis;
+
+ std::vector<ButtonName::eType> 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++) {
+ button_caps[i] = ButtonCapability(button_names[i]);
+ }
+ rc_capabilities_[strings::kbuttonCapabilities] = button_caps;
+ ON_CALL(*mock_service_, GetRCCapabilities())
+ .WillByDefault(Return(&rc_capabilities_));
+ ON_CALL(*mock_service_, IsInterfaceAvailable(_))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_service_, IsRemoteControlApplication(_))
+ .WillByDefault(Return(true));
+ }
+
+ 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<Message>(
+ 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:
+ smart_objects::SmartObject rc_capabilities_;
+ utils::SharedPtr<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ testing::NiceMock<remote_control_test::MockRemotePluginInterface>
+ mock_module_;
+ testing::NiceMock<remote_control_test::MockResourceAllocationManager>
+ 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_, CheckModule(_, _)).WillOnce(Return(true));
+ 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(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
+ 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_, CheckModule(_, _)).WillOnce(Return(true));
+ 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(_))
+ .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..4ad833aa60
--- /dev/null
+++ b/src/components/remote_control/test/commands/get_interior_vehicle_data_request_test.cc
@@ -0,0 +1,291 @@
+/*
+ * 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<remote_control::commands::BaseCommandRequest>
+ GIVDRequestPtr;
+ typedef rc_event_engine::Event<application_manager::MessagePtr, std::string>
+ GIVD_HMI_Response;
+ GetInteriorVehicleDataRequestTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(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_));
+ ON_CALL(*mock_service_, IsInterfaceAvailable(_))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_service_, IsRemoteControlApplication(_))
+ .WillByDefault(Return(true));
+ 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<Message>(
+ 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<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> 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_, CheckModule(_, _)).WillOnce(Return(true));
+ 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(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
+ 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..7329890e94
--- /dev/null
+++ b/src/components/remote_control/test/commands/on_interior_vehicle_data_notification_test.cc
@@ -0,0 +1,182 @@
+/*
+ * 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<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(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<Message>(
+ 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<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ remote_control_test::MockRemotePluginInterface mock_module_;
+ std::vector<ApplicationSharedPtr> 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_app_, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3));
+ 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(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_3,
+ 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..5c13ea63d5
--- /dev/null
+++ b/src/components/remote_control/test/commands/on_remote_control_settings_test.cc
@@ -0,0 +1,326 @@
+/*
+ * 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<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(kModuleId)) {
+ ON_CALL(mock_module_, resource_allocation_manager())
+ .WillByDefault(ReturnRef(mock_allocation_manager_));
+ ON_CALL(*mock_service_, IsInterfaceAvailable(_))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_service_, IsRemoteControlApplication(_))
+ .WillByDefault(Return(true));
+ 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<Message>(
+ 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<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ remote_control_test::MockRemotePluginInterface mock_module_;
+ std::vector<ApplicationSharedPtr> apps_;
+ testing::NiceMock<remote_control_test::MockResourceAllocationManager>
+ 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..a219bc086d
--- /dev/null
+++ b/src/components/remote_control/test/commands/set_interior_vehicle_data_request_test.cc
@@ -0,0 +1,433 @@
+/*
+ * 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<NiceMock<MockService> >())
+ , mock_app_(utils::MakeShared<NiceMock<MockApplication> >())
+ , rc_app_extention_(
+ utils::MakeShared<remote_control::RCAppExtension>(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_service_, IsInterfaceAvailable(_))
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_service_, IsRemoteControlApplication(_))
+ .WillByDefault(Return(true));
+ 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<Message>(
+ 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<NiceMock<application_manager::MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_;
+ utils::SharedPtr<remote_control::RCAppExtension> rc_app_extention_;
+ testing::NiceMock<remote_control_test::MockRemotePluginInterface>
+ mock_module_;
+ testing::NiceMock<remote_control_test::MockResourceAllocationManager>
+ 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_, CheckModule(_, _)).WillOnce(Return(true));
+ 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(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
+ 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_, CheckModule(_, _)).WillOnce(Return(true));
+ 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(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_HMI,
+ 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));
+ 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))
+ .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_, CheckModule(_, _)).WillOnce(Return(true));
+ 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..2c4ce641ee
--- /dev/null
+++ b/src/components/remote_control/test/include/mock_application.h
@@ -0,0 +1,335 @@
+/*
+ * 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 <string>
+
+#include <string>
+#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_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));
+ 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 ::protocol_handler::MajorProtocolVersion& protocol_version));
+ MOCK_CONST_METHOD0(protocol_version,
+ ::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));
+ 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_projection_enabled, void(bool));
+ MOCK_CONST_METHOD0(mobile_projection_enabled, bool());
+
+ 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<uint32_t>&());
+
+#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..2e221ca75d
--- /dev/null
+++ b/src/components/remote_control/test/include/mock_remote_control_plugin.h
@@ -0,0 +1,54 @@
+#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 <stdint.h>
+#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<RCAppExtension> 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_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&());
+ MOCK_METHOD2(OnApplicationEvent,
+ void(functional_modules::ApplicationEvent event,
+ const uint32_t application_id));
+ MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
+};
+
+} // 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..d55af2b00d
--- /dev/null
+++ b/src/components/remote_control/test/include/mock_resource_allocation_manager.h
@@ -0,0 +1,40 @@
+#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 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_METHOD2(OnApplicationEvent,
+ void(functional_modules::ApplicationEvent event,
+ const uint32_t application_id));
+ MOCK_METHOD1(OnPolicyEvent, void(functional_modules::PolicyEvent event));
+ 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,
+ const remote_control::ResourceState::eType state));
+ MOCK_CONST_METHOD1(IsResourceFree, bool(const std::string& module_type));
+ MOCK_METHOD0(ResetAllAllocations, void());
+};
+
+} // 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/src/rc_app_extension_test.cc b/src/components/remote_control/test/src/rc_app_extension_test.cc
new file mode 100644
index 0000000000..78388ccbf1
--- /dev/null
+++ b/src/components/remote_control/test/src/rc_app_extension_test.cc
@@ -0,0 +1,43 @@
+/*
+ * 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);
+}
+
+} // 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 <dlfcn.h>
+#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<const char*>(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<Create>(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<application_manager::ApplicationSharedPtr> 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..57efb90551
--- /dev/null
+++ b/src/components/remote_control/test/src/rc_module_test.cc
@@ -0,0 +1,263 @@
+/*
+ * 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"
+#include "application_manager/mock_application_manager_settings.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 test::components::application_manager_test::
+ MockApplicationManagerSettings;
+
+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";
+const uint32_t kDefaultTimeout = 10000;
+}
+
+namespace remote_control {
+
+class RCModuleTest : public ::testing::Test {
+ public:
+ RCModuleTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_settings_(
+ utils::MakeShared<NiceMock<MockApplicationManagerSettings> >())
+ , mock_message_helper_(*MockMessageHelper::message_helper_mock())
+ , app0_(utils::MakeShared<NiceMock<MockApplication> >())
+ , app1_(utils::MakeShared<NiceMock<MockApplication> >())
+ , message_(utils::MakeShared<Message>(MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc)))
+ , rc_app_extention_(
+ utils::MakeShared<RCAppExtension>(module_.GetModuleID())) {}
+
+ void HandleMessage() {
+ module_.ProcessHMIMessage(message_);
+ }
+
+ protected:
+ RemoteControlPlugin module_;
+ utils::SharedPtr<NiceMock<MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplicationManagerSettings> > mock_settings_;
+ MockMessageHelper& mock_message_helper_;
+ std::vector<ApplicationSharedPtr> apps_;
+ utils::SharedPtr<NiceMock<MockApplication> > app0_;
+ utils::SharedPtr<NiceMock<MockApplication> > app1_;
+ application_manager::MessagePtr message_;
+ utils::SharedPtr<RCAppExtension> rc_app_extention_;
+
+ void SetUp() OVERRIDE {
+ Mock::VerifyAndClearExpectations(&mock_message_helper_);
+ ON_CALL(*mock_service_, GetSettings())
+ .WillByDefault(ReturnRef(*mock_settings_));
+ ON_CALL(*mock_settings_, default_timeout())
+ .WillByDefault(ReturnRef(kDefaultTimeout));
+ 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(*app0_, protocol_version())
+ .WillRepeatedly(
+ Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4));
+ 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_, 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);
+}
+
+} // 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..4d1b399add
--- /dev/null
+++ b/src/components/remote_control/test/src/resource_allocation_manager_impl_test.cc
@@ -0,0 +1,470 @@
+/*
+ * 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 <algorithm>
+#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"
+#include "interfaces/MOBILE_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 ::testing::DoAll;
+using ::testing::SetArgPointee;
+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 uint32_t kAppId1 = 11u;
+const uint32_t kAppId2 = 22u;
+const std::string policy_app_id_1_ = "policy_id_1";
+const functional_modules::ModuleID kDefaultModuleID = 0;
+}
+
+namespace remote_control {
+
+class RAManagerTest : public ::testing::Test {
+ public:
+ RAManagerTest()
+ : mock_service_(utils::MakeShared<NiceMock<MockService> >())
+ , mock_app_1_(utils::MakeShared<NiceMock<MockApplication> >())
+ , mock_app_2_(utils::MakeShared<NiceMock<MockApplication> >())
+ , message_(utils::MakeShared<Message>(MessagePriority::FromServiceType(
+ protocol_handler::ServiceType::kRpc))) {
+ EXPECT_CALL(mock_module_, service()).WillRepeatedly(Return(mock_service_));
+ EXPECT_CALL(mock_module_, GetModuleID())
+ .WillRepeatedly(Return(kDefaultModuleID));
+ }
+
+ 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<NiceMock<MockService> > mock_service_;
+ utils::SharedPtr<NiceMock<MockApplication> > mock_app_1_;
+ utils::SharedPtr<NiceMock<MockApplication> > 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, AppExit_ReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ ra_manager.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationExit, kAppId1);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) {
+ // 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));
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_2_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ // Act
+ ra_manager.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationExit, kAppId2);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(remote_control::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppUnregistered_ReleaseResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+
+ // Act
+ ra_manager.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationUnregistered, kAppId1);
+
+ 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, AnotherAppUnregistered_NoReleaseResource) {
+ // 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));
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_2_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ // Act
+ ra_manager.OnApplicationEvent(
+ functional_modules::ApplicationEvent::kApplicationUnregistered, kAppId2);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillOnce(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(remote_control::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId1));
+
+ std::vector<ApplicationSharedPtr> apps;
+ apps.push_back(mock_app_1_);
+ EXPECT_CALL(*mock_service_, GetApplications(_)).WillRepeatedly(Return(apps));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ // Act
+ ra_manager.OnPolicyEvent(
+ functional_modules::PolicyEvent::kApplicationsDisabled);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId2));
+}
+
+TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) {
+ // Arrange
+ ResourceAllocationManagerImpl ra_manager(mock_module_);
+ ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ RCAppExtensionPtr rc_extention_ptr = utils::MakeShared<RCAppExtension>(
+ application_manager::AppExtensionUID(kDefaultModuleID));
+
+ EXPECT_CALL(*mock_app_1_, QueryInterface(_))
+ .WillOnce(Return(rc_extention_ptr));
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId1))
+ .WillRepeatedly(Return(mock_app_1_));
+
+ EXPECT_CALL(*mock_app_1_, app_id()).WillRepeatedly(Return(kAppId1));
+
+ EXPECT_CALL(*mock_app_1_, policy_app_id())
+ .WillRepeatedly(Return(policy_app_id_1_));
+
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType1, kAppId1));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, kAppId1));
+
+ std::vector<application_manager::ApplicationSharedPtr> apps;
+ apps.push_back(mock_app_1_);
+ EXPECT_CALL(*mock_service_, GetApplications(_)).WillOnce(Return(apps));
+
+ Resources allowed_modules;
+ allowed_modules.push_back(kModuleType1);
+
+ EXPECT_CALL(*mock_service_, GetModuleTypes(policy_app_id_1_, _))
+ .WillOnce(DoAll(SetArgPointee<1>(allowed_modules), Return(true)));
+
+ // Act
+ ra_manager.OnPolicyEvent(
+ functional_modules::PolicyEvent::kApplicationPolicyUpdated);
+
+ EXPECT_CALL(*mock_service_, GetApplication(kAppId2))
+ .WillRepeatedly(Return(mock_app_2_));
+ EXPECT_CALL(*mock_app_2_, hmi_level())
+ .WillRepeatedly(Return(mobile_apis::HMILevel::HMI_FULL));
+ EXPECT_EQ(remote_control::AcquireResult::IN_USE,
+ ra_manager.AcquireResource(kModuleType1, kAppId2));
+ EXPECT_EQ(remote_control::AcquireResult::ALLOWED,
+ ra_manager.AcquireResource(kModuleType2, 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
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<char*>(cert_data.c_str()), cert_data.length());
+ BIO* bio_cert =
+ BIO_new_mem_buf(const_cast<char*>(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) {
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/
diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc
index 759b843961..88c484ffd4 100644
--- a/src/components/telemetry_monitor/src/telemetry_monitor.cc
+++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc
@@ -1,34 +1,34 @@
/*
- * 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.
- */
+* 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 "telemetry_monitor/telemetry_monitor.h"
@@ -59,7 +59,7 @@ TelemetryMonitor::TelemetryMonitor(const std::string& server_address,
, ph_observer(this) {}
void TelemetryMonitor::Start() {
- streamer_ = new Streamer(this);
+ streamer_ = streamer_ ? streamer_ : new Streamer(this);
thread_ = threads::CreateThread("TelemetryMonitor", streamer_);
}
@@ -86,6 +86,7 @@ int16_t TelemetryMonitor::port() const {
TelemetryMonitor::~TelemetryMonitor() {
Stop();
+ delete streamer_;
}
void TelemetryMonitor::Init(
@@ -170,6 +171,7 @@ void Streamer::exitThreadMain() {
LOG4CXX_AUTO_TRACE(logger_);
Stop();
messages_.Shutdown();
+ ThreadDelegate::exitThreadMain();
}
void Streamer::Start() {
diff --git a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
index 5043524a06..090c7ab5b7 100644
--- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
+++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc
@@ -90,14 +90,14 @@ TEST(TelemetryMonitorTest, MessageProcess) {
EXPECT_CALL(am_observeble, SetTelemetryObserver(_));
EXPECT_CALL(transport_manager_mock, SetTelemetryObserver(_));
telemetry_monitor::TelemetryMonitor telemetry_monitor(server_address, port);
- StreamerMock streamer_mock(&telemetry_monitor);
+ StreamerMock* streamer_mock = new StreamerMock(&telemetry_monitor);
+ // streamer_mock will be freed by telemetry_monitor on destruction
telemetry_monitor.Start();
-
- telemetry_monitor.set_streamer(&streamer_mock);
+ telemetry_monitor.set_streamer(streamer_mock);
telemetry_monitor.Init(
&protocol_handler_mock, &am_observeble, &transport_manager_mock);
utils::SharedPtr<telemetry_monitor::MetricWrapper> test_metric;
- EXPECT_CALL(streamer_mock, PushMessage(test_metric));
+ EXPECT_CALL(*streamer_mock, PushMessage(test_metric));
telemetry_monitor.SendMetric(test_metric);
}
diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc
index 14362050a2..c7cf3b2cb2 100644
--- a/src/components/transport_manager/test/transport_manager_impl_test.cc
+++ b/src/components/transport_manager/test/transport_manager_impl_test.cc
@@ -70,10 +70,10 @@ const uint32_t kAsyncExpectationsTimeout = 10000u;
class TransportManagerImplTest : public ::testing::Test {
protected:
TransportManagerImplTest()
- : tm_(settings)
- , device_handle_(1)
+ : device_handle_(1)
, mac_address_("MA:CA:DR:ES:S")
- , dev_info_(device_handle_, mac_address_, "TestDeviceName", "BTMAC") {}
+ , dev_info_(device_handle_, mac_address_, "TestDeviceName", "BTMAC")
+ , tm_(settings) {}
void SetUp() OVERRIDE {
resumption::LastStateImpl last_state_("app_storage_folder",
@@ -313,7 +313,6 @@ class TransportManagerImplTest : public ::testing::Test {
ASSERT_EQ(E_SUCCESS, tm_.Stop());
}
MockTransportManagerSettings settings;
- MockTransportManagerImpl tm_;
#ifdef TELEMETRY_MONITOR
MockTMTelemetryObserver mock_metric_observer_;
#endif // TELEMETRY_MONITOR
@@ -329,6 +328,7 @@ class TransportManagerImplTest : public ::testing::Test {
const DeviceInfo dev_info_;
DeviceList device_list_;
BaseErrorPtr error_;
+ MockTransportManagerImpl tm_;
};
TEST_F(TransportManagerImplTest, SearchDevices_AdaptersNotAdded) {
diff --git a/src/components/utils/include/utils/file_system.h b/src/components/utils/include/utils/file_system.h
index a46135a47b..22c200934f 100644
--- a/src/components/utils/include/utils/file_system.h
+++ b/src/components/utils/include/utils/file_system.h
@@ -38,6 +38,7 @@
#include <string>
#include <vector>
#include <iostream>
+#include <fstream>
namespace file_system {
diff --git a/src/components/utils/include/utils/log_message_loop_thread.h b/src/components/utils/include/utils/log_message_loop_thread.h
index deea1a07c0..d6a9edd072 100644
--- a/src/components/utils/include/utils/log_message_loop_thread.h
+++ b/src/components/utils/include/utils/log_message_loop_thread.h
@@ -66,6 +66,8 @@ class LogMessageLoopThread : public LogMessageLoopThreadTemplate {
LogMessageLoopThread();
~LogMessageLoopThread();
+ private:
+ LogMessageHandler* handler_;
DISALLOW_COPY_AND_ASSIGN(LogMessageLoopThread);
};
diff --git a/src/components/utils/src/file_system.cc b/src/components/utils/src/file_system.cc
index d31582c8e1..62a91ad1f3 100644
--- a/src/components/utils/src/file_system.cc
+++ b/src/components/utils/src/file_system.cc
@@ -73,15 +73,8 @@ size_t file_system::DirectorySize(const std::string& path) {
size_t size = 0;
int32_t return_code = 0;
DIR* directory = NULL;
-
-#ifndef __QNXNTO__
struct dirent dir_element_;
struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer = new char[offsetof(struct dirent, d_name) +
- pathconf(path.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
struct dirent* result = NULL;
struct stat file_info = {0};
directory = opendir(path.c_str());
@@ -97,19 +90,12 @@ size_t file_system::DirectorySize(const std::string& path) {
if (file_system::IsDirectory(full_element_path)) {
size += DirectorySize(full_element_path);
} else {
- if (0 != stat(full_element_path.c_str(), &file_info)) {
- LOG4CXX_WARN_WITH_ERRNO(
- logger_, "Could not get file info: " << full_element_path);
- } else {
- size += file_info.st_size;
- }
+ stat(full_element_path.c_str(), &file_info);
+ size += file_info.st_size;
}
}
}
closedir(directory);
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
return size;
}
@@ -245,15 +231,8 @@ bool file_system::DeleteFile(const std::string& name) {
void file_system::remove_directory_content(const std::string& directory_name) {
int32_t return_code = 0;
DIR* directory = NULL;
-#ifndef __QNXNTO__
struct dirent dir_element_;
struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer =
- new char[offsetof(struct dirent, d_name) +
- pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
struct dirent* result = NULL;
directory = opendir(directory_name.c_str());
@@ -283,9 +262,6 @@ void file_system::remove_directory_content(const std::string& directory_name) {
}
closedir(directory);
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
}
bool file_system::RemoveDirectory(const std::string& directory_name,
@@ -321,15 +297,8 @@ std::vector<std::string> file_system::ListFiles(
int32_t return_code = 0;
DIR* directory = NULL;
-#ifndef __QNXNTO__
struct dirent dir_element_;
struct dirent* dir_element = &dir_element_;
-#else
- char* direntbuffer =
- new char[offsetof(struct dirent, d_name) +
- pathconf(directory_name.c_str(), _PC_NAME_MAX) + 1];
- struct dirent* dir_element = new (direntbuffer) dirent;
-#endif
struct dirent* result = NULL;
directory = opendir(directory_name.c_str());
@@ -349,10 +318,6 @@ std::vector<std::string> file_system::ListFiles(
closedir(directory);
}
-#ifdef __QNXNTO__
- delete[] direntbuffer;
-#endif
-
return listFiles;
}
@@ -430,11 +395,7 @@ uint64_t file_system::GetFileModificationTime(const std::string& path) {
if (0 != stat(path.c_str(), &info)) {
LOG4CXX_WARN_WITH_ERRNO(logger_, "Could not get file mod time: " << path);
}
-#ifndef __QNXNTO__
return static_cast<uint64_t>(info.st_mtim.tv_nsec);
-#else
- return static_cast<uint64_t>(info.st_mtime);
-#endif
}
bool file_system::CopyFile(const std::string& src, const std::string& dst) {
diff --git a/src/components/utils/src/log_message_loop_thread.cc b/src/components/utils/src/log_message_loop_thread.cc
index 77bc8107eb..2b7f28fbfd 100644
--- a/src/components/utils/src/log_message_loop_thread.cc
+++ b/src/components/utils/src/log_message_loop_thread.cc
@@ -44,12 +44,14 @@ void LogMessageHandler::Handle(const LogMessage message) {
}
LogMessageLoopThread::LogMessageLoopThread()
- : LogMessageLoopThreadTemplate("Logger", new LogMessageHandler()) {}
+ : LogMessageLoopThreadTemplate("Logger",
+ handler_ = new LogMessageHandler()) {}
LogMessageLoopThread::~LogMessageLoopThread() {
// we'll have to drop messages
// while deleting logger thread
logger_status = DeletingLoggerThread;
+ delete handler_;
}
} // namespace logger
diff --git a/src/components/utils/src/threads/thread_delegate.cc b/src/components/utils/src/threads/thread_delegate.cc
index 7bdce000da..917603f92c 100644
--- a/src/components/utils/src/threads/thread_delegate.cc
+++ b/src/components/utils/src/threads/thread_delegate.cc
@@ -52,6 +52,7 @@ void ThreadDelegate::exitThreadMain() {
} else {
pthread_cancel(thread_->thread_handle());
}
+ thread_ = NULL;
}
}
diff --git a/src/components/utils/test/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc
index 3dd6383588..65abad65c2 100644
--- a/src/components/utils/test/async_runner_test.cc
+++ b/src/components/utils/test/async_runner_test.cc
@@ -30,57 +30,72 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <ctime>
#include <stdlib.h>
-
-#include "gtest/gtest.h"
-
+#include <ctime>
+#include <memory>
#include "utils/lock.h"
-#include "utils/conditional_variable.h"
#include "utils/threads/async_runner.h"
+#include "utils/conditional_variable.h"
+#include "utils/shared_ptr.h"
+#include "utils/make_shared.h"
+
+#include "gtest/gtest.h"
+#include "gmock/gmock.h"
namespace test {
namespace components {
-namespace utils_test {
+namespace utils {
-using namespace sync_primitives;
using namespace threads;
namespace {
-uint32_t check_value = 0;
+size_t kCheckValue = 0u;
+const size_t kDelegatesAmount = 4u;
}
// ThreadDelegate successor
class TestThreadDelegate : public ThreadDelegate {
public:
+ TestThreadDelegate(sync_primitives::ConditionalVariable& cond_var,
+ sync_primitives::Lock& test_lock)
+ : cond_var_(cond_var), test_lock_(test_lock) {}
+
void threadMain() {
- ++check_value;
+ sync_primitives::AutoLock lock(test_lock_);
+ ++kCheckValue;
+ cond_var_.NotifyOne();
}
+
+ protected:
+ sync_primitives::ConditionalVariable& cond_var_;
+ sync_primitives::Lock& test_lock_;
+};
+
+class MockThreadDelegate : public ThreadDelegate {
+ public:
+ MOCK_METHOD0(threadMain, void());
+ MOCK_METHOD0(exitThreadMain, void());
};
class AsyncRunnerTest : public ::testing::Test {
public:
- AsyncRunnerTest() : kDelegatesNum_(1), asr_pt_(NULL) {
+ AsyncRunnerTest() {
+ // Clear global value before test execution
+ kCheckValue = 0;
CreateAsyncRunner();
CreateThreadsArray();
}
~AsyncRunnerTest() {
- DeleteAsyncRunner();
DeleteThreadsArray();
}
protected:
- Lock test_lock_;
- uint32_t kDelegatesNum_;
- ConditionalVariable cond_var_;
- TestThreadDelegate** delegates_;
- AsyncRunner* asr_pt_;
+ ThreadDelegate** delegates_;
+ ::utils::SharedPtr<AsyncRunner> async_runner_;
void CreateThreadsArray() {
- srand(std::time(NULL));
- kDelegatesNum_ = (rand() % 20 + 1);
- delegates_ = new TestThreadDelegate* [kDelegatesNum_];
+ delegates_ = new ThreadDelegate* [kDelegatesAmount];
}
void DeleteThreadsArray() {
@@ -88,53 +103,38 @@ class AsyncRunnerTest : public ::testing::Test {
}
void CreateAsyncRunner() {
- asr_pt_ = new AsyncRunner("test");
- }
- void DeleteAsyncRunner() {
- delete asr_pt_;
+ async_runner_ = ::utils::MakeShared<AsyncRunner>("test");
}
};
TEST_F(AsyncRunnerTest, ASyncRunManyDelegates_ExpectSuccessfulAllDelegatesRun) {
- AutoLock lock(test_lock_);
- // Clear global value before test
- check_value = 0;
// Create Delegates and run
- for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
- delegates_[i] = new TestThreadDelegate();
- asr_pt_->AsyncRun(delegates_[i]);
+ sync_primitives::ConditionalVariable cond_var;
+ sync_primitives::Lock test_lock;
+ for (size_t i = 0; i < kDelegatesAmount; ++i) {
+ sync_primitives::AutoLock lock(test_lock);
+ delegates_[i] = new TestThreadDelegate(cond_var, test_lock);
+ async_runner_->AsyncRun(delegates_[i]);
+ // Wait for delegate to be run
+ cond_var.WaitFor(lock, 1500);
}
- // Wait for 2 secs. Give this time to delegates to be run
- cond_var_.WaitFor(lock, 2000);
- // Expect all delegates run successfully
- EXPECT_EQ(kDelegatesNum_, check_value);
+ // Expect all delegates started successfully
+ EXPECT_EQ(kDelegatesAmount, kCheckValue);
}
-// TODO(VVeremjova) APPLINK-12834 Sometimes delegates do not run
-TEST_F(AsyncRunnerTest,
- DISABLED_RunManyDelegatesAndStop_ExpectSuccessfulDelegatesStop) {
- AutoLock lock(test_lock_);
- // Clear global value before test
- check_value = 0;
- // Create Delegates
- for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
- delegates_[i] = new TestThreadDelegate();
- }
- // Wait for 2 secs
- cond_var_.WaitFor(lock, 2000);
- // Run created delegates
- for (unsigned int i = 0; i < kDelegatesNum_; ++i) {
- if (kDelegatesNum_ > 1) {
- if (i == kDelegatesNum_ / 2) {
- asr_pt_->Stop();
- }
- }
- asr_pt_->AsyncRun(delegates_[i]);
+TEST_F(AsyncRunnerTest, StopThenRun_ExpectDelegateNotStarted) {
+ // Create Delegate mock
+ MockThreadDelegate mock_thread_delegate;
+ // Check that delegate was not started due to Stop() called before AsyncRun()
+ EXPECT_CALL(mock_thread_delegate, threadMain()).Times(0);
+ {
+ ::utils::SharedPtr<AsyncRunner> async_runner =
+ ::utils::MakeShared<AsyncRunner>("test");
+ async_runner->Stop();
+ async_runner->AsyncRun(&mock_thread_delegate);
}
- // Expect 3 delegates run successlully. The other stopped.
- EXPECT_EQ(kDelegatesNum_ / 2, check_value);
}
-} // namespace utils_test
+} // namespace utils
} // namespace components
} // namespace test
diff --git a/src/components/utils/test/conditional_variable_test.cc b/src/components/utils/test/conditional_variable_test.cc
index 86c9dfa2e0..524d53cafa 100644
--- a/src/components/utils/test/conditional_variable_test.cc
+++ b/src/components/utils/test/conditional_variable_test.cc
@@ -123,7 +123,7 @@ TEST_F(
CheckWaitForWithTimeout1sec_ThreadBlockedForTimeout_ExpectSuccessfulWakeUp) {
sync_primitives::AutoLock test_lock(test_mutex_);
sync_primitives::ConditionalVariable::WaitStatus wait_st =
- cond_var_.WaitFor(test_lock, 1000);
+ cond_var_.WaitFor(test_lock, 10);
EXPECT_EQ(sync_primitives::ConditionalVariable::kTimeout, wait_st);
}
diff --git a/src/components/utils/test/messagemeter_test.cc b/src/components/utils/test/messagemeter_test.cc
index efaaa41252..4ec14ac1cc 100644
--- a/src/components/utils/test/messagemeter_test.cc
+++ b/src/components/utils/test/messagemeter_test.cc
@@ -126,7 +126,8 @@ TEST(MessageMeterTest, AddingWithNullTimeRange) {
}
}
-TEST_P(MessageMeterTest, TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
+TEST_P(MessageMeterTest,
+ DISABLED_TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
size_t messages = 0;
const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
// Add messages for less range period
@@ -150,7 +151,7 @@ TEST_P(MessageMeterTest, TrackMessage_AddingOverPeriod_CorrectCountOfMessages) {
}
TEST_P(MessageMeterTest,
- TrackMessage_AddingOverPeriodMultiIds_CorrectCountOfMessages) {
+ DISABLED_TrackMessage_AddingOverPeriodMultiIds_CorrectCountOfMessages) {
size_t messages = 0;
const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
// Add messages for less range period
@@ -184,7 +185,8 @@ TEST_P(MessageMeterTest,
}
}
-TEST_P(MessageMeterTest, Frequency_CountingOverPeriod_CorrectCountOfMessages) {
+TEST_P(MessageMeterTest,
+ DISABLED_Frequency_CountingOverPeriod_CorrectCountOfMessages) {
const size_t one_message = 1;
const TimevalStruct start_time = date_time::DateTime::getCurrentTime();
EXPECT_EQ(one_message, meter.TrackMessage(id1));
@@ -206,7 +208,7 @@ TEST_P(MessageMeterTest, Frequency_CountingOverPeriod_CorrectCountOfMessages) {
}
}
-TEST_P(MessageMeterTest, CountingOutOfPeriod) {
+TEST_P(MessageMeterTest, DISABLED_CountingOutOfPeriod) {
const size_t one_message = 1;
EXPECT_EQ(one_message, meter.TrackMessage(id1));
EXPECT_EQ(one_message, meter.TrackMessage(id2));
diff --git a/src/components/utils/test/scope_guard_test.cc b/src/components/utils/test/scope_guard_test.cc
index 85abbd90de..5e685d6aba 100644
--- a/src/components/utils/test/scope_guard_test.cc
+++ b/src/components/utils/test/scope_guard_test.cc
@@ -43,7 +43,7 @@ using ::utils::MakeGuard;
using ::utils::MakeObjGuard;
using ::testing::Mock;
-class TestObject {
+class TestCalleeObject {
public:
MOCK_METHOD0(function_to_call, void());
MOCK_METHOD1(function_to_call_with_param, void(void*));
@@ -68,21 +68,21 @@ TEST(ScopeGuardTest, CallFreeFunctionWithParam) {
}
TEST(ScopeGuardTest, CallObjectFunction) {
- TestObject obj;
+ TestCalleeObject obj;
Mock::AllowLeak(&obj); // Google tests bug
EXPECT_CALL(obj, function_to_call()).Times(1);
{
- ScopeGuard guard = MakeObjGuard(obj, &TestObject::function_to_call);
+ ScopeGuard guard = MakeObjGuard(obj, &TestCalleeObject::function_to_call);
UNUSED(guard);
}
}
TEST(ScopeGuardTest, CallObjectFunctionWithParam) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call_with_param(&obj)).Times(1);
{
ScopeGuard guard =
- MakeObjGuard(obj, &TestObject::function_to_call_with_param, &obj);
+ MakeObjGuard(obj, &TestCalleeObject::function_to_call_with_param, &obj);
UNUSED(guard);
}
}
@@ -98,20 +98,20 @@ TEST(ScopeGuardTest, DismissCallFreeFunctionWithParam) {
}
TEST(ScopeGuardTest, DismissCallObjectFunction) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call()).Times(0);
{
- ScopeGuard guard = MakeObjGuard(obj, &TestObject::function_to_call);
+ ScopeGuard guard = MakeObjGuard(obj, &TestCalleeObject::function_to_call);
guard.Dismiss();
}
}
TEST(ScopeGuardTest, DismissCallObjectFunctionWithParam) {
- TestObject obj;
+ TestCalleeObject obj;
EXPECT_CALL(obj, function_to_call_with_param(&obj)).Times(0);
{
ScopeGuard guard =
- MakeObjGuard(obj, &TestObject::function_to_call_with_param, &obj);
+ MakeObjGuard(obj, &TestCalleeObject::function_to_call_with_param, &obj);
guard.Dismiss();
}
}
diff --git a/src/components/utils/test/shared_ptr_test.cc b/src/components/utils/test/shared_ptr_test.cc
index a30f2f66eb..99fe4f7dd7 100644
--- a/src/components/utils/test/shared_ptr_test.cc
+++ b/src/components/utils/test/shared_ptr_test.cc
@@ -507,7 +507,7 @@ TEST(SharedPtrTest, ValidMethodTest_ExpectCorrectValidation) {
ASSERT_FALSE(p2.valid());
}
-TEST(SharedPtrTest, StressTest) {
+TEST(SharedPtrTest, DISABLED_StressTest) {
// Arrange
const size_t kNumIterations = 1024U * 1024U;
diff --git a/src/components/utils/test/sqlite_wrapper/sql_query_test.cc b/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
index b481e45fd3..c10c26a2c7 100644
--- a/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
+++ b/src/components/utils/test/sqlite_wrapper/sql_query_test.cc
@@ -97,7 +97,9 @@ class SQLQueryTest : public ::testing::Test {
};
sqlite3* SQLQueryTest::conn = 0;
-const std::string SQLQueryTest::kDatabaseName = "test-query";
+
+// mounting /tmp as tmpfs will descrease utils unit tests runing time
+const std::string SQLQueryTest::kDatabaseName = "/tmp/test-query";
TEST_F(SQLQueryTest, Query_CreateQuery_QueryInDBEqualCreated) {
// arrange