Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miscellaneous small cleanups #62

Merged
merged 6 commits into from
Mar 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 106 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ SDL2GUI
sdl2_config
SDL2_LIBS
SDL2_CFLAGS
WAYLAND_LIBS
WAYLAND_CFLAGS
SIXEL_LIBS
SIXEL_CFLAGS
VT_NORM_CFLAGS
Expand Down Expand Up @@ -1033,6 +1035,8 @@ GIO_CFLAGS
GIO_LIBS
FT_CFLAGS
FT_LIBS
WAYLAND_CFLAGS
WAYLAND_LIBS
SDL2_CFLAGS
SDL2_LIBS
FRIBIDI_CFLAGS
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <http://pkg-config.freedesktop.org/>.
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
9 changes: 8 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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`"
Expand Down Expand Up @@ -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"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/en/README.sdl2
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions inputmethod/canna/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/fcitx/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/ibus/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/iiimf/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@TYPE_CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/kbd/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/m17nlib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/scim/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@MEF_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/skk/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/uim/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
1 change: 1 addition & 0 deletions inputmethod/wnn/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ CFLAGS = $(CFLAGS_LOCAL) \
@DEB_CFLAGS@ \
@X_CFLAGS@ \
@GUI_CFLAGS@ \
@WAYLAND_CFLAGS@ \
@SDL2_CFLAGS@ \
@TRUECOLOR_CFLAGS@ \
@CFLAGS@ \
Expand Down
7 changes: 3 additions & 4 deletions main/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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@)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion uitoolkit/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions uitoolkit/fb/ui_display_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down