- This is for Tizen 4.0.
: Tizen 4.0 Configurability and Build Blocks require
to remove all profile-depending build options in spec files.
(No More profile macros)
- It is recommended to distinguish features/profiles at runtime.
unless it incurs too much overhead, which requires you to
create multiple binaries and subpackages.
ps. added a code clean in spec file that removes a lot of rpmbuild
warnings:
...
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
[ 30s] Warning: spec file parser line 58: macro too deeply nested
...
Change-Id: I5c850a788826cc0cda1f1bf12dde7fc5df036271
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
AC_SUBST(ENLIGHTENMENT_CFLAGS)
AC_SUBST(ENLIGHTENMENT_LIBS)
+PKG_CHECK_MODULES(CAPI_SYSTEM_INFO, [capi-system-info])
+AC_SUBST(CAPI_SYSTEM_INFO_CFLAGS)
+AC_SUBST(CAPI_SYSTEM_INFO_LIBS)
+
# Checks for ttrace header files
PKG_CHECK_MODULES(TTRACE,
[ttrace],
AC_DEFINE_UNQUOTED([HAVE_WAYLAND],[1],[enable wayland support])
fi
-# IVI-HOME support
-enable_ivi_home=no
-AC_ARG_ENABLE([ivi-home],
- [AS_HELP_STRING([--enable-ivi-home], [support ivi-home @<:@default=disabled@:>@])],
- [enable_ivi_home=yes],
- [enable_ivi_home=no])
-AC_MSG_CHECKING([whether ivi-home is enabled])
-AC_MSG_RESULT([${enable_ivi_home}])
-if test "x${enable_ivi_home}" == "xyes"; then
- AC_DEFINE_UNQUOTED([ENABLE_IVI_HOME],[1],[enable ivi-home])
-fi
-AM_CONDITIONAL(ENABLE_IVI_HOME, [test "x${enable_ivi_home}" = xyes])
-# end of IVI_HOME support
-
#### WM Rotation
want_auto_rotation=
have_auto_rotation=
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(edje)
%endif
+BuildRequires: pkgconfig(capi-system-info)
-%global TZ_SYS_RO_SHARE %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
+%if 0%{?TZ_SYS_RO_SHARE:1}
+# TZ_SYS_RO_SHARE is defined
+%else
+%global TZ_SYS_RO_SHARE /usr/share
+%endif
%description
The Enlightenment WM Policy Module for Tizen
export CFLAGS+=" -DE_LOGGING=1 -Werror-implicit-function-declaration"
%if %{with wayland}
%reconfigure \
-%if "%{profile}" == "ivi"
- --enable-ivi-home \
-%endif
--enable-wayland-only \
--enable-auto-rotation
%else
WL_SRC =
-if ENABLE_IVI_HOME
WL_SRC += e_mod_ivi_home.c \
e_mod_ivi_home.h
-endif
ROT_SRC = rotation/e_mod_rotation.c \
rotation/e_mod_rotation.h \
$(ROT_SRC)
module_la_LIBADD =
-module_la_CFLAGS = @ENLIGHTENMENT_CFLAGS@ @TTRACE_CFLAGS@
-module_la_LDFLAGS = -module -avoid-version @ENLIGHTENMENT_LIBS@ @TTRACE_LIBS@
+module_la_CFLAGS = @ENLIGHTENMENT_CFLAGS@ @TTRACE_CFLAGS@ @CAPI_SYSTEM_INFO_CFLAGS@
+module_la_LDFLAGS = -module -avoid-version @ENLIGHTENMENT_LIBS@ @TTRACE_LIBS@ @CAPI_SYSTEM_INFO_LIBS@
module_la_DEPENDENCIES = $(top_builddir)/config.h
if HAVE_AUTO_ROTATION
#include "e_mod_main.h"
#include "e_mod_rotation.h"
-#if ENABLE_IVI_HOME
-# include "e_mod_ivi_home.h"
-#endif
+#include "e_mod_ivi_home.h"
+#include <stdlib.h>
+#include <system_info.h>
E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Policy-Mobile" };
Mod *_pol_mod = NULL;
+static Tz_Profile_Type
+_tz_profile_type_get(void)
+{
+ static Tz_Profile_Type p = TZ_PROFILE_TYPE_UNKNOWN;
+ char *name = NULL;
+
+ if (EINA_LIKELY(p != TZ_PROFILE_TYPE_UNKNOWN))
+ {
+ return p;
+ }
+
+ system_info_get_platform_string("http://tizen.org/feature/profile",
+ &name);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(name, p);
+
+ switch (*name)
+ {
+ case 'm':
+ case 'M':
+ p = TZ_PROFILE_TYPE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ p = TZ_PROFILE_TYPE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ p = TZ_PROFILE_TYPE_TV;
+ break;
+ case 'i':
+ case 'I':
+ p = TZ_PROFILE_TYPE_IVI;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ p = TZ_PROFILE_TYPE_COMMON;
+ break;
+ }
+
+ free(name);
+
+ return p;
+}
+
+
E_API void *
e_modapi_init(E_Module *m)
{
e_mod_pol_conf_init(mod);
e_mod_pol_rotation_init();
-#if ENABLE_IVI_HOME
- e_mod_ivi_home_init();
-#endif
+ if (_tz_profile_type_get() == TZ_PROFILE_TYPE_IVI)
+ e_mod_ivi_home_init();
return mod;
}
e_mod_pol_rotation_shutdown();
e_mod_pol_conf_shutdown(mod);
-#if ENABLE_IVI_HOME
- e_mod_ivi_home_shutdown();
-#endif
+ if (_tz_profile_type_get() == TZ_PROFILE_TYPE_IVI)
+ e_mod_ivi_home_shutdown();
E_FREE(mod);
_pol_mod = NULL;
return 1;
Config *conf;
};
+typedef enum
+{
+ TZ_PROFILE_TYPE_UNKNOWN = 0,
+ TZ_PROFILE_TYPE_MOBILE = 0x1,
+ TZ_PROFILE_TYPE_WEARABLE = 0x2,
+ TZ_PROFILE_TYPE_TV = 0x4,
+ TZ_PROFILE_TYPE_IVI = 0x8,
+ TZ_PROFILE_TYPE_COMMON = 0x10,
+} Tz_Profile_Type;
+
#undef E_CLIENT_HOOK_APPEND
#define E_CLIENT_HOOK_APPEND(l, t, cb, d) \
do \