Skip to content

Commit 1d350f8

Browse files
committed
JBR-4578 Add Java ATK Wrapper
Library to enable accessibility on gnome linux.
1 parent 6c252e1 commit 1d350f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+11572
-3
lines changed

.github/workflows/build-cross-compile.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
g++-${{ inputs.gcc-major-version }} \
114114
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
115115
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
116-
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
116+
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev libatspi2.0-dev libatk1.0-dev libglib2.0-dev
117117
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 }}
118118
119119
- name: 'Check cache for sysroot'
@@ -133,7 +133,7 @@ jobs:
133133
sudo debootstrap
134134
--arch=${{ matrix.debian-arch }}
135135
--verbose
136-
--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
136+
--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
137137
--resolve-deps
138138
--variant=minbase
139139
${{ matrix.debian-version }}

.github/workflows/build-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
fi
112112
sudo apt-get update
113113
sudo apt-get install --only-upgrade apt
114-
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 }}
114+
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 }}
115115
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 }}
116116
117117
- name: 'Configure'

make/autoconf/help.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ apt_help() {
119119
PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;;
120120
capstone)
121121
PKGHANDLER_COMMAND="sudo apt-get install libcapstone-dev" ;;
122+
atk)
123+
PKGHANDLER_COMMAND="sudo apt-get install libatspi2.0-dev libatk1.0-dev libglib2.0-dev" ;;
122124
esac
123125
}
124126

make/autoconf/jdk-options.m4

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,32 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
270270
A11Y_JAWS_ANNOUNCING_ENABLED=false
271271
fi
272272
AC_SUBST(A11Y_JAWS_ANNOUNCING_ENABLED)
273+
274+
# Should we build support for Java ATK Wrapper?
275+
if test "x$OPENJDK_TARGET_OS" = xlinux; then
276+
AC_MSG_CHECKING([if Java ATK Wrapper support is enabled])
277+
278+
A11Y_JAVA_ATK_WRAPPER_ENABLED=true
279+
AC_ARG_ENABLE(
280+
[java-atk-wrapper],
281+
[AS_HELP_STRING([--disable-java-atk-wrapper], [Set to disable the Java ATK Wrapper])],
282+
[
283+
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
284+
AC_MSG_WARN([--[enable|disable]-java-atk-wrapper[=*] flags are ignored for headless builds])
285+
elif test "x$enableval" != xyes; then
286+
A11Y_JAVA_ATK_WRAPPER_ENABLED=false
287+
fi
288+
]
289+
)
290+
if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
291+
A11Y_JAVA_ATK_WRAPPER_ENABLED=false
292+
fi
293+
294+
AC_MSG_RESULT([$A11Y_JAVA_ATK_WRAPPER_ENABLED])
295+
else
296+
A11Y_JAVA_ATK_WRAPPER_ENABLED=false
297+
fi
298+
AC_SUBST(A11Y_JAVA_ATK_WRAPPER_ENABLED)
273299
])
274300

275301
###############################################################################

