diff --git a/configure b/configure index 6fe98348f..1a5a92ea3 100755 --- a/configure +++ b/configure @@ -807,6 +807,8 @@ SDL2GUI sdl2_config SDL2_LIBS SDL2_CFLAGS +WAYLAND_LIBS +WAYLAND_CFLAGS SIXEL_LIBS SIXEL_CFLAGS VT_NORM_CFLAGS @@ -1033,6 +1035,8 @@ GIO_CFLAGS GIO_LIBS FT_CFLAGS FT_LIBS +WAYLAND_CFLAGS +WAYLAND_LIBS SDL2_CFLAGS SDL2_LIBS FRIBIDI_CFLAGS @@ -1796,6 +1800,10 @@ Some influential environment variables: GIO_LIBS linker flags for GIO, overriding pkg-config FT_CFLAGS C compiler flags for FT, overriding pkg-config FT_LIBS linker flags for FT, overriding pkg-config + WAYLAND_CFLAGS + C compiler flags for WAYLAND, overriding pkg-config + WAYLAND_LIBS + linker flags for WAYLAND, overriding pkg-config SDL2_CFLAGS C compiler flags for SDL2, overriding pkg-config SDL2_LIBS linker flags for SDL2, overriding pkg-config FRIBIDI_CFLAGS @@ -18268,8 +18276,101 @@ elif test "$gui" = "beos" ; then GUI="beos" GUI_CFLAGS="-DUSE_BEOS" elif test "$gui" = "wayland" ; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for WAYLAND" >&5 +$as_echo_n "checking for WAYLAND... " >&6; } + +if test -n "$WAYLAND_CFLAGS"; then + pkg_cv_WAYLAND_CFLAGS="$WAYLAND_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client wayland-cursor xkbcommon\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-client wayland-cursor xkbcommon") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_CFLAGS=`$PKG_CONFIG --cflags "wayland-client wayland-cursor xkbcommon" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$WAYLAND_LIBS"; then + pkg_cv_WAYLAND_LIBS="$WAYLAND_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wayland-client wayland-cursor xkbcommon\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wayland-client wayland-cursor xkbcommon") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAYLAND_LIBS=`$PKG_CONFIG --libs "wayland-client wayland-cursor xkbcommon" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + WAYLAND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wayland-client wayland-cursor xkbcommon" 2>&1` + else + WAYLAND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wayland-client wayland-cursor xkbcommon" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$WAYLAND_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (wayland-client wayland-cursor xkbcommon) were not met: + +$WAYLAND_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables WAYLAND_CFLAGS +and WAYLAND_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables WAYLAND_CFLAGS +and WAYLAND_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + WAYLAND_CFLAGS=$pkg_cv_WAYLAND_CFLAGS + WAYLAND_LIBS=$pkg_cv_WAYLAND_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi GUI="wayland" GUI_CFLAGS="-DUSE_WAYLAND" + + elif test "$gui" = "sdl2" ; then pkg_failed=no @@ -18342,7 +18443,7 @@ else $as_echo "yes" >&6; } have_sdl2=yes fi - if test "$have_sdl2" != "yes" ; then + if test "$have_sdl2" != "yes" ; then # Extract the first word of "sdl2-config", so it can be a program name with args. set dummy sdl2-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -28218,7 +28319,11 @@ elif test "$gui" = "xlib"; then echo "Type engines :$type_engines_result" fi echo "DnD : $dnd" +if test "$gui" = "xlib"; then echo "Input Methods : XIM$input_methods_result" +else +echo "Input Methods :$input_methods_result" +fi echo "Scrollbars : simple${scrollbars_result}" echo "libssh2 : $ssh2" echo "mosh directory : $MOSH_DIR" diff --git a/configure.in b/configure.in index 61d50462f..43cee48c4 100644 --- a/configure.in +++ b/configure.in @@ -546,11 +546,14 @@ elif test "$gui" = "beos" ; then GUI="beos" GUI_CFLAGS="-DUSE_BEOS" elif test "$gui" = "wayland" ; then + PKG_CHECK_MODULES(WAYLAND, [wayland-client wayland-cursor xkbcommon]) GUI="wayland" GUI_CFLAGS="-DUSE_WAYLAND" + AC_SUBST(WAYLAND_CFLAGS) + AC_SUBST(WAYLAND_LIBS) elif test "$gui" = "sdl2" ; then PKG_CHECK_MODULES(SDL2, sdl2, have_sdl2=yes, have_sdl2=no) - if test "$have_sdl2" != "yes" ; then + if test "$have_sdl2" != "yes" ; then AC_CHECK_PROG(sdl2_config, sdl2-config, yes) if test "$sdl2_config" = "yes"; then SDL2_CFLAGS="`sdl2-config --cflags`" @@ -2412,7 +2415,11 @@ elif test "$gui" = "xlib"; then echo "Type engines :$type_engines_result" fi echo "DnD : $dnd" +if test "$gui" = "xlib"; then echo "Input Methods : XIM$input_methods_result" +else +echo "Input Methods :$input_methods_result" +fi echo "Scrollbars : simple${scrollbars_result}" echo "libssh2 : $ssh2" echo "mosh directory : $MOSH_DIR" diff --git a/contrib/tool/mlcc/Makefile b/contrib/tool/mlcc/Makefile.static similarity index 100% rename from contrib/tool/mlcc/Makefile rename to contrib/tool/mlcc/Makefile.static diff --git a/doc/en/README.sdl2 b/doc/en/README.sdl2 index 2d1d2638a..dadad49f5 100644 --- a/doc/en/README.sdl2 +++ b/doc/en/README.sdl2 @@ -18,7 +18,7 @@ SDL2 support instead of installing all files by 'make install'.) * Configuration - Configuration of wayland version is the same as that of X11 version + Configuration of sdl2 version is the same as that of X11 version except font settings as follows. Be sure to configure fonts before starting mlterm. diff --git a/inputmethod/canna/Makefile.in b/inputmethod/canna/Makefile.in index a8466b4cf..4c808cf56 100644 --- a/inputmethod/canna/Makefile.in +++ b/inputmethod/canna/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/inputmethod/fcitx/Makefile.in b/inputmethod/fcitx/Makefile.in index 93b58b0ad..219a8fc31 100644 --- a/inputmethod/fcitx/Makefile.in +++ b/inputmethod/fcitx/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/inputmethod/ibus/Makefile.in b/inputmethod/ibus/Makefile.in index b65b8b765..cae381cf0 100644 --- a/inputmethod/ibus/Makefile.in +++ b/inputmethod/ibus/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/inputmethod/iiimf/Makefile.in b/inputmethod/iiimf/Makefile.in index f892bc3f2..a4607939b 100644 --- a/inputmethod/iiimf/Makefile.in +++ b/inputmethod/iiimf/Makefile.in @@ -18,6 +18,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @TYPE_CFLAGS@ \ diff --git a/inputmethod/kbd/Makefile.in b/inputmethod/kbd/Makefile.in index ff6242b37..43e21cbc3 100644 --- a/inputmethod/kbd/Makefile.in +++ b/inputmethod/kbd/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/inputmethod/m17nlib/Makefile.in b/inputmethod/m17nlib/Makefile.in index a1e012bbe..ddef0a84f 100644 --- a/inputmethod/m17nlib/Makefile.in +++ b/inputmethod/m17nlib/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/inputmethod/scim/Makefile.in b/inputmethod/scim/Makefile.in index 5c835f8e4..ee203ae28 100644 --- a/inputmethod/scim/Makefile.in +++ b/inputmethod/scim/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @MEF_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/inputmethod/skk/Makefile.in b/inputmethod/skk/Makefile.in index 4e37c9fa9..a86cbb20e 100644 --- a/inputmethod/skk/Makefile.in +++ b/inputmethod/skk/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/inputmethod/uim/Makefile.in b/inputmethod/uim/Makefile.in index 766c621bd..a20d03a90 100644 --- a/inputmethod/uim/Makefile.in +++ b/inputmethod/uim/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/inputmethod/wnn/Makefile.in b/inputmethod/wnn/Makefile.in index f74334a15..e57849d80 100644 --- a/inputmethod/wnn/Makefile.in +++ b/inputmethod/wnn/Makefile.in @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \ @DEB_CFLAGS@ \ @X_CFLAGS@ \ @GUI_CFLAGS@ \ + @WAYLAND_CFLAGS@ \ @SDL2_CFLAGS@ \ @TRUECOLOR_CFLAGS@ \ @CFLAGS@ \ diff --git a/main/Makefile.in b/main/Makefile.in index e44d24a7b..83e810c1a 100644 --- a/main/Makefile.in +++ b/main/Makefile.in @@ -38,7 +38,7 @@ LMEF_DEB = -lmef_deb # XDATADIR is to avoid conflicting with DATADIR structure in w32api/objidl.h. CFLAGS = $(CFLAGS_LOCAL) @POBL_CFLAGS@ @MEF_CFLAGS@ @DEB_CFLAGS@ @BRLAPI_CFLAGS@ \ - @X_CFLAGS@ @GUI_CFLAGS@ @SSH2_CFLAGS@ @TYPE_CFLAGS@ @FT_CFLAGS@ @SDL2_CFLAGS@ \ + @X_CFLAGS@ @GUI_CFLAGS@ @SSH2_CFLAGS@ @TYPE_CFLAGS@ @FT_CFLAGS@ @WAYLAND_CFLAGS@ @SDL2_CFLAGS@ \ @DAEMON_CFLAGS@ @SPLIT_CFLAGS@ @DND_CFLAGS@ @TRANSFER_CFLAGS@ @IMAGE_CFLAGS@ \ @TRUECOLOR_CFLAGS@ @CFLAGS@ @CPPFLAGS@ -DSYSCONFDIR=\"$(sysconfdir)\" \ -I$(top_srcdir)/vtemu \ @@ -63,12 +63,11 @@ LIBS2_beos = -lbe -ltranslation -lsocket LIBS2_console = @SIXEL_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @SOCK_LIBS@ -LIBS2_wayland = @FT_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @SOCK_LIBS@ \ - -lwayland-client -lwayland-cursor -lxkbcommon +LIBS2_wayland = @WAYLAND_LIBS@ @FT_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @SOCK_LIBS@ LIBS2_sdl2_win32 = ../uitoolkit/winrs.o -LIBS2_sdl2 = @SDL2_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @FT_LIBS@ @SOCK_LIBS@ $(LIBS2_@GUI@_@SDL2GUI@) +LIBS2_sdl2 = @SDL2_LIBS@ @MATH_LIBS@ @DL_LIBS_IM@ @DL_LIBS_SB@ @FT_LIBS@ @SOCK_LIBS@ $(LIBS2_@GUI@_@SDL2GUI@) LIBS = $(LIBS1) $(LIBS2_@GUI@) diff --git a/tool/mlclient/Makefile b/tool/mlclient/Makefile.static similarity index 100% rename from tool/mlclient/Makefile rename to tool/mlclient/Makefile.static diff --git a/uitoolkit/Makefile.in b/uitoolkit/Makefile.in index 0d0a1bb09..12e353287 100644 --- a/uitoolkit/Makefile.in +++ b/uitoolkit/Makefile.in @@ -60,7 +60,7 @@ CFLAGS = $(CFLAGS_LOCAL) @POBL_CFLAGS@ @MEF_CFLAGS@ @DEB_CFLAGS@ @MATH_CFLAGS@ \ @IMAGELIB_CFLAGS@ @X_CFLAGS@ @GUI_CFLAGS@ @SSH2_CFLAGS@ @XUTF8_CFLAGS@ @DND_CFLAGS@ \ @IM_CFLAGS@ @SB_CFLAGS@ @REGEX_CFLAGS@ @CTL_CFLAGS@ @TYPE_CFLAGS@ @FT_CFLAGS@ \ @IMAGE_CFLAGS@ @TOOLS_CFLAGS@ @OT_LAYOUT_CFLAGS@ @SIXEL_CFLAGS@ @BRLAPI_CFLAGS@ \ - @SDL2_CFLAGS@ @SPLIT_CFLAGS@ @TRUECOLOR_CFLAGS@ @CFLAGS@ @CPPFLAGS@ \ + @WAYLAND_CFLAGS@ @SDL2_CFLAGS@ @SPLIT_CFLAGS@ @TRUECOLOR_CFLAGS@ @CFLAGS@ @CPPFLAGS@ \ -DBINDIR=\"$(bindir)\" -DLIBDIR=\"$(libdir)\" -DLIBEXECDIR=\"$(libexecdir)\" \ -DXDATADIR=\"$(datadir)\" \ -I$(top_srcdir)/vtemu -I$(top_srcdir)/uitoolkit/libotl -I/usr/local/include diff --git a/uitoolkit/fb/ui_display_linux.c b/uitoolkit/fb/ui_display_linux.c index 8db347e51..7c3367830 100644 --- a/uitoolkit/fb/ui_display_linux.c +++ b/uitoolkit/fb/ui_display_linux.c @@ -367,13 +367,15 @@ static int open_display(u_int depth) { bl_priv_restore_euid(); bl_priv_restore_egid(); - _display.fb_fd = open((dev = getenv("FRAMEBUFFER")) ? dev : "/dev/fb0", O_RDWR); + dev = getenv("FRAMEBUFFER"); + dev = dev ? dev : "/dev/fb0"; + _display.fb_fd = open(dev, O_RDWR); bl_priv_change_euid(bl_getuid()); bl_priv_change_egid(bl_getgid()); if (_display.fb_fd < 0) { - bl_error_printf("Couldn't open %s.\n", dev ? dev : "/dev/fb0"); + bl_error_printf("Couldn't open %s.\n", dev); return 0; }