Skip to content
Closed
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
5 changes: 3 additions & 2 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,9 @@ <h4 id="alsa-1">ALSA</h4>
<li>If alsa is not properly detected by <code>configure</code>, you can point it out by <code>--with-alsa</code>.</li>
</ul>
<h4 id="x11-1">X11</h4>
<p>You will need X11 libraries suitable for your <em>target</em> system. For most cases, using Debian's pre-built libraries work fine.</p>
<p>Note that X11 is needed even if you only want to build a headless JDK.</p>
<p>When not building a headless JDK, you will need X11 libraries
suitable for your <em>target</em> system. In most cases, using Debian's
pre-built libraries work fine.</p>
<ul>
<li>Go to <a href="https://www.debian.org/distrib/packages">Debian Package Search</a>, search for the following packages for your <em>target</em> system, and download them to /tmp/target-x11:
<ul>
Expand Down
6 changes: 2 additions & 4 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -1077,10 +1077,8 @@ dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb .

#### X11

You will need X11 libraries suitable for your *target* system. For most cases,
using Debian's pre-built libraries work fine.

Note that X11 is needed even if you only want to build a headless JDK.
When not building a headless JDK, you will need X11 libraries suitable for your
*target* system. In most cases, using Debian's pre-built libraries work fine.

* Go to [Debian Package Search](https://www.debian.org/distrib/packages),
search for the following packages for your *target* system, and download them
Expand Down
16 changes: 14 additions & 2 deletions make/modules/java.desktop/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ ifeq ($(call isTargetOs, windows), true)
#
endif

ifeq ($(ENABLE_HEADLESS_ONLY), true)
LIBAWT_CFLAGS += -DHEADLESS
endif

ifeq ($(call isTargetOs, linux macosx aix), true)
LIBAWT_EXFILES += awt_Font.c CUPSfuncs.c fontpath.c X11Color.c
endif
Expand Down Expand Up @@ -369,13 +373,20 @@ ifeq ($(call isTargetOs, windows macosx), false)
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
#

LIBAWT_HEADLESS_EXCLUDES := medialib
LIBAWT_HEADLESS_EXCLUDES := medialib opengl

LIBAWT_HEADLESS_EXCLUDE_FILES := \
GLXGraphicsConfig.c \
GLXSurfaceData.c \
X11PMBlitLoops.c \
X11Renderer.c \
X11SurfaceData.c \
#

LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
$(LIBAWT_DEFAULT_HEADER_DIRS) \
common/awt/debug \
common/font \
common/java2d/opengl \
#

LIBAWT_HEADLESS_CFLAGS := $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) $(X_CFLAGS) \
Expand All @@ -385,6 +396,7 @@ ifeq ($(call isTargetOs, windows macosx), false)
NAME := awt_headless, \
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
EXCLUDE_FILES := $(LIBAWT_HEADLESS_EXCLUDE_FILES), \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKLIB) \
$(LIBAWT_HEADLESS_CFLAGS), \
Expand Down
4 changes: 2 additions & 2 deletions src/java.desktop/unix/native/common/awt/utility/rect.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef _AWT_RECT_H
#define _AWT_RECT_H

#ifndef MACOSX
#if !defined(HEADLESS) && !defined(MACOSX)
#include <X11/Xlib.h>
typedef XRectangle RECT_T;
#else
Expand All @@ -39,7 +39,7 @@ typedef struct {
int width;
int height;
} RECT_T;
#endif /* !MACOSX */
#endif /* !HEADLESS && !MACOSX */

#define RECT_EQ_X(r1,r2) ((r1).x==(r2).x && (r1).width==(r2).width)

Expand Down