make/autoconf/lib-at-spi2-atk.m4

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
################################################################################
2+
# Setup at-spi2-atk
3+
################################################################################
4+
AC_DEFUN_ONCE([LIB_SETUP_AT_SPI2_ATK],
5+
[
6+
AC_ARG_WITH(at-spi2-atk, [AS_HELP_STRING([--with-at-spi2-atk],
7+
[specify prefix directory for the at-spi2-atk package
8+
(expecting the headers under PATH/include); required for atk-wrapper to work])])
9+
AC_ARG_WITH(at-spi2-atk-include, [AS_HELP_STRING([--with-at-spi2-atk-include],
10+
[specify directory for the at-spi2-atk include files])])
11+
12+
if test "x$NEEDS_LIB_AT_SPI2_ATK" = xfalse || test "x${with_at_spi2_atk}" = xno || \
13+
test "x${with_at_spi2_atk_include}" = xno; then
14+
if (test "x${with_at_spi2_atk}" != x && test "x${with_at_spi2_atk}" != xno) || \
15+
(test "x${with_at_spi2_atk_include}" != x && test "x${with_at_spi2_atk_include}" != xno); then
16+
AC_MSG_WARN([[at-spi2-atk not used, so --with-at-spi2-atk[-*] is ignored]])
17+
fi
18+
AT_SPI2_ATK_CFLAGS=
19+
AT_SPI2_ATK_LIBS=
20+
else
21+
AT_SPI2_ATK_FOUND=no
22+
if test "x${with_at_spi2_atk}" != x && test "x${with_at_spi2_atk}" != xyes; then
23+
AC_MSG_CHECKING([for at-spi2-atk header and library])
24+
if test -s "${with_at_spi2_atk}/include/at-spi2-atk/2.0/atk-bridge.h"; then
25+
AT_SPI2_ATK_CFLAGS="-I${with_at_spi2_atk}/include/at-spi2-atk/2.0"
26+
AT_SPI2_ATK_LIBS="-L${with_at_spi2_atk}/lib -latk-bridge-2.0"
27+
AT_SPI2_ATK_FOUND=yes
28+
AC_MSG_RESULT([$AT_SPI2_ATK_FOUND])
29+
else
30+
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.])
31+
fi
32+
fi
33+
if test "x${with_at_spi2_atk_include}" != x; then
34+
AC_MSG_CHECKING([for at-spi2-atk headers])
35+
if test -s "${with_at_spi2_atk_include}/at-spi2-atk/2.0/atk-bridge.h"; then
36+
AT_SPI2_ATK_CFLAGS="-I${with_at_spi2_atk_include}/at-spi2-atk/2.0"
37+
AT_SPI2_ATK_FOUND=yes
38+
AC_MSG_RESULT([$AT_SPI2_ATK_FOUND])
39+
else
40+
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.])
41+
fi
42+
fi
43+
if test "x$AT_SPI2_ATK_FOUND" = xno; then
44+
# Are the at-spi2-atk headers installed in the default /usr/include location?
45+
46+
# FIXME: AC_CHECK_HEADERS doesn't find the header without CPPFLAGS update
47+
PKG_CHECK_MODULES([AT_SPI2_ATK], [atk-bridge-2.0], CPPFLAGS="$CPPFLAGS $AT_SPI2_ATK_CFLAGS", break)
48+
49+
AC_CHECK_HEADERS([at-spi2-atk/2.0/atk-bridge.h],
50+
[ AT_SPI2_ATK_FOUND=yes; AT_SPI2_ATK_LIBS="-latk-bridge-2.0" ],
51+
[ AT_SPI2_ATK_FOUND=no; break ]
52+
)
53+
fi
54+
fi
55+
AC_SUBST(AT_SPI2_ATK_CFLAGS)
56+
AC_SUBST(AT_SPI2_ATK_LIBS)
57+
])

make/autoconf/lib-atk.m4

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
################################################################################
2+
# Setup atk
3+
################################################################################
4+
AC_DEFUN_ONCE([LIB_SETUP_ATK],
5+
[
6+
AC_ARG_WITH(atk, [AS_HELP_STRING([--with-atk],
7+
[specify prefix directory for the atk package
8+
(expecting the headers under PATH/include); required for atk-wrapper to work])])
9+
AC_ARG_WITH(atk-include, [AS_HELP_STRING([--with-atk-include],
10+
[specify directory for the atk include files])])
11+
if test "x$NEEDS_LIB_ATK" = xfalse || test "x${with_atk}" = xno || \
12+
test "x${with_atk_include}" = xno; then
13+
if (test "x${with_atk}" != x && test "x${with_atk}" != xno) || \
14+
(test "x${with_atk_include}" != x && test "x${with_atk_include}" != xno); then
15+
AC_MSG_WARN([[atk not used, so --with-atk[-*] is ignored]])
16+
fi
17+
ATK_CFLAGS=
18+
ATK_LIBS=
19+
else
20+
ATK_FOUND=no
21+
if test "x${with_atk}" != x && test "x${with_atk}" != xyes; then
22+
AC_MSG_CHECKING([for atk header and library])
23+
if test -s "${with_atk}/include/atk-1.0/atk/atk.h"; then
24+
ATK_CFLAGS="-I${with_atk}/include/atk-1.0"
25+
ATK_LIBS="-L${with_atk}/lib -latk-1.0"
26+
ATK_FOUND=yes
27+
AC_MSG_RESULT([$ATK_FOUND])
28+
else
29+
AC_MSG_ERROR([Can't find '/include/atk-1.0/atk/atk.h' under ${with_atk} given with the --with-atk option.])
30+
fi
31+
fi
32+
if test "x${with_atk_include}" != x; then
33+
AC_MSG_CHECKING([for atk headers])
34+
if test -s "${with_atk_include}/atk-1.0/atk/atk.h"; then
35+
ATK_CFLAGS="-I${with_atk_include}/atk-1.0"
36+
ATK_FOUND=yes
37+
AC_MSG_RESULT([$ATK_FOUND])
38+
else
39+
AC_MSG_ERROR([Can't find 'include/atk-1.0/atk/atk.h' under ${with_atk_include} given with the --with-atk-include option.])
40+
fi
41+
fi
42+
if test "x$ATK_FOUND" = xno; then
43+
# Are the atk headers installed in the default /usr/include location?
44+
45+
# FIXME: AC_CHECK_HEADERS doesn't find the header without CPPFLAGS update
46+
PKG_CHECK_MODULES([ATK], [atk], CPPFLAGS="$CPPFLAGS $ATK_CFLAGS", break)
47+
48+
AC_CHECK_HEADERS([atk-1.0/atk/atk.h],
49+
[ ATK_FOUND=yes; ATK_LIBS="-latk-1.0" ],
50+
[ ATK_FOUND=no; break ]
51+
)
52+
fi
53+
fi
54+
AC_SUBST(ATK_CFLAGS)
55+
AC_SUBST(ATK_LIBS)
56+
])

make/autoconf/lib-glib.m4

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
################################################################################
2+
# Setup glib
3+
################################################################################
4+
AC_DEFUN_ONCE([LIB_SETUP_GLIB],
5+
[
6+
AC_ARG_WITH(glib, [AS_HELP_STRING([--with-glib],
7+
[specify prefix directory for the glib package
8+
(expecting the headers under PATH/include); required for atk-wrapper to work])])
9+
AC_ARG_WITH(glib-include, [AS_HELP_STRING([--with-glib-include],
10+
[specify directory for the glib include files])])
11+
if test "x$NEEDS_LIB_GLIB" = xfalse || test "x${with_glib}" = xno || \
12+
test "x${with_glib_include}" = xno; then
13+
if (test "x${with_glib}" != x && test "x${with_glib}" != xno) || \
14+
(test "x${with_glib_include}" != x && test "x${with_glib_include}" != xno); then
15+
AC_MSG_WARN([[glib not used, so --with-glib[-*] is ignored]])
16+
fi
17+
GLIB_CFLAGS=
18+
GLIB_LIBS=
19+
else
20+
GLIB_FOUND=no
21+
22+
if test "x${with_glib}" != x && test "x${with_glib}" != xyes; then
23+
AC_MSG_CHECKING([for glib header and library])
24+
if test -s "${with_glib}/include/glib-2.0/glib.h"; then
25+
GLIB_CFLAGS="-I${with_glib}/include/glib-2.0"
26+
GLIB_LIBS="-L${with_glib}/lib -lglib-2.0"
27+
GLIB_FOUND=yes
28+
AC_MSG_RESULT([$GLIB_FOUND])
29+
else
30+
AC_MSG_ERROR([Can't find '/include/glib-2.0/glib.h' under ${with_glib} given with the --with-glib option.])
31+
fi
32+
fi
33+
if test "x${with_glib_include}" != x; then
34+
AC_MSG_CHECKING([for glib headers])
35+
if test -s "${with_glib_include}/glib-2.0/glib.h"; then
36+
GLIB_CFLAGS="-I${with_glib_include}"
37+
GLIB_FOUND=yes
38+
AC_MSG_RESULT([$GLIB_FOUND])
39+
else
40+
AC_MSG_ERROR([Can't find '/include/glib-2.0/glib.h' under ${with_glib_include} given with the --with-glib-include option.])
41+
fi
42+
fi
43+
if test "x$GLIB_FOUND" = xno; then
44+
# Are the glib headers installed in the default /usr/include location?
45+
46+
# FIXME: AC_CHECK_HEADERS doesn't find the header without CPPFLAGS update
47+
PKG_CHECK_MODULES([GLIB], [glib-2.0], CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS", break)
48+
49+
AC_CHECK_HEADERS([glib-2.0/glib.h],
50+
[ GLIB_FOUND=yes; GLIB_LIBS="-lglib-2.0" ],
51+
[ GLIB_FOUND=no; break ]
52+
)
53+
fi
54+
fi
55+
AC_SUBST(GLIB_CFLAGS)
56+
AC_SUBST(GLIB_LIBS)
57+
])

make/autoconf/lib-glibconfig.m4

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
################################################################################
2+
# Setup glibconfig
3+
################################################################################
4+
AC_DEFUN_ONCE([LIB_SETUP_GLIBCONFIG],
5+
[
6+
AC_ARG_WITH(glibconfig, [AS_HELP_STRING([--with-glibconfig],
7+
[specify prefix directory for the glibconfig package
8+
(expecting the headers under PATH/include); required for atk-wrapper to work])])
9+
AC_ARG_WITH(glibconfig-include, [AS_HELP_STRING([--with-glibconfig-include],
10+
[specify directory for the glibconfig include files])])
11+
if test "x$NEEDS_LIB_GLIBCONFIG" = xfalse || test "x${with_glibconfig}" = xno || \
12+
test "x${with_glibconfig_include}" = xno; then
13+
if (test "x${with_glibconfig}" != x && test "x${with_glibconfig}" != xno) || \
14+
(test "x${with_glibconfig_include}" != x && test "x${with_glibconfig_include}" != xno); then
15+
AC_MSG_WARN([[glibconfig not used, so --with-glibconfig[-*] is ignored]])
16+
fi
17+
GLIBCONFIG_CFLAGS=
18+
else
19+
GLIBCONFIG_FOUND=no
20+
if test "x${with_glibconfig}" != x && test "x${with_glibconfig}" != xyes; then
21+
AC_MSG_CHECKING([for glibconfig header])
22+
if test -s "${with_glibconfig}/include/glibconfig.h"; then
23+
GLIBCONFIG_CFLAGS="-I${with_glibconfig}/include"
24+
GLIBCONFIG_FOUND=yes
25+
AC_MSG_RESULT([$GLIBCONFIG_FOUND])
26+
else
27+
AC_MSG_ERROR([Can't find '/include/glibconfig.h' under ${with_glibconfig} given with the --with-glibconfig option.])
28+
fi
29+
fi
30+
if test "x${with_glibconfig_include}" != x; then
31+
AC_MSG_CHECKING([for glibconfig headers])
32+
if test -s "${with_glibconfig_include}/glibconfig.h"; then
33+
GLIBCONFIG_CFLAGS="-I${with_glibconfig_include}"
34+
GLIBCONFIG_FOUND=yes
35+
AC_MSG_RESULT([$GLIBCONFIG_FOUND])
36+
else
37+
AC_MSG_ERROR([Can't find '/include/glibconfig.h' under ${with_glibconfig_include} given with the --with-glibconfig-include option.])
38+
fi
39+
fi
40+
if test "x$GLIBCONFIG_FOUND" = xno; then
41+
# Are the glibconfig header installed in the default /usr/lib/glib-2.0/include location?
42+
43+
PKG_CHECK_MODULES([GLIBCONFIG], [glib-2.0], CPPFLAGS="$CPPFLAGS $GLIBCONFIG_CFLAGS", break)
44+
45+
# FIXME: AC_CHECK_HEADERS doesn't find glibconfig.h, even though $GLIBCONFIG_CFLAGS contains its path
46+
AC_CHECK_HEADER([glibconfig.h],
47+
[ GLIBCONFIG_FOUND=yes ],
48+
[ GLIBCONFIG_FOUND=no; break ]
49+
)
50+
fi
51+
fi
52+
AC_SUBST(GLIBCONFIG_CFLAGS)
53+
])

make/autoconf/lib-gobject.m4

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
################################################################################
2+
# Setup gobject
3+
################################################################################
4+
AC_DEFUN_ONCE([LIB_SETUP_GOBJECT],
5+
[
6+
AC_ARG_WITH(gobject, [AS_HELP_STRING([--with-gobject],
7+
[specify prefix directory for the gobject package
8+
(expecting the headers under PATH/include); required for atk-wrapper to work])])
9+
AC_ARG_WITH(gobject-include, [AS_HELP_STRING([--with-gobject-include],
10+
[specify directory for the gobject include files])])
11+
12+
if test "x$NEEDS_LIB_GOBJECT" = xfalse || test "x${with_gobject}" = xno || \
13+
test "x${with_gobject_include}" = xno; then
14+
if (test "x${with_gobject}" != x && test "x${with_gobject}" != xno) || \
15+
(test "x${with_gobject_include}" != x && test "x${with_gobject_include}" != xno); then
16+
AC_MSG_WARN([[gobject not used, so --with-gobject[-*] is ignored]])
17+
fi
18+
GOBJECT_CFLAGS=
19+
GOBJECT_LIBS=
20+
else
21+
GOBJECT_FOUND=no
22+
23+
if test "x${with_gobject}" != x && test "x${with_gobject}" != xyes; then
24+
AC_MSG_CHECKING([for gobject header and library])
25+
if test -s "${with_gobject}/include/glib-2.0/gobject/gobject.h"; then
26+
GOBJECT_CFLAGS="-I${with_gobject}/include/glib-2.0/gobject"
27+
GOBJECT_LIBS="-L${with_gobject}/lib -lgobject-2.0"
28+
GOBJECT_FOUND=yes
29+
AC_MSG_RESULT([$GOBJECT_FOUND])
30+
else
31+
AC_MSG_ERROR([Can't find '/include/glib-2.0/gobject/gobject.h' under ${with_gobject} given with the --with-gobject option.])
32+
fi
33+
fi
34+
if test "x${with_gobject_include}" != x; then
35+
AC_MSG_CHECKING([for gobject headers])
36+
if test -s "${with_gobject_include}/glib-2.0/gobject/gobject.h"; then
37+
GOBJECT_CFLAGS="-I${with_gobject_include}/glib-2.0/gobject"
38+
GOBJECT_FOUND=yes
39+
AC_MSG_RESULT([$GOBJECT_FOUND])
40+
else
41+
AC_MSG_ERROR([Can't find '/include/glib-2.0/gobject/gobject.h' under ${with_gobject_include} given with the --with-gobject-include option.])
42+
fi
43+
fi
44+
if test "x$GOBJECT_FOUND" = xno; then
45+
# Are the gobject headers installed in the default /usr/include location?
46+
47+
# FIXME: AC_CHECK_HEADERS doesn't find the header without CPPFLAGS update
48+
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0], CPPFLAGS="$CPPFLAGS $GOBJECT_CFLAGS", break)
49+
50+
AC_CHECK_HEADERS([glib-object.h],
51+
[ GOBJECT_FOUND=yes; GOBJECT_LIBS="-lgobject-2.0" ],
52+
[ GOBJECT_FOUND=no; break ]
53+
)
54+
fi
55+
fi
56+
AC_SUBST(GOBJECT_CFLAGS)
57+
AC_SUBST(GOBJECT_LIBS)
58+
])

0 commit comments

Comments
 (0)