Configure which platform style to use 88/43088/10
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Tue, 7 Jul 2015 16:10:16 +0000 (17:10 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Wed, 8 Jul 2015 16:47:59 +0000 (17:47 +0100)
Change-Id: I5c558f08ecfd63aff34da334f8a60b28309eefa2
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
build/tizen/configure.ac
build/tizen/dali-toolkit/Makefile.am
packaging/dali-toolkit.spec

index 6fb8b47..a0b795d 100644 (file)
@@ -79,10 +79,15 @@ fi
 
 # Tizen Profile options
 AC_ARG_ENABLE([profile],
-              [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV],
+              [AC_HELP_STRING([--enable-profile=UBUNTU,MOBILE,WEARABLE,TV],
                             [Select the variant of tizen])],
               [dali_profile=$enableval],
-              [dali_profile=COMMON])
+              [dali_profile=UBUNTU])
+
+# Ensure valid profile selected
+if test "x$dali_profile" != "xUBUNTU" -a "x$dali_profile" != "xMOBILE" -a "x$dali_profile" != "xWEARABLE" -a "x$dali_profile" != "xTV" ; then
+  AC_MSG_ERROR([$enable_profile is an invalid profile])
+fi
 
 if test x$DALI_DATA_RW_DIR != x; then
   dataReadWriteDir=${DALI_DATA_RW_DIR}/
@@ -96,9 +101,18 @@ else
   dataReadOnlyDir=${prefix}/share/dali/
 fi
 
-DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDALI_PROFILE_${enable_profile}"
-AM_CONDITIONAL([COMMON_PROFILE], [test x$enable_profile = xCOMMON])
-AM_CONDITIONAL([MOBILE_PROFILE], [test x$enable_profile = xMOBILE])
+DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDALI_PROFILE_${dali_profile}"
+
+# Style paths
+if test "x$dali_profile" = "xUBUNTU"; then
+  STYLE_DIR=../../../dali-toolkit/styles
+fi
+
+if test "x$dali_profile" = "xMOBILE"; then
+  STYLE_DIR=../../../dali-toolkit/styles/mobile
+fi
+
+AC_SUBST(STYLE_DIR)
 
 # v8 version 4+ requires c++11
 PKG_CHECK_MODULES(V8, v8 = 3.32.7, [ pkg_check_v8=yes ],  [ pkg_check_v8=no  ] )
index 9ef6afb..37bff58 100644 (file)
@@ -22,11 +22,7 @@ toolkit_src_dir    = ../../../dali-toolkit/internal
 public_api_src_dir = ../../../dali-toolkit/public-api
 devel_api_src_dir  = ../../../dali-toolkit/devel-api
 
-if MOBILE_PROFILE
-toolkit_styles_dir = ../../../dali-toolkit/styles/mobile
-else
-toolkit_styles_dir = ../../../dali-toolkit/styles
-endif
+toolkit_styles_dir = $(STYLE_DIR)
 
 include ../../../dali-toolkit/images/file.list
 include ../../../dali-toolkit/sounds/file.list
index 7c1fa67..c56450d 100644 (file)
@@ -16,6 +16,17 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(dali)
 BuildRequires:  pkgconfig(dali-core)
 
+#############################
+# profile setup
+#############################
+
+%define dali_toolkit_profile MOBILE
+
+# Further resource locations profiles can be provided here otherwise MOBILE will be used
+%if "%{tizen_profile_name}" == "mobile"
+  %define dali_toolkit_profile MOBILE
+%endif
+
 %description
 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
 user interface functionality.
@@ -56,7 +67,7 @@ cd %{_builddir}/dali-toolkit-%{version}/build/tizen
 autoreconf --install
 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
-%configure
+%configure --enable-profile=%{dali_toolkit_profile}
 make %{?jobs:-j%jobs}
 
 ##############################