Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8257913: Add more known library locations to simplify Linux cross-com…
…pilation

Reviewed-by: erikj
  • Loading branch information
shipilev committed Mar 8, 2021
1 parent 22a3117 commit 61cff4da90706e27de27ee9ee09e5b277be6bcad
Showing with 51 additions and 4 deletions.
  1. +0 −4 .github/workflows/submit.yml
  2. +10 −0 make/autoconf/lib-freetype.m4
  3. +4 −0 make/autoconf/lib-x11.m4
  4. +37 −0 make/autoconf/platform.m4
@@ -536,10 +536,6 @@ jobs:
echo "cross_flags=
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}
--with-sysroot=${HOME}/sysroot-${{ matrix.debian-arch }}/
--with-toolchain-path=${HOME}/sysroot-${{ matrix.debian-arch }}/
--with-freetype-lib=${HOME}/sysroot-${{ matrix.debian-arch }}/usr/lib/${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}/
--with-freetype-include=${HOME}/sysroot-${{ matrix.debian-arch }}/usr/include/freetype2/
--x-libraries=${HOME}/sysroot-${{ matrix.debian-arch }}/usr/lib/${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-flavor}}/
" >> $GITHUB_ENV
if: matrix.debian-arch != ''

@@ -192,6 +192,16 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
[$FREETYPE_BASE_DIR/lib], [well-known location])
fi
if test "x$FOUND_FREETYPE" != "xyes" ; then
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
[$FREETYPE_BASE_DIR/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI], [well-known location])
fi
if test "x$FOUND_FREETYPE" != "xyes" ; then
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
[$FREETYPE_BASE_DIR/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI], [well-known location])
fi
if test "x$FOUND_FREETYPE" != "xyes" ; then
FREETYPE_BASE_DIR="$SYSROOT/usr/X11"
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include],
@@ -68,6 +68,10 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
x_libraries="$SYSROOT/usr/lib64"
elif test -f "$SYSROOT/usr/lib/libX11.so"; then
x_libraries="$SYSROOT/usr/lib"
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"
fi
fi
fi
@@ -238,6 +238,33 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_LIBC],
esac
])

# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
# Converts autoconf style OS name to OpenJDK style, into
# VAR_ABI.
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_ABI],
[
case "$1" in
*linux*-musl)
VAR_ABI=musl
;;
*linux*-gnu)
VAR_ABI=gnu
;;
*linux*-gnueabi)
VAR_ABI=gnueabi
;;
*linux*-gnueabihf)
VAR_ABI=gnueabihf
;;
*linux*-gnuabi64)
VAR_ABI=gnuabi64
;;
*)
VAR_ABI=default
;;
esac
])

# Expects $host_os $host_cpu $build_os and $build_cpu
# and $with_target_bits to have been setup!
#
@@ -259,6 +286,7 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
PLATFORM_EXTRACT_VARS_FROM_OS($build_os)
PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu)
PLATFORM_EXTRACT_VARS_FROM_LIBC($build_os)
PLATFORM_EXTRACT_VARS_FROM_ABI($build_os)
# ..and setup our own variables. (Do this explicitly to facilitate searching)
OPENJDK_BUILD_OS="$VAR_OS"
if test "x$VAR_OS_TYPE" != x; then
@@ -275,15 +303,19 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS"
OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN"
OPENJDK_BUILD_CPU_AUTOCONF="$build_cpu"
OPENJDK_BUILD_LIBC="$VAR_LIBC"
OPENJDK_BUILD_ABI="$VAR_ABI"
AC_SUBST(OPENJDK_BUILD_OS)
AC_SUBST(OPENJDK_BUILD_OS_TYPE)
AC_SUBST(OPENJDK_BUILD_OS_ENV)
AC_SUBST(OPENJDK_BUILD_CPU)
AC_SUBST(OPENJDK_BUILD_CPU_ARCH)
AC_SUBST(OPENJDK_BUILD_CPU_BITS)
AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN)
AC_SUBST(OPENJDK_BUILD_CPU_AUTOCONF)
AC_SUBST(OPENJDK_BUILD_LIBC)
AC_SUBST(OPENJDK_BUILD_ABI)
AC_MSG_CHECKING([openjdk-build os-cpu])
AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU])
@@ -297,6 +329,7 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
PLATFORM_EXTRACT_VARS_FROM_OS($host_os)
PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu)
PLATFORM_EXTRACT_VARS_FROM_LIBC($host_os)
PLATFORM_EXTRACT_VARS_FROM_ABI($host_os)
# ... and setup our own variables. (Do this explicitly to facilitate searching)
OPENJDK_TARGET_OS="$VAR_OS"
if test "x$VAR_OS_TYPE" != x; then
@@ -313,8 +346,10 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS"
OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN"
OPENJDK_TARGET_CPU_AUTOCONF="$host_cpu"
OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
OPENJDK_TARGET_LIBC="$VAR_LIBC"
OPENJDK_TARGET_ABI="$VAR_ABI"
AC_SUBST(OPENJDK_TARGET_OS)
AC_SUBST(OPENJDK_TARGET_OS_TYPE)
@@ -324,7 +359,9 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
AC_SUBST(OPENJDK_TARGET_CPU_ARCH)
AC_SUBST(OPENJDK_TARGET_CPU_BITS)
AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN)
AC_SUBST(OPENJDK_TARGET_CPU_AUTOCONF)
AC_SUBST(OPENJDK_TARGET_LIBC)
AC_SUBST(OPENJDK_TARGET_ABI)
AC_MSG_CHECKING([openjdk-target os-cpu])
AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU])

0 comments on commit 61cff4d

Please sign in to comment.