diff options
| author | Paul Eggert | 2016-01-20 11:06:01 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-01-20 11:06:35 -0800 |
| commit | 2388fa74982a9146e4bcefc75004ec9d7241c505 (patch) | |
| tree | 77818707711ddc4e467dc0e6ae141c01636d6811 | |
| parent | 65575c24aaad9bedf6b84cc062cc03fbe4dd1315 (diff) | |
| download | emacs-2388fa74982a9146e4bcefc75004ec9d7241c505.tar.gz emacs-2388fa74982a9146e4bcefc75004ec9d7241c505.zip | |
Port to platforms with gtk3 but not webkitgtk3
I ran into this problem on my Fedora 23 installation;
Emacs configured but did not build when --with-xwidgets was specified.
* configure.ac (HAVE_WEBKIT, HAVE_GIR): Omit unnecessary initializations.
(DOES_XWIDGETS_USE_GIR): New var.
If --with-xwidgets is specified, report an error if not
doable, to be consistent with the other --with options.
Require webkitgtk3 to use Xwidgets, as the Xwidgets code does
not work at all without webkitgtk3. Simplify use of
EMACS_CHECK_MODULES. Output message about gobject
introspection only if xwidgets are used.
* etc/NEWS: Users need webkitgtk3, not merely webkit.
* src/xwidget.c (syms_of_xwidget): Don’t worry about HAVE_WEBKIT_OSR,
since this file is no longer compiled if webkitgtk3 is not available.
| -rw-r--r-- | configure.ac | 35 | ||||
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | src/xwidget.c | 2 |
3 files changed, 16 insertions, 23 deletions
diff --git a/configure.ac b/configure.ac index 3b87fad60b6..a344b28c68a 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -2566,35 +2566,32 @@ if test "${HAVE_GTK}" = "yes"; then | |||
| 2566 | fi | 2566 | fi |
| 2567 | 2567 | ||
| 2568 | 2568 | ||
| 2569 | dnl Enable xwidgets if GTK3 and WebKitGTK+ are available. | ||
| 2569 | HAVE_XWIDGETS=no | 2570 | HAVE_XWIDGETS=no |
| 2570 | HAVE_WEBKIT=no | ||
| 2571 | HAVE_GIR=no | ||
| 2572 | XWIDGETS_OBJ= | 2571 | XWIDGETS_OBJ= |
| 2573 | if test "$with_xwidgets" != "no" && test "$USE_GTK_TOOLKIT" = "GTK3" && | 2572 | DOES_XWIDGETS_USE_GIR= |
| 2574 | test "$window_system" != "none" | 2573 | if test "$with_xwidgets" != "no"; then |
| 2575 | then | 2574 | test "$USE_GTK_TOOLKIT" = "GTK3" && test "$window_system" != "none" || |
| 2576 | HAVE_XWIDGETS=yes | 2575 | AC_MSG_ERROR([xwidgets requested but gtk3 not used.]) |
| 2577 | AC_DEFINE([HAVE_XWIDGETS], 1, [Define to 1 if you have xwidgets support.]) | ||
| 2578 | 2576 | ||
| 2579 | dnl xwidgets | ||
| 2580 | dnl - enable only if GTK3 is enabled, and we have a window system | ||
| 2581 | dnl - check for webkit and gobject introspection | ||
| 2582 | dnl webkit version for gtk3. | ||
| 2583 | WEBKIT_REQUIRED=1.4.0 | 2577 | WEBKIT_REQUIRED=1.4.0 |
| 2584 | WEBKIT_MODULES="webkitgtk-3.0 >= $WEBKIT_REQUIRED" | 2578 | WEBKIT_MODULES="webkitgtk-3.0 >= $WEBKIT_REQUIRED" |
| 2579 | EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES]) | ||
| 2580 | HAVE_XWIDGETS=$HAVE_WEBKIT | ||
| 2581 | test $HAVE_XWIDGETS = yes || | ||
| 2582 | AC_MSG_ERROR([xwidgets requested but WebKitGTK+ not found.]) | ||
| 2585 | 2583 | ||
| 2586 | EMACS_CHECK_MODULES(WEBKIT, $WEBKIT_MODULES, HAVE_WEBKIT=yes, HAVE_WEBKIT=no) | 2584 | XWIDGETS_OBJ=xwidget.o |
| 2587 | if test $HAVE_WEBKIT = yes; then | 2585 | AC_DEFINE([HAVE_XWIDGETS], 1, [Define to 1 if you have xwidgets support.]) |
| 2588 | AC_DEFINE([HAVE_WEBKIT_OSR], 1, [Define to 1 if you have webkit_osr support.]) | ||
| 2589 | fi | ||
| 2590 | 2586 | ||
| 2591 | GIR_REQUIRED=1.32.1 | 2587 | GIR_REQUIRED=1.32.1 |
| 2592 | GIR_MODULES="gobject-introspection-1.0 >= $GIR_REQUIRED" | 2588 | GIR_MODULES="gobject-introspection-1.0 >= $GIR_REQUIRED" |
| 2593 | EMACS_CHECK_MODULES(GIR, $GIR_MODULES, HAVE_GIR=yes, HAVE_GIR=no) | 2589 | EMACS_CHECK_MODULES([GIR], [$GIR_MODULES]) |
| 2594 | if test $HAVE_GIR = yes; then | 2590 | if test $HAVE_GIR = yes; then |
| 2595 | AC_DEFINE([HAVE_GIR], 1, [Define to 1 if you have GIR support.]) | 2591 | AC_DEFINE([HAVE_GIR], 1, [Define to 1 if you have GIR support.]) |
| 2596 | fi | 2592 | fi |
| 2597 | XWIDGETS_OBJ=xwidget.o | 2593 | DOES_XWIDGETS_USE_GIR="\ |
| 2594 | Does Xwidgets use gobject introspection? $HAVE_GIR" | ||
| 2598 | fi | 2595 | fi |
| 2599 | AC_SUBST(XWIDGETS_OBJ) | 2596 | AC_SUBST(XWIDGETS_OBJ) |
| 2600 | 2597 | ||
| @@ -5305,9 +5302,7 @@ AS_ECHO([" Does Emacs use -lXaw3d? ${HAVE_XAW3D | |||
| 5305 | Does Emacs have dynamic modules support? ${HAVE_MODULES} | 5302 | Does Emacs have dynamic modules support? ${HAVE_MODULES} |
| 5306 | Does Emacs use toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS} | 5303 | Does Emacs use toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS} |
| 5307 | Does Emacs support Xwidgets (requires gtk3)? ${HAVE_XWIDGETS} | 5304 | Does Emacs support Xwidgets (requires gtk3)? ${HAVE_XWIDGETS} |
| 5308 | Does xwidgets support webkit? ${HAVE_WEBKIT} | 5305 | ${DOES_XWIDGETS_USE_GIR}"]) |
| 5309 | Does xwidgets support gobject introspection? ${HAVE_GIR} | ||
| 5310 | "]) | ||
| 5311 | 5306 | ||
| 5312 | if test -n "${EMACSDATA}"; then | 5307 | if test -n "${EMACSDATA}"; then |
| 5313 | AS_ECHO([" Environment variable EMACSDATA set to: $EMACSDATA"]) | 5308 | AS_ECHO([" Environment variable EMACSDATA set to: $EMACSDATA"]) |
| @@ -121,7 +121,7 @@ and can contain escape sequences for command keys, quotes, and the like. | |||
| 121 | * Changes in Emacs 25.1 | 121 | * Changes in Emacs 25.1 |
| 122 | 122 | ||
| 123 | ** Xwidgets: a new feature for embedding native widgets inside Emacs buffers. | 123 | ** Xwidgets: a new feature for embedding native widgets inside Emacs buffers. |
| 124 | If you have gtk3 and webkit-devel installed, you can access the | 124 | If you have gtk3 and webkitgtk3 installed, you can access the |
| 125 | embedded webkit browser with `M-x xwidget-webkit-browse-url'. This | 125 | embedded webkit browser with `M-x xwidget-webkit-browse-url'. This |
| 126 | opens a new buffer with the embedded browser. The buffer will | 126 | opens a new buffer with the embedded browser. The buffer will |
| 127 | have a new mode, `xwidget-webkit-mode' (similar to `image-mode'), | 127 | have a new mode, `xwidget-webkit-mode' (similar to `image-mode'), |
diff --git a/src/xwidget.c b/src/xwidget.c index 88cdb941c4c..f8e13cd4522 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -1077,12 +1077,10 @@ syms_of_xwidget (void) | |||
| 1077 | defsubr (&Sxwidget_query_on_exit_flag); | 1077 | defsubr (&Sxwidget_query_on_exit_flag); |
| 1078 | defsubr (&Sset_xwidget_query_on_exit_flag); | 1078 | defsubr (&Sset_xwidget_query_on_exit_flag); |
| 1079 | 1079 | ||
| 1080 | #ifdef HAVE_WEBKIT_OSR | ||
| 1081 | defsubr (&Sxwidget_webkit_goto_uri); | 1080 | defsubr (&Sxwidget_webkit_goto_uri); |
| 1082 | defsubr (&Sxwidget_webkit_execute_script); | 1081 | defsubr (&Sxwidget_webkit_execute_script); |
| 1083 | defsubr (&Sxwidget_webkit_get_title); | 1082 | defsubr (&Sxwidget_webkit_get_title); |
| 1084 | DEFSYM (Qwebkit_osr, "webkit-osr"); | 1083 | DEFSYM (Qwebkit_osr, "webkit-osr"); |
| 1085 | #endif | ||
| 1086 | 1084 | ||
| 1087 | defsubr (&Sxwidget_size_request); | 1085 | defsubr (&Sxwidget_size_request); |
| 1088 | defsubr (&Sdelete_xwidget_view); | 1086 | defsubr (&Sdelete_xwidget_view); |