Skip to content

Commit 54fbcaa

Browse files
hs0225daeyeon
authored andcommitted
feat: add aul option
Signed-off-by: Hosung Kim [email protected]
1 parent d84ebf0 commit 54fbcaa

File tree

7 files changed

+34
-19
lines changed

7 files changed

+34
-19
lines changed

configure.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def lwnode_gyp_opts(opts):
8080
args += ['-Dtarget_os=' + ('tizen' if opts.tizen else 'linux')]
8181
args += ['-Dprofile=' + str(opts.profile)] if opts.tizen else []
8282
args += ['-Drevision=' + opts.revision]
83+
args += ['-Denable_aul=' + b(opts.aul)]
8384

8485
# definitions (used: escargot)
8586
args += ['-Descargot_build_mode=' + ('debug' if opts.debug else 'release')]
@@ -189,6 +190,14 @@ def setupCLIOptions(parser):
189190
help='Build for Tizen Platform (%default)',
190191
)
191192

193+
lwnode_optgroup.add_option(
194+
'--aul',
195+
action='store_true',
196+
dest='aul',
197+
default=False,
198+
help='Enable AUL for Tizen Platform (%default)',
199+
)
200+
192201
lwnode_optgroup.add_option(
193202
'--profile',
194203
choices=['common', 'tv', 'kiosk'],

deps/node/node.gyp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
'variables': {
3+
'enable_aul%': 'false',
34
'v8_use_siphash%': 0,
45
'v8_trace_maps%': 0,
56
'v8_enable_pointer_compression%': 0,
@@ -800,8 +801,17 @@
800801
['target_os=="tizen"', {
801802
'dependencies': [
802803
'<(lwnode_jsengine_path)/deps/tizen.gyp:dlog',
803-
'<(lwnode_jsengine_path)/deps/tizen.gyp:appcommon',
804804
],
805+
'conditions': [
806+
['enable_aul=="true"', {
807+
'dependencies': [
808+
'<(lwnode_jsengine_path)/deps/tizen.gyp:appcommon',
809+
],
810+
'defines': [
811+
'LWNODE_TIZEN_AUL=1',
812+
]
813+
}],
814+
]
805815
}],
806816
['external_builtins=="true"', {
807817
'variables': {

deps/node/src/lwnode/aul-event-receiver.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "lwnode.h"
2323
#include "trace.h"
2424

25-
#ifdef HOST_TIZEN
25+
#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL)
2626

2727
int AULEventReceiver::aulEventHandler(aul_type type, bundle* b, void* data) {
2828
switch (type) {

deps/node/src/lwnode/aul-event-receiver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifdef HOST_TIZEN
17+
#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL)
1818
#include <app_common.h>
1919
#include <aul.h>
2020
#include <bundle.h>
@@ -27,7 +27,7 @@ class AULEventReceiver {
2727
public:
2828
static AULEventReceiver* getInstance();
2929

30-
#ifdef HOST_TIZEN
30+
#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL)
3131
static int aulEventHandler(aul_type type, bundle* b, void* data);
3232
bool hasAulArguments(int argc, char* argv[], std::string& parsed_bundle);
3333
bool start(int argc, char* argv[]);

deps/node/src/lwnode/lwnode-public.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,18 @@ bool ParseAULEvent(int argc, char** argv) {
3434
}
3535

3636
bool InitScriptRootPath(const std::string path) {
37-
#if defined(HOST_TIZEN)
3837
int result;
38+
39+
#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL)
3940
if (path.empty()) {
4041
char* path = app_get_resource_path();
4142
result = uv_chdir(path);
4243
free(path);
43-
} else {
44-
result = uv_chdir(path.c_str());
44+
return result == 0;
4545
}
46+
#endif
47+
48+
result = uv_chdir(path.c_str());
4649

4750
if (result != 0) {
4851
LWNODE_DEV_LOGF("ERROR: Failed to change directory. (%d)\n", -errno);
@@ -51,9 +54,6 @@ bool InitScriptRootPath(const std::string path) {
5154
}
5255

5356
return true;
54-
#else
55-
return false;
56-
#endif
5757
}
5858

5959
int Start(int argc, char** argv) {

include/lwnode/lwnode-public.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ namespace lwnode {
2626

2727
LWNODE_EXPORT bool ParseAULEvent(int argc, char** argv);
2828

29-
// Support only Tizen platform.
30-
// Sets the path of the root directory of the JavaScript. If you do not put the
31-
// path argument, the root path is the app's resource path
32-
// by default. Be sure to call this function before lwnode::Start function.
29+
// Sets the path of the root directory of the JavaScript. If you do
30+
// not put the path argument, the root path is the app's resource path by
31+
// default on Tizen AUL mode. Be sure to call this function before lwnode::Start
32+
// function.
3333
LWNODE_EXPORT bool InitScriptRootPath(const std::string path = "");
3434

3535
LWNODE_EXPORT int Start(int argc, char** argv);

packaging/lwnode.spec

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ BuildRequires: pkgconfig(glib-2.0)
3838
BuildRequires: nghttp2-devel
3939
BuildRequires: pkgconfig(libcares)
4040

41-
%if (0%{?tizen_version_major} >= 8)
42-
BuildRequires: pkgconfig(openssl3)
43-
%endif
44-
45-
%if (0%{?tizen_version_major} == 7 || 0%{?tizen_version_major} == 6)
41+
%if (0%{?tizen_version_major} >= 6)
4642
BuildRequires: pkgconfig(openssl1.1)
4743
%endif
4844

0 commit comments

Comments
 (0)