Skip to content

Commit

Permalink
JBR-4578 Add Java ATK Wrapper
Browse files Browse the repository at this point in the history
Library to enable accessibility on gnome linux.
  • Loading branch information
tanya011 committed Dec 18, 2024
1 parent 6c252e1 commit 1d350f8
Show file tree
Hide file tree
Showing 60 changed files with 11,572 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
g++-${{ inputs.gcc-major-version }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev libatspi2.0-dev libatk1.0-dev libglib2.0-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
- name: 'Check cache for sysroot'
Expand All @@ -133,7 +133,7 @@ jobs:
sudo debootstrap
--arch=${{ matrix.debian-arch }}
--verbose
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev,libatspi2.0-dev,libatk1.0-dev,libglib2.0-dev
--resolve-deps
--variant=minbase
${{ matrix.debian-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
fi
sudo apt-get update
sudo apt-get install --only-upgrade apt
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
sudo apt-get install gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} libatspi2.0-dev${{ steps.arch.outputs.suffix }} libatk1.0-dev${{ steps.arch.outputs.suffix }} libglib2.0-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
- name: 'Configure'
Expand Down
2 changes: 2 additions & 0 deletions make/autoconf/help.m4
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ apt_help() {
PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;;
capstone)
PKGHANDLER_COMMAND="sudo apt-get install libcapstone-dev" ;;
atk)
PKGHANDLER_COMMAND="sudo apt-get install libatspi2.0-dev libatk1.0-dev libglib2.0-dev" ;;
esac
}

Expand Down
26 changes: 26 additions & 0 deletions make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,32 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
A11Y_JAWS_ANNOUNCING_ENABLED=false
fi
AC_SUBST(A11Y_JAWS_ANNOUNCING_ENABLED)
# Should we build support for Java ATK Wrapper?
if test "x$OPENJDK_TARGET_OS" = xlinux; then
AC_MSG_CHECKING([if Java ATK Wrapper support is enabled])
A11Y_JAVA_ATK_WRAPPER_ENABLED=true
AC_ARG_ENABLE(
[java-atk-wrapper],
[AS_HELP_STRING([--disable-java-atk-wrapper], [Set to disable the Java ATK Wrapper])],
[
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
AC_MSG_WARN([--[enable|disable]-java-atk-wrapper[=*] flags are ignored for headless builds])
elif test "x$enableval" != xyes; then
A11Y_JAVA_ATK_WRAPPER_ENABLED=false
fi
]
)
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
A11Y_JAVA_ATK_WRAPPER_ENABLED=false
fi
AC_MSG_RESULT([$A11Y_JAVA_ATK_WRAPPER_ENABLED])
else
A11Y_JAVA_ATK_WRAPPER_ENABLED=false
fi
AC_SUBST(A11Y_JAVA_ATK_WRAPPER_ENABLED)
])

###############################################################################
Expand Down
57 changes: 57 additions & 0 deletions make/autoconf/lib-at-spi2-atk.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
################################################################################
# Setup at-spi2-atk
################################################################################
AC_DEFUN_ONCE([LIB_SETUP_AT_SPI2_ATK],
[
AC_ARG_WITH(at-spi2-atk, [AS_HELP_STRING([--with-at-spi2-atk],
[specify prefix directory for the at-spi2-atk package
(expecting the headers under PATH/include); required for atk-wrapper to work])])
AC_ARG_WITH(at-spi2-atk-include, [AS_HELP_STRING([--with-at-spi2-atk-include],
[specify directory for the at-spi2-atk include files])])
if test "x$NEEDS_LIB_AT_SPI2_ATK" = xfalse || test "x${with_at_spi2_atk}" = xno || \
test "x${with_at_spi2_atk_include}" = xno; then
if (test "x${with_at_spi2_atk}" != x && test "x${with_at_spi2_atk}" != xno) || \
(test "x${with_at_spi2_atk_include}" != x && test "x${with_at_spi2_atk_include}" != xno); then
AC_MSG_WARN([[at-spi2-atk not used, so --with-at-spi2-atk[-*] is ignored]])
fi
AT_SPI2_ATK_CFLAGS=
AT_SPI2_ATK_LIBS=
else
AT_SPI2_ATK_FOUND=no
if test "x${with_at_spi2_atk}" != x && test "x${with_at_spi2_atk}" != xyes; then
AC_MSG_CHECKING([for at-spi2-atk header and library])
if test -s "${with_at_spi2_atk}/include/at-spi2-atk/2.0/atk-bridge.h"; then
AT_SPI2_ATK_CFLAGS="-I${with_at_spi2_atk}/include/at-spi2-atk/2.0"
AT_SPI2_ATK_LIBS="-L${with_at_spi2_atk}/lib -latk-bridge-2.0"
AT_SPI2_ATK_FOUND=yes
AC_MSG_RESULT([$AT_SPI2_ATK_FOUND])
else
AC_MSG_ERROR([Can't find '/include/at-spi2-atk/2.0/atk-bridge.h' under ${with_at_spi2_atk} given with the --with-at-spi2-atk option.])
fi
fi
if test "x${with_at_spi2_atk_include}" != x; then
AC_MSG_CHECKING([for at-spi2-atk headers])
if test -s "${with_at_spi2_atk_include}/at-spi2-atk/2.0/atk-bridge.h"; then
AT_SPI2_ATK_CFLAGS="-I${with_at_spi2_atk_include}/at-spi2-atk/2.0"
AT_SPI2_ATK_FOUND=yes
AC_MSG_RESULT([$AT_SPI2_ATK_FOUND])
else
AC_MSG_ERROR([Can't find 'include/at-spi2-atk-2.0/atk-bridge.h' under ${with_at_spi2_atk_include} given with the --with-at-spi2-atk-include option.])
fi
fi
if test "x$AT_SPI2_ATK_FOUND" = xno; then
# Are the at-spi2-atk headers installed in the default /usr/include location?
# FIXME: AC_CHECK_HEADERS doesn't find the header without CPPFLAGS update
PKG_CHECK_MODULES([AT_SPI2_ATK], [atk-bridge-2.0], CPPFLAGS="$CPPFLAGS $AT_SPI2_ATK_CFLAGS", break)
AC_CHECK_HEADERS([at-spi2-atk/2.0/atk-bridge.h],
[ AT_SPI2_ATK_FOUND=yes; AT_SPI2_ATK_LIBS="-latk-bridge-2.0" ],
[ AT_SPI2_ATK_FOUND=no; break ]
)
fi
fi
AC_SUBST(AT_SPI2_ATK_CFLAGS)
AC_SUBST(AT_SPI2_ATK_LIBS)
])
56 changes: 56 additions & 0 deletions make/autoconf/lib-atk.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
################################################################################
# Setup atk
################################################################################
AC_DEFUN_ONCE([LIB_SETUP_ATK],
[
AC_ARG_WITH(atk, [AS_HELP_STRING([--with-atk],
[specify prefix directory for the atk package
(expecting the headers under PATH/include); required for atk-wrapper to work])])
AC_ARG_WITH(atk-include, [AS_HELP_STRING([--with-atk-include],
[specify directory for the atk include files])])
if test "x$NEEDS_LIB_ATK" = xfalse || test "x${with_atk}" = xno || \
test "x${with_atk_include}" = xno; then
if (test "x${with_atk}" != x && test "x${with_atk}" != xno) || \
(test "x${with_atk_include}" != x && test "x${with_atk_include}" != xno); then
AC_MSG_WARN([[atk not used, so --with-atk[-*] is ignored]])
fi
ATK_CFLAGS=
ATK_LIBS=
else
ATK_FOUND=no
if test "x${with_atk}" != x && test "x${with_atk}" != xyes; then
AC_MSG_CHECKING([for atk header and library])
if test -s "${with_atk}/include/atk-1.0/atk/atk.h"; then
ATK_CFLAGS="-I${with_atk}/include/atk-1.0"
ATK_LIBS="-L${with_atk}/lib -latk-1.0"
ATK_FOUND=yes
AC_MSG_RESULT([$ATK_FOUND])
else
AC_MSG_ERROR([Can't find '/include/atk-1.0/atk/atk.h' under ${with_atk} given with the --with-atk option.])
fi
fi
if test "x${with_atk_include}" != x; then
AC_MSG_CHECKING([for atk headers])
if test -s "${with_atk_include}/atk-1.0/atk/atk.h"; then
ATK_CFLAGS="-I${with_atk_include}/atk-1.0"
ATK_FOUND=yes
AC_MSG_RESULT([$ATK_FOUND])
else
AC_MSG_ERROR([Can't find 'include/atk-1.0/atk/atk.h' under ${with_atk_include} given with the --with-atk-include option.])
fi
fi
if test "x$ATK_FOUND" = xno; then
# Are the atk headers installed in the default /usr/include location?
# FIXME: AC_CHECK_HEADERS doesn't find the header without CPPFLAGS update
PKG_CHECK_MODULES([ATK], [atk], CPPFLAGS="$CPPFLAGS $ATK_CFLAGS", break)
AC_CHECK_HEADERS([atk-1.0/atk/atk.h],
[ ATK_FOUND=yes; ATK_LIBS="-latk-1.0" ],
[ ATK_FOUND=no; break ]
)
fi
fi
AC_SUBST(ATK_CFLAGS)
AC_SUBST(ATK_LIBS)
])
57 changes: 57 additions & 0 deletions make/autoconf/lib-glib.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
################################################################################
# Setup glib
################################################################################
AC_DEFUN_ONCE([LIB_SETUP_GLIB],
[
AC_ARG_WITH(glib, [AS_HELP_STRING([--with-glib],
[specify prefix directory for the glib package
(expecting the headers under PATH/include); required for atk-wrapper to work])])
AC_ARG_WITH(glib-include, [AS_HELP_STRING([--with-glib-include],
[specify directory for the glib include files])])
if test "x$NEEDS_LIB_GLIB" = xfalse || test "x${with_glib}" = xno || \
test "x${with_glib_include}" = xno; then
if (test "x${with_glib}" != x && test "x${with_glib}" != xno) || \
(test "x${with_glib_include}" != x && test "x${with_glib_include}" != xno); then
AC_MSG_WARN([[glib not used, so --with-glib[-*] is ignored]])
fi
GLIB_CFLAGS=
GLIB_LIBS=
else
GLIB_FOUND=no
if test "x${with_glib}" != x && test "x${with_glib}" != xyes; then
AC_MSG_CHECKING([for glib header and library])
if test -s "${with_glib}/include/glib-2.0/glib.h"; then
GLIB_CFLAGS="-I${with_glib}/include/glib-2.0"
GLIB_LIBS="-L${with_glib}/lib -lglib-2.0"
GLIB_FOUND=yes
AC_MSG_RESULT([$GLIB_FOUND])
else
AC_MSG_ERROR([Can't find '/include/glib-2.0/glib.h' under ${with_glib} given with the --with-glib option.])
fi
fi
if test "x${with_glib_include}" != x; then
AC_MSG_CHECKING([for glib headers])
if test -s "${with_glib_include}/glib-2.0/glib.h"; then
GLIB_CFLAGS="-I${with_glib_include}"
GLIB_FOUND=yes
AC_MSG_RESULT([$GLIB_FOUND])
else
AC_MSG_ERROR([Can't find '/include/glib-2.0/glib.h' under ${with_glib_include} given with the --with-glib-include option.])
fi
fi
if test "x$GLIB_FOUND" = xno; then
# Are the glib headers installed in the default /usr/include location?
# FIXME: AC_CHECK_HEADERS doesn't find the header without CPPFLAGS update
PKG_CHECK_MODULES([GLIB], [glib-2.0], CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS", break)
AC_CHECK_HEADERS([glib-2.0/glib.h],
[ GLIB_FOUND=yes; GLIB_LIBS="-lglib-2.0" ],
[ GLIB_FOUND=no; break ]
)
fi
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
])
53 changes: 53 additions & 0 deletions make/autoconf/lib-glibconfig.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
################################################################################
# Setup glibconfig
################################################################################
AC_DEFUN_ONCE([LIB_SETUP_GLIBCONFIG],
[
AC_ARG_WITH(glibconfig, [AS_HELP_STRING([--with-glibconfig],
[specify prefix directory for the glibconfig package
(expecting the headers under PATH/include); required for atk-wrapper to work])])
AC_ARG_WITH(glibconfig-include, [AS_HELP_STRING([--with-glibconfig-include],
[specify directory for the glibconfig include files])])
if test "x$NEEDS_LIB_GLIBCONFIG" = xfalse || test "x${with_glibconfig}" = xno || \
test "x${with_glibconfig_include}" = xno; then
if (test "x${with_glibconfig}" != x && test "x${with_glibconfig}" != xno) || \
(test "x${with_glibconfig_include}" != x && test "x${with_glibconfig_include}" != xno); then
AC_MSG_WARN([[glibconfig not used, so --with-glibconfig[-*] is ignored]])
fi
GLIBCONFIG_CFLAGS=
else
GLIBCONFIG_FOUND=no
if test "x${with_glibconfig}" != x && test "x${with_glibconfig}" != xyes; then
AC_MSG_CHECKING([for glibconfig header])
if test -s "${with_glibconfig}/include/glibconfig.h"; then
GLIBCONFIG_CFLAGS="-I${with_glibconfig}/include"
GLIBCONFIG_FOUND=yes
AC_MSG_RESULT([$GLIBCONFIG_FOUND])
else
AC_MSG_ERROR([Can't find '/include/glibconfig.h' under ${with_glibconfig} given with the --with-glibconfig option.])
fi
fi
if test "x${with_glibconfig_include}" != x; then
AC_MSG_CHECKING([for glibconfig headers])
if test -s "${with_glibconfig_include}/glibconfig.h"; then
GLIBCONFIG_CFLAGS="-I${with_glibconfig_include}"
GLIBCONFIG_FOUND=yes
AC_MSG_RESULT([$GLIBCONFIG_FOUND])
else
AC_MSG_ERROR([Can't find '/include/glibconfig.h' under ${with_glibconfig_include} given with the --with-glibconfig-include option.])
fi
fi
if test "x$GLIBCONFIG_FOUND" = xno; then
# Are the glibconfig header installed in the default /usr/lib/glib-2.0/include location?
PKG_CHECK_MODULES([GLIBCONFIG], [glib-2.0], CPPFLAGS="$CPPFLAGS $GLIBCONFIG_CFLAGS", break)
# FIXME: AC_CHECK_HEADERS doesn't find glibconfig.h, even though $GLIBCONFIG_CFLAGS contains its path
AC_CHECK_HEADER([glibconfig.h],
[ GLIBCONFIG_FOUND=yes ],
[ GLIBCONFIG_FOUND=no; break ]
)
fi
fi
AC_SUBST(GLIBCONFIG_CFLAGS)
])
58 changes: 58 additions & 0 deletions make/autoconf/lib-gobject.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
################################################################################
# Setup gobject
################################################################################
AC_DEFUN_ONCE([LIB_SETUP_GOBJECT],
[
AC_ARG_WITH(gobject, [AS_HELP_STRING([--with-gobject],
[specify prefix directory for the gobject package
(expecting the headers under PATH/include); required for atk-wrapper to work])])
AC_ARG_WITH(gobject-include, [AS_HELP_STRING([--with-gobject-include],
[specify directory for the gobject include files])])
if test "x$NEEDS_LIB_GOBJECT" = xfalse || test "x${with_gobject}" = xno || \
test "x${with_gobject_include}" = xno; then
if (test "x${with_gobject}" != x && test "x${with_gobject}" != xno) || \
(test "x${with_gobject_include}" != x && test "x${with_gobject_include}" != xno); then
AC_MSG_WARN([[gobject not used, so --with-gobject[-*] is ignored]])
fi
GOBJECT_CFLAGS=
GOBJECT_LIBS=
else
GOBJECT_FOUND=no
if test "x${with_gobject}" != x && test "x${with_gobject}" != xyes; then
AC_MSG_CHECKING([for gobject header and library])
if test -s "${with_gobject}/include/glib-2.0/gobject/gobject.h"; then
GOBJECT_CFLAGS="-I${with_gobject}/include/glib-2.0/gobject"
GOBJECT_LIBS="-L${with_gobject}/lib -lgobject-2.0"
GOBJECT_FOUND=yes
AC_MSG_RESULT([$GOBJECT_FOUND])
else
AC_MSG_ERROR([Can't find '/include/glib-2.0/gobject/gobject.h' under ${with_gobject} given with the --with-gobject option.])
fi
fi
if test "x${with_gobject_include}" != x; then
AC_MSG_CHECKING([for gobject headers])
if test -s "${with_gobject_include}/glib-2.0/gobject/gobject.h"; then
GOBJECT_CFLAGS="-I${with_gobject_include}/glib-2.0/gobject"
GOBJECT_FOUND=yes
AC_MSG_RESULT([$GOBJECT_FOUND])
else
AC_MSG_ERROR([Can't find '/include/glib-2.0/gobject/gobject.h' under ${with_gobject_include} given with the --with-gobject-include option.])
fi
fi
if test "x$GOBJECT_FOUND" = xno; then
# Are the gobject headers installed in the default /usr/include location?
# FIXME: AC_CHECK_HEADERS doesn't find the header without CPPFLAGS update
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0], CPPFLAGS="$CPPFLAGS $GOBJECT_CFLAGS", break)
AC_CHECK_HEADERS([glib-object.h],
[ GOBJECT_FOUND=yes; GOBJECT_LIBS="-lgobject-2.0" ],
[ GOBJECT_FOUND=no; break ]
)
fi
fi
AC_SUBST(GOBJECT_CFLAGS)
AC_SUBST(GOBJECT_LIBS)
])
Loading

0 comments on commit 1d350f8

Please sign in to comment.