configure.in
changeset 10496 6660aa9120d6
parent 10490 24472af11074
child 10565 15ba7a201f0a
     1.1 --- a/configure.in	Fri Oct 07 18:24:34 2016 -0700
     1.2 +++ b/configure.in	Fri Oct 07 18:57:40 2016 -0700
     1.3 @@ -2260,6 +2260,18 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl See if the platform wanna IME support.
     1.8 +CheckIME()
     1.9 +{
    1.10 +    AC_ARG_ENABLE(ime,
    1.11 +AC_HELP_STRING([--enable-ime], [enable IME support [[default=yes]]]),
    1.12 +                  , enable_ime=yes)
    1.13 +    if test x$enable_ime = xyes; then
    1.14 +        AC_DEFINE(SDL_USE_IME, 1, [ ])
    1.15 +            SOURCES="$SOURCES $srcdir/src/core/linux/SDL_ime.c"
    1.16 +    fi
    1.17 +}
    1.18 +
    1.19  dnl See if the platform has libibus IME support.
    1.20  CheckIBus()
    1.21  {
    1.22 @@ -2280,7 +2292,10 @@
    1.23                              have_inotify_inotify_h_hdr=no)
    1.24              CFLAGS="$save_CFLAGS"
    1.25              if test x$have_ibus_ibus_h_hdr = xyes; then
    1.26 -                if test x$enable_dbus != xyes; then
    1.27 +                if test x$enable_ime != xyes; then
    1.28 +                    AC_MSG_WARN([IME support is required for IBus.])
    1.29 +                    have_ibus_ibus_h_hdr=no
    1.30 +                elif test x$enable_dbus != xyes; then
    1.31                      AC_MSG_WARN([DBus support is required for IBus.])
    1.32                      have_ibus_ibus_h_hdr=no
    1.33                  elif test x$have_inotify_inotify_h_hdr != xyes; then
    1.34 @@ -2296,6 +2311,38 @@
    1.35      fi
    1.36  }
    1.37  
    1.38 +dnl See if the platform has fcitx IME support.
    1.39 +CheckFcitx()
    1.40 +{
    1.41 +    AC_ARG_ENABLE(fcitx,
    1.42 +AC_HELP_STRING([--enable-fcitx], [enable fcitx support [[default=yes]]]),
    1.43 +                  , enable_fcitx=yes)
    1.44 +    if test x$enable_fcitx = xyes; then
    1.45 +        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
    1.46 +        if test x$PKG_CONFIG != xno; then
    1.47 +            FCITX_CFLAGS=`$PKG_CONFIG --cflags fcitx`
    1.48 +            CFLAGS="$CFLAGS $FCITX_CFLAGS"
    1.49 +            AC_CHECK_HEADER(fcitx/frontend.h,
    1.50 +                            have_fcitx_frontend_h_hdr=yes,
    1.51 +                            have_fcitx_frontend_h_hdr=no)
    1.52 +            CFLAGS="$save_CFLAGS"
    1.53 +            if test x$have_fcitx_frontend_h_hdr = xyes; then
    1.54 +                if test x$enable_ime != xyes; then
    1.55 +                    AC_MSG_WARN([IME support is required for fcitx.])
    1.56 +                    have_fcitx_frontend_h_hdr=no
    1.57 +                elif test x$enable_dbus != xyes; then
    1.58 +                    AC_MSG_WARN([DBus support is required for fcitx.])
    1.59 +                    have_fcitx_frontend_h_hdr=no
    1.60 +                else
    1.61 +                    AC_DEFINE(HAVE_FCITX_FRONTEND_H, 1, [ ])
    1.62 +                    EXTRA_CFLAGS="$EXTRA_CFLAGS $FCITX_CFLAGS"
    1.63 +                    SOURCES="$SOURCES $srcdir/src/core/linux/SDL_fcitx.c"
    1.64 +               fi
    1.65 +            fi
    1.66 +        fi
    1.67 +    fi
    1.68 +}
    1.69 +
    1.70  dnl See if we can use the Touchscreen input library
    1.71  CheckTslib()
    1.72  {
    1.73 @@ -2924,7 +2971,9 @@
    1.74          CheckWayland
    1.75          CheckLibUDev
    1.76          CheckDBus
    1.77 +        CheckIME
    1.78          CheckIBus
    1.79 +        CheckFcitx
    1.80          case $ARCH in
    1.81            linux)
    1.82                CheckInputEvents
    1.83 @@ -3679,11 +3728,21 @@
    1.84  else
    1.85      SUMMARY="${SUMMARY}Using dbus      : NO\n"
    1.86  fi
    1.87 +if test x$enable_ime = xyes; then
    1.88 +    SUMMARY="${SUMMARY}Using ime       : YES\n"
    1.89 +else
    1.90 +    SUMMARY="${SUMMARY}Using ime       : NO\n"
    1.91 +fi
    1.92  if test x$have_ibus_ibus_h_hdr = xyes; then
    1.93      SUMMARY="${SUMMARY}Using ibus      : YES\n"
    1.94  else
    1.95      SUMMARY="${SUMMARY}Using ibus      : NO\n"
    1.96  fi
    1.97 +if test x$have_fcitx_frontend_h_hdr = xyes; then
    1.98 +    SUMMARY="${SUMMARY}Using fcitx     : YES\n"
    1.99 +else
   1.100 +    SUMMARY="${SUMMARY}Using fcitx     : NO\n"
   1.101 +fi
   1.102  AC_CONFIG_COMMANDS([summary], [echo -en "$SUMMARY"], [SUMMARY="$SUMMARY"])
   1.103  
   1.104  AC_OUTPUT