summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungjae Shin <yj99.shin@samsung.com>2015-11-10 14:03:06 +0900
committerYoungjae Shin <yj99.shin@samsung.com>2015-11-10 18:56:34 +0900
commit84149f62da4dafddac04a9b7aede9172c0cf32e9 (patch)
treeac3598a85031ab197f5e9593fbbd1d12a551fa59
parentdf73ef3fd1ebd8f2b8d74b7ed57c2ffc8eaf6825 (diff)
downloadiotivity-84149f62da4dafddac04a9b7aede9172c0cf32e9.tar.gz
iotivity-84149f62da4dafddac04a9b7aede9172c0cf32e9.tar.bz2
iotivity-84149f62da4dafddac04a9b7aede9172c0cf32e9.zip
Change-Id: I7d9fe6747c47e4e30574b907f338c9638f72c17a
-rw-r--r--build_common/SConscript19
-rw-r--r--iotivity.pc.in4
-rw-r--r--packaging/iotivity.spec16
-rw-r--r--resource/third_party_libs.scons2
-rw-r--r--service/third_party_libs.scons2
5 files changed, 23 insertions, 20 deletions
diff --git a/build_common/SConscript b/build_common/SConscript
index 39991e290..f56b16683 100644
--- a/build_common/SConscript
+++ b/build_common/SConscript
@@ -126,7 +126,11 @@ if target_os in ['android', 'arduino']: # Android/Arduino always uses GNU compil
tools = ['gnulink', 'gcc', 'g++', 'ar', 'as', 'textfile']
)
else:
- env = Environment(variables = help_vars, tools = ['default', 'textfile'], TARGET_ARCH = target_arch, TARGET_OS = target_os, PREFIX = GetOption('prefix'), INSTALL_ROOT = ARGUMENTS.get('INSTALL_ROOT', dir))
+ env = Environment(variables = help_vars, tools = ['default', 'textfile'],
+ TARGET_ARCH = target_arch, TARGET_OS = target_os,
+ PREFIX = GetOption('prefix'), INSTALL_ROOT = ARGUMENTS.get('INSTALL_ROOT', dir),
+ LIB_INSTALL_DIR = ARGUMENTS.get('LIB_INSTALL_DIR', GetOption('prefix')+'/lib')
+ )
Help(help_vars.GenerateHelpText(env))
tc_set_msg = '''
@@ -209,7 +213,7 @@ def __install(ienv, targets, name):
def __installlib(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(env.get('INSTALL_ROOT') + user_prefix + '/lib', targets)
+ i_n = ienv.Install(env.get('INSTALL_ROOT') + env.get('LIB_INSTALL_DIR'), targets)
else:
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
@@ -233,7 +237,7 @@ def __installheader(ienv, targets, dir, name):
def __installpcfile(ienv, targets, name):
user_prefix = env.get('PREFIX')
if user_prefix:
- i_n = ienv.Install(env.get('INSTALL_ROOT') + user_prefix + '/lib/pkgconfig', targets)
+ i_n = ienv.Install(env.get('INSTALL_ROOT') + env.get('LIB_INSTALL_DIR') + '/pkgconfig', targets)
else:
i_n = ienv.Install(env.get('BUILD_DIR'), targets)
ienv.Alias("install", i_n)
@@ -283,9 +287,14 @@ elif env.get('ROUTING') == 'EP':
user_prefix = env.get('PREFIX')
if user_prefix:
- pc_vars = {'\@PREFIX\@': user_prefix, '\@EXEC_PREFIX\@':user_prefix, '\@VERSION\@':'1.0.0', '\@ROUTING_DEFINE\@': routing_define}
+ pc_vars = {'\@PREFIX\@': user_prefix,
+ '\@LIB_INSTALL_DIR\@': env.get('LIB_INSTALL_DIR'),
+ '\@VERSION\@': '1.0.0', '\@ROUTING_DEFINE\@': routing_define
+ }
else:
- pc_vars = {'\@PREFIX\@': env.get('BUILD_DIR'), '\@EXEC_PREFIX\@': env.get('BUILD_DIR'), '\@VERSION\@':'1.0.0', '\@ROUTING_DEFINE\@': routing_define}
+ pc_vars = {'\@PREFIX\@': env.get('BUILD_DIR'), '\@VERSION\@': '1.0.0',
+ '\@ROUTING_DEFINE\@': routing_define
+ }
env.Substfile(pc_file, SUBST_DICT = pc_vars)
diff --git a/iotivity.pc.in b/iotivity.pc.in
index ba40f04c7..66d088bd8 100644
--- a/iotivity.pc.in
+++ b/iotivity.pc.in
@@ -2,7 +2,7 @@
prefix=@PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/lib
+libdir=@LIB_INSTALL_DIR@
includedir=${prefix}/include
Name: iotivity
@@ -10,5 +10,5 @@ Description: IoTivity is an open source reference implementation of the OIC stan
Version: @VERSION@
URL: https://www.iotivity.org
Requires:
-Libs: -loc -loc_logger -loc_logger_core -loctbstack -lconnectivity_abstraction
+Libs: -L${libdir} -loc -loc_logger -loc_logger_core -loctbstack -lconnectivity_abstraction
Cflags: -I${includedir}/resource -I${includedir}/iotivity-service -D@ROUTING_DEFINE@
diff --git a/packaging/iotivity.spec b/packaging/iotivity.spec
index 82978b734..ad60de0a9 100644
--- a/packaging/iotivity.spec
+++ b/packaging/iotivity.spec
@@ -100,25 +100,18 @@ cp %{SOURCE1001} ./%{name}-test.manifest
%define RPM_ARCH "x86"
%endif
-
-scons -j 4 --prefix=%{_prefix} \
+scons --prefix=%{_prefix} \
TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
- INSTALL_ROOT=%{buildroot}
+ INSTALL_ROOT=%{buildroot} LIB_INSTALL_DIR=%{_libdir}
+
%install
rm -rf %{buildroot}
scons install --prefix=%{_prefix} \
TARGET_OS=tizen TARGET_ARCH=%{RPM_ARCH} TARGET_TRANSPORT=%{TARGET_TRANSPORT} \
RELEASE=%{RELEASE} SECURED=%{SECURED} LOGGING=%{LOGGING} ROUTING=%{ROUTING} \
- INSTALL_ROOT=%{buildroot}
-
-
-mkdir -p %{buildroot}%{_includedir}
-mkdir -p %{buildroot}%{_libdir}
-mkdir -p %{buildroot}%{_libdir}/pkgconfig
-mkdir -p %{buildroot}%{_bindir}
-
+ INSTALL_ROOT=%{buildroot} LIB_INSTALL_DIR=%{_libdir}
%if %{RELEASE} == "True"
%define build_mode release
@@ -127,6 +120,7 @@ mkdir -p %{buildroot}%{_bindir}
%endif
# For Example
+mkdir -p %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/examples/OICMiddle/OICMiddle %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryclient %{buildroot}%{_bindir}
cp out/tizen/*/%{build_mode}/resource/examples/devicediscoveryserver %{buildroot}%{_bindir}
diff --git a/resource/third_party_libs.scons b/resource/third_party_libs.scons
index 46b80bd9b..94495ba47 100644
--- a/resource/third_party_libs.scons
+++ b/resource/third_party_libs.scons
@@ -36,7 +36,7 @@ src_dir = env.get('SRC_DIR')
######################################################################
# Check dependent packages (Linux only)
######################################################################
-if target_os in ['linux', 'tizen']:
+if target_os in ['linux']:
if not env.GetOption('help'):
if not target_arch == platform.machine():
print '''
diff --git a/service/third_party_libs.scons b/service/third_party_libs.scons
index 6ddeebcaf..b486a2578 100644
--- a/service/third_party_libs.scons
+++ b/service/third_party_libs.scons
@@ -37,7 +37,7 @@ resource_path = src_dir + '/resource'
######################################################################
# Check dependent packages (Linux only)
######################################################################
-if target_os in ['linux', 'tizen']:
+if target_os in ['linux']:
if not env.GetOption('help'):
if not target_arch == platform.machine():
print '''