diff -r 4d3fefdd2f98 -r 64a3eeabf6e5 common/autoconf/platform.m4 --- a/common/autoconf/platform.m4 Sat Oct 06 10:24:47 2018 +0100 +++ b/common/autoconf/platform.m4 Thu Dec 27 11:47:57 2018 +0800 @@ -23,6 +23,12 @@ # questions. # +# +# This file has been modified by Loongson Technology in 2018. These +# modifications are Copyright (c) 2018 Loongson Technology, and are made +# available on the same license terms set forth above. +# + # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Converts autoconf style CPU name to OpenJDK style, into # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. @@ -96,6 +102,12 @@ VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; + mips64el) + VAR_CPU=mips64 + VAR_CPU_ARCH=mips + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; *) AC_MSG_ERROR([unsupported cpu $1]) ;; @@ -283,6 +295,8 @@ OPENJDK_TARGET_CPU_LEGACY_LIB="i386" elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" + elif test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then + OPENJDK_TARGET_CPU_LEGACY_LIB="mips64el" fi AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) @@ -316,6 +330,10 @@ elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_OSARCH="amd64" + elif test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then + # Jin: to be exactly same with OpenJDK 6(mips64) + # System.getProperty("os.arch"): mips64 -> mips64el + OPENJDK_TARGET_CPU_OSARCH="mips64el" fi AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) @@ -325,6 +343,8 @@ elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_JLI="amd64" + elif test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then + OPENJDK_TARGET_CPU_JLI="mips64el" fi # Now setup the -D flags for building libjli. OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" @@ -335,6 +355,9 @@ OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" fi fi + if test "x$OPENJDK_TARGET_CPU" = xmips64 && test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"mips32el\"' -DLIBARCH64NAME='\"mips64el\"'" + fi AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. @@ -548,3 +571,45 @@ AC_MSG_ERROR([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)]) fi ]) + +AC_DEFUN([GET_BUILDER_AND_HOST_DATA], +[ +BUILDER_NAME="$build_os" +BUILDER_ID="Custom build ($(date))" +if test -f /etc/issue; then + etc_issue_info=`cat /etc/issue` + if test -n "$etc_issue_info"; then + BUILDER_NAME=`cat /etc/issue | head -n 1 | cut -d " " -f 1` + fi +fi +if test -f /etc/redhat-release; then + etc_issue_info=`cat /etc/redhat-release` + if test -n "$etc_issue_info"; then + BUILDER_NAME=`cat /etc/redhat-release | head -n 1 | cut -d " " -f 1` + fi +fi +if test -f /etc/neokylin-release; then + etc_issue_info=`cat /etc/neokylin-release` + if test -n "$etc_issue_info"; then + BUILDER_NAME=`cat /etc/neokylin-release | head -n 1 | cut -d " " -f 1` + fi +fi +if test -z "$BUILDER_NAME"; then + BUILDER_NAME="unknown" +fi +if test -n "$OPENJDK_TARGET_CPU_OSARCH"; then + HOST_NAME="$OPENJDK_TARGET_CPU_OSARCH" +else + HOST_NAME="unknown" +fi +if test -f "/usr/bin/cpp"; then + # gcc_with_arch_info=`gcc -v 2>&1 | grep '\-\-with-arch=' | sed 's/.*--with-arch=//;s/ .*$//'` + gcc_with_arch_info=`cpp -dM /dev/null | grep '\<_MIPS_ARCH\>' | sed 's/^#define _MIPS_ARCH "//;s/"$//'` + if test -n "$gcc_with_arch_info"; then + HOST_NAME="$gcc_with_arch_info" + fi +fi +AC_SUBST(BUILDER_ID) +AC_SUBST(BUILDER_NAME) +AC_SUBST(HOST_NAME) +])