diff --git a/common/autoconf/boot-jdk.m4 b/common/autoconf/boot-jdk.m4 index 170049731dc63b0d40e6eaadb2a632490838e368..edd6cec4ffbaa99194e4277dd9a74d4ea18af2ee 100644 --- a/common/autoconf/boot-jdk.m4 +++ b/common/autoconf/boot-jdk.m4 @@ -350,8 +350,23 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], AC_MSG_CHECKING([flags for boot jdk java command] ) + # Disable special log output when a debug build is used as Boot JDK... + ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA]) + + # Apply user provided options. + ADD_JVM_ARG_IF_OK([$with_boot_jdk_jvmargs],boot_jdk_jvmargs,[$JAVA]) + + AC_MSG_RESULT([$boot_jdk_jvmargs]) + + # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs + JAVA_FLAGS=$boot_jdk_jvmargs + AC_SUBST(JAVA_FLAGS) + + + AC_MSG_CHECKING([flags for boot jdk java command for big workloads]) + # Starting amount of heap memory. - ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA]) + ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) # Maximum amount of heap memory. # Maximum stack size. @@ -366,20 +381,24 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], JVM_MAX_HEAP=1600M STACK_SIZE=1536 fi - ADD_JVM_ARG_IF_OK([-Xmx$JVM_MAX_HEAP],boot_jdk_jvmargs,[$JAVA]) - ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA]) + ADD_JVM_ARG_IF_OK([-Xmx$JVM_MAX_HEAP],boot_jdk_jvmargs_big,[$JAVA]) + ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs_big,[$JAVA]) - # Disable special log output when a debug build is used as Boot JDK... - ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA]) + AC_MSG_RESULT([$boot_jdk_jvmargs_big]) - # Apply user provided options. - ADD_JVM_ARG_IF_OK([$with_boot_jdk_jvmargs],boot_jdk_jvmargs,[$JAVA]) + JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big + AC_SUBST(JAVA_FLAGS_BIG) - AC_MSG_RESULT([$boot_jdk_jvmargs]) - # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs - JAVA_FLAGS=$boot_jdk_jvmargs + AC_MSG_CHECKING([flags for boot jdk java command for small workloads]) + + # Use serial gc for small short lived tools if possible + ADD_JVM_ARG_IF_OK([-XX:+UseSerialGC],boot_jdk_jvmargs_small,[$JAVA]) + ADD_JVM_ARG_IF_OK([-Xms32M],boot_jdk_jvmargs_small,[$JAVA]) + ADD_JVM_ARG_IF_OK([-Xmx512M],boot_jdk_jvmargs_small,[$JAVA]) + + AC_MSG_RESULT([$boot_jdk_jvmargs_small]) - AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs) - AC_SUBST(JAVA_FLAGS, $JAVA_FLAGS) + JAVA_FLAGS_SMALL=$boot_jdk_jvmargs_small + AC_SUBST(JAVA_FLAGS_SMALL) ]) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index 613afc319a1cef6d3e5f553265a29712db381801..bcfa1777bcfb8ff1f09b2369ebdcb996f82df4b8 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -133,6 +133,26 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], C_FLAG_REORDER='' CXX_FLAG_REORDER='' + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # Linking is different on MacOSX + SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" + SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' + SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" + SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' + SET_SHARED_LIBRARY_MAPFILE='' + else + # Default works for linux, might work on other platforms as well. + SHARED_LIBRARY_FLAGS='-shared' + SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1' + SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN" + SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1' + SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1' + fi + elif test "x$TOOLCHAIN_TYPE" = xclang; then + PICFLAG='' + C_FLAG_REORDER='' + CXX_FLAG_REORDER='' + if test "x$OPENJDK_TARGET_OS" = xmacosx; then # Linking is different on MacOSX SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" @@ -242,6 +262,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], # Generate make dependency files if test "x$TOOLCHAIN_TYPE" = xgcc; then C_FLAG_DEPS="-MMD -MF" + elif test "x$TOOLCHAIN_TYPE" = xclang; then + C_FLAG_DEPS="-MMD -MF" elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then C_FLAG_DEPS="-xMMD -xMF" elif test "x$TOOLCHAIN_TYPE" = xxlc; then @@ -260,6 +282,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], CFLAGS_DEBUG_SYMBOLS="-g" CXXFLAGS_DEBUG_SYMBOLS="-g" fi + elif test "x$TOOLCHAIN_TYPE" = xclang; then + CFLAGS_DEBUG_SYMBOLS="-g" + CXXFLAGS_DEBUG_SYMBOLS="-g" elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then CFLAGS_DEBUG_SYMBOLS="-g -xs" CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" @@ -315,6 +340,20 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], C_O_FLAG_NORM="-O2" C_O_FLAG_NONE="-O0" fi + elif test "x$TOOLCHAIN_TYPE" = xclang; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # On MacOSX we optimize for size, something + # we should do for all platforms? + C_O_FLAG_HIGHEST="-Os" + C_O_FLAG_HI="-Os" + C_O_FLAG_NORM="-Os" + C_O_FLAG_NONE="" + else + C_O_FLAG_HIGHEST="-O3" + C_O_FLAG_HI="-O3" + C_O_FLAG_NORM="-O2" + C_O_FLAG_NONE="-O0" + fi elif test "x$TOOLCHAIN_TYPE" = xxlc; then C_O_FLAG_HIGHEST="-O3" C_O_FLAG_HI="-O3 -qstrict" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 7473edb634ffa15be9d11caa2ad45627fdc41454..b3d823b29ede9da7ff940a2d581053ebcc38889e 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -653,6 +653,9 @@ LIBDL LIBM LIBZIP_CAN_USE_MMAP USE_EXTERNAL_LIBZ +USE_EXTERNAL_LIBPNG +PNG_LIBS +PNG_CFLAGS USE_EXTERNAL_LIBGIF USE_EXTERNAL_LIBJPEG ALSA_LIBS @@ -793,8 +796,9 @@ JAXWS_TOPDIR JAXP_TOPDIR CORBA_TOPDIR LANGTOOLS_TOPDIR +JAVA_FLAGS_SMALL +JAVA_FLAGS_BIG JAVA_FLAGS -BOOT_JDK_JVMARGS JAVAC_FLAGS BOOT_JDK_SOURCETARGET JARSIGNER @@ -1071,6 +1075,7 @@ with_alsa with_alsa_include with_alsa_lib with_giflib +with_libpng with_zlib with_stdc__lib with_msvcr_dll @@ -1183,6 +1188,8 @@ FREETYPE_CFLAGS FREETYPE_LIBS ALSA_CFLAGS ALSA_LIBS +PNG_CFLAGS +PNG_LIBS LIBFFI_CFLAGS LIBFFI_LIBS CCACHE' @@ -1921,6 +1928,8 @@ Optional Packages: --with-alsa-lib specify directory for the alsa library --with-giflib use giflib from build system or OpenJDK source (system, bundled) [bundled] + --with-libpng use libpng from build system or OpenJDK source + (system, bundled) [bundled] --with-zlib use zlib from build system or OpenJDK source (system, bundled) [bundled] --with-stdc++lib=,, @@ -2045,6 +2054,8 @@ Some influential environment variables: linker flags for FREETYPE, overriding pkg-config ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config ALSA_LIBS linker flags for ALSA, overriding pkg-config + PNG_CFLAGS C compiler flags for PNG, overriding pkg-config + PNG_LIBS linker flags for PNG, overriding pkg-config LIBFFI_CFLAGS C compiler flags for LIBFFI, overriding pkg-config LIBFFI_LIBS linker flags for LIBFFI, overriding pkg-config @@ -4221,7 +4232,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1394011255 +DATE_WHEN_GENERATED=1394794899 ############################################################################### # @@ -25856,6 +25867,51 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for boot jdk java command " >&5 $as_echo_n "checking flags for boot jdk java command ... " >&6; } + # Disable special log output when a debug build is used as Boot JDK... + + $ECHO "Check if jvm arg is ok: -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" >&5 + $ECHO "Command: $JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version" >&5 + OUTPUT=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + + # Apply user provided options. + + $ECHO "Check if jvm arg is ok: $with_boot_jdk_jvmargs" >&5 + $ECHO "Command: $JAVA $with_boot_jdk_jvmargs -version" >&5 + OUTPUT=`$JAVA $with_boot_jdk_jvmargs -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs="$boot_jdk_jvmargs $with_boot_jdk_jvmargs" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boot_jdk_jvmargs" >&5 +$as_echo "$boot_jdk_jvmargs" >&6; } + + # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs + JAVA_FLAGS=$boot_jdk_jvmargs + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for boot jdk java command for big workloads" >&5 +$as_echo_n "checking flags for boot jdk java command for big workloads... " >&6; } + # Starting amount of heap memory. $ECHO "Check if jvm arg is ok: -Xms64M" >&5 @@ -25864,7 +25920,7 @@ $as_echo_n "checking flags for boot jdk java command ... " >&6; } FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -Xms64M" + boot_jdk_jvmargs_big="$boot_jdk_jvmargs_big -Xms64M" JVM_ARG_OK=true else $ECHO "Arg failed:" >&5 @@ -25893,7 +25949,7 @@ $as_echo_n "checking flags for boot jdk java command ... " >&6; } FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -Xmx$JVM_MAX_HEAP" + boot_jdk_jvmargs_big="$boot_jdk_jvmargs_big -Xmx$JVM_MAX_HEAP" JVM_ARG_OK=true else $ECHO "Arg failed:" >&5 @@ -25908,7 +25964,7 @@ $as_echo_n "checking flags for boot jdk java command ... " >&6; } FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:ThreadStackSize=$STACK_SIZE" + boot_jdk_jvmargs_big="$boot_jdk_jvmargs_big -XX:ThreadStackSize=$STACK_SIZE" JVM_ARG_OK=true else $ECHO "Arg failed:" >&5 @@ -25917,15 +25973,25 @@ $as_echo_n "checking flags for boot jdk java command ... " >&6; } fi - # Disable special log output when a debug build is used as Boot JDK... + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boot_jdk_jvmargs_big" >&5 +$as_echo "$boot_jdk_jvmargs_big" >&6; } - $ECHO "Check if jvm arg is ok: -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" >&5 - $ECHO "Command: $JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version" >&5 - OUTPUT=`$JAVA -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput -version 2>&1` + JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking flags for boot jdk java command for small workloads" >&5 +$as_echo_n "checking flags for boot jdk java command for small workloads... " >&6; } + + # Use serial gc for small short lived tools if possible + + $ECHO "Check if jvm arg is ok: -XX:+UseSerialGC" >&5 + $ECHO "Command: $JAVA -XX:+UseSerialGC -version" >&5 + OUTPUT=`$JAVA -XX:+UseSerialGC -version 2>&1` FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs -XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput" + boot_jdk_jvmargs_small="$boot_jdk_jvmargs_small -XX:+UseSerialGC" JVM_ARG_OK=true else $ECHO "Arg failed:" >&5 @@ -25934,15 +26000,13 @@ $as_echo_n "checking flags for boot jdk java command ... " >&6; } fi - # Apply user provided options. - - $ECHO "Check if jvm arg is ok: $with_boot_jdk_jvmargs" >&5 - $ECHO "Command: $JAVA $with_boot_jdk_jvmargs -version" >&5 - OUTPUT=`$JAVA $with_boot_jdk_jvmargs -version 2>&1` + $ECHO "Check if jvm arg is ok: -Xms32M" >&5 + $ECHO "Command: $JAVA -Xms32M -version" >&5 + OUTPUT=`$JAVA -Xms32M -version 2>&1` FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then - boot_jdk_jvmargs="$boot_jdk_jvmargs $with_boot_jdk_jvmargs" + boot_jdk_jvmargs_small="$boot_jdk_jvmargs_small -Xms32M" JVM_ARG_OK=true else $ECHO "Arg failed:" >&5 @@ -25951,15 +26015,25 @@ $as_echo_n "checking flags for boot jdk java command ... " >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boot_jdk_jvmargs" >&5 -$as_echo "$boot_jdk_jvmargs" >&6; } + $ECHO "Check if jvm arg is ok: -Xmx512M" >&5 + $ECHO "Command: $JAVA -Xmx512M -version" >&5 + OUTPUT=`$JAVA -Xmx512M -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + boot_jdk_jvmargs_small="$boot_jdk_jvmargs_small -Xmx512M" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi - # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs - JAVA_FLAGS=$boot_jdk_jvmargs - BOOT_JDK_JVMARGS=$boot_jdk_jvmargs + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boot_jdk_jvmargs_small" >&5 +$as_echo "$boot_jdk_jvmargs_small" >&6; } - JAVA_FLAGS=$JAVA_FLAGS + JAVA_FLAGS_SMALL=$boot_jdk_jvmargs_small @@ -26297,8 +26371,28 @@ fi # Use indirect variable referencing toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS VALID_TOOLCHAINS=${!toolchain_var_name} - # First toolchain type in the list is the default - DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} + + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # On Mac OS X, default toolchain to clang after Xcode 5 + XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1` + $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null + if test $? -ne 0; then + as_fn_error $? "Failed to determine Xcode version." "$LINENO" 5 + fi + XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ + $SED -e 's/^Xcode \([1-9][0-9.]*\)/\1/' | \ + $CUT -f 1 -d .` + { $as_echo "$as_me:${as_lineno-$LINENO}: Xcode major version: $XCODE_MAJOR_VERSION" >&5 +$as_echo "$as_me: Xcode major version: $XCODE_MAJOR_VERSION" >&6;} + if test $XCODE_MAJOR_VERSION -ge 5; then + DEFAULT_TOOLCHAIN="clang" + else + DEFAULT_TOOLCHAIN="gcc" + fi + else + # First toolchain type in the list is the default + DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} + fi if test "x$with_toolchain_type" = xlist; then # List all toolchains @@ -41221,6 +41315,26 @@ $as_echo "$ac_cv_c_bigendian" >&6; } C_FLAG_REORDER='' CXX_FLAG_REORDER='' + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # Linking is different on MacOSX + SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" + SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' + SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" + SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1' + SET_SHARED_LIBRARY_MAPFILE='' + else + # Default works for linux, might work on other platforms as well. + SHARED_LIBRARY_FLAGS='-shared' + SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1' + SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN" + SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1' + SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1' + fi + elif test "x$TOOLCHAIN_TYPE" = xclang; then + PICFLAG='' + C_FLAG_REORDER='' + CXX_FLAG_REORDER='' + if test "x$OPENJDK_TARGET_OS" = xmacosx; then # Linking is different on MacOSX SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" @@ -41297,6 +41411,8 @@ $as_echo "$ac_cv_c_bigendian" >&6; } # Generate make dependency files if test "x$TOOLCHAIN_TYPE" = xgcc; then C_FLAG_DEPS="-MMD -MF" + elif test "x$TOOLCHAIN_TYPE" = xclang; then + C_FLAG_DEPS="-MMD -MF" elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then C_FLAG_DEPS="-xMMD -xMF" elif test "x$TOOLCHAIN_TYPE" = xxlc; then @@ -41315,6 +41431,9 @@ $as_echo "$ac_cv_c_bigendian" >&6; } CFLAGS_DEBUG_SYMBOLS="-g" CXXFLAGS_DEBUG_SYMBOLS="-g" fi + elif test "x$TOOLCHAIN_TYPE" = xclang; then + CFLAGS_DEBUG_SYMBOLS="-g" + CXXFLAGS_DEBUG_SYMBOLS="-g" elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then CFLAGS_DEBUG_SYMBOLS="-g -xs" CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" @@ -41370,6 +41489,20 @@ $as_echo "$ac_cv_c_bigendian" >&6; } C_O_FLAG_NORM="-O2" C_O_FLAG_NONE="-O0" fi + elif test "x$TOOLCHAIN_TYPE" = xclang; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # On MacOSX we optimize for size, something + # we should do for all platforms? + C_O_FLAG_HIGHEST="-Os" + C_O_FLAG_HI="-Os" + C_O_FLAG_NORM="-Os" + C_O_FLAG_NONE="" + else + C_O_FLAG_HIGHEST="-O3" + C_O_FLAG_HI="-O3" + C_O_FLAG_NORM="-O2" + C_O_FLAG_NONE="-O0" + fi elif test "x$TOOLCHAIN_TYPE" = xxlc; then C_O_FLAG_HIGHEST="-O3" C_O_FLAG_HI="-O3 -qstrict" @@ -46789,6 +46922,118 @@ fi fi + ############################################################################### + # + # Check for the png library + # + + +# Check whether --with-libpng was given. +if test "${with_libpng+set}" = set; then : + withval=$with_libpng; +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for which libpng to use" >&5 +$as_echo_n "checking for which libpng to use... " >&6; } + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5 +$as_echo "bundled" >&6; } + elif test "x${with_libpng}" = "xsystem"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PNG" >&5 +$as_echo_n "checking for PNG... " >&6; } + +if test -n "$PNG_CFLAGS"; then + pkg_cv_PNG_CFLAGS="$PNG_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PNG_CFLAGS=`$PKG_CONFIG --cflags "libpng" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PNG_LIBS"; then + pkg_cv_PNG_LIBS="$PNG_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpng\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpng") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PNG_LIBS=`$PKG_CONFIG --libs "libpng" 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 + PNG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpng" 2>&1` + else + PNG_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpng" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PNG_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + LIBPNG_FOUND=no +elif test $pkg_failed = untried; then + LIBPNG_FOUND=no +else + PNG_CFLAGS=$pkg_cv_PNG_CFLAGS + PNG_LIBS=$pkg_cv_PNG_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LIBPNG_FOUND=yes +fi + if test "x${LIBPNG_FOUND}" = "xyes"; then + USE_EXTERNAL_LIBPNG=true + { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 +$as_echo "system" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: system not found" >&5 +$as_echo "system not found" >&6; } + as_fn_error $? "--with-libpng=system specified, but no libpng found!" "$LINENO" 5 + fi + else + as_fn_error $? "Invalid value of --with-libpng: ${with_libpng}, use 'system' or 'bundled'" "$LINENO" 5 + fi + + ############################################################################### # # Check for the zlib library diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 index 685e9a903c6836c375f58305825f83591bba228e..6dca4aad3c664376244e2f4e937aeafc2a97a639 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -652,6 +652,46 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], fi AC_SUBST(USE_EXTERNAL_LIBGIF) + ############################################################################### + # + # Check for the png library + # + + 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) + ############################################################################### # # Check for the zlib library diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 81dc5a99a813e8fe30f0598c2e594682798fd0d2..fe5fb1be8d8d99951caf4d5eae641751ca88828f 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -254,7 +254,6 @@ BUILD_HOTSPOT=@BUILD_HOTSPOT@ # The boot jdk to use BOOT_JDK:=@BOOT_JDK@ -BOOT_JDK_JVMARGS:=@BOOT_JDK_JVMARGS@ BOOT_RTJAR:=@BOOT_RTJAR@ BOOT_TOOLSJAR=$(BOOT_JDK)/lib/tools.jar @@ -442,8 +441,11 @@ POST_STRIP_CMD:=@POST_STRIP_CMD@ POST_MCS_CMD:=@POST_MCS_CMD@ JAVA_FLAGS:=@JAVA_FLAGS@ +JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@ +JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@ -JAVA=@FIXPATH@ @JAVA@ $(JAVA_FLAGS) +JAVA=@FIXPATH@ @JAVA@ $(JAVA_FLAGS_BIG) $(JAVA_FLAGS) +JAVA_SMALL=@FIXPATH@ @JAVA@ $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS) JAVAC:=@FIXPATH@ @JAVAC@ # Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid @@ -454,7 +456,7 @@ JAVAH:=@FIXPATH@ @JAVAH@ JAR:=@FIXPATH@ @JAR@ -NATIVE2ASCII:=@FIXPATH@ @NATIVE2ASCII@ +NATIVE2ASCII:=@FIXPATH@ @NATIVE2ASCII@ $(addprefix -J, $(JAVA_FLAGS_SMALL)) JARSIGNER:=@FIXPATH@ @JARSIGNER@ @@ -645,6 +647,15 @@ INSTALL_SHAREDSTATEDIR=@sharedstatedir@ # Read-only single-machine data INSTALL_SYSCONFDIR=@sysconfdir@ +#################################################### +# +# Libraries +# + +USE_EXTERNAL_LIBPNG:=@USE_EXTERNAL_LIBPNG@ +PNG_LIBS:=@PNG_LIBS@ +PNG_CFLAGS:=@PNG_CFLAGS@ + #################################################### # diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 7110d78320516718bfd18092349ed1f8cbd455c5..ba57a850219dac9540e687cb54d551bfe575d411 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -96,8 +96,27 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE], # Use indirect variable referencing toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS VALID_TOOLCHAINS=${!toolchain_var_name} - # First toolchain type in the list is the default - DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} + + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # On Mac OS X, default toolchain to clang after Xcode 5 + XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1` + $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null + if test $? -ne 0; then + AC_MSG_ERROR([Failed to determine Xcode version.]) + fi + XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ + $SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \ + $CUT -f 1 -d .` + AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION]) + if test $XCODE_MAJOR_VERSION -ge 5; then + DEFAULT_TOOLCHAIN="clang" + else + DEFAULT_TOOLCHAIN="gcc" + fi + else + # First toolchain type in the list is the default + DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} + fi if test "x$with_toolchain_type" = xlist; then # List all toolchains diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index c2dd54b2be587e88a76b4d7436dd7eb36b1dae23..5b3f23741dd752833ed6544bf3ecd81f884834e7 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -143,6 +143,9 @@ define SetupArchive ifneq (,$2) $1_DEPS:=$2 else + # Add all source roots to the find cache since we are likely going to run find + # on these more than once. The cache will only be updated if necessary. + $$(eval $$(call FillCacheFind, $$($1_FIND_LIST))) $1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \ $$(call CacheFind,$$($1_SRCS))) ifneq (,$$($1_GREP_INCLUDE_PATTERNS)) @@ -158,6 +161,10 @@ define SetupArchive $1_DEPS+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS)))) endif endif + # The dependency list should never be empty + ifeq ($$(strip $$($1_DEPS)), ) + $$(warning No dependencies found for $1) + endif # Utility macros, to make the shell script receipt somewhat easier to decipher. @@ -336,7 +343,20 @@ endef # Previously this was inconsistently done in different repositories. # This is the new clean standard. Though it is to be superseded by # a standard annotation processor from with sjavac. -define add_file_to_copy_and_clean +# +# The sed expression does this: +# 1. Add a backslash before any :, = or ! that do not have a backslash already. +# 2. Apply the file unicode2x.sed which does a whole bunch of \u00XX to \xXX +# conversions. +# 3. Delete all lines starting with #. +# 4. Delete empty lines. +# 5. Append lines ending with \ with the next line. +# 6. Remove leading and trailing white space. +# 7. Replace the first \= with just =. +# 8. Finally it's all sorted to create a stable output. +# +# It is assumed that = is the character used for separating names and values. +define add_file_to_clean # param 1 = BUILD_MYPACKAGE # parma 2 = The source file to copy and clean. $2_TARGET:=$2 @@ -345,12 +365,13 @@ define add_file_to_copy_and_clean # Now we can setup the depency that will trigger the copying. $$($1_BIN)$$($2_TARGET) : $2 $(MKDIR) -p $$(@D) - $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ + $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \ + -e 's/\([^\\]\)!/\1\\!/g' -e 's/#.*/#/g' \ | $(SED) -f "$(SRC_ROOT)/make/common/support/unicode2x.sed" \ | $(SED) -e '/^#/d' -e '/^$$$$/d' \ -e :a -e '/\\$$$$/N; s/\\\n//; ta' \ -e 's/^[ \t]*//;s/[ \t]*$$$$//' \ - -e 's/\\=/=/' | LANG=C $(SORT) > $$@ + -e 's/\\=/=/' | LC_ALL=C $(SORT) > $$@ $(CHMOD) -f ug+w $$@ # And do not forget this target @@ -376,8 +397,9 @@ define SetupJavaCompilation # INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages. # EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages. # COPY:=.prp means copy all prp files to the corresponding package in BIN. - # CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN. # COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo + # CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN. + # CLEAN_FILES:=myapp/foo/setting.txt means clean this file over to the package myapp/foo # SRCZIP:=Create a src.zip based on the found sources and copied files. # INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file! # EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file! @@ -405,6 +427,9 @@ define SetupJavaCompilation # Make sure the dirs exist. $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d))) $$(eval $$(call MakeDir,$$($1_BIN))) + # Add all source roots to the find cache since we are likely going to run find + # on these more than once. The cache will only be updated if necessary. + $$(eval $$(call FillCacheFind,$$($1_SRC))) # Find all files in the source trees. $1_ALL_SRCS += $$(filter-out $(OVR_SRCS),$$(call CacheFind,$$($1_SRC))) # Extract the java files. @@ -437,7 +462,7 @@ define SetupJavaCompilation endif # Find all files to be copied from source to bin. - ifneq (,$$($1_COPY)) + ifneq (,$$($1_COPY)$$($1_COPY_FILES)) # Search for all files to be copied. $1_ALL_COPIES := $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS)) # Copy these explicitly @@ -452,20 +477,22 @@ define SetupJavaCompilation ifneq (,$$($1_EXCLUDE_FILES)) $1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES)) endif - # All files below META-INF are always copied. - $1_ALL_COPIES += $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) - ifneq (,$$($1_ALL_COPIES)) - # Yep, there are files to be copied! - $1_ALL_COPY_TARGETS:= - $$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i))) - # Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files! - endif + endif + # All files below META-INF are always copied. + $1_ALL_COPIES += $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) + ifneq (,$$($1_ALL_COPIES)) + # Yep, there are files to be copied! + $1_ALL_COPY_TARGETS:= + $$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i))) + # Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files! endif # Find all property files to be copied and cleaned from source to bin. - ifneq (,$$($1_CLEAN)) + ifneq (,$$($1_CLEAN)$$($1_CLEAN_FILES)) # Search for all files to be copied. $1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS)) + # Clean these explicitly + $1_ALL_CLEANS += $$($1_CLEAN_FILES) # Copy and clean must also respect filters. ifneq (,$$($1_INCLUDES)) $1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS)) @@ -479,7 +506,7 @@ define SetupJavaCompilation ifneq (,$$($1_ALL_CLEANS)) # Yep, there are files to be copied and cleaned! $1_ALL_COPY_CLEAN_TARGETS:= - $$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_copy_and_clean,$1,$$i))) + $$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_clean,$1,$$i))) # Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files! endif endif diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index 2b276c6f1fb959ab717b38089cb750f8884c2ede..ca183ad3b86aee32b96e0b290313f01c5e2cf4c9 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -380,11 +380,23 @@ ifeq ($(OPENJDK_TARGET_OS),solaris) # On Solaris, if the target is a symlink and exists, cp won't overwrite. # Cp has to operate in recursive mode to allow for -P flag, to preserve soft links. If the # name of the target file differs from the source file, rename after copy. + # If the source and target parent directories are the same, recursive copy doesn't work + # so we fall back on regular copy, which isn't preserving symlinks. define install-file $(MKDIR) -p $(@D) $(RM) '$@' - $(CP) -f -r -P '$<' '$(@D)' - if [ "$(@F)" != "$(