From 260dc1608ec2a2e37c0620897e46f3f892e94ca1 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Mon, 25 May 2015 15:22:27 +0900 Subject: [PATCH] Fix for aarch64 build Change-Id: I726865138971b04bf2dc99570e60fb4f534d0bbf --- CMakeLists.txt | 5 +++++ packaging/wrt.spec | 14 +++++++------- src/bundle/CMakeLists.txt | 2 +- src/bundle/injected_bundle.cc | 3 +-- src/bundle/xwalk_v8tools_module.h | 2 +- src/common/CMakeLists.txt | 2 ++ src/common/constants.cc | 3 --- src/common/constants.h | 3 --- src/common/resource_manager.cc | 2 +- src/extension/CMakeLists.txt | 2 ++ src/extension/extension_server.cc | 9 ++++++++- src/extension/widget/CMakeLists.txt | 6 +++--- src/runtime/native_window.cc | 3 +-- src/runtime/web_view_impl.cc | 14 ++++++++++---- tests/popup/popup.cc | 4 ---- 15 files changed, 42 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 405a676..6b7e811 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,11 @@ IF(WAYLAND_SUPPORT) ADD_DEFINITIONS("-DHAVE_WAYLAND") ENDIF(WAYLAND_SUPPORT) +IF(NOT EXTENSION_PATH) + SET(EXTENSION_PATH ${LIB_INSTALL_DIR}/tizen-extensions-crosswalk) +ENDIF(NOT EXTENSION_PATH) +ADD_DEFINITIONS("-DEXTENSION_PATH=\"${EXTENSION_PATH}\"") + # Targets names SET(TARGET_RUNTIME "wrt") SET(TARGET_COMMON_STATIC "wrt-common-static") diff --git a/packaging/wrt.spec b/packaging/wrt.spec index 40198e4..35652dc 100755 --- a/packaging/wrt.spec +++ b/packaging/wrt.spec @@ -48,13 +48,11 @@ Runtime for Web Application %prep %setup -q +%define extension_path %{_libdir}/tizen-extensions-crosswalk + %build -%ifarch %{arm} -%define build_dir build-arm -%else -%define build_dir build-x86 -%endif +%define build_dir cmake_build_dir %if %{with x} %define enable_x11 On @@ -72,9 +70,11 @@ mkdir -p %{build_dir} cd %{build_dir} cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DLIB_INSTALL_DIR=%{_libdir} \ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \ -DX11_SUPPORT=%{enable_x11} \ - -DWAYLAND_SUPPORT=%{enable_wayland} + -DWAYLAND_SUPPORT=%{enable_wayland} \ + -DEXTENSION_PATH=%{extension_path} make %{?jobs:-j%jobs} @@ -90,5 +90,5 @@ rm -fr %{buildroot} %attr(755,root,root) %{_bindir}/wrt-popup-test %attr(644,root,root) %{_datadir}/edje/wrt/wrt.edj %attr(644,root,root) %{_libdir}/libwrt-injected-bundle.so -%attr(644,root,root) %{_libdir}/tizen-extensions-crosswalk/libwidget-plugin.so +%attr(644,root,root) %{extension_path}/libwidget-plugin.so %attr(755,root,root) %{_datadir}/locale/* diff --git a/src/bundle/CMakeLists.txt b/src/bundle/CMakeLists.txt index 81a8757..6590a16 100755 --- a/src/bundle/CMakeLists.txt +++ b/src/bundle/CMakeLists.txt @@ -63,7 +63,7 @@ SET_TARGET_PROPERTIES(${TARGET_INJECTED_BUNDLE} PROPERTIES ) INSTALL(TARGETS ${TARGET_INJECTED_BUNDLE} - DESTINATION lib/ + DESTINATION ${LIB_INSTALL_DIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) diff --git a/src/bundle/injected_bundle.cc b/src/bundle/injected_bundle.cc index 593e3bf..5a1cf62 100755 --- a/src/bundle/injected_bundle.cc +++ b/src/bundle/injected_bundle.cc @@ -93,8 +93,7 @@ extern "C" void DynamicPluginStopSession( } extern "C" void DynamicUrlParsing( - std::string* old_url, std::string* new_url, const char* tizen_id) { - // LOGGER(DEBUG) << "InjectedBundle::DynamicUrlParsing !!" << tizen_id; + std::string* old_url, std::string* new_url, const char* /*tizen_id*/) { auto res_manager = wrt::BundleGlobalData::GetInstance()->resource_manager(); if (res_manager == NULL) { LOGGER(ERROR) << "Widget Info was not set, Resource Manager is NULL"; diff --git a/src/bundle/xwalk_v8tools_module.h b/src/bundle/xwalk_v8tools_module.h index d330547..42c7389 100755 --- a/src/bundle/xwalk_v8tools_module.h +++ b/src/bundle/xwalk_v8tools_module.h @@ -24,4 +24,4 @@ class XWalkV8ToolsModule : public NativeModule { } // namespace wrt -#endif // WRT_BUNDLE_XWALK_V8TOOLS_MODULE_H_ \ No newline at end of file +#endif // WRT_BUNDLE_XWALK_V8TOOLS_MODULE_H_ diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 54a2f63..dd7e1a8 100755 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -40,6 +40,8 @@ INCLUDE_DIRECTORIES(${TARGET_COMMON_STATIC_INCS}) ADD_LIBRARY(${TARGET_COMMON_STATIC} STATIC ${TARGET_COMMON_STATIC_SRCS} ) +SET_TARGET_PROPERTIES(${TARGET_COMMON_STATIC} PROPERTIES + COMPILE_FLAGS -fPIC) TARGET_LINK_LIBRARIES(${TARGET_COMMON_STATIC} ${TARGET_COMMON_STATIC_DEPS_LIBRARIES} ) diff --git a/src/common/constants.cc b/src/common/constants.cc index d07af1a..4d35be8 100644 --- a/src/common/constants.cc +++ b/src/common/constants.cc @@ -7,9 +7,6 @@ namespace wrt { // Extension -const char kSystemExtensionPath[] = "/usr/lib/tizen-extensions-crosswalk"; -const char kExtensionPrefix[] = "lib"; -const char kExtensionSuffix[] = ".so"; const char kSwitchExtensionServer[] = "extension-server"; // DBus for Application diff --git a/src/common/constants.h b/src/common/constants.h index 3545551..e650c44 100644 --- a/src/common/constants.h +++ b/src/common/constants.h @@ -7,9 +7,6 @@ namespace wrt { -extern const char kSystemExtensionPath[]; -extern const char kExtensionPrefix[]; -extern const char kExtensionSuffix[]; extern const char kSwitchExtensionServer[]; extern const char kDBusNameForApplication[]; diff --git a/src/common/resource_manager.cc b/src/common/resource_manager.cc index 8ad5383..e044fea 100755 --- a/src/common/resource_manager.cc +++ b/src/common/resource_manager.cc @@ -48,7 +48,7 @@ static std::string GetMimeFromUri(const std::string& uri) { std::string file_uri_case(kSchemeTypeFile); int ret = AUL_R_EINVAL; char mimetype[128] = {0, }; - int pos = std::string::npos; + size_t pos = std::string::npos; if (utils::StartsWith(uri, file_uri_case)) { // case 1. uri = file:///xxxx ret = aul_get_mime_from_file(uri.substr(pos+file_uri_case.length()).c_str(), diff --git a/src/extension/CMakeLists.txt b/src/extension/CMakeLists.txt index 13a3080..e0fbc99 100755 --- a/src/extension/CMakeLists.txt +++ b/src/extension/CMakeLists.txt @@ -24,6 +24,8 @@ INCLUDE_DIRECTORIES(${TARGET_EXTENSION_STATIC_INCS}) ADD_LIBRARY(${TARGET_EXTENSION_STATIC} STATIC ${TARGET_EXTENSION_STATIC_SRCS} ) +SET_TARGET_PROPERTIES(${TARGET_EXTENSION_STATIC} PROPERTIES + COMPILE_FLAGS -fPIC) TARGET_LINK_LIBRARIES(${TARGET_EXTENSION_STATIC} ${TARGET_EXTENSION_STATIC_DEPS_LIBRARIES} ${TARGET_COMMON_STATIC} diff --git a/src/extension/extension_server.cc b/src/extension/extension_server.cc index 683d490..e6ff11f 100644 --- a/src/extension/extension_server.cc +++ b/src/extension/extension_server.cc @@ -22,6 +22,9 @@ namespace wrt { namespace { +const char kExtensionPrefix[] = "lib"; +const char kExtensionSuffix[] = ".so"; + const char kDBusIntrospectionXML[] = "" " " @@ -111,7 +114,11 @@ void ExtensionServer::RegisterExtension(const std::string& path) { } void ExtensionServer::RegisterSystemExtensions() { - std::string extension_path(kSystemExtensionPath); +#ifdef EXTENSION_PATH + std::string extension_path(EXTENSION_PATH); +#else + #error EXTENSION_PATH is not set. +#endif extension_path.append("/"); extension_path.append(kExtensionPrefix); extension_path.append("*"); diff --git a/src/extension/widget/CMakeLists.txt b/src/extension/widget/CMakeLists.txt index 4ff80d7..f4f7141 100755 --- a/src/extension/widget/CMakeLists.txt +++ b/src/extension/widget/CMakeLists.txt @@ -23,7 +23,7 @@ SET(TARGET_WIDGET_PLUGIN_INCS ) # Libraries -SET(TARGET_INJECTED_BUNDLE_LIBS +SET(TARGET_WIDGET_PLUGIN_LIBS ${TARGET_WIDGET_PLUGIN_DEPS_LIBRARIES} ) @@ -39,7 +39,7 @@ ADD_LIBRARY(${TARGET_WIDGET_PLUGIN} SHARED ) TARGET_LINK_LIBRARIES(${TARGET_WIDGET_PLUGIN} - ${TARGET_INJECTED_BUNDLE_LIBS} + ${TARGET_WIDGET_PLUGIN_LIBS} ${TARGET_COMMON_STATIC} ) @@ -51,7 +51,7 @@ SET_TARGET_PROPERTIES(${TARGET_WIDGET_PLUGIN} PROPERTIES ) INSTALL(TARGETS ${TARGET_WIDGET_PLUGIN} - DESTINATION lib/tizen-extensions-crosswalk/ + DESTINATION ${EXTENSION_PATH} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) diff --git a/src/runtime/native_window.cc b/src/runtime/native_window.cc index b2e1b00..868718e 100755 --- a/src/runtime/native_window.cc +++ b/src/runtime/native_window.cc @@ -37,13 +37,12 @@ NativeWindow::~NativeWindow() { } void NativeWindow::Initialize() { - uint16_t pid = getpid(); - // window window_ = CreateWindowInternal(); elm_win_conformant_set(window_, EINA_TRUE); int w, h; #if defined(HAVE_X11) + uint16_t pid = getpid(); ecore_x_window_prop_property_set( elm_win_xwindow_get(window_), ECORE_X_ATOM_NET_WM_PID, diff --git a/src/runtime/web_view_impl.cc b/src/runtime/web_view_impl.cc index aecdc9d..2c09fa6 100755 --- a/src/runtime/web_view_impl.cc +++ b/src/runtime/web_view_impl.cc @@ -157,7 +157,7 @@ void WebViewImpl::InitKeyCallback() { void* event_info) -> void { WebViewImpl* self = static_cast(user_data); Ea_Callback_Type key = static_cast( - reinterpret_cast(event_info)); + *static_cast(event_info)); self->OnKeyEvent(key); }; ea_object_event_callback_add(ewk_view_, @@ -286,10 +286,12 @@ void WebViewImpl::InitQuotaExceededCallback() { // check http://tizen.org/privilege/unlimitedstorage // callback for database quota exceeded + // TODO(wy80.choi): AARCH64: + // Fix ewk api to use stdint types instead of longlong. auto database_exceeded_callback = [](Evas_Object* view, Ewk_Security_Origin* origin, const char*, - uint64_t, + unsigned long long, void* user_data) -> Eina_Bool { WebViewImpl* self = static_cast(user_data); if (self == NULL || self->listener_ == NULL) @@ -317,9 +319,11 @@ void WebViewImpl::InitQuotaExceededCallback() { this); // callback for indexed database quota exceeded + // TODO(wy80.choi): AARCH64: + // Fix ewk api to use stdint types instead of longlong. auto indexed_db_exceeded_callback = [](Evas_Object* view, Ewk_Security_Origin* origin, - int64_t, + long long, void* user_data) -> Eina_Bool { WebViewImpl* self = static_cast(user_data); if (self == NULL || self->listener_ == NULL) @@ -347,9 +351,11 @@ void WebViewImpl::InitQuotaExceededCallback() { this); // callback for localfile quota exceeded + // TODO(wy80.choi): AARCH64: + // Fix ewk api to use stdint types instead of longlong. auto localfile_exceeded_callback = [](Evas_Object* view, Ewk_Security_Origin* origin, - int64_t, + long long, void* user_data) -> Eina_Bool { WebViewImpl* self = static_cast(user_data); if (self == NULL || self->listener_ == NULL) diff --git a/tests/popup/popup.cc b/tests/popup/popup.cc index b4e0b7c..eec0b63 100755 --- a/tests/popup/popup.cc +++ b/tests/popup/popup.cc @@ -14,15 +14,11 @@ namespace wrt { namespace { -const char* kEdjPath = "/usr/share/edje/wrt/wrt.edj"; -const char* kEdcGroupName = "PopupCommon"; - const char* kContentTitle = "title,text"; const char* kContentButton1 = "button1"; const char* kContentButton2 = "button2"; const char* kStyleDefault = "default"; -const char* kStylePopup = "popup"; const char* kStyleLabel = "default"; const char* kStyleButton = "popup"; const char* kStyleEditPw = "editfield/password/popup"; -- 2.7.4