8138761: Improved handling of libffi, and cleanup of libraries.m4
Reviewed-by: erikj
This commit is contained in:
parent
9f31d88faf
commit
203f76fbda
@ -383,9 +383,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
|
||||
[
|
||||
# Start with tools that do not need have cross compilation support
|
||||
# and can be expected to be found in the default PATH. These tools are
|
||||
# used by configure. Nor are these tools expected to be found in the
|
||||
# devkit from the builddeps server either, since they are
|
||||
# needed to download the devkit.
|
||||
# used by configure.
|
||||
|
||||
# First are all the simple required tools.
|
||||
BASIC_REQUIRE_PROGS(BASENAME, basename)
|
||||
|
@ -108,12 +108,6 @@ AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS],
|
||||
fi
|
||||
])
|
||||
|
||||
# Test: Is bootjdk available from builddeps?
|
||||
AC_DEFUN([BOOTJDK_CHECK_BUILDDEPS],
|
||||
[
|
||||
BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=maybe], [BOOT_JDK_FOUND=no])
|
||||
])
|
||||
|
||||
# Test: Is $JAVA_HOME set?
|
||||
AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME],
|
||||
[
|
||||
@ -276,9 +270,6 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
|
||||
AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK])
|
||||
fi
|
||||
|
||||
# Test: Is bootjdk available from builddeps?
|
||||
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_BUILDDEPS])
|
||||
|
||||
# Test: On MacOS X, can we find a boot jdk using /usr/libexec/java_home?
|
||||
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_MACOSX_JAVA_LOCATOR])
|
||||
|
||||
|
@ -1,66 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This is a configuration example using builddeps
|
||||
# that are downloaded from an ftp server.
|
||||
# This is how you use it:
|
||||
|
||||
#configure --with-builddeps-server=ftp://builddeps.server/adir \
|
||||
# --with-builddeps-conf=..../builddeps.conf.example
|
||||
# --with-builddeps-dir=/localdisk/mybuilddeps
|
||||
|
||||
# Translate a configuration triplet/quadruplet into something
|
||||
# known by this configuration file.
|
||||
# If no rewrite was found, then rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME}
|
||||
REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu
|
||||
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
|
||||
|
||||
# The needed cups builddeps are platform independent header files.
|
||||
# I.e. they need not be part of the devkit.
|
||||
builddep_cups=lib/cups_1_3_9.zip
|
||||
builddep_cups_CFLAGS=-I${depdir}
|
||||
|
||||
# The devkit is the cross compiler tools and sys-roots
|
||||
# for the build platform.
|
||||
builddep_devkit=sdk/sdk-${rewritten_build}-20110921.tar.gz
|
||||
|
||||
# The freetype dependency is partly platform dependent.
|
||||
# It is stored inside the sys-root.
|
||||
builddep_freetype2=sdk/sdk-${rewritten_build}-20110921.tar.gz
|
||||
builddep_freetype2_CFLAGS=-I${depdir}/${rewritten_target}/sys-root/usr/include/freetype2
|
||||
builddep_freetype2_LIBS=-lfreetype
|
||||
|
||||
# There are many other build dependencies, but they are implicitly
|
||||
# found inside the devkit sys-root.
|
||||
|
||||
# The boot jdk runs on the build system and is used to compile and run
|
||||
# Java build tools and of course, the bootstrap javac.
|
||||
builddep_bootjdk_BUILD_i386_pc_solaris2=java/jdk-7u2-fcs-bin-b13-solaris-i586-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_x86_64_pc_solaris2=java/jdk-7u2-fcs-bin-b13-solaris-x64-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_i686_unknown_linux_gnu=java/jdk-7u2-fcs-bin-b13-linux-i586-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_x86_64_unknown_linux_gnu=java/jdk-7u2-fcs-bin-b13-linux-x64-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_sparc_solaris2=java/jdk-7u2-fcs-bin-b13-solaris-sparc-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_sparcv9_solaris2=java/jdk-7u2-fcs-bin-b13-solaris-sparcv9-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_i386_pc_windows=java/jdk-7u2-fcs-bin-b13-windows-i586-17_nov_2011.zip
|
||||
builddep_bootjdk_BUILD_x86_64_pc_windows=java/jdk-7u2-fcs-bin-b13-windows-x64-17_nov_2011.zip
|
||||
builddep_bootjdk_ROOT=${depdir}/jdk7_02/jdk1.7.0_02
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# This is a configuration example using an nfs-mount /java
|
||||
# it will use the builddeps directly from the nfs mounted directory.
|
||||
# This is how you use it:
|
||||
|
||||
#configure --with-builddeps-conf=..../builddeps.conf.nfs.example
|
||||
|
||||
REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu
|
||||
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
|
||||
|
||||
DEVTOOLS=/java/devtools
|
||||
|
||||
builddep_cups=${DEVTOOLS}/linux/cups/include
|
||||
builddep_cups_CFLAGS=-I${depdir}
|
||||
|
||||
JDK_ROOT=/java/re/jdk/7u4/latest/binaries
|
||||
builddep_bootjdk_BUILD_i386_pc_solaris2=${JDK_ROOT}/solaris-i586
|
||||
builddep_bootjdk_BUILD_x86_64_pc_solaris2=${JDK_ROOT}/solaris-amd64
|
||||
builddep_bootjdk_BUILD_i686_unknown_linux_gnu=${JDK_ROOT}/linux-i586
|
||||
builddep_bootjdk_BUILD_x86_64_unknown_linux_gnu=${JDK_ROOT}/linux-amd64
|
||||
builddep_bootjdk_ROOT=
|
@ -1,247 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS],
|
||||
[
|
||||
define(LIST_OF_BUILD_DEPENDENCIES,)
|
||||
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
|
||||
if test "x$with_builddeps_conf" != x; then
|
||||
AC_MSG_CHECKING([for supplied builddeps configuration file])
|
||||
builddepsfile=$with_builddeps_conf
|
||||
if test -s $builddepsfile; then
|
||||
. $builddepsfile
|
||||
AC_MSG_RESULT([loaded!])
|
||||
else
|
||||
AC_MSG_ERROR([The given builddeps conf file $with_builddeps_conf could not be loaded!])
|
||||
fi
|
||||
else
|
||||
AC_MSG_CHECKING([for builddeps.conf files in sources...])
|
||||
builddepsfile=`mktemp`
|
||||
touch $builddepsfile
|
||||
# Put all found confs into a single file.
|
||||
find ${SRC_ROOT} -name builddeps.conf -exec cat \{\} \; >> $builddepsfile
|
||||
# Source the file to acquire the variables
|
||||
if test -s $builddepsfile; then
|
||||
. $builddepsfile
|
||||
AC_MSG_RESULT([found at least one!])
|
||||
else
|
||||
AC_MSG_ERROR([Could not find any builddeps.conf at all!])
|
||||
fi
|
||||
fi
|
||||
# Create build and target names that use _ instead of "-" and ".".
|
||||
# This is necessary to use them in variable names.
|
||||
build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'`
|
||||
target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'`
|
||||
# Extract rewrite information for build and target
|
||||
eval rewritten_build=\${REWRITE_${build_var}}
|
||||
if test "x$rewritten_build" = x; then
|
||||
rewritten_build=${OPENJDK_BUILD_AUTOCONF_NAME}
|
||||
echo Build stays the same $rewritten_build
|
||||
else
|
||||
echo Rewriting build for builddeps into $rewritten_build
|
||||
fi
|
||||
eval rewritten_target=\${REWRITE_${target_var}}
|
||||
if test "x$rewritten_target" = x; then
|
||||
rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME}
|
||||
echo Target stays the same $rewritten_target
|
||||
else
|
||||
echo Rewriting target for builddeps into $rewritten_target
|
||||
fi
|
||||
rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'`
|
||||
rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'`
|
||||
fi
|
||||
AC_CHECK_PROGS(BDEPS_UNZIP, [7z unzip])
|
||||
if test "x$BDEPS_UNZIP" = x7z; then
|
||||
BDEPS_UNZIP="7z x"
|
||||
fi
|
||||
|
||||
AC_CHECK_PROGS(BDEPS_FTP, [wget lftp ftp])
|
||||
])
|
||||
|
||||
AC_DEFUN([BDEPS_FTPGET],
|
||||
[
|
||||
# $1 is the ftp://abuilddeps.server.com/libs/cups.zip
|
||||
# $2 is the local file name for the downloaded file.
|
||||
VALID_TOOL=no
|
||||
if test "x$BDEPS_FTP" = xwget; then
|
||||
VALID_TOOL=yes
|
||||
wget -O $2 $1
|
||||
fi
|
||||
if test "x$BDEPS_FTP" = xlftp; then
|
||||
VALID_TOOL=yes
|
||||
lftp -c "get $1 -o $2"
|
||||
fi
|
||||
if test "x$BDEPS_FTP" = xftp; then
|
||||
VALID_TOOL=yes
|
||||
FTPSERVER=`echo $1 | cut -f 3 -d '/'`
|
||||
FTPPATH=`echo $1 | cut -f 4- -d '/'`
|
||||
FTPUSERPWD=${FTPSERVER%%@*}
|
||||
if test "x$FTPSERVER" != "x$FTPUSERPWD"; then
|
||||
FTPUSER=${userpwd%%:*}
|
||||
FTPPWD=${userpwd#*@}
|
||||
FTPSERVER=${FTPSERVER#*@}
|
||||
else
|
||||
FTPUSER=ftp
|
||||
FTPPWD=ftp
|
||||
fi
|
||||
# the "pass" command does not work on some
|
||||
# ftp clients (read ftp.exe) but if it works,
|
||||
# passive mode is better!
|
||||
( \
|
||||
echo "user $FTPUSER $FTPPWD" ; \
|
||||
echo "pass" ; \
|
||||
echo "bin" ; \
|
||||
echo "get $FTPPATH $2" ; \
|
||||
) | ftp -in $FTPSERVER
|
||||
fi
|
||||
if test "x$VALID_TOOL" != xyes; then
|
||||
AC_MSG_ERROR([I do not know how to use the tool: $BDEPS_FTP])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([BDEPS_CHECK_MODULE],
|
||||
[
|
||||
define([LIST_OF_BUILD_DEPENDENCIES],LIST_OF_BUILD_DEPENDENCIES[$2=$3'\n'])
|
||||
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
|
||||
# Source the builddeps file again, to make sure it uses the latest variables!
|
||||
. $builddepsfile
|
||||
# Look for a target and build machine specific resource!
|
||||
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}}
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a target specific resource
|
||||
eval resource=\${builddep_$2_TARGET_${rewritten_target_var}}
|
||||
fi
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a build specific resource
|
||||
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}}
|
||||
fi
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a generic resource
|
||||
# (The $2 comes from M4 and not the shell, thus no need for eval here.)
|
||||
resource=${builddep_$2}
|
||||
fi
|
||||
if test "x$resource" != x; then
|
||||
AC_MSG_NOTICE([Using builddeps $resource for $2])
|
||||
# If the resource in the builddeps.conf file is an existing directory,
|
||||
# for example /java/linux/cups
|
||||
if test -d ${resource}; then
|
||||
depdir=${resource}
|
||||
else
|
||||
BDEPS_FETCH($2, $resource, $with_builddeps_server, $with_builddeps_dir, depdir)
|
||||
fi
|
||||
# Source the builddeps file again, because in the previous command, the depdir
|
||||
# was updated to point at the current build dependency install directory.
|
||||
. $builddepsfile
|
||||
# Now extract variables from the builddeps.conf files.
|
||||
theroot=${builddep_$2_ROOT}
|
||||
thecflags=${builddep_$2_CFLAGS}
|
||||
thelibs=${builddep_$2_LIBS}
|
||||
if test "x$depdir" = x; then
|
||||
AC_MSG_ERROR([Could not download build dependency $2])
|
||||
fi
|
||||
$1=$depdir
|
||||
if test "x$theroot" != x; then
|
||||
$1="$theroot"
|
||||
fi
|
||||
if test "x$thecflags" != x; then
|
||||
$1_CFLAGS="$thecflags"
|
||||
fi
|
||||
if test "x$thelibs" != x; then
|
||||
$1_LIBS="$thelibs"
|
||||
fi
|
||||
m4_default([$4], [:])
|
||||
m4_ifvaln([$5], [else $5])
|
||||
fi
|
||||
m4_ifvaln([$5], [else $5])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([BDEPS_FETCH],
|
||||
[
|
||||
# $1 is for example mymodule
|
||||
# $2 is for example libs/general/libmymod_1_2_3.zip
|
||||
# $3 is for example ftp://mybuilddeps.myserver.com/builddeps
|
||||
# $4 is for example /localhome/builddeps
|
||||
# $5 is the name of the variable into which we store the depdir, eg MYMOD
|
||||
# Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and
|
||||
# unzip into the directory: /localhome/builddeps/libmymod_1_2_3
|
||||
filename=`basename $2`
|
||||
filebase=`echo $filename | sed 's/\.[[^\.]]*$//'`
|
||||
filebase=${filename%%.*}
|
||||
extension=${filename#*.}
|
||||
installdir=$4/$filebase
|
||||
if test ! -f $installdir/$filename.unpacked; then
|
||||
AC_MSG_NOTICE([Downloading build dependency $1 from $3/$2 and installing into $installdir])
|
||||
if test ! -d $installdir; then
|
||||
mkdir -p $installdir
|
||||
fi
|
||||
if test ! -d $installdir; then
|
||||
AC_MSG_ERROR([Could not create directory $installdir])
|
||||
fi
|
||||
tmpfile=`mktemp $installdir/$1.XXXXXXXXX`
|
||||
touch $tmpfile
|
||||
if test ! -f $tmpfile; then
|
||||
AC_MSG_ERROR([Could not create files in directory $installdir])
|
||||
fi
|
||||
BDEPS_FTPGET([$3/$2] , [$tmpfile])
|
||||
mv $tmpfile $installdir/$filename
|
||||
if test ! -s $installdir/$filename; then
|
||||
AC_MSG_ERROR([Could not download $3/$2])
|
||||
fi
|
||||
case "$extension" in
|
||||
zip) echo "Unzipping $installdir/$filename..."
|
||||
(cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked)
|
||||
;;
|
||||
tar.gz) echo "Untaring $installdir/$filename..."
|
||||
(cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
|
||||
;;
|
||||
tgz) echo "Untaring $installdir/$filename..."
|
||||
(cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
|
||||
;;
|
||||
*) AC_MSG_ERROR([Cannot handle build depency archive with extension $extension])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test -f $installdir/$filename.unpacked; then
|
||||
$5=$installdir
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BDEPS_CONFIGURE_BUILDDEPS],
|
||||
[
|
||||
AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf],
|
||||
[use this configuration file for the builddeps])])
|
||||
|
||||
AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server],
|
||||
[download and use build dependencies from this server url])])
|
||||
|
||||
AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir],
|
||||
[store downloaded build dependencies here @<:@/localhome/builddeps@:>@])],
|
||||
[],
|
||||
[with_builddeps_dir=/localhome/builddeps])
|
||||
|
||||
AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group],
|
||||
[chgrp the downloaded build dependencies to this group])])
|
||||
])
|
@ -39,7 +39,6 @@ m4_include([build-aux/pkg.m4])
|
||||
# Include these first...
|
||||
m4_include([basics.m4])
|
||||
m4_include([basics_windows.m4])
|
||||
m4_include([builddeps.m4])
|
||||
# ... then the rest
|
||||
m4_include([boot-jdk.m4])
|
||||
m4_include([build-performance.m4])
|
||||
@ -121,12 +120,6 @@ PKG_PROG_PKG_CONFIG
|
||||
# After basic tools have been setup, we can check build os specific details.
|
||||
PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
|
||||
|
||||
# Setup builddeps, for automatic downloading of tools we need.
|
||||
# This is needed before we can call BDEPS_CHECK_MODULE, which is done in
|
||||
# boot-jdk setup, but we need to have basic tools setup first.
|
||||
BDEPS_CONFIGURE_BUILDDEPS
|
||||
BDEPS_SCAN_FOR_BUILDDEPS
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Determine OpenJDK variants, options and version numbers.
|
||||
@ -211,14 +204,8 @@ JDKOPT_SETUP_CODE_COVERAGE
|
||||
# After we have toolchain, we can compile fixpath. It's needed by the lib checks.
|
||||
BASIC_COMPILE_FIXPATH
|
||||
|
||||
LIB_SETUP_INIT
|
||||
LIB_SETUP_X11
|
||||
LIB_SETUP_CUPS
|
||||
LIB_SETUP_FREETYPE
|
||||
LIB_SETUP_ALSA
|
||||
LIB_SETUP_MISC_LIBS
|
||||
LIB_SETUP_STATIC_LINK_LIBSTDCPP
|
||||
LIB_SETUP_ON_WINDOWS
|
||||
LIB_DETERMINE_DEPENDENCIES
|
||||
LIB_SETUP_LIBRARIES
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -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, pulse, alsa etc
|
||||
# $1 is the help tag: freetype, cups, alsa etc
|
||||
MISSING_DEPENDENCY=$1
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
|
||||
@ -109,8 +109,8 @@ apt_help() {
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
|
||||
pulse)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;;
|
||||
ffi)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;;
|
||||
ccache)
|
||||
@ -130,8 +130,6 @@ yum_help() {
|
||||
PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
|
||||
freetype)
|
||||
PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
|
||||
pulse)
|
||||
PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;;
|
||||
x11)
|
||||
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;;
|
||||
ccache)
|
||||
|
90
common/autoconf/lib-alsa.m4
Normal file
90
common/autoconf/lib-alsa.m4
Normal file
@ -0,0 +1,90 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup alsa (Advanced Linux Sound Architecture)
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_ALSA],
|
||||
[
|
||||
AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],
|
||||
[specify prefix directory for the alsa package
|
||||
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
|
||||
AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include],
|
||||
[specify directory for the alsa include files])])
|
||||
AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib],
|
||||
[specify directory for the alsa library])])
|
||||
|
||||
if test "x$NEEDS_LIB_ALSA" = xfalse; then
|
||||
if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then
|
||||
AC_MSG_WARN([alsa not used, so --with-alsa is ignored])
|
||||
fi
|
||||
ALSA_CFLAGS=
|
||||
ALSA_LIBS=
|
||||
else
|
||||
ALSA_FOUND=no
|
||||
|
||||
if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
|
||||
AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
|
||||
fi
|
||||
|
||||
if test "x${with_alsa}" != x; then
|
||||
ALSA_LIBS="-L${with_alsa}/lib -lasound"
|
||||
ALSA_CFLAGS="-I${with_alsa}/include"
|
||||
ALSA_FOUND=yes
|
||||
fi
|
||||
if test "x${with_alsa_include}" != x; then
|
||||
ALSA_CFLAGS="-I${with_alsa_include}"
|
||||
ALSA_FOUND=yes
|
||||
fi
|
||||
if test "x${with_alsa_lib}" != x; then
|
||||
ALSA_LIBS="-L${with_alsa_lib} -lasound"
|
||||
ALSA_FOUND=yes
|
||||
fi
|
||||
# Do not try pkg-config if we have a sysroot set.
|
||||
if test "x$SYSROOT" = x; then
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
|
||||
fi
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
AC_CHECK_HEADERS([alsa/asoundlib.h],
|
||||
[
|
||||
ALSA_FOUND=yes
|
||||
ALSA_CFLAGS=-Iignoreme
|
||||
ALSA_LIBS=-lasound
|
||||
DEFAULT_ALSA=yes
|
||||
],
|
||||
[ALSA_FOUND=no]
|
||||
)
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([alsa])
|
||||
AC_MSG_ERROR([Could not find alsa! $HELP_MSG])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(ALSA_CFLAGS)
|
||||
AC_SUBST(ALSA_LIBS)
|
||||
])
|
226
common/autoconf/lib-bundled.m4
Normal file
226
common/autoconf/lib-bundled.m4
Normal file
@ -0,0 +1,226 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup bundled libraries.
|
||||
#
|
||||
# For libjpeg, giflib, libpng, lcms2 and zlib, the source is present in the
|
||||
# OpenJDK repository. Default is to use these libraries as bundled, but they
|
||||
# might be replaced by en external version by the user.
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_BUNDLED_LIBS],
|
||||
[
|
||||
LIB_SETUP_LIBJPEG
|
||||
LIB_SETUP_GIFLIB
|
||||
LIB_SETUP_LIBPNG
|
||||
LIB_SETUP_ZLIB
|
||||
LIB_SETUP_LCMS
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup libjpeg
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_LIBJPEG],
|
||||
[
|
||||
AC_ARG_WITH(libjpeg, [AS_HELP_STRING([--with-libjpeg],
|
||||
[use libjpeg from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([for which libjpeg to use])
|
||||
# default is bundled
|
||||
DEFAULT_LIBJPEG=bundled
|
||||
# if user didn't specify, use DEFAULT_LIBJPEG
|
||||
if test "x${with_libjpeg}" = "x"; then
|
||||
with_libjpeg=${DEFAULT_LIBJPEG}
|
||||
fi
|
||||
AC_MSG_RESULT(${with_libjpeg})
|
||||
|
||||
if test "x${with_libjpeg}" = "xbundled"; then
|
||||
USE_EXTERNAL_LIBJPEG=false
|
||||
elif test "x${with_libjpeg}" = "xsystem"; then
|
||||
AC_CHECK_HEADER(jpeglib.h, [],
|
||||
[ AC_MSG_ERROR([--with-libjpeg=system specified, but jpeglib.h not found!])])
|
||||
AC_CHECK_LIB(jpeg, jpeg_CreateDecompress, [],
|
||||
[ AC_MSG_ERROR([--with-libjpeg=system specified, but no libjpeg found])])
|
||||
|
||||
USE_EXTERNAL_LIBJPEG=true
|
||||
else
|
||||
AC_MSG_ERROR([Invalid use of --with-libjpeg: ${with_libjpeg}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBJPEG)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup giflib
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_GIFLIB],
|
||||
[
|
||||
AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib],
|
||||
[use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([for which giflib to use])
|
||||
# default is bundled
|
||||
DEFAULT_GIFLIB=bundled
|
||||
# if user didn't specify, use DEFAULT_GIFLIB
|
||||
if test "x${with_giflib}" = "x"; then
|
||||
with_giflib=${DEFAULT_GIFLIB}
|
||||
fi
|
||||
AC_MSG_RESULT(${with_giflib})
|
||||
|
||||
if test "x${with_giflib}" = "xbundled"; then
|
||||
USE_EXTERNAL_LIBGIF=false
|
||||
elif test "x${with_giflib}" = "xsystem"; then
|
||||
AC_CHECK_HEADER(gif_lib.h, [],
|
||||
[ AC_MSG_ERROR([--with-giflib=system specified, but gif_lib.h not found!])])
|
||||
AC_CHECK_LIB(gif, DGifGetCode, [],
|
||||
[ AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!])])
|
||||
|
||||
USE_EXTERNAL_LIBGIF=true
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBGIF)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup libpng
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_LIBPNG],
|
||||
[
|
||||
AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng],
|
||||
[use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([for which libpng to use])
|
||||
|
||||
# default is bundled
|
||||
DEFAULT_LIBPNG=bundled
|
||||
# if user didn't specify, use DEFAULT_LIBPNG
|
||||
if test "x${with_libpng}" = "x"; then
|
||||
with_libpng=${DEFAULT_LIBPNG}
|
||||
fi
|
||||
|
||||
if test "x${with_libpng}" = "xbundled"; then
|
||||
USE_EXTERNAL_LIBPNG=false
|
||||
AC_MSG_RESULT([bundled])
|
||||
elif test "x${with_libpng}" = "xsystem"; then
|
||||
PKG_CHECK_MODULES(PNG, libpng,
|
||||
[ LIBPNG_FOUND=yes ],
|
||||
[ LIBPNG_FOUND=no ])
|
||||
if test "x${LIBPNG_FOUND}" = "xyes"; then
|
||||
USE_EXTERNAL_LIBPNG=true
|
||||
AC_MSG_RESULT([system])
|
||||
else
|
||||
AC_MSG_RESULT([system not found])
|
||||
AC_MSG_ERROR([--with-libpng=system specified, but no libpng found!])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBPNG)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup zlib
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_ZLIB],
|
||||
[
|
||||
AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib],
|
||||
[use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_CHECK_LIB(z, compress,
|
||||
[ ZLIB_FOUND=yes ],
|
||||
[ ZLIB_FOUND=no ])
|
||||
|
||||
AC_MSG_CHECKING([for which zlib to use])
|
||||
|
||||
DEFAULT_ZLIB=bundled
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# On macosx default is system...on others default is bundled
|
||||
DEFAULT_ZLIB=system
|
||||
fi
|
||||
|
||||
if test "x${ZLIB_FOUND}" != "xyes"; then
|
||||
# If we don't find any system...set default to bundled
|
||||
DEFAULT_ZLIB=bundled
|
||||
fi
|
||||
|
||||
# If user didn't specify, use DEFAULT_ZLIB
|
||||
if test "x${with_zlib}" = "x"; then
|
||||
with_zlib=${DEFAULT_ZLIB}
|
||||
fi
|
||||
|
||||
if test "x${with_zlib}" = "xbundled"; then
|
||||
USE_EXTERNAL_LIBZ=false
|
||||
AC_MSG_RESULT([bundled])
|
||||
elif test "x${with_zlib}" = "xsystem"; then
|
||||
if test "x${ZLIB_FOUND}" = "xyes"; then
|
||||
USE_EXTERNAL_LIBZ=true
|
||||
AC_MSG_RESULT([system])
|
||||
else
|
||||
AC_MSG_RESULT([system not found])
|
||||
AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBZ)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup lcms (Little CMS)
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_LCMS],
|
||||
[
|
||||
AC_ARG_WITH(lcms, [AS_HELP_STRING([--with-lcms],
|
||||
[use lcms2 from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([for which lcms to use])
|
||||
|
||||
DEFAULT_LCMS=bundled
|
||||
# If user didn't specify, use DEFAULT_LCMS
|
||||
if test "x${with_lcms}" = "x"; then
|
||||
with_lcms=${DEFAULT_LCMS}
|
||||
fi
|
||||
|
||||
if test "x${with_lcms}" = "xbundled"; then
|
||||
USE_EXTERNAL_LCMS=false
|
||||
AC_MSG_RESULT([bundled])
|
||||
elif test "x${with_lcms}" = "xsystem"; then
|
||||
AC_MSG_RESULT([system])
|
||||
PKG_CHECK_MODULES([LCMS], [lcms2], [LCMS_FOUND=yes], [LCMS_FOUND=no])
|
||||
if test "x${LCMS_FOUND}" = "xyes"; then
|
||||
USE_EXTERNAL_LCMS=true
|
||||
else
|
||||
AC_MSG_ERROR([--with-lcms=system specified, but no lcms found!])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --with-lcms: ${with_lcms}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LCMS)
|
||||
])
|
87
common/autoconf/lib-cups.m4
Normal file
87
common/autoconf/lib-cups.m4
Normal file
@ -0,0 +1,87 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup cups (Common Unix Printing System)
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_CUPS],
|
||||
[
|
||||
AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups],
|
||||
[specify prefix directory for the cups package
|
||||
(expecting the headers under PATH/include)])])
|
||||
AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include],
|
||||
[specify directory for the cups include files])])
|
||||
|
||||
if test "x$NEEDS_LIB_CUPS" = xfalse; then
|
||||
if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then
|
||||
AC_MSG_WARN([cups not used, so --with-cups is ignored])
|
||||
fi
|
||||
CUPS_CFLAGS=
|
||||
else
|
||||
CUPS_FOUND=no
|
||||
|
||||
if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then
|
||||
AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.])
|
||||
fi
|
||||
|
||||
if test "x${with_cups}" != x; then
|
||||
CUPS_CFLAGS="-I${with_cups}/include"
|
||||
CUPS_FOUND=yes
|
||||
fi
|
||||
if test "x${with_cups_include}" != x; then
|
||||
CUPS_CFLAGS="-I${with_cups_include}"
|
||||
CUPS_FOUND=yes
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
# Are the cups headers installed in the default /usr/include location?
|
||||
AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], [
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS=
|
||||
DEFAULT_CUPS=yes
|
||||
])
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
# Getting nervous now? Lets poke around for standard Solaris third-party
|
||||
# package installation locations.
|
||||
AC_MSG_CHECKING([for cups headers])
|
||||
if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then
|
||||
# An SFW package seems to be installed!
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include"
|
||||
elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then
|
||||
# A CSW package seems to be installed!
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
|
||||
fi
|
||||
AC_MSG_RESULT([$CUPS_FOUND])
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([cups])
|
||||
AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(CUPS_CFLAGS)
|
||||
])
|
114
common/autoconf/lib-ffi.m4
Normal file
114
common/autoconf/lib-ffi.m4
Normal file
@ -0,0 +1,114 @@
|
||||
#
|
||||
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup libffi (Foreign Function Interface)
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
|
||||
[
|
||||
AC_ARG_WITH(libffi, [AS_HELP_STRING([--with-libffi],
|
||||
[specify prefix directory for the libffi package
|
||||
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
|
||||
AC_ARG_WITH(libffi-include, [AS_HELP_STRING([--with-libffi-include],
|
||||
[specify directory for the libffi include files])])
|
||||
AC_ARG_WITH(libffi-lib, [AS_HELP_STRING([--with-libffi-lib],
|
||||
[specify directory for the libffi library])])
|
||||
|
||||
if test "x$NEEDS_LIB_FFI" = xfalse; then
|
||||
if test "x${with_libffi}" != x || test "x${with_libffi_include}" != x || test "x${with_libffi_lib}" != x; then
|
||||
AC_MSG_WARN([libffi not used, so --with-libffi is ignored])
|
||||
fi
|
||||
LIBFFI_CFLAGS=
|
||||
LIBFFI_LIBS=
|
||||
else
|
||||
LIBFFI_FOUND=no
|
||||
|
||||
if test "x${with_libffi}" = xno || test "x${with_libffi_include}" = xno || test "x${with_libffi_lib}" = xno; then
|
||||
AC_MSG_ERROR([It is not possible to disable the use of libffi. Remove the --without-libffi option.])
|
||||
fi
|
||||
|
||||
if test "x${with_libffi}" != x; then
|
||||
LIBFFI_LIBS="-L${with_libffi}/lib -lffi"
|
||||
LIBFFI_CFLAGS="-I${with_libffi}/include"
|
||||
LIBFFI_FOUND=yes
|
||||
fi
|
||||
if test "x${with_libffi_include}" != x; then
|
||||
LIBFFI_CFLAGS="-I${with_libffi_include}"
|
||||
LIBFFI_FOUND=yes
|
||||
fi
|
||||
if test "x${with_libffi_lib}" != x; then
|
||||
LIBFFI_LIBS="-L${with_libffi_lib} -lffi"
|
||||
LIBFFI_FOUND=yes
|
||||
fi
|
||||
# Do not try pkg-config if we have a sysroot set.
|
||||
if test "x$SYSROOT" = x; then
|
||||
if test "x$LIBFFI_FOUND" = xno; then
|
||||
# Figure out LIBFFI_CFLAGS and LIBFFI_LIBS
|
||||
PKG_CHECK_MODULES([LIBFFI], [libffi], [LIBFFI_FOUND=yes], [LIBFFI_FOUND=no])
|
||||
fi
|
||||
fi
|
||||
if test "x$LIBFFI_FOUND" = xno; then
|
||||
AC_CHECK_HEADERS([ffi.h],
|
||||
[
|
||||
LIBFFI_FOUND=yes
|
||||
LIBFFI_CFLAGS=
|
||||
LIBFFI_LIBS=-lffi
|
||||
],
|
||||
[LIBFFI_FOUND=no]
|
||||
)
|
||||
fi
|
||||
if test "x$LIBFFI_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([ffi])
|
||||
AC_MSG_ERROR([Could not find libffi! $HELP_MSG])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if libffi works])
|
||||
AC_LANG_PUSH(C)
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $LIBFFI_CFLAGS"
|
||||
OLD_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LIBFFI_LIBS"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ffi.h>],
|
||||
[
|
||||
ffi_call(NULL, NULL, NULL, NULL);
|
||||
return 0;
|
||||
])],
|
||||
[LIBFFI_WORKS=yes],
|
||||
[LIBFFI_WORKS=no]
|
||||
)
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
LIBS="$OLD_LIBS"
|
||||
AC_LANG_POP(C)
|
||||
AC_MSG_RESULT([$LIBFFI_WORKS])
|
||||
|
||||
if test "x$LIBFFI_WORKS" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([ffi])
|
||||
AC_MSG_ERROR([Found libffi but could not link and compile with it. $HELP_MSG])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBFFI_CFLAGS)
|
||||
AC_SUBST(LIBFFI_LIBS)
|
||||
])
|
420
common/autoconf/lib-freetype.m4
Normal file
420
common/autoconf/lib-freetype.m4
Normal file
@ -0,0 +1,420 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Build the freetype lib from source
|
||||
################################################################################
|
||||
AC_DEFUN([LIB_BUILD_FREETYPE],
|
||||
[
|
||||
FREETYPE_SRC_PATH="$1"
|
||||
BUILD_FREETYPE=yes
|
||||
|
||||
# Check if the freetype sources are acessible..
|
||||
if ! test -d $FREETYPE_SRC_PATH; then
|
||||
AC_MSG_WARN([--with-freetype-src specified, but can not find path "$FREETYPE_SRC_PATH" - ignoring --with-freetype-src])
|
||||
BUILD_FREETYPE=no
|
||||
fi
|
||||
# ..and contain a vc2010 project file
|
||||
vcxproj_path="$FREETYPE_SRC_PATH/builds/windows/vc2010/freetype.vcxproj"
|
||||
if test "x$BUILD_FREETYPE" = xyes && ! test -s $vcxproj_path; then
|
||||
AC_MSG_WARN([Can not find project file $vcxproj_path (you may try a newer freetype version) - ignoring --with-freetype-src])
|
||||
BUILD_FREETYPE=no
|
||||
fi
|
||||
# Now check if configure found a version of 'msbuild.exe'
|
||||
if test "x$BUILD_FREETYPE" = xyes && test "x$MSBUILD" == x ; then
|
||||
AC_MSG_WARN([Can not find an msbuild.exe executable (you may try to install .NET 4.0) - ignoring --with-freetype-src])
|
||||
BUILD_FREETYPE=no
|
||||
fi
|
||||
|
||||
# Ready to go..
|
||||
if test "x$BUILD_FREETYPE" = xyes; then
|
||||
# msbuild requires trailing slashes for output directories
|
||||
freetype_lib_path="$FREETYPE_SRC_PATH/lib$OPENJDK_TARGET_CPU_BITS/"
|
||||
freetype_lib_path_unix="$freetype_lib_path"
|
||||
freetype_obj_path="$FREETYPE_SRC_PATH/obj$OPENJDK_TARGET_CPU_BITS/"
|
||||
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(vcxproj_path)
|
||||
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_lib_path)
|
||||
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(freetype_obj_path)
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
freetype_platform=x64
|
||||
else
|
||||
freetype_platform=win32
|
||||
fi
|
||||
|
||||
# The original freetype project file is for VS 2010 (i.e. 'v100'),
|
||||
# so we have to adapt the toolset if building with any other toolsed (i.e. SDK).
|
||||
# Currently 'PLATFORM_TOOLSET' is set in 'TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT'/
|
||||
# 'TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT' in toolchain_windows.m4
|
||||
AC_MSG_NOTICE([Trying to compile freetype sources with PlatformToolset=$PLATFORM_TOOLSET to $freetype_lib_path_unix ...])
|
||||
|
||||
# First we try to build the freetype.dll
|
||||
$ECHO -e "@echo off\n"\
|
||||
"$MSBUILD $vcxproj_path "\
|
||||
"/p:PlatformToolset=$PLATFORM_TOOLSET "\
|
||||
"/p:Configuration=\"Release Multithreaded\" "\
|
||||
"/p:Platform=$freetype_platform "\
|
||||
"/p:ConfigurationType=DynamicLibrary "\
|
||||
"/p:TargetName=freetype "\
|
||||
"/p:OutDir=\"$freetype_lib_path\" "\
|
||||
"/p:IntDir=\"$freetype_obj_path\" > freetype.log" > freetype.bat
|
||||
cmd /c freetype.bat
|
||||
|
||||
if test -s "$freetype_lib_path_unix/freetype.dll"; then
|
||||
# If that succeeds we also build freetype.lib
|
||||
$ECHO -e "@echo off\n"\
|
||||
"$MSBUILD $vcxproj_path "\
|
||||
"/p:PlatformToolset=$PLATFORM_TOOLSET "\
|
||||
"/p:Configuration=\"Release Multithreaded\" "\
|
||||
"/p:Platform=$freetype_platform "\
|
||||
"/p:ConfigurationType=StaticLibrary "\
|
||||
"/p:TargetName=freetype "\
|
||||
"/p:OutDir=\"$freetype_lib_path\" "\
|
||||
"/p:IntDir=\"$freetype_obj_path\" >> freetype.log" > freetype.bat
|
||||
cmd /c freetype.bat
|
||||
|
||||
if test -s "$freetype_lib_path_unix/freetype.lib"; then
|
||||
# Once we build both, lib and dll, set freetype lib and include path appropriately
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_SRC_PATH/include"
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$freetype_lib_path_unix"
|
||||
AC_MSG_NOTICE([Compiling freetype sources succeeded! (see freetype.log for build results)])
|
||||
else
|
||||
BUILD_FREETYPE=no
|
||||
fi
|
||||
else
|
||||
BUILD_FREETYPE=no
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Check if a potential freeype library match is correct and usable
|
||||
################################################################################
|
||||
AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
|
||||
[
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$1"
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$2"
|
||||
METHOD="$3"
|
||||
|
||||
# Let's start with an optimistic view of the world :-)
|
||||
FOUND_FREETYPE=yes
|
||||
|
||||
# First look for the canonical freetype main include file ft2build.h.
|
||||
if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
|
||||
# Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite.
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2"
|
||||
if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
|
||||
# Fail.
|
||||
FOUND_FREETYPE=no
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" = xyes; then
|
||||
# Include file found, let's continue the sanity check.
|
||||
AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD])
|
||||
|
||||
# Reset to default value
|
||||
FREETYPE_BASE_NAME=freetype
|
||||
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}"
|
||||
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx \
|
||||
&& test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then
|
||||
# On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check
|
||||
# for the .6 version explicitly.
|
||||
FREETYPE_BASE_NAME=freetype.6
|
||||
FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}"
|
||||
AC_MSG_NOTICE([Compensating for missing symlink by using version 6 explicitly])
|
||||
else
|
||||
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.])
|
||||
FOUND_FREETYPE=no
|
||||
fi
|
||||
else
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
# On Windows, we will need both .lib and .dll file.
|
||||
if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then
|
||||
AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location.])
|
||||
FOUND_FREETYPE=no
|
||||
fi
|
||||
elif test "x$OPENJDK_TARGET_OS" = xsolaris \
|
||||
&& test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then
|
||||
# Found lib in isa dir, use that instead.
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR"
|
||||
AC_MSG_NOTICE([Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" = xyes; then
|
||||
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH)
|
||||
BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH)
|
||||
|
||||
FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
|
||||
AC_MSG_CHECKING([for freetype includes])
|
||||
AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH])
|
||||
FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
|
||||
AC_MSG_CHECKING([for freetype libraries])
|
||||
AC_MSG_RESULT([$FREETYPE_LIB_PATH])
|
||||
fi
|
||||
])
|
||||
|
||||
################################################################################
|
||||
# Setup freetype (The FreeType2 font rendering library)
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
[
|
||||
AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
|
||||
[specify prefix directory for the freetype package
|
||||
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
|
||||
AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include],
|
||||
[specify directory for the freetype include files])])
|
||||
AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib],
|
||||
[specify directory for the freetype library])])
|
||||
AC_ARG_WITH(freetype-src, [AS_HELP_STRING([--with-freetype-src],
|
||||
[specify directory with freetype sources to automatically build the library (experimental, Windows-only)])])
|
||||
AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling],
|
||||
[disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])])
|
||||
|
||||
# Need to specify explicitly since it needs to be overridden on some versions of macosx
|
||||
FREETYPE_BASE_NAME=freetype
|
||||
FREETYPE_CFLAGS=
|
||||
FREETYPE_LIBS=
|
||||
FREETYPE_BUNDLE_LIB_PATH=
|
||||
|
||||
if test "x$NEEDS_LIB_FREETYPE" = xfalse; then
|
||||
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x || test "x$with_freetype_src" != x; then
|
||||
AC_MSG_WARN([freetype not used, so --with-freetype is ignored])
|
||||
fi
|
||||
if test "x$enable_freetype_bundling" != x; then
|
||||
AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored])
|
||||
fi
|
||||
else
|
||||
# freetype is needed to build; go get it!
|
||||
|
||||
BUNDLE_FREETYPE="$enable_freetype_bundling"
|
||||
|
||||
if test "x$with_freetype_src" != x; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
# Try to build freetype if --with-freetype-src was given on Windows
|
||||
LIB_BUILD_FREETYPE([$with_freetype_src])
|
||||
if test "x$BUILD_FREETYPE" = xyes; then
|
||||
# Okay, we built it. Check that it works.
|
||||
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype-src])
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
AC_MSG_ERROR([Can not use the built freetype at location given by --with-freetype-src])
|
||||
fi
|
||||
else
|
||||
AC_MSG_NOTICE([User specified --with-freetype-src but building freetype failed. (see freetype.log for build results)])
|
||||
AC_MSG_ERROR([Consider building freetype manually and using --with-freetype instead.])
|
||||
fi
|
||||
else
|
||||
AC_MSG_WARN([--with-freetype-src is currently only supported on Windows - ignoring])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
|
||||
# User has specified settings
|
||||
|
||||
if test "x$BUNDLE_FREETYPE" = x; then
|
||||
# If not specified, default is to bundle freetype
|
||||
BUNDLE_FREETYPE=yes
|
||||
fi
|
||||
|
||||
if test "x$with_freetype" != x; then
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include"
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib"
|
||||
fi
|
||||
|
||||
# Allow --with-freetype-lib and --with-freetype-include to override
|
||||
if test "x$with_freetype_include" != x; then
|
||||
POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include"
|
||||
fi
|
||||
if test "x$with_freetype_lib" != x; then
|
||||
POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib"
|
||||
fi
|
||||
|
||||
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then
|
||||
# Okay, we got it. Check that it works.
|
||||
LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype])
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype])
|
||||
fi
|
||||
else
|
||||
# User specified only one of lib or include. This is an error.
|
||||
if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then
|
||||
AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include])
|
||||
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.])
|
||||
else
|
||||
AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib])
|
||||
AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.])
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# User did not specify settings, but we need freetype. Try to locate it.
|
||||
|
||||
if test "x$BUNDLE_FREETYPE" = x; then
|
||||
# If not specified, default is to bundle freetype only on windows
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
BUNDLE_FREETYPE=yes
|
||||
else
|
||||
BUNDLE_FREETYPE=no
|
||||
fi
|
||||
fi
|
||||
|
||||
# If we have a sysroot, assume that's where we are supposed to look and skip pkg-config.
|
||||
if test "x$SYSROOT" = x; then
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
# Check modules using pkg-config, but only if we have it (ugly output results otherwise)
|
||||
if test "x$PKG_CONFIG" != x; then
|
||||
PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no])
|
||||
if test "x$FOUND_FREETYPE" = xyes; then
|
||||
# On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
|
||||
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
|
||||
# 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
|
||||
FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
|
||||
fi
|
||||
# PKG_CHECK_MODULES will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
|
||||
if test "x$BUNDLE_FREETYPE" = xyes; then
|
||||
AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that])
|
||||
FOUND_FREETYPE=no
|
||||
else
|
||||
AC_MSG_CHECKING([for freetype])
|
||||
AC_MSG_RESULT([yes (using pkg-config)])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
# Check in well-known locations
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32"
|
||||
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32"
|
||||
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
else
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr/X11"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr/sfw"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr"
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location])
|
||||
else
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location])
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi # end check in well-known locations
|
||||
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([freetype])
|
||||
AC_MSG_ERROR([Could not find freetype! $HELP_MSG ])
|
||||
fi
|
||||
fi # end user specified settings
|
||||
|
||||
# Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir.
|
||||
if test "x$FREETYPE_CFLAGS" = x; then
|
||||
BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH)
|
||||
if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then
|
||||
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH"
|
||||
else
|
||||
FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$FREETYPE_LIBS" = x; then
|
||||
BASIC_FIXUP_PATH(FREETYPE_LIB_PATH)
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
FREETYPE_LIBS="$FREETYPE_LIB_PATH/$FREETYPE_BASE_NAME.lib"
|
||||
else
|
||||
FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -l$FREETYPE_BASE_NAME"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Try to compile it
|
||||
AC_MSG_CHECKING([if we can compile and link with freetype])
|
||||
AC_LANG_PUSH(C++)
|
||||
PREV_CXXCFLAGS="$CXXFLAGS"
|
||||
PREV_LIBS="$LIBS"
|
||||
PREV_CXX="$CXX"
|
||||
CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
|
||||
LIBS="$LIBS $FREETYPE_LIBS"
|
||||
CXX="$FIXPATH $CXX"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include<ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
int main () {
|
||||
FT_Init_FreeType(NULL);
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.])
|
||||
AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS])
|
||||
|
||||
HELP_MSG_MISSING_DEPENDENCY([freetype])
|
||||
|
||||
AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG])
|
||||
]
|
||||
)
|
||||
CXXCFLAGS="$PREV_CXXFLAGS"
|
||||
LIBS="$PREV_LIBS"
|
||||
CXX="$PREV_CXX"
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
AC_MSG_CHECKING([if we should bundle freetype])
|
||||
if test "x$BUNDLE_FREETYPE" = xyes; then
|
||||
FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH"
|
||||
fi
|
||||
AC_MSG_RESULT([$BUNDLE_FREETYPE])
|
||||
|
||||
fi # end freetype needed
|
||||
|
||||
AC_SUBST(FREETYPE_BUNDLE_LIB_PATH)
|
||||
AC_SUBST(FREETYPE_CFLAGS)
|
||||
AC_SUBST(FREETYPE_LIBS)
|
||||
])
|
120
common/autoconf/lib-std.m4
Normal file
120
common/autoconf/lib-std.m4
Normal file
@ -0,0 +1,120 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup the standard C/C++ runtime libraries.
|
||||
#
|
||||
# Most importantly, determine if stdc++ should be linked statically or
|
||||
# dynamically.
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_STD_LIBS],
|
||||
[
|
||||
# statically link libstdc++ before C++ ABI is stablized on Linux unless
|
||||
# dynamic build is configured on command line.
|
||||
AC_ARG_WITH([stdc++lib], [AS_HELP_STRING([--with-stdc++lib=<static>,<dynamic>,<default>],
|
||||
[force linking of the C++ runtime on Linux to either static or dynamic, default is static with dynamic as fallback])],
|
||||
[
|
||||
if test "x$with_stdc__lib" != xdynamic && test "x$with_stdc__lib" != xstatic \
|
||||
&& test "x$with_stdc__lib" != xdefault; then
|
||||
AC_MSG_ERROR([Bad parameter value --with-stdc++lib=$with_stdc__lib!])
|
||||
fi
|
||||
],
|
||||
[with_stdc__lib=default]
|
||||
)
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
# Test if -lstdc++ works.
|
||||
AC_MSG_CHECKING([if dynamic link of stdc++ is possible])
|
||||
AC_LANG_PUSH(C++)
|
||||
OLD_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -lstdc++"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
|
||||
[has_dynamic_libstdcxx=yes],
|
||||
[has_dynamic_libstdcxx=no])
|
||||
CXXFLAGS="$OLD_CXXFLAGS"
|
||||
AC_LANG_POP(C++)
|
||||
AC_MSG_RESULT([$has_dynamic_libstdcxx])
|
||||
|
||||
# Test if stdc++ can be linked statically.
|
||||
AC_MSG_CHECKING([if static link of stdc++ is possible])
|
||||
STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
|
||||
AC_LANG_PUSH(C++)
|
||||
OLD_LIBS="$LIBS"
|
||||
OLD_CXX="$CXX"
|
||||
LIBS="$STATIC_STDCXX_FLAGS"
|
||||
CXX="$CC"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
|
||||
[has_static_libstdcxx=yes],
|
||||
[has_static_libstdcxx=no])
|
||||
LIBS="$OLD_LIBS"
|
||||
CXX="$OLD_CXX"
|
||||
AC_LANG_POP(C++)
|
||||
AC_MSG_RESULT([$has_static_libstdcxx])
|
||||
|
||||
if test "x$has_static_libstdcxx" = xno && test "x$has_dynamic_libstdcxx" = xno; then
|
||||
AC_MSG_ERROR([Cannot link to stdc++, neither dynamically nor statically!])
|
||||
fi
|
||||
|
||||
if test "x$with_stdc__lib" = xstatic && test "x$has_static_libstdcxx" = xno; then
|
||||
AC_MSG_ERROR([Static linking of libstdc++ was not possible!])
|
||||
fi
|
||||
|
||||
if test "x$with_stdc__lib" = xdynamic && test "x$has_dynamic_libstdcxx" = xno; then
|
||||
AC_MSG_ERROR([Dynamic linking of libstdc++ was not possible!])
|
||||
fi
|
||||
|
||||
# If dynamic was requested, it's available since it would fail above otherwise.
|
||||
# If dynamic wasn't requested, go with static unless it isn't available.
|
||||
AC_MSG_CHECKING([how to link with libstdc++])
|
||||
if test "x$with_stdc__lib" = xdynamic || test "x$has_static_libstdcxx" = xno || test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
|
||||
LIBCXX="$LIBCXX -lstdc++"
|
||||
LDCXX="$CXX"
|
||||
STATIC_CXX_SETTING="STATIC_CXX=false"
|
||||
AC_MSG_RESULT([dynamic])
|
||||
else
|
||||
LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
|
||||
LDCXX="$CC"
|
||||
STATIC_CXX_SETTING="STATIC_CXX=true"
|
||||
AC_MSG_RESULT([static])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(STATIC_CXX_SETTING)
|
||||
|
||||
# libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
|
||||
LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
|
||||
fi
|
||||
|
||||
# TODO better (platform agnostic) test
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
LIBCXX="-lstdc++"
|
||||
fi
|
||||
AC_SUBST(LIBCXX)
|
||||
|
||||
# Setup Windows runtime dlls
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
TOOLCHAIN_SETUP_VS_RUNTIME_DLLS
|
||||
fi
|
||||
])
|
121
common/autoconf/lib-x11.m4
Normal file
121
common/autoconf/lib-x11.m4
Normal file
@ -0,0 +1,121 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# Setup X11 Windows system
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_X11],
|
||||
[
|
||||
if test "x$NEEDS_LIB_X11" = xfalse; then
|
||||
if test "x${with_x}" != x; then
|
||||
AC_MSG_WARN([X11 is not used, so --with-x is ignored])
|
||||
fi
|
||||
X_CFLAGS=
|
||||
X_LIBS=
|
||||
else
|
||||
# Check if the user has specified sysroot, but not --x-includes or --x-libraries.
|
||||
# Make a simple check for the libraries at the sysroot, and setup --x-includes and
|
||||
# --x-libraries for the sysroot, if that seems to be correct.
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
if test "x$SYSROOT" != "x"; then
|
||||
if test "x$x_includes" = xNONE; then
|
||||
if test -f "$SYSROOT/usr/X11R6/include/X11/Xlib.h"; then
|
||||
x_includes="$SYSROOT/usr/X11R6/include"
|
||||
elif test -f "$SYSROOT/usr/include/X11/Xlib.h"; then
|
||||
x_includes="$SYSROOT/usr/include"
|
||||
fi
|
||||
fi
|
||||
if test "x$x_libraries" = xNONE; then
|
||||
if test -f "$SYSROOT/usr/X11R6/lib/libX11.so"; then
|
||||
x_libraries="$SYSROOT/usr/X11R6/lib"
|
||||
elif test -f "$SYSROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
x_libraries="$SYSROOT/usr/lib64"
|
||||
elif test -f "$SYSROOT/usr/lib/libX11.so"; then
|
||||
x_libraries="$SYSROOT/usr/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Now let autoconf do it's magic
|
||||
AC_PATH_X
|
||||
AC_PATH_XTRA
|
||||
|
||||
# AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling
|
||||
# this doesn't make sense so we remove it.
|
||||
if test "x$COMPILE_TYPE" = xcross; then
|
||||
X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'`
|
||||
fi
|
||||
|
||||
if test "x$no_x" = xyes; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([x11])
|
||||
AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
OPENWIN_HOME="/usr/openwin"
|
||||
X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
|
||||
X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
fi
|
||||
|
||||
AC_LANG_PUSH(C)
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $SYSROOT_CFLAGS $X_CFLAGS"
|
||||
|
||||
# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
|
||||
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h X11/Intrinsic.h],
|
||||
[X11_HEADERS_OK=yes],
|
||||
[X11_HEADERS_OK=no; break],
|
||||
[
|
||||
# include <X11/Xlib.h>
|
||||
# include <X11/Xutil.h>
|
||||
]
|
||||
)
|
||||
|
||||
if test "x$X11_HEADERS_OK" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([x11])
|
||||
AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG])
|
||||
fi
|
||||
|
||||
# If XLinearGradient isn't available in Xrender.h, signal that it needs to be
|
||||
# defined in libawt_xawt.
|
||||
AC_MSG_CHECKING([if XlinearGradient is defined in Xrender.h])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],
|
||||
[[XLinearGradient x;]])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([no])
|
||||
X_CFLAGS="$X_CFLAGS -DSOLARIS10_NO_XRENDER_STRUCTS"])
|
||||
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
AC_LANG_POP(C)
|
||||
fi # NEEDS_LIB_X11
|
||||
|
||||
AC_SUBST(X_CFLAGS)
|
||||
AC_SUBST(X_LIBS)
|
||||
])
|
File diff suppressed because it is too large
Load Diff
@ -96,7 +96,7 @@ REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@
|
||||
REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@
|
||||
|
||||
@SET_OPENJDK@
|
||||
LIBM:=-lm
|
||||
LIBM:=@LIBM@
|
||||
LIBDL:=@LIBDL@
|
||||
|
||||
# colon or semicolon
|
||||
|
Loading…
x
Reference in New Issue
Block a user