From: WonYoung Choi Date: Fri, 7 Aug 2015 10:47:45 +0000 (+0900) Subject: Fix rpath for 64bits architecture X-Git-Tag: submit/tizen/20150807.110325^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85a0466c60eeabe9cb65ccd881424c42763fbbda;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git Fix rpath for 64bits architecture Change-Id: I3b048ce1ff77ce9efd3b62de20237c5b0fb08572 --- diff --git a/packaging/webapi-plugins.spec b/packaging/webapi-plugins.spec index c7d9d4f3..d4ec4d54 100755 --- a/packaging/webapi-plugins.spec +++ b/packaging/webapi-plugins.spec @@ -7,6 +7,8 @@ %define crosswalk_extensions tizen-extensions-crosswalk +%define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions} + Name: webapi-plugins Version: 0.21 Release: 0 @@ -450,6 +452,7 @@ webapi-plugins development headers export GYP_GENERATORS='ninja' GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{profile} -Dprivilege_engine=%{tizen_privilege_engine}" GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}" +GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}" # feature flags GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}" @@ -492,7 +495,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_feature_sound_s GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_feature_system_info_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_feature_system_setting_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_feature_telephony_support}" -GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{tizen_feature_time_support}" +GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_feature_time_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_feature_inputdevice_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_feature_web_setting_support}" GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_feature_wi_fi_support}" @@ -507,8 +510,8 @@ cp LICENSE %{buildroot}/usr/share/license/%{name} cat LICENSE.BSD-2.0 >> %{buildroot}/usr/share/license/%{name} # Extensions. -mkdir -p %{buildroot}%{_libdir}/%{crosswalk_extensions} -install -p -m 644 out/Default/libtizen*.so %{buildroot}%{_libdir}/%{crosswalk_extensions} +mkdir -p %{buildroot}%{crosswalk_extensions_path} +install -p -m 644 out/Default/libtizen*.so %{buildroot}%{crosswalk_extensions_path} # devel files mkdir -p %{buildroot}%{_libdir}/pkgconfig @@ -525,15 +528,17 @@ cp -a tools/gyp %{buildroot}%{_includedir}/%{name}/tools/gyp cp -a tools/slimit %{buildroot}%{_includedir}/%{name}/tools/slimit # execute desc_gentool -LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}/%{crosswalk_extensions} out/Default/desc_gentool %{buildroot}%{_libdir}/%{crosswalk_extensions} > plugins.json +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path} out/Default/desc_gentool \ + %{crosswalk_extensions_path} \ + %{buildroot}%{crosswalk_extensions_path} > plugins.json # temporary plugins description for lazy loading -install -p -m 644 plugins.json %{buildroot}%{_libdir}/%{crosswalk_extensions}/plugins.json +install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/plugins.json %files -%{_libdir}/%{crosswalk_extensions}/libtizen*.so -%{_libdir}/%{crosswalk_extensions}/plugins.json +%{crosswalk_extensions_path}/libtizen*.so +%{crosswalk_extensions_path}/plugins.json %{_datadir}/license/%{name} %manifest webapi-plugins.manifest diff --git a/src/common/common.gypi b/src/common/common.gypi index b2fcc609..ae3d6b1f 100644 --- a/src/common/common.gypi +++ b/src/common/common.gypi @@ -85,7 +85,7 @@ ], 'libraries' : [ '-L .', - '-Wl,-rpath=/usr/lib/tizen-extensions-crosswalk', + '-Wl,-rpath=<(crosswalk_extensions_path)', ], }, } diff --git a/src/tool/desc_gentool.cc b/src/tool/desc_gentool.cc index 69fc6ceb..60d4646a 100644 --- a/src/tool/desc_gentool.cc +++ b/src/tool/desc_gentool.cc @@ -12,7 +12,6 @@ static std::string prefix_ = "libtizen"; static std::string postfix_ = ".so"; -static std::string target_path_ = "/usr/lib/tizen-extensions-crosswalk/"; static std::vector apinamespaces = {"tizen", "xwalk"}; typedef common::Extension *(*CreateExtensionFunc)(void); @@ -148,20 +147,25 @@ const void* get_interface(const char* name) { } int main(int argc, char* argv[]) { - if (argc < 2) { + if (argc < 3) { std::cerr << "Need tizen crosswalk path" << std::endl; return -1; } - std::string tce_path = argv[1]; - - if (tce_path.empty()) { + std::string lib_path = argv[1]; + if (lib_path.empty()) { + std::cerr << "Invalid libpath for tec." << std::endl; + return -1; + } + + std::string tec_path = argv[2]; + if (tec_path.empty()) { std::cerr << "Invalid tizen crosswalk path" << std::endl; return -1; } DIR * dir; struct dirent *ent; - if ((dir = opendir(tce_path.c_str())) != NULL) { + if ((dir = opendir(tec_path.c_str())) != NULL) { while ((ent = readdir(dir)) != NULL) { std::string fname = ent->d_name; @@ -169,7 +173,7 @@ int main(int argc, char* argv[]) { !fname.compare(0, prefix_.size(), prefix_) && !fname.compare(fname.size() - postfix_.size(), postfix_.size(), postfix_)) { - std::string so_path = tce_path + "/" + fname; + std::string so_path = tec_path + "/" + fname; char* error; void *handle = dlopen(so_path.c_str(), RTLD_LAZY); if ((error = dlerror()) != NULL) { @@ -186,7 +190,7 @@ int main(int argc, char* argv[]) { } else { ext++; descriptions[ext] = module_description(); - descriptions[ext].lib = target_path_ + fname; + descriptions[ext].lib = lib_path + "/" + fname; int ret = initialize(ext, get_interface); if (ret != XW_OK) { std::cerr << "Error loading extension " << fname << std::endl; @@ -206,7 +210,7 @@ int main(int argc, char* argv[]) { print_json(); } else { - std::cerr << "path not exist : " << tce_path << std::endl; + std::cerr << "path not exist : " << tec_path << std::endl; return -1; }