8172670: AOT Platform Support for Windows and Mac OS X x64
Reviewed-by: dholmes, erikj, gadams
This commit is contained in:
parent
23b743a2b7
commit
9721b48428
@ -663,8 +663,6 @@ JVM_FEATURES_core
|
||||
JVM_FEATURES_client
|
||||
JVM_FEATURES_server
|
||||
INCLUDE_GRAAL
|
||||
ELF_LIBS
|
||||
ELF_CFLAGS
|
||||
STLPORT_LIB
|
||||
LIBZIP_CAN_USE_MMAP
|
||||
LIBDL
|
||||
@ -1219,9 +1217,6 @@ with_lcms
|
||||
with_dxsdk
|
||||
with_dxsdk_lib
|
||||
with_dxsdk_include
|
||||
with_libelf
|
||||
with_libelf_include
|
||||
with_libelf_lib
|
||||
with_jvm_features
|
||||
with_jvm_interpreter
|
||||
enable_jtreg_failure_handler
|
||||
@ -1348,8 +1343,6 @@ PNG_CFLAGS
|
||||
PNG_LIBS
|
||||
LCMS_CFLAGS
|
||||
LCMS_LIBS
|
||||
ELF_CFLAGS
|
||||
ELF_LIBS
|
||||
ICECC_CMD
|
||||
ICECC_CREATE_ENV
|
||||
ICECC_WRAPPER
|
||||
@ -2178,11 +2171,6 @@ Optional Packages:
|
||||
compatibility and is ignored
|
||||
--with-dxsdk-include Deprecated. Option is kept for backwards
|
||||
compatibility and is ignored
|
||||
--with-libelf specify prefix directory for the libelf package
|
||||
(expecting the libraries under PATH/lib and the
|
||||
headers under PATH/include)
|
||||
--with-libelf-include specify directory for the libelf include files
|
||||
--with-libelf-lib specify directory for the libelf library
|
||||
--with-jvm-features additional JVM features to enable (separated by
|
||||
comma), use '--help' to show possible values [none]
|
||||
--with-jvm-interpreter Deprecated. Option is kept for backwards
|
||||
@ -2316,8 +2304,6 @@ Some influential environment variables:
|
||||
PNG_LIBS linker flags for PNG, overriding pkg-config
|
||||
LCMS_CFLAGS C compiler flags for LCMS, overriding pkg-config
|
||||
LCMS_LIBS linker flags for LCMS, overriding pkg-config
|
||||
ELF_CFLAGS C compiler flags for ELF, overriding pkg-config
|
||||
ELF_LIBS linker flags for ELF, overriding pkg-config
|
||||
ICECC_CMD Override default value for ICECC_CMD
|
||||
ICECC_CREATE_ENV
|
||||
Override default value for ICECC_CREATE_ENV
|
||||
@ -4273,7 +4259,7 @@ pkgadd_help() {
|
||||
|
||||
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2017, 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
|
||||
@ -4505,7 +4491,7 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
|
||||
|
||||
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2017, 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
|
||||
@ -4782,36 +4768,6 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
|
||||
################################################################################
|
||||
|
||||
|
||||
#
|
||||
# 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 libelf (ELF library)
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
# Determine which libraries are needed for this configuration
|
||||
@ -5180,7 +5136,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
||||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1484571183
|
||||
DATE_WHEN_GENERATED=1486657511
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -52944,8 +52900,8 @@ $as_echo "no, forced" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$ENABLE_AOT" = "xtrue"; then
|
||||
# Only enable AOT on linux-X64.
|
||||
if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then
|
||||
# Only enable AOT on X64 platforms.
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||
if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then
|
||||
if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then
|
||||
ENABLE_AOT="true"
|
||||
@ -64291,286 +64247,6 @@ $as_echo "no, not found at $STLPORT_LIB" >&6; }
|
||||
|
||||
|
||||
|
||||
# Check whether --with-libelf was given.
|
||||
if test "${with_libelf+set}" = set; then :
|
||||
withval=$with_libelf;
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-libelf-include was given.
|
||||
if test "${with_libelf_include+set}" = set; then :
|
||||
withval=$with_libelf_include;
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-libelf-lib was given.
|
||||
if test "${with_libelf_lib+set}" = set; then :
|
||||
withval=$with_libelf_lib;
|
||||
fi
|
||||
|
||||
|
||||
if test "x$ENABLE_AOT" = xfalse; then
|
||||
if (test "x${with_libelf}" != x && test "x${with_libelf}" != xno) || \
|
||||
(test "x${with_libelf_include}" != x && test "x${with_libelf_include}" != xno) || \
|
||||
(test "x${with_libelf_lib}" != x && test "x${with_libelf_lib}" != xno); then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libelf is not used, so --with-libelf[-*] is ignored" >&5
|
||||
$as_echo "$as_me: WARNING: libelf is not used, so --with-libelf[-*] is ignored" >&2;}
|
||||
fi
|
||||
LIBELF_CFLAGS=
|
||||
LIBELF_LIBS=
|
||||
else
|
||||
LIBELF_FOUND=no
|
||||
|
||||
if test "x${with_libelf}" = xno || test "x${with_libelf_include}" = xno || test "x${with_libelf_lib}" = xno; then
|
||||
ENABLE_AOT="false"
|
||||
if test "x${enable_aot}" = xyes; then
|
||||
as_fn_error $? "libelf is explicitly disabled, cannot build AOT. Enable libelf or remove --enable-aot to disable AOT." "$LINENO" 5
|
||||
fi
|
||||
else
|
||||
if test "x${with_libelf}" != x; then
|
||||
ELF_LIBS="-L${with_libelf}/lib -lelf"
|
||||
ELF_CFLAGS="-I${with_libelf}/include"
|
||||
LIBELF_FOUND=yes
|
||||
fi
|
||||
if test "x${with_libelf_include}" != x; then
|
||||
ELF_CFLAGS="-I${with_libelf_include}"
|
||||
LIBELF_FOUND=yes
|
||||
fi
|
||||
if test "x${with_libelf_lib}" != x; then
|
||||
ELF_LIBS="-L${with_libelf_lib} -lelf"
|
||||
LIBELF_FOUND=yes
|
||||
fi
|
||||
# Do not try pkg-config if we have a sysroot set.
|
||||
if test "x$SYSROOT" = x; then
|
||||
if test "x$LIBELF_FOUND" = xno; then
|
||||
# Figure out ELF_CFLAGS and ELF_LIBS
|
||||
|
||||
pkg_failed=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF" >&5
|
||||
$as_echo_n "checking for ELF... " >&6; }
|
||||
|
||||
if test -n "$ELF_CFLAGS"; then
|
||||
pkg_cv_ELF_CFLAGS="$ELF_CFLAGS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelf\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "libelf") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_ELF_CFLAGS=`$PKG_CONFIG --cflags "libelf" 2>/dev/null`
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
if test -n "$ELF_LIBS"; then
|
||||
pkg_cv_ELF_LIBS="$ELF_LIBS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libelf\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "libelf") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_ELF_LIBS=`$PKG_CONFIG --libs "libelf" 2>/dev/null`
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
ELF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libelf" 2>&1`
|
||||
else
|
||||
ELF_PKG_ERRORS=`$PKG_CONFIG --print-errors "libelf" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$ELF_PKG_ERRORS" >&5
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
LIBELF_FOUND=no
|
||||
elif test $pkg_failed = untried; then
|
||||
LIBELF_FOUND=no
|
||||
else
|
||||
ELF_CFLAGS=$pkg_cv_ELF_CFLAGS
|
||||
ELF_LIBS=$pkg_cv_ELF_LIBS
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
LIBELF_FOUND=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "x$LIBELF_FOUND" = xno; then
|
||||
for ac_header in libelf.h
|
||||
do :
|
||||
ac_fn_cxx_check_header_mongrel "$LINENO" "libelf.h" "ac_cv_header_libelf_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_libelf_h" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_LIBELF_H 1
|
||||
_ACEOF
|
||||
|
||||
LIBELF_FOUND=yes
|
||||
ELF_CFLAGS=
|
||||
ELF_LIBS=-lelf
|
||||
|
||||
else
|
||||
LIBELF_FOUND=no
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
if test "x$LIBELF_FOUND" = xno; then
|
||||
ENABLE_AOT="false"
|
||||
|
||||
# Print a helpful message on how to acquire the necessary build dependency.
|
||||
# elf is the help tag: freetype, cups, alsa etc
|
||||
MISSING_DEPENDENCY=elf
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
|
||||
cygwin_help $MISSING_DEPENDENCY
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
msys_help $MISSING_DEPENDENCY
|
||||
else
|
||||
PKGHANDLER_COMMAND=
|
||||
|
||||
case $PKGHANDLER in
|
||||
apt-get)
|
||||
apt_help $MISSING_DEPENDENCY ;;
|
||||
yum)
|
||||
yum_help $MISSING_DEPENDENCY ;;
|
||||
brew)
|
||||
brew_help $MISSING_DEPENDENCY ;;
|
||||
port)
|
||||
port_help $MISSING_DEPENDENCY ;;
|
||||
pkgutil)
|
||||
pkgutil_help $MISSING_DEPENDENCY ;;
|
||||
pkgadd)
|
||||
pkgadd_help $MISSING_DEPENDENCY ;;
|
||||
esac
|
||||
|
||||
if test "x$PKGHANDLER_COMMAND" != x; then
|
||||
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x${enable_aot}" = xyes; then
|
||||
as_fn_error $? "libelf not found, cannot build AOT. Remove --enable-aot to disable AOT or: $HELP_MSG" "$LINENO" 5
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libelf not found, cannot build AOT. $HELP_MSG" >&5
|
||||
$as_echo "$as_me: WARNING: libelf not found, cannot build AOT. $HELP_MSG" >&2;}
|
||||
fi
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libelf works" >&5
|
||||
$as_echo_n "checking if libelf works... " >&6; }
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $ELF_CFLAGS"
|
||||
OLD_LIBS="$LIBS"
|
||||
LIBS="$LIBS $ELF_LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <libelf.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
elf_version(0);
|
||||
return 0;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
LIBELF_WORKS=yes
|
||||
else
|
||||
LIBELF_WORKS=no
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
LIBS="$OLD_LIBS"
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBELF_WORKS" >&5
|
||||
$as_echo "$LIBELF_WORKS" >&6; }
|
||||
|
||||
if test "x$LIBELF_WORKS" = xno; then
|
||||
ENABLE_AOT="false"
|
||||
|
||||
# Print a helpful message on how to acquire the necessary build dependency.
|
||||
# elf is the help tag: freetype, cups, alsa etc
|
||||
MISSING_DEPENDENCY=elf
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
|
||||
cygwin_help $MISSING_DEPENDENCY
|
||||
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
|
||||
msys_help $MISSING_DEPENDENCY
|
||||
else
|
||||
PKGHANDLER_COMMAND=
|
||||
|
||||
case $PKGHANDLER in
|
||||
apt-get)
|
||||
apt_help $MISSING_DEPENDENCY ;;
|
||||
yum)
|
||||
yum_help $MISSING_DEPENDENCY ;;
|
||||
brew)
|
||||
brew_help $MISSING_DEPENDENCY ;;
|
||||
port)
|
||||
port_help $MISSING_DEPENDENCY ;;
|
||||
pkgutil)
|
||||
pkgutil_help $MISSING_DEPENDENCY ;;
|
||||
pkgadd)
|
||||
pkgadd_help $MISSING_DEPENDENCY ;;
|
||||
esac
|
||||
|
||||
if test "x$PKGHANDLER_COMMAND" != x; then
|
||||
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_aot" = "xyes"; then
|
||||
as_fn_error $? "Found libelf but could not link and compile with it. Remove --enable-aot to disable AOT or: $HELP_MSG" "$LINENO" 5
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found libelf but could not link and compile with it. $HELP_MSG" >&5
|
||||
$as_echo "$as_me: WARNING: Found libelf but could not link and compile with it. $HELP_MSG" >&2;}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2017, 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
|
||||
@ -213,8 +213,8 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT],
|
||||
fi
|
||||
|
||||
if test "x$ENABLE_AOT" = "xtrue"; then
|
||||
# Only enable AOT on linux-X64.
|
||||
if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then
|
||||
# Only enable AOT on X64 platforms.
|
||||
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||
if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then
|
||||
if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then
|
||||
ENABLE_AOT="true"
|
||||
|
@ -1,129 +0,0 @@
|
||||
#
|
||||
# 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 libelf (ELF library)
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_LIBELF],
|
||||
[
|
||||
AC_ARG_WITH(libelf, [AS_HELP_STRING([--with-libelf],
|
||||
[specify prefix directory for the libelf package
|
||||
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
|
||||
AC_ARG_WITH(libelf-include, [AS_HELP_STRING([--with-libelf-include],
|
||||
[specify directory for the libelf include files])])
|
||||
AC_ARG_WITH(libelf-lib, [AS_HELP_STRING([--with-libelf-lib],
|
||||
[specify directory for the libelf library])])
|
||||
|
||||
if test "x$ENABLE_AOT" = xfalse; then
|
||||
if (test "x${with_libelf}" != x && test "x${with_libelf}" != xno) || \
|
||||
(test "x${with_libelf_include}" != x && test "x${with_libelf_include}" != xno) || \
|
||||
(test "x${with_libelf_lib}" != x && test "x${with_libelf_lib}" != xno); then
|
||||
AC_MSG_WARN([[libelf is not used, so --with-libelf[-*] is ignored]])
|
||||
fi
|
||||
LIBELF_CFLAGS=
|
||||
LIBELF_LIBS=
|
||||
else
|
||||
LIBELF_FOUND=no
|
||||
|
||||
if test "x${with_libelf}" = xno || test "x${with_libelf_include}" = xno || test "x${with_libelf_lib}" = xno; then
|
||||
ENABLE_AOT="false"
|
||||
if test "x${enable_aot}" = xyes; then
|
||||
AC_MSG_ERROR([libelf is explicitly disabled, cannot build AOT. Enable libelf or remove --enable-aot to disable AOT.])
|
||||
fi
|
||||
else
|
||||
if test "x${with_libelf}" != x; then
|
||||
ELF_LIBS="-L${with_libelf}/lib -lelf"
|
||||
ELF_CFLAGS="-I${with_libelf}/include"
|
||||
LIBELF_FOUND=yes
|
||||
fi
|
||||
if test "x${with_libelf_include}" != x; then
|
||||
ELF_CFLAGS="-I${with_libelf_include}"
|
||||
LIBELF_FOUND=yes
|
||||
fi
|
||||
if test "x${with_libelf_lib}" != x; then
|
||||
ELF_LIBS="-L${with_libelf_lib} -lelf"
|
||||
LIBELF_FOUND=yes
|
||||
fi
|
||||
# Do not try pkg-config if we have a sysroot set.
|
||||
if test "x$SYSROOT" = x; then
|
||||
if test "x$LIBELF_FOUND" = xno; then
|
||||
# Figure out ELF_CFLAGS and ELF_LIBS
|
||||
PKG_CHECK_MODULES([ELF], [libelf], [LIBELF_FOUND=yes], [LIBELF_FOUND=no])
|
||||
fi
|
||||
fi
|
||||
if test "x$LIBELF_FOUND" = xno; then
|
||||
AC_CHECK_HEADERS([libelf.h],
|
||||
[
|
||||
LIBELF_FOUND=yes
|
||||
ELF_CFLAGS=
|
||||
ELF_LIBS=-lelf
|
||||
],
|
||||
[LIBELF_FOUND=no]
|
||||
)
|
||||
fi
|
||||
if test "x$LIBELF_FOUND" = xno; then
|
||||
ENABLE_AOT="false"
|
||||
HELP_MSG_MISSING_DEPENDENCY([elf])
|
||||
if test "x${enable_aot}" = xyes; then
|
||||
AC_MSG_ERROR([libelf not found, cannot build AOT. Remove --enable-aot to disable AOT or: $HELP_MSG])
|
||||
else
|
||||
AC_MSG_WARN([libelf not found, cannot build AOT. $HELP_MSG])
|
||||
fi
|
||||
else
|
||||
AC_MSG_CHECKING([if libelf works])
|
||||
AC_LANG_PUSH(C)
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $ELF_CFLAGS"
|
||||
OLD_LIBS="$LIBS"
|
||||
LIBS="$LIBS $ELF_LIBS"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <libelf.h>],
|
||||
[
|
||||
elf_version(0);
|
||||
return 0;
|
||||
])],
|
||||
[LIBELF_WORKS=yes],
|
||||
[LIBELF_WORKS=no]
|
||||
)
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
LIBS="$OLD_LIBS"
|
||||
AC_LANG_POP(C)
|
||||
AC_MSG_RESULT([$LIBELF_WORKS])
|
||||
|
||||
if test "x$LIBELF_WORKS" = xno; then
|
||||
ENABLE_AOT="false"
|
||||
HELP_MSG_MISSING_DEPENDENCY([elf])
|
||||
if test "x$enable_aot" = "xyes"; then
|
||||
AC_MSG_ERROR([Found libelf but could not link and compile with it. Remove --enable-aot to disable AOT or: $HELP_MSG])
|
||||
else
|
||||
AC_MSG_WARN([Found libelf but could not link and compile with it. $HELP_MSG])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(ELF_CFLAGS)
|
||||
AC_SUBST(ELF_LIBS)
|
||||
])
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2017, 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,6 @@ m4_include([lib-ffi.m4])
|
||||
m4_include([lib-freetype.m4])
|
||||
m4_include([lib-std.m4])
|
||||
m4_include([lib-x11.m4])
|
||||
m4_include([lib-elf.m4])
|
||||
|
||||
################################################################################
|
||||
# Determine which libraries are needed for this configuration
|
||||
@ -91,7 +90,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
|
||||
LIB_SETUP_BUNDLED_LIBS
|
||||
LIB_SETUP_MISC_LIBS
|
||||
LIB_SETUP_SOLARIS_STLPORT
|
||||
LIB_SETUP_LIBELF
|
||||
])
|
||||
|
||||
################################################################################
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2017, 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
|
||||
@ -757,9 +757,6 @@ USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@
|
||||
PNG_LIBS:=@PNG_LIBS@
|
||||
PNG_CFLAGS:=@PNG_CFLAGS@
|
||||
|
||||
ELF_CFLAGS:=@ELF_CFLAGS@
|
||||
ELF_LIBS:=@ELF_LIBS@
|
||||
|
||||
####################################################
|
||||
#
|
||||
# Misc
|
||||
|
Loading…
x
Reference in New Issue
Block a user