summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2014-09-01 15:08:49 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-12-23 23:59:40 -0200
commita3db1dddd3ba67c81118f7f2c0bc753dc8aac551 (patch)
tree233ee1be7bfa299bff560207135d20940c4e411f /configure.ac
parent1a3cb45f1cc7fdf8d481879e6bd7349d9cb0b3fa (diff)
efl-js: JavaScript Eolian binding
To configure efl sources with bindings to use in nodejs add ––with-js=nodejs in configure flags to generate node files $ configure --with-js=nodejs and compile normally with: $ make $ make install To use, you have to require efl: efl = require('efl') The bindings is divided in two parts: generated and manually written. The generation uses the Eolian library for parsing Eo files and generate C++ code that is compiled against V8 interpreter library to create a efl.node file that can be required in a node.js instance. @feature
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac275
1 files changed, 274 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 08976a5..6e5953b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1051,6 +1051,191 @@ EFL_EVAL_PKGS([EINA_CXX])
1051EFL_LIB_END([Eina_Cxx]) 1051EFL_LIB_END([Eina_Cxx])
1052#### End of Eina CXX 1052#### End of Eina CXX
1053 1053
1054AC_ARG_WITH([js],
1055 [AS_HELP_STRING([--with-js=@<:@nodejs/libv8/libuv/none@:>@],[enable JavaScript bindings using nodejs or libv8/libuv as build dependencies. The libuv option implies libv8. @<:@default=none@:>@])],
1056 [want_js="${withval}"], [want_js="none"])
1057
1058EFLJS_CXXFLAGS=""
1059AC_LANG_PUSH([C++])
1060case "$want_js" in
1061 nodejs)
1062 AC_CHECK_HEADERS([node/v8.h nodejs/deps/v8/v8.h nodejs/deps/v8/include/v8.h nodejs/src/v8.h v8.h],
1063 [
1064 v8_header=AC_header
1065 v8_header_define=AS_TR_CPP([HAVE_]AC_header)
1066 EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -D$v8_header_define"
1067 break
1068 ]
1069 [AC_MSG_ERROR([Could not find v8 include headers from nodejs.])])
1070 AC_CHECK_HEADERS([node/node.h nodejs/deps/node/node.h nodejs/deps/node/include/node.h nodejs/src/node.h node.h],
1071 [
1072 node_header_define=AS_TR_CPP([HAVE_]AC_header)
1073 EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -D$node_header_define"
1074 break
1075 ]
1076 [AC_MSG_ERROR([Could not find node include headers from nodejs.])])
1077 AC_CHECK_HEADERS([node/uv.h nodejs/deps/uv/uv.h nodejs/deps/uv/include/uv.h nodejs/src/uv.h uv.h],
1078 [
1079 uv_header_define=AS_TR_CPP([HAVE_]AC_header)
1080 EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -D$uv_header_define"
1081 break
1082 ]
1083 [AC_MSG_ERROR([Could not find uv include headers from nodejs.])])
1084 ;;
1085 libv8)
1086 AC_CHECK_HEADERS([v8.h],
1087 [
1088 v8_header=AC_header
1089 break
1090 ]
1091 [AC_MSG_ERROR([Could not find v8 include headers from libv8.])])
1092 ;;
1093 libuv)
1094 AC_CHECK_HEADERS([v8.h],
1095 [
1096 v8_header=AC_header
1097 break
1098 ]
1099 [AC_MSG_ERROR([Could not find v8 include headers from libv8.])])
1100 AC_CHECK_HEADERS([uv.h],
1101 [break]
1102 [AC_MSG_ERROR([Could not find uv include headers from libuv.])])
1103 ;;
1104 none)
1105 ;;
1106 *) AC_MSG_ERROR([Invalid javascript dependency (${want_js}): must be none, nodejs, libv8 or libuv]) ;;
1107esac
1108
1109have_v8_global="no"
1110have_v8_create_params="no"
1111if test "$want_js" != "none" ; then
1112AC_COMPILE_IFELSE(
1113 [AC_LANG_PROGRAM(
1114 [[
1115#include "$v8_header"
1116 ]],
1117 [[
1118v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = nullptr;
1119 ]])
1120 ],
1121 [
1122 AC_DEFINE(HAVE_V8_CREATE_PARAMS, 1, [Define to 1 if you must pass create_params explicitly.])
1123 have_v8_create_params="yes"
1124 AC_MSG_NOTICE([checking for v8::Isolate::CreateParams... yes])
1125 ],
1126 [
1127 AC_MSG_NOTICE([checking for v8::Isolate::CreateParams... no])
1128 ])
1129AC_COMPILE_IFELSE(
1130 [AC_LANG_PROGRAM(
1131 [[
1132#include "$v8_header"
1133#include <type_traits>
1134 ]],
1135 [[
1136 static_assert((std::is_same< ::v8::Global<void>, ::v8::UniquePersistent<void>>::value), "");
1137 ]])
1138 ],
1139 [
1140 AC_DEFINE(HAVE_V8_GLOBAL, 1, [Define to 1 if you must pass create_params explicitly.])
1141 have_v8_global="yes"
1142 AC_MSG_NOTICE([checking for v8::Global<T> class... yes])
1143 ],
1144 [
1145 AC_MSG_NOTICE([checking for v8::Global<T> class... no])
1146 ])
1147fi
1148AM_CONDITIONAL([HAVE_V8_CREATE_PARAMS], [test "x${have_v8_create_params}" = "xyes"])
1149AM_CONDITIONAL([HAVE_V8_GLOBAL], [test "x${have_v8_global}" = "xyes"])
1150AC_SUBST([HAVE_V8_CREATE_PARAMS])
1151AC_SUBST([HAVE_V8_GLOBAL])
1152AC_LANG_POP([C++])
1153
1154AM_CONDITIONAL([HAVE_NODEJS], [test "x${want_js}" = "xnodejs"])
1155AC_DEFINE_IF([HAVE_NODEJS], [test "x${want_js}" = "xnodejs"],
1156 [1], [Using NodeJS])
1157AC_SUBST([want_js])
1158AC_SUBST([HAVE_NODEJS])
1159
1160have_js="no"
1161if test "x${want_js}" != "xnone" ; then
1162 have_js="yes"
1163fi
1164AM_CONDITIONAL([HAVE_JS], [test "x${have_js}" = "xyes"])
1165AC_DEFINE_IF([HAVE_JS], [test "x${have_js}" = "xyes"], [1], [Compiling bindings for JavaScript])
1166AC_SUBST([HAVE_JS])
1167
1168AM_CONDITIONAL([HAVE_LIBUV], [test "x${want_js}" = "xnodejs" -o "x${want_js}" = "xlibuv"])
1169AC_DEFINE_IF([HAVE_LIBUV], [test "x${want_js}" = "xnodejs" -o "x${want_js}" = "xlibuv"],
1170 [1], [Compiling libuv event loop integration])
1171AC_SUBST([HAVE_LIBUV])
1172
1173# For efljspack mime handling
1174AM_CONDITIONAL([HAVE_XDG_DATA_HOME], [test "x${XDG_DATA_HOME}" != "x"])
1175AM_COND_IF([HAVE_XDG_DATA_HOME], [AC_SUBST([XDG_DATA_HOME])], [AC_SUBST([XDG_DATA_HOME], "$HOME/.local/share")])
1176
1177#### Eina JS
1178EFL_LIB_START_OPTIONAL([Eina_Js], [test "x${have_js}" = "xyes"])
1179EFL_INTERNAL_DEPEND_PKG([EINA_JS], [Eina])
1180EFL_INTERNAL_DEPEND_PKG([EINA_JS], [Eo])
1181EFL_ADD_CFLAGS([EINA_JS], [${EFL_PTHREAD_CFLAGS}])
1182EFL_EVAL_PKGS([EINA_JS])
1183
1184EFL_LIB_END_OPTIONAL([Eina_Js])
1185#### End of Eina JS
1186
1187#### Ecore JS
1188EFL_LIB_START_OPTIONAL([Ecore_Js], [test "x${have_js}" = "xyes"])
1189
1190EFL_INTERNAL_DEPEND_PKG([ECORE_JS], [ecore])
1191EFL_INTERNAL_DEPEND_PKG([ECORE_JS], [ecore_file])
1192EFL_ADD_CFLAGS([ECORE_JS], [${EFL_PTHREAD_CFLAGS}])
1193EFL_EVAL_PKGS([ECORE_JS])
1194
1195EFL_LIB_END_OPTIONAL([Ecore_Js])
1196#### End of Ecore JS
1197
1198#### Eio JS
1199EFL_LIB_START_OPTIONAL([Eio_Js], [test "x${have_js}" = "xyes"])
1200
1201EFL_INTERNAL_DEPEND_PKG([EIO_JS], [eio])
1202EFL_ADD_CFLAGS([EIO_JS], [${EFL_PTHREAD_CFLAGS}])
1203EFL_EVAL_PKGS([EIO_JS])
1204
1205EFL_LIB_END_OPTIONAL([Eio_Js])
1206#### End of Eio JS
1207
1208#### Ethumb JS
1209EFL_LIB_START_OPTIONAL([Ethumb_Js], [test "x${have_js}" = "xyes"])
1210
1211EFL_INTERNAL_DEPEND_PKG([ETHUMB_JS], [ethumb])
1212EFL_INTERNAL_DEPEND_PKG([ETHUMB_JS], [ethumb_client])
1213EFL_ADD_CFLAGS([ETHUMB_JS], [${EFL_PTHREAD_CFLAGS}])
1214EFL_EVAL_PKGS([ETHUMB_JS])
1215
1216EFL_LIB_END_OPTIONAL([Ethumb_Js])
1217#### End of Ethumb JS
1218
1219#### Eldbus JS
1220EFL_LIB_START_OPTIONAL([Eldbus_Js], [test "x${have_js}" = "xyes"])
1221
1222EFL_INTERNAL_DEPEND_PKG([ELDBUS_JS], [eldbus])
1223EFL_ADD_CFLAGS([ELDBUS_JS], [${EFL_PTHREAD_CFLAGS}])
1224EFL_EVAL_PKGS([ELDBUS_JS])
1225
1226EFL_LIB_END_OPTIONAL([Eldbus_Js])
1227#### End of Eldbus JS
1228
1229#### Eo JS
1230EFL_LIB_START_OPTIONAL([Eo_Js], [test "x${have_js}" = "xyes"])
1231
1232EFL_INTERNAL_DEPEND_PKG([EO_JS], [eina])
1233EFL_ADD_CFLAGS([EO_JS], [${EFL_PTHREAD_CFLAGS}])
1234EFL_EVAL_PKGS([EO_JS])
1235
1236EFL_LIB_END_OPTIONAL([Eo_Js])
1237#### End of Eo JS
1238
1054#### Eo 1239#### Eo
1055 1240
1056EFL_LIB_START([Eo]) 1241EFL_LIB_START([Eo])
@@ -1244,6 +1429,15 @@ EFL_INTERNAL_DEPEND_PKG([EOLIAN], [eina])
1244EFL_LIB_END([Eolian]) 1429EFL_LIB_END([Eolian])
1245#### End of Eolian 1430#### End of Eolian
1246 1431
1432EFL_LIB_START_OPTIONAL([Eolian_Js], [test "${have_js}" = "yes"])
1433
1434EFL_INTERNAL_DEPEND_PKG([EOLIAN_JS], [eina])
1435EFL_INTERNAL_DEPEND_PKG([EOLIAN_JS], [eolian])
1436
1437EFL_LIB_END_OPTIONAL([Eolian_Js])
1438#### End of Eolian
1439
1440
1247EFL_LIB_START([Eolian_Cxx]) 1441EFL_LIB_START([Eolian_Cxx])
1248### Default values 1442### Default values
1249 1443
@@ -2322,6 +2516,17 @@ AC_ARG_ENABLE([g-main-loop],
2322 fi 2516 fi
2323 ], 2517 ],
2324 [want_g_main_loop="no"]) 2518 [want_g_main_loop="no"])
2519AC_ARG_ENABLE([libuv],
2520 [AS_HELP_STRING([--enable-libuv],[enable ecore_main_loop based on libuv. @<:@default=disabled@:>@])],
2521 [
2522 if test "x${enableval}" = "xyes" ; then
2523 want_libuv="yes"
2524 CFOPT_WARNING="xyes"
2525 else
2526 want_libuv="no"
2527 fi
2528 ],
2529 [want_libuv="no"])
2325 2530
2326AC_ARG_ENABLE([gstreamer], 2531AC_ARG_ENABLE([gstreamer],
2327 [AS_HELP_STRING([--enable-gstreamer],[enable gstreamer 0.10 support. @<:@default=disabled@:>@])], 2532 [AS_HELP_STRING([--enable-gstreamer],[enable gstreamer 0.10 support. @<:@default=disabled@:>@])],
@@ -2410,6 +2615,7 @@ EFL_OPTIONAL_DEPEND_PKG([ECORE], [${want_systemd}], [SYSTEMD], [libsystemd])
2410EFL_ADD_FEATURE([ECORE], [systemd-daemon], [${want_systemd}]) 2615EFL_ADD_FEATURE([ECORE], [systemd-daemon], [${want_systemd}])
2411EFL_ADD_FEATURE([ECORE], [glib]) 2616EFL_ADD_FEATURE([ECORE], [glib])
2412EFL_ADD_FEATURE([ECORE], [g-main-loop]) 2617EFL_ADD_FEATURE([ECORE], [g-main-loop])
2618EFL_ADD_FEATURE([ECORE], [libuv])
2413 2619
2414want_glib_integration_always=no 2620want_glib_integration_always=no
2415if test "x${with_glib}" = "xalways" ; then 2621if test "x${with_glib}" = "xalways" ; then
@@ -2419,6 +2625,9 @@ fi
2419 2625
2420if test "x${want_g_main_loop}" = "xyes" ; then 2626if test "x${want_g_main_loop}" = "xyes" ; then
2421 AC_DEFINE([USE_G_MAIN_LOOP], [1], [Use g_main_loop in ecore]) 2627 AC_DEFINE([USE_G_MAIN_LOOP], [1], [Use g_main_loop in ecore])
2628 if test "x${want_js}" = "xnodejs" -o "x${want_js}" = "xlibuv" ; then
2629 AC_MSG_ERROR([Can't define glib and libuv integration together])
2630 fi
2422fi 2631fi
2423 2632
2424# not EFL_OPTIONAL_DEPEND_PKG() because it's only used for ecore examples 2633# not EFL_OPTIONAL_DEPEND_PKG() because it's only used for ecore examples
@@ -4007,7 +4216,7 @@ EFL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [emile])
4007ECORE_EVAS_MODULE([extn], [${want_ecore_evas_extn}]) 4216ECORE_EVAS_MODULE([extn], [${want_ecore_evas_extn}])
4008ECORE_EVAS_MODULE([ews], [yes]) 4217ECORE_EVAS_MODULE([ews], [yes])
4009ECORE_EVAS_MODULE([fb], [${want_fb}]) 4218ECORE_EVAS_MODULE([fb], [${want_fb}])
4010ECORE_EVAS_MODULE([drm], [${want_drm}], 4219ECORE_EVAS_MODULE([drm], [${want_drm}],
4011 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_drm}], [ecore-drm])]) 4220 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_drm}], [ecore-drm])])
4012ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}], 4221ECORE_EVAS_MODULE([gl-drm], [${want_gl_drm}],
4013 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_gl_drm}], [ecore-drm])]) 4222 [EFL_OPTIONAL_INTERNAL_DEPEND_PKG([ECORE_EVAS], [${want_gl_drm}], [ecore-drm])])
@@ -4677,6 +4886,63 @@ EFL_ADD_LIBS([ELOCATION], [-lm])
4677EFL_LIB_END([Elocation]) 4886EFL_LIB_END([Elocation])
4678#### End of Elocation 4887#### End of Elocation
4679 4888
4889
4890
4891#### Efl_Js
4892EFL_LIB_START_OPTIONAL([Efl_Js], [test "x${have_js}" = "xyes"])
4893
4894### Default values
4895
4896### Additional options to configure
4897
4898### Checks for programs
4899
4900### Checks for libraries
4901EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eina])
4902EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eo])
4903EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ecore])
4904EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eet])
4905EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ecore_Evas])
4906EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ecore_Con])
4907EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ecore_Audio])
4908EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Efl])
4909EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Evas])
4910EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Edje])
4911EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Emotion])
4912EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eldbus])
4913EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Emile])
4914EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Ethumb_Client])
4915EFL_INTERNAL_DEPEND_PKG([EFL_JS], [Eio])
4916
4917AM_COND_IF([HAVE_NODEJS], [], [ EFL_ADD_LIBS([EFL_JS], [-lv8]) ])
4918
4919EFL_EVAL_PKGS([EFL_JS])
4920
4921AM_COND_IF([HAVE_NODEJS], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_NODEJS"], [])
4922AM_COND_IF([HAVE_LIBUV], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_LIBUV"], [])
4923AM_COND_IF([HAVE_JS], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_JS"], [])
4924
4925AM_COND_IF([HAVE_V8_CREATE_PARAMS], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_V8_CREATE_PARAMS"], [])
4926AM_COND_IF([HAVE_V8_GLOBAL], [EFLJS_CXXFLAGS="$EFLJS_CXXFLAGS -DHAVE_V8_GLOBAL"], [])
4927AC_SUBST([EFLJS_CXXFLAGS])
4928
4929### Checks for header files
4930
4931### Checks for types
4932
4933### Checks for structures
4934
4935### Checks for compiler characteristics
4936
4937### Checks for linker characteristics
4938
4939### Checks for library functions
4940
4941### Check availability
4942
4943EFL_LIB_END_OPTIONAL([Efl_Js])
4944#### End of Efl_Js
4945
4680### Add Wayland server library if test is enabled 4946### Add Wayland server library if test is enabled
4681if test "x${want_tests}" = "xyes" -a "x${want_wayland}" = "xyes"; then 4947if test "x${want_tests}" = "xyes" -a "x${want_wayland}" = "xyes"; then
4682 EFL_DEPEND_PKG([ECORE_WAYLAND_SRV], [WAYLAND], [wayland-server >= 1.8.0]) 4948 EFL_DEPEND_PKG([ECORE_WAYLAND_SRV], [WAYLAND], [wayland-server >= 1.8.0])
@@ -4809,6 +5075,10 @@ pc/eo.pc
4809pc/eo-cxx.pc 5075pc/eo-cxx.pc
4810pc/eolian.pc 5076pc/eolian.pc
4811pc/eolian-cxx.pc 5077pc/eolian-cxx.pc
5078pc/eina-js.pc
5079pc/efl-js.pc
5080pc/eolian-js.pc
5081pc/eo-js.pc
4812pc/efl.pc 5082pc/efl.pc
4813pc/efl-cxx.pc 5083pc/efl-cxx.pc
4814pc/evas-fb.pc 5084pc/evas-fb.pc
@@ -4991,6 +5261,8 @@ echo " Cryptography..: ${build_crypto}"
4991echo " X11...........: ${with_x11}" 5261echo " X11...........: ${with_x11}"
4992echo " OpenGL........: ${with_opengl}" 5262echo " OpenGL........: ${with_opengl}"
4993echo " C++11.........: ${have_cxx11}" 5263echo " C++11.........: ${have_cxx11}"
5264echo " JavaScript....: ${want_js}"
5265echo " JavaScript flg: $EINA_JS_LIBS"
4994echo "Eina............: yes (${features_eina} unwind=$have_unwind)" 5266echo "Eina............: yes (${features_eina} unwind=$have_unwind)"
4995echo "Eo..............: yes (${features_eo})" 5267echo "Eo..............: yes (${features_eo})"
4996echo "Eolian..........: yes (${features_eolian})" 5268echo "Eolian..........: yes (${features_eolian})"
@@ -5052,6 +5324,7 @@ echo " CPPFLAGS......: $CPPFLAGS"
5052echo " CFLAGS........: $CFLAGS" 5324echo " CFLAGS........: $CFLAGS"
5053echo " CXXFLAGS......: $CXXFLAGS" 5325echo " CXXFLAGS......: $CXXFLAGS"
5054echo " LDFLAGS.......: $LDFLAGS" 5326echo " LDFLAGS.......: $LDFLAGS"
5327echo " EFLJS_CXXFLAGS: $EFLJS_CXXFLAGS"
5055 5328
5056if test "x${with_binary_edje_cc}" != "x"; then 5329if test "x${with_binary_edje_cc}" != "x"; then
5057echo " edje_cc.......: ${with_binary_edje_cc}" 5330echo " edje_cc.......: ${with_binary_edje_cc}"