Skip to content

Commit

Permalink
8193017: Import freetype sources into OpenJDK source tree
Browse files Browse the repository at this point in the history
Reviewed-by: erikj, ihse, serb
  • Loading branch information
prrace committed Mar 12, 2018
1 parent 10ced3a commit 58ff4ee
Show file tree
Hide file tree
Showing 322 changed files with 162,446 additions and 497 deletions.
19 changes: 5 additions & 14 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h3 id="windows">Windows</h3>
<p>Windows XP is not a supported platform, but all newer Windows should be able to build OpenJDK.</p>
<p>On Windows, it is important that you pay attention to the instructions in the <a href="#special-considerations">Special Considerations</a>.</p>
<p>Windows is the only non-POSIX OS supported by OpenJDK, and as such, requires some extra care. A POSIX support layer is required to build on Windows. For OpenJDK 9, the only supported such layer is Cygwin. (Msys is no longer supported due to a too old bash; msys2 and the new Windows Subsystem for Linux (WSL) would likely be possible to support in a future version but that would require a community effort to implement.)</p>
<p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/hg/jdk9/Makefile</code> rather than <code>C:\hg\jdk9\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-freetype=/cygdrive/c/freetype</code> rather than <code>--with-freetype=c:\freetype</code>. For details on this conversion, see the section on <a href="#fixpath">Fixpath</a>.</p>
<p>Internally in the build system, all paths are represented as Unix-style paths, e.g. <code>/cygdrive/c/hg/jdk9/Makefile</code> rather than <code>C:\hg\jdk9\Makefile</code>. This rule also applies to input to the build system, e.g. in arguments to <code>configure</code>. So, use <code>--with-msvcr-dll=/cygdrive/c/msvcr100.dll</code> rather than <code>--with-msvcr-dll=c:\msvcr100.dll</code>. For details on this conversion, see the section on <a href="#fixpath">Fixpath</a>.</p>
<h4 id="cygwin">Cygwin</h4>
<p>A functioning <a href="http://www.cygwin.com/">Cygwin</a> environment is thus required for building OpenJDK on Windows. If you have a 64-bit OS, we strongly recommend using the 64-bit version of Cygwin.</p>
<p><strong>Note:</strong> Cygwin has a model of continuously updating all packages without any easy way to install or revert to a specific version of a package. This means that whenever you add or update a package in Cygwin, you might (inadvertently) update tools that are used by the OpenJDK build process, and that can cause unexpected build problems.</p>
Expand Down Expand Up @@ -372,22 +372,13 @@ <h2 id="external-library-requirements">External Library Requirements</h2>
<p>If a required library is not detected by <code>configure</code>, you need to provide the path to it. There are two forms of the <code>configure</code> arguments to point to an external library: <code>--with-&lt;LIB&gt;=&lt;path&gt;</code> or <code>--with-&lt;LIB&gt;-include=&lt;path to include&gt; --with-&lt;LIB&gt;-lib=&lt;path to lib&gt;</code>. The first variant is more concise, but require the include files an library files to reside in a default hierarchy under this directory. In most cases, it works fine.</p>
<p>As a fallback, the second version allows you to point to the include directory and the lib directory separately.</p>
<h3 id="freetype">FreeType</h3>
<p>FreeType2 from <a href="http://www.freetype.org/">The FreeType Project</a> is required on all platforms. At least version 2.3 is required.</p>
<p>FreeType2 from <a href="http://www.freetype.org/">The FreeType Project</a> is not required on any platform. The exception is on Unix-based platforms when configuring such that the build artifacts will reference a system installed library, rather than bundling OpenJDK's own copy.</p>
<ul>
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libcups2-dev</code>.</li>
<li>To install on an rpm-based Linux, try running <code>sudo yum install cups-devel</code>.</li>
<li>To install on an apt-based Linux, try running <code>sudo apt-get install libfreetype6-dev</code>.</li>
<li>To install on an rpm-based Linux, try running <code>sudo yum install freetype-devel</code>.</li>
<li>To install on Solaris, try running <code>pkg install system/library/freetype-2</code>.</li>
<li>To install on macOS, try running <code>brew install freetype</code>.</li>
<li>To install on Windows, see <a href="#building-freetype-on-windows">below</a>.</li>
</ul>
<p>Use <code>--with-freetype=&lt;path&gt;</code> if <code>configure</code> does not properly locate your FreeType files.</p>
<h4 id="building-freetype-on-windows">Building FreeType on Windows</h4>
<p>On Windows, there is no readily available compiled version of FreeType. OpenJDK can help you compile FreeType from source. Download the FreeType sources and unpack them into an arbitrary directory:</p>
<pre><code>wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
tar -xzf freetype-2.5.3.tar.gz</code></pre>
<p>Then run <code>configure</code> with <code>--with-freetype-src=&lt;freetype_src&gt;</code>. This will automatically build the freetype library into <code>&lt;freetype_src&gt;/lib64</code> for 64-bit builds or into <code>&lt;freetype_src&gt;/lib32</code> for 32-bit builds. Afterwards you can always use <code>--with-freetype-include=&lt;freetype_src&gt;/include</code> and <code>--with-freetype-lib=&lt;freetype_src&gt;/lib[32|64]</code> for other builds.</p>
<p>Alternatively you can unpack the sources like this to use the default directory:</p>
<pre><code>tar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz</code></pre>
<p>Use <code>--with-freetype-include=&lt;path&gt;</code> and <code>--with-freetype-lib=&lt;path&gt;</code> if <code>configure</code> does not automatically locate the platform FreeType files.</p>
<h3 id="cups">CUPS</h3>
<p>CUPS, <a href="http://www.cups.org">Common UNIX Printing System</a> header files are required on all platforms, except Windows. Often these files are provided by your operating system.</p>
<ul>
Expand Down
44 changes: 10 additions & 34 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ require a community effort to implement.)
Internally in the build system, all paths are represented as Unix-style paths,
e.g. `/cygdrive/c/hg/jdk9/Makefile` rather than `C:\hg\jdk9\Makefile`. This
rule also applies to input to the build system, e.g. in arguments to
`configure`. So, use `--with-freetype=/cygdrive/c/freetype` rather than
`--with-freetype=c:\freetype`. For details on this conversion, see the section
`configure`. So, use `--with-msvcr-dll=/cygdrive/c/msvcr100.dll` rather than
`--with-msvcr-dll=c:\msvcr100.dll`. For details on this conversion, see the section
on [Fixpath](#fixpath).

#### Cygwin
Expand Down Expand Up @@ -444,43 +444,19 @@ and the lib directory separately.

### FreeType

FreeType2 from [The FreeType Project](http://www.freetype.org/) is required on
all platforms. At least version 2.3 is required.
FreeType2 from [The FreeType Project](http://www.freetype.org/) is not required
on any platform. The exception is on Unix-based platforms when configuring such
that the build artifacts will reference a system installed library,
rather than bundling OpenJDK's own copy.

* To install on an apt-based Linux, try running `sudo apt-get install
libcups2-dev`.
libfreetype6-dev`.
* To install on an rpm-based Linux, try running `sudo yum install
cups-devel`.
freetype-devel`.
* To install on Solaris, try running `pkg install system/library/freetype-2`.
* To install on macOS, try running `brew install freetype`.
* To install on Windows, see [below](#building-freetype-on-windows).

Use `--with-freetype=<path>` if `configure` does not properly locate your
FreeType files.

#### Building FreeType on Windows

On Windows, there is no readily available compiled version of FreeType. OpenJDK
can help you compile FreeType from source. Download the FreeType sources and
unpack them into an arbitrary directory:

```
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
tar -xzf freetype-2.5.3.tar.gz
```

Then run `configure` with `--with-freetype-src=<freetype_src>`. This will
automatically build the freetype library into `<freetype_src>/lib64` for 64-bit
builds or into `<freetype_src>/lib32` for 32-bit builds. Afterwards you can
always use `--with-freetype-include=<freetype_src>/include` and
`--with-freetype-lib=<freetype_src>/lib[32|64]` for other builds.

Alternatively you can unpack the sources like this to use the default
directory:

```
tar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz
```
Use `--with-freetype-include=<path>` and `--with-freetype-lib=<path>`
if `configure` does not automatically locate the platform FreeType files.

### CUPS

Expand Down
20 changes: 1 addition & 19 deletions make/autoconf/help.m4
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
[
# Print a helpful message on how to acquire the necessary build dependency.
# $1 is the help tag: freetype, cups, alsa etc
# $1 is the help tag: cups, alsa etc
MISSING_DEPENDENCY=$1
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
Expand Down Expand Up @@ -76,24 +76,6 @@ cygwin_help() {
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
;;
freetype)
HELP_MSG="
The freetype library can now be build during the configure process.
Download the freetype sources and unpack them into an arbitrary directory:

wget http://download.savannah.gnu.org/releases/freetype/freetype-2.5.3.tar.gz
tar -xzf freetype-2.5.3.tar.gz

Then run configure with '--with-freetype-src=<freetype_src>'. This will
automatically build the freetype library into '<freetype_src>/lib64' for 64-bit
builds or into '<freetype_src>/lib32' for 32-bit builds.
Afterwards you can always use '--with-freetype-include=<freetype_src>/include'
and '--with-freetype-lib=<freetype_src>/lib[32|64]' for other builds.

Alternatively you can unpack the sources like this to use the default directory:

tar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz"
;;
esac
}

Expand Down
Loading

0 comments on commit 58ff4ee

Please sign in to comment.