START_SH = ../scripts/start.sh
STOP_SH = ../scripts/stop.sh
INIT_PRELOAD_SH = ../scripts/init_preload.sh
+INIT_WSP_SH = ../scripts/init_wsp.sh
PRELOAD_SCRIPT = ../scripts/gen_preload_header.sh
+SCRIPTS := \
+ $(START_SH) \
+ $(STOP_SH) \
+ $(INIT_PRELOAD_SH) \
+ $(INIT_WSP_SH)
all: debug
sh $< > $@
+#Preload
+$(INIT_PRELOAD_SH): $(PRELOAD_SCRIPT)
+ bash $< $@
+
# WSP
+$(INIT_WSP_SH): $(WSP_SCRIPT)
+ifeq ($(WSP_SUPPORT),y)
+ bash $(WSP_SCRIPT) -s > $@
+else # WSP_SUPPORT
+ echo "#!/bin/bash" > $@
+ echo "echo \"Do not init WSP!\" " >> $@
+endif # WSP_SUPPORT
+
ifeq ($(WSP_SUPPORT),y)
SRC_CPP += cpp/features/feature_wsp.cpp
GENERATED_WSP_H = include/generated/wsp_data.h
+ WSP_SCRIPT = ../scripts/gen_wsp_data.sh
GENERATED_HEADERS += $(GENERATED_WSP_H)
- $(GENERATED_WSP_H): ../scripts/gen_wsp_data.sh
- sh $< > $@
+ $(GENERATED_WSP_H): $(WSP_SCRIPT)
+ bash $< -h > $@
+
endif # WSP_SUPPORT
$(CPP) $(CPPFLAGS) -c -o $@ $<
-debug: rmheaders headers $(OBJS)
+debug: rmheaders headers $(SCRIPTS) $(OBJS)
$(CPP) $(OBJS) -o $(TARGET) $(LDFLAGS)
install: BINDIR = $(DESTDIR)/usr/bin
install: OPTDIR = $(DESTDIR)/opt/swap/sdk
-install: $(TARGET)
+install: $(TARGET) $(SCRIPTS)
mkdir -p $(BINDIR)
mkdir -p $(OPTDIR)
install $(TARGET) -t $(BINDIR)
- bash $(PRELOAD_SCRIPT) $(INIT_PRELOAD_SH)
- install -m 755 $(INIT_PRELOAD_SH) $(START_SH) $(STOP_SH) -t $(OPTDIR)
+ install -m 755 $(SCRIPTS) -t $(OPTDIR)
clean:
rm -f $(TARGET) $(OBJS)
#!/bin/bash
-
+output_type=$1
script_dir=$(readlink -f $0 | xargs dirname)
+webapp_path="/sys/kernel/debug/swap/wsp/webapp_path"
+ewebkit_path="/sys/kernel/debug/swap/wsp/ewebkit_path"
source $script_dir/dyn_vars
if [ "$__tizen_profile_name__" == "tv" ]; then
done
}
+function gen_header_out()
+{
+ if [ "$__tizen_profile_name__" == "tv" ] || [ "$__tizen_product_2_4_wearable__" == "1" ]; then
+ add_func_plt soup_requester_request_uri@plt soup_request
+ add_func _ZN7WebCore14ResourceLoader15willSendRequestERNS_15ResourceRequestERKNS_16ResourceResponseE main_res_will
+ add_func _ZN7WebCore11CachedImage7addDataEPKcj main_res_add
+ add_func _ZN7WebCore14ResourceLoader16didFinishLoadingEd main_res_finish
+ add_func _ZN7WebCore14ResourceLoader15willSendRequestERNS_15ResourceRequestERKNS_16ResourceResponseE res_will
+ add_func _ZN7WebCore14ResourceLoader16didFinishLoadingEPNS_14ResourceHandleEd res_finish
+ add_func _ZN7WebCore22CompositingCoordinator24flushPendingLayerChangesEv redraw
+ else
+ add_func_plt soup_requester_request@plt soup_request
+ add_func _ZN7WebCore18MainResourceLoader15willSendRequestERNS_15ResourceRequestERKNS_16ResourceResponseE main_res_will
+ add_func _ZN7WebCore18MainResourceLoader7addDataEPKcib main_res_add
+ add_func _ZN7WebCore18MainResourceLoader16didFinishLoadingEd main_res_finish
+ add_func _ZN7WebCore14ResourceLoader15willSendRequestERNS_15ResourceRequestERKNS_16ResourceResponseE res_will
+ add_func _ZN7WebCore14ResourceLoader16didFinishLoadingEPNS_14ResourceHandleEd res_finish
+ add_func _ZN6WebKit20LayerTreeCoordinator24flushPendingLayerChangesEv redraw
+ fi
-if [ "$__tizen_profile_name__" == "tv" ] || [ "$__tizen_product_2_4_wearable__" == "1" ]; then
- add_func_plt soup_requester_request_uri@plt soup_request
- add_func _ZN7WebCore14ResourceLoader15willSendRequestERNS_15ResourceRequestERKNS_16ResourceResponseE main_res_will
- add_func _ZN7WebCore11CachedImage7addDataEPKcj main_res_add
- add_func _ZN7WebCore14ResourceLoader16didFinishLoadingEd main_res_finish
- add_func _ZN7WebCore14ResourceLoader15willSendRequestERNS_15ResourceRequestERKNS_16ResourceResponseE res_will
- add_func _ZN7WebCore14ResourceLoader16didFinishLoadingEPNS_14ResourceHandleEd res_finish
- add_func _ZN7WebCore22CompositingCoordinator24flushPendingLayerChangesEv redraw
-else
- add_func_plt soup_requester_request@plt soup_request
- add_func _ZN7WebCore18MainResourceLoader15willSendRequestERNS_15ResourceRequestERKNS_16ResourceResponseE main_res_will
- add_func _ZN7WebCore18MainResourceLoader7addDataEPKcib main_res_add
- add_func _ZN7WebCore18MainResourceLoader16didFinishLoadingEd main_res_finish
- add_func _ZN7WebCore14ResourceLoader15willSendRequestERNS_15ResourceRequestERKNS_16ResourceResponseE res_will
- add_func _ZN7WebCore14ResourceLoader16didFinishLoadingEPNS_14ResourceHandleEd res_finish
- add_func _ZN6WebKit20LayerTreeCoordinator24flushPendingLayerChangesEv redraw
-fi
+ IFS=$'\n'
-IFS=$'\n'
+ array=`gen_array`
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
-array=`gen_array`
-if [ $? -ne 0 ]; then
- exit 1
-fi
+ cat <<- EOF
+
+ /*
+ * Autogenerated header
+ */
+ #ifndef __WSP_DATA__
+ #define __WSP_DATA__
+ struct wsp_data {
+ const char *name;
+ const char *nick_name;
+ unsigned long addr;
+ };
-cat << EOF
-/*
- * Autogenerated header
- */
+ static struct wsp_data wsp_data[] = {
+ ${array}
+ };
-#ifndef __WSP_DATA__
-#define __WSP_DATA__
+ enum {
+ wsp_data_cnt = sizeof(wsp_data) / sizeof(struct wsp_data)
+ };
-struct wsp_data {
- const char *name;
- const char *nick_name;
- unsigned long addr;
-};
+ #endif /* __WSP_DATA__ */
-static struct wsp_data wsp_data[] = {
-${array}
-};
+EOF
+}
+
+function gen_script_out()
+{
+ webapp_package_name=wrt
+ path_webapp=`rpm -ql $webapp_package_name | grep "wrt_launchpad_daemon$" | head -1`
+
+ cat <<- EOF
+
+ #!/bin/bash
-enum {
- wsp_data_cnt = sizeof(wsp_data) / sizeof(struct wsp_data)
-};
+ #WSP initialze autogenerated script
+
+ /bin/echo "$path_webapp" > $webapp_path
+ /bin/echo "$path_libewebkit2" > $ewebkit_path
-#endif /* __WSP_DATA__ */
EOF
+}
+if [ "$1" == "-h" ]; then
+ gen_header_out
+elif [ "$1" == "-s" ]; then
+ gen_script_out
+else
+ exit 1
+fi