Merge
This commit is contained in:
commit
eb95b252c0
@ -249,3 +249,4 @@ fd8d51bdf9aadf7ae83e65e8655c53581017c363 jdk9-b03
|
||||
cb4c3440bc2748101923e2488506e61009ab1bf5 jdk9-b04
|
||||
8c63f0b6ada282f27e3a80125e53c3be603f9af7 jdk9-b05
|
||||
d0b525cd31b87abeb6d5b7e3516953eeb13b323c jdk9-b06
|
||||
0ea015c298b201c07fa33990f2445b6d0ef3566d jdk9-b07
|
||||
|
@ -46,10 +46,24 @@ AC_DEFUN([ADD_JVM_ARG_IF_OK],
|
||||
# Appends a string to a path variable, only adding the : when needed.
|
||||
AC_DEFUN([BASIC_APPEND_TO_PATH],
|
||||
[
|
||||
if test "x[$]$1" = x; then
|
||||
$1="$2"
|
||||
else
|
||||
$1="[$]$1:$2"
|
||||
if test "x$2" != x; then
|
||||
if test "x[$]$1" = x; then
|
||||
$1="$2"
|
||||
else
|
||||
$1="[$]$1:$2"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
# Prepends a string to a path variable, only adding the : when needed.
|
||||
AC_DEFUN([BASIC_PREPEND_TO_PATH],
|
||||
[
|
||||
if test "x$2" != x; then
|
||||
if test "x[$]$1" = x; then
|
||||
$1="$2"
|
||||
else
|
||||
$1="$2:[$]$1"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
@ -442,43 +456,95 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
|
||||
|
||||
# Locate the directory of this script.
|
||||
AUTOCONF_DIR=$TOPDIR/common/autoconf
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
|
||||
[
|
||||
AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
|
||||
[use this devkit for compilers, tools and resources])],
|
||||
[
|
||||
BASIC_FIXUP_PATH([with_devkit])
|
||||
DEVKIT_ROOT="$with_devkit"
|
||||
# Check for a meta data info file in the root of the devkit
|
||||
if test -f "$DEVKIT_ROOT/devkit.info"; then
|
||||
# This potentially sets the following:
|
||||
# DEVKIT_NAME: A descriptive name of the devkit
|
||||
# DEVKIT_TOOLCHAIN_PATH: Corresponds to --with-toolchain-path
|
||||
# DEVKIT_EXTRA_PATH: Corresponds to --with-extra-path
|
||||
# DEVKIT_SYSROOT: Corresponds to --with-sysroot
|
||||
. $DEVKIT_ROOT/devkit.info
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for devkit])
|
||||
if test "x$DEVKIT_NAME" != x; then
|
||||
AC_MSG_RESULT([$DEVKIT_NAME in $DEVKIT_ROOT])
|
||||
else
|
||||
AC_MSG_RESULT([$DEVKIT_ROOT])
|
||||
fi
|
||||
|
||||
if test "x$DEVKIT_EXTRA_PATH" != x; then
|
||||
BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH)
|
||||
fi
|
||||
|
||||
# Fallback default of just /bin if DEVKIT_PATH is not defined
|
||||
if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
|
||||
DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin"
|
||||
fi
|
||||
BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$DEVKIT_TOOLCHAIN_PATH)
|
||||
|
||||
# If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known
|
||||
# places for backwards compatiblity.
|
||||
if test "x$DEVKIT_SYSROOT" != x; then
|
||||
SYSROOT="$DEVKIT_SYSROOT"
|
||||
elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then
|
||||
SYSROOT="$DEVKIT_ROOT/$host_alias/libc"
|
||||
elif test -d "$DEVKIT_ROOT/$host/sys-root"; then
|
||||
SYSROOT="$DEVKIT_ROOT/$host/sys-root"
|
||||
fi
|
||||
]
|
||||
)
|
||||
|
||||
# You can force the sysroot if the sysroot encoded into the compiler tools
|
||||
# is not correct.
|
||||
AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root],
|
||||
[alias for --with-sysroot for backwards compatability])],
|
||||
[SYSROOT=$with_sys_root]
|
||||
)
|
||||
|
||||
AC_ARG_WITH(sysroot, [AS_HELP_STRING([--with-sysroot],
|
||||
[use this directory as sysroot)])],
|
||||
[SYSROOT=$with_sysroot]
|
||||
)
|
||||
|
||||
AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
|
||||
[alias for --with-toolchain-path for backwards compatibility])],
|
||||
[BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$with_tools_dir)]
|
||||
)
|
||||
|
||||
AC_ARG_WITH([toolchain-path], [AS_HELP_STRING([--with-toolchain-path],
|
||||
[prepend these directories when searching for toolchain binaries (compilers etc)])],
|
||||
[BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$with_toolchain_path)]
|
||||
)
|
||||
|
||||
AC_ARG_WITH([extra-path], [AS_HELP_STRING([--with-extra-path],
|
||||
[prepend these directories to the default path])],
|
||||
[BASIC_PREPEND_TO_PATH([EXTRA_PATH],$with_extra_path)]
|
||||
)
|
||||
|
||||
# Prepend the extra path to the global path
|
||||
BASIC_PREPEND_TO_PATH([PATH],$EXTRA_PATH)
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
|
||||
# Add extra search paths on solaris for utilities like ar and as etc...
|
||||
PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
|
||||
fi
|
||||
|
||||
# You can force the sys-root if the sys-root encoded into the cross compiler tools
|
||||
# is not correct.
|
||||
AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root],
|
||||
[pass this sys-root to the compilers and tools (for cross-compiling)])])
|
||||
|
||||
if test "x$with_sys_root" != x; then
|
||||
SYS_ROOT=$with_sys_root
|
||||
else
|
||||
SYS_ROOT=/
|
||||
fi
|
||||
AC_SUBST(SYS_ROOT)
|
||||
|
||||
AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
|
||||
[search this directory for compilers and tools (for cross-compiling)])],
|
||||
[TOOLS_DIR=$with_tools_dir]
|
||||
)
|
||||
|
||||
AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
|
||||
[use this directory as base for tools-dir and sys-root (for cross-compiling)])],
|
||||
[
|
||||
if test "x$with_sys_root" != x; then
|
||||
AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time])
|
||||
fi
|
||||
BASIC_FIXUP_PATH([with_devkit])
|
||||
BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin)
|
||||
if test -d "$with_devkit/$host_alias/libc"; then
|
||||
SYS_ROOT=$with_devkit/$host_alias/libc
|
||||
elif test -d "$with_devkit/$host/sys-root"; then
|
||||
SYS_ROOT=$with_devkit/$host/sys-root
|
||||
fi
|
||||
])
|
||||
AC_MSG_CHECKING([for sysroot])
|
||||
AC_MSG_RESULT([$SYSROOT])
|
||||
AC_MSG_CHECKING([for toolchain path])
|
||||
AC_MSG_RESULT([$TOOLCHAIN_PATH])
|
||||
AC_MSG_CHECKING([for extra path])
|
||||
AC_MSG_RESULT([$EXTRA_PATH])
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
|
||||
@ -648,10 +714,10 @@ AC_DEFUN([BASIC_CHECK_GNU_MAKE],
|
||||
fi
|
||||
|
||||
if test "x$FOUND_MAKE" = x; then
|
||||
if test "x$TOOLS_DIR" != x; then
|
||||
# We have a tools-dir, check that as well before giving up.
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
# We have a toolchain path, check that as well before giving up.
|
||||
OLD_PATH=$PATH
|
||||
PATH=$TOOLS_DIR:$PATH
|
||||
PATH=$TOOLCHAIN_PATH:$PATH
|
||||
AC_PATH_PROGS(CHECK_TOOLSDIR_GMAKE, gmake)
|
||||
BASIC_CHECK_MAKE_VERSION("$CHECK_TOOLSDIR_GMAKE", [gmake in tools-dir])
|
||||
if test "x$FOUND_MAKE" = x; then
|
||||
|
10
common/autoconf/build-aux/config.guess
vendored
10
common/autoconf/build-aux/config.guess
vendored
@ -76,4 +76,14 @@ if test $? = 0; then
|
||||
OUT=powerpc$KERNEL_BITMODE`echo $OUT | sed -e 's/[^-]*//'`
|
||||
fi
|
||||
|
||||
# Test and fix little endian PowerPC64.
|
||||
# TODO: should be handled by autoconf-config.guess.
|
||||
if [ "x$OUT" = x ]; then
|
||||
if [ `uname -m` = ppc64le ]; then
|
||||
if [ `uname -s` = Linux ]; then
|
||||
OUT=powerpc64le-unknown-linux-gnu
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $OUT
|
||||
|
@ -169,8 +169,8 @@ AC_DEFUN([BPERF_SETUP_CCACHE],
|
||||
if test "x$enable_ccache" = xyes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
OLD_PATH="$PATH"
|
||||
if test "x$TOOLS_DIR" != x; then
|
||||
PATH=$TOOLS_DIR:$PATH
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
PATH=$TOOLCHAIN_PATH:$PATH
|
||||
fi
|
||||
BASIC_REQUIRE_PROGS(CCACHE, ccache)
|
||||
CCACHE_STATUS="enabled"
|
||||
|
@ -100,6 +100,9 @@ JDKOPT_SETUP_DEBUG_LEVEL
|
||||
# With basic setup done, call the custom early hook.
|
||||
CUSTOM_EARLY_HOOK
|
||||
|
||||
# Check if we have devkits, extra paths or sysroot set.
|
||||
BASIC_SETUP_DEVKIT
|
||||
|
||||
# To properly create a configuration name, we need to have the OpenJDK target
|
||||
# and options (variants and debug level) parsed.
|
||||
BASIC_SETUP_OUTPUT_DIR
|
||||
|
@ -119,6 +119,32 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
|
||||
# FIXME: likely bug, should be CCXXFLAGS_JDK? or one for C or CXX.
|
||||
CCXXFLAGS="$CCXXFLAGS -nologo"
|
||||
fi
|
||||
|
||||
if test "x$SYSROOT" != "x"; then
|
||||
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
# Solaris Studio does not have a concept of sysroot. Instead we must
|
||||
# make sure the default include and lib dirs are appended to each
|
||||
# compile and link command line.
|
||||
SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
|
||||
SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
|
||||
-L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
SYSROOT_CFLAGS="--sysroot=\"$SYSROOT\""
|
||||
SYSROOT_LDFLAGS="--sysroot=\"$SYSROOT\""
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
SYSROOT_CFLAGS="-isysroot \"$SYSROOT\""
|
||||
SYSROOT_LDFLAGS="-isysroot \"$SYSROOT\""
|
||||
fi
|
||||
# Propagate the sysroot args to hotspot
|
||||
LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
|
||||
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
|
||||
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
|
||||
fi
|
||||
AC_SUBST(SYSROOT_CFLAGS)
|
||||
AC_SUBST(SYSROOT_LDFLAGS)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
|
||||
@ -421,9 +447,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
|
||||
|
||||
# Hotspot needs these set in their legacy form
|
||||
LEGACY_EXTRA_CFLAGS=$with_extra_cflags
|
||||
LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags
|
||||
LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags
|
||||
LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags"
|
||||
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags"
|
||||
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags"
|
||||
|
||||
AC_SUBST(LEGACY_EXTRA_CFLAGS)
|
||||
AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
|
||||
@ -521,7 +547,13 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
|
||||
fi
|
||||
else
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
|
||||
# Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they
|
||||
# are defined in the system?
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN="
|
||||
else
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Setup target OS define. Use OS target name but in upper case.
|
||||
@ -735,4 +767,20 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
|
||||
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
|
||||
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
|
||||
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
|
||||
|
||||
case "${TOOLCHAIN_TYPE}" in
|
||||
microsoft)
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="/WX"
|
||||
;;
|
||||
solstudio)
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
|
||||
;;
|
||||
gcc)
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||
;;
|
||||
clang)
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
|
||||
])
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -200,6 +200,7 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
||||
printf "\n"
|
||||
printf "Configuration summary:\n"
|
||||
printf "* Debug level: $DEBUG_LEVEL\n"
|
||||
printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n"
|
||||
printf "* JDK variant: $JDK_VARIANT\n"
|
||||
printf "* JVM variants: $with_jvm_variants\n"
|
||||
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
|
||||
|
@ -176,6 +176,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
#
|
||||
# Set the debug level
|
||||
# release: no debug information, all optimizations, no asserts.
|
||||
# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
|
||||
# fastdebug: debug information (-g), all optimizations, all asserts
|
||||
# slowdebug: debug information (-g), no optimizations, all asserts
|
||||
#
|
||||
@ -189,7 +190,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
], [ENABLE_DEBUG="no"])
|
||||
|
||||
AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
|
||||
[set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])],
|
||||
[set the debug level (release, fastdebug, slowdebug, optimized (HotSpot build only)) @<:@release@:>@])],
|
||||
[
|
||||
DEBUG_LEVEL="${withval}"
|
||||
if test "x$ENABLE_DEBUG" = xyes; then
|
||||
@ -199,6 +200,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
AC_MSG_RESULT([$DEBUG_LEVEL])
|
||||
|
||||
if test "x$DEBUG_LEVEL" != xrelease && \
|
||||
test "x$DEBUG_LEVEL" != xoptimized && \
|
||||
test "x$DEBUG_LEVEL" != xfastdebug && \
|
||||
test "x$DEBUG_LEVEL" != xslowdebug; then
|
||||
AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
|
||||
@ -235,8 +237,30 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
HOTSPOT_DEBUG_LEVEL="jvmg"
|
||||
HOTSPOT_EXPORT="debug"
|
||||
;;
|
||||
optimized )
|
||||
VARIANT="OPT"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="false"
|
||||
BUILD_VARIANT_RELEASE="-optimized"
|
||||
HOTSPOT_DEBUG_LEVEL="optimized"
|
||||
HOTSPOT_EXPORT="optimized"
|
||||
;;
|
||||
esac
|
||||
|
||||
# The debug level 'optimized' is a little special because it is currently only
|
||||
# applicable to the HotSpot build where it means to build a completely
|
||||
# optimized version of the VM without any debugging code (like for the
|
||||
# 'release' debug level which is called 'product' in the HotSpot build) but
|
||||
# with the exception that it can contain additional code which is otherwise
|
||||
# protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
|
||||
# test new and/or experimental features which are not intended for customer
|
||||
# shipment. Because these new features need to be tested and benchmarked in
|
||||
# real world scenarios, we want to build the containing JDK at the 'release'
|
||||
# debug level.
|
||||
if test "x$DEBUG_LEVEL" = xoptimized; then
|
||||
DEBUG_LEVEL="release"
|
||||
fi
|
||||
|
||||
#####
|
||||
# Generate the legacy makefile targets for hotspot.
|
||||
# The hotspot api for selecting the build artifacts, really, needs to be improved.
|
||||
|
@ -110,21 +110,23 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
|
||||
# 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$SYS_ROOT" != "x/"; then
|
||||
if test "x$x_includes" = xNONE; then
|
||||
if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then
|
||||
x_includes="$SYS_ROOT/usr/X11R6/include"
|
||||
elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then
|
||||
x_includes="$SYS_ROOT/usr/include"
|
||||
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
|
||||
fi
|
||||
if test "x$x_libraries" = xNONE; then
|
||||
if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then
|
||||
x_libraries="$SYS_ROOT/usr/X11R6/lib"
|
||||
elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
x_libraries="$SYS_ROOT/usr/lib64"
|
||||
elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then
|
||||
x_libraries="$SYS_ROOT/usr/lib"
|
||||
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 "$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
|
||||
@ -146,9 +148,12 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
|
||||
|
||||
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_SUBST(OPENWIN_HOME)
|
||||
|
||||
|
||||
#
|
||||
# Weird Sol10 something check...TODO change to try compile
|
||||
@ -237,14 +242,14 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
|
||||
# Getting nervous now? Lets poke around for standard Solaris third-party
|
||||
# package installation locations.
|
||||
AC_MSG_CHECKING([for cups headers])
|
||||
if test -s /opt/sfw/cups/include/cups/cups.h; then
|
||||
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/opt/sfw/cups/include"
|
||||
elif test -s /opt/csw/include/cups/cups.h; then
|
||||
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/opt/csw/include"
|
||||
CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
|
||||
fi
|
||||
AC_MSG_RESULT([$CUPS_FOUND])
|
||||
fi
|
||||
@ -398,24 +403,27 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
fi
|
||||
fi
|
||||
|
||||
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
|
||||
# BDEPS_CHECK_MODULE 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)])
|
||||
# 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
|
||||
# BDEPS_CHECK_MODULE 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
|
||||
@ -433,21 +441,21 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
else
|
||||
if test "x$SYS_ROOT" = "x/"; then
|
||||
FREETYPE_ROOT=
|
||||
else
|
||||
FREETYPE_ROOT="$SYS_ROOT"
|
||||
fi
|
||||
FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
|
||||
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="$FREETYPE_ROOT/usr/X11"
|
||||
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="$FREETYPE_ROOT/usr"
|
||||
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
|
||||
@ -577,8 +585,11 @@ AC_DEFUN_ONCE([LIB_SETUP_ALSA],
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no])
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
|
||||
# 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],
|
||||
@ -917,7 +928,7 @@ AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP],
|
||||
|
||||
# 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="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
|
||||
LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
|
||||
fi
|
||||
|
||||
# TODO better (platform agnostic) test
|
||||
|
@ -60,6 +60,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=big
|
||||
;;
|
||||
powerpc64le)
|
||||
VAR_CPU=ppc64
|
||||
VAR_CPU_ARCH=ppc
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=little
|
||||
;;
|
||||
s390)
|
||||
VAR_CPU=s390
|
||||
VAR_CPU_ARCH=s390
|
||||
|
@ -130,10 +130,8 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
export LIB:=@VS_LIB@
|
||||
endif
|
||||
|
||||
# The sys root where standard headers and libraries are found.
|
||||
# Usually not needed since the configure script should have
|
||||
# taken it into account already when setting CFLAGS et al.
|
||||
SYS_ROOT:=@SYS_ROOT@
|
||||
SYSROOT_CFLAGS := @SYSROOT_CFLAGS@
|
||||
SYSROOT_LDFLAGS := @SYSROOT_LDFLAGS@
|
||||
|
||||
# Paths to the source code
|
||||
ADD_SRC_ROOT:=@ADD_SRC_ROOT@
|
||||
@ -294,7 +292,6 @@ RMICONNECTOR_IIOP=@RMICONNECTOR_IIOP@
|
||||
# Necessary additional compiler flags to compile X11
|
||||
X_CFLAGS:=@X_CFLAGS@
|
||||
X_LIBS:=@X_LIBS@
|
||||
OPENWIN_HOME:=@OPENWIN_HOME@
|
||||
|
||||
# The lowest required version of macosx to enforce compatiblity for
|
||||
MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
|
||||
@ -324,6 +321,8 @@ CXX_O_FLAG_NONE:=@CXX_O_FLAG_NONE@
|
||||
C_FLAG_DEPS:=@C_FLAG_DEPS@
|
||||
CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
|
||||
|
||||
CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
|
||||
|
||||
# Tools that potentially need to be cross compilation aware.
|
||||
CC:=@FIXPATH@ @CCACHE@ @CC@
|
||||
|
||||
|
@ -189,6 +189,12 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
|
||||
# it for DLL resolution in runtime.
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
|
||||
TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
|
||||
# Reset path to VS_PATH. It will include everything that was on PATH at the time we
|
||||
# ran TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV.
|
||||
PATH="$VS_PATH"
|
||||
# The microsoft toolchain also requires INCLUDE and LIB to be set.
|
||||
export INCLUDE="$VS_INCLUDE"
|
||||
export LIB="$VS_LIB"
|
||||
fi
|
||||
|
||||
# autoconf magic only relies on PATH, so update it if tools dir is specified
|
||||
@ -202,29 +208,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
|
||||
PATH="/usr/ccs/bin:$PATH"
|
||||
fi
|
||||
|
||||
# Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to
|
||||
# Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
|
||||
# override all other locations.
|
||||
if test "x$TOOLS_DIR" != x; then
|
||||
PATH=$TOOLS_DIR:$PATH
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
PATH=$TOOLCHAIN_PATH:$PATH
|
||||
fi
|
||||
|
||||
# If a devkit is found on the builddeps server, then prepend its path to the
|
||||
# PATH variable. If there are cross compilers available in the devkit, these
|
||||
# will be found by AC_PROG_CC et al.
|
||||
DEVKIT=
|
||||
BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
|
||||
[
|
||||
# Found devkit
|
||||
PATH="$DEVKIT/bin:$PATH"
|
||||
SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root"
|
||||
if test "x$x_includes" = "xNONE"; then
|
||||
x_includes="$SYS_ROOT/usr/include/X11"
|
||||
fi
|
||||
if test "x$x_libraries" = "xNONE"; then
|
||||
x_libraries="$SYS_ROOT/usr/lib"
|
||||
fi
|
||||
],
|
||||
[])
|
||||
])
|
||||
|
||||
# Restore path, etc
|
||||
@ -396,15 +384,15 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
|
||||
# used.
|
||||
|
||||
$1=
|
||||
# If TOOLS_DIR is set, check for all compiler names in there first
|
||||
# If TOOLCHAIN_PATH is set, check for all compiler names in there first
|
||||
# before checking the rest of the PATH.
|
||||
# FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION
|
||||
# step, this should not be necessary.
|
||||
if test -n "$TOOLS_DIR"; then
|
||||
if test -n "$TOOLCHAIN_PATH"; then
|
||||
PATH_save="$PATH"
|
||||
PATH="$TOOLS_DIR"
|
||||
AC_PATH_PROGS(TOOLS_DIR_$1, $SEARCH_LIST)
|
||||
$1=$TOOLS_DIR_$1
|
||||
PATH="$TOOLCHAIN_PATH"
|
||||
AC_PATH_PROGS(TOOLCHAIN_PATH_$1, $SEARCH_LIST)
|
||||
$1=$TOOLCHAIN_PATH_$1
|
||||
PATH="$PATH_save"
|
||||
fi
|
||||
|
||||
|
@ -141,46 +141,44 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
|
||||
|
||||
# Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
|
||||
AC_MSG_NOTICE([Trying to extract Visual Studio environment variables])
|
||||
cd $OUTPUT_ROOT
|
||||
# FIXME: The code betweeen ---- was inlined from a separate script and is not properly adapted
|
||||
# to autoconf standards.
|
||||
|
||||
#----
|
||||
# We need to create a couple of temporary files.
|
||||
VS_ENV_TMP_DIR="$OUTPUT_ROOT/vs-env"
|
||||
$MKDIR -p $VS_ENV_TMP_DIR
|
||||
|
||||
# Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment)
|
||||
# but calculate the difference in Cygwin environment before/after running it and then
|
||||
# apply the diff.
|
||||
# Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment).
|
||||
# Instead create a shell script which will set the relevant variables when run.
|
||||
WINPATH_VS_ENV_CMD="$VS_ENV_CMD"
|
||||
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_VS_ENV_CMD])
|
||||
WINPATH_BASH="$BASH"
|
||||
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH])
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then
|
||||
_vs10varsall=`cygpath -a -m -s "$VS_ENV_CMD"`
|
||||
_dosvs10varsall=`cygpath -a -w -s $_vs10varsall`
|
||||
_dosbash=`cygpath -a -w -s \`which bash\`.*`
|
||||
else
|
||||
_dosvs10varsall=`cmd //c echo $VS_ENV_CMD`
|
||||
_dosbash=`cmd //c echo \`which bash\``
|
||||
fi
|
||||
|
||||
# generate the set of exported vars before/after the vs10 setup
|
||||
$ECHO "@echo off" > localdevenvtmp.bat
|
||||
$ECHO "$_dosbash -c \"export -p\" > localdevenvtmp.export0" >> localdevenvtmp.bat
|
||||
$ECHO "call $_dosvs10varsall $VS_ENV_ARGS" >> localdevenvtmp.bat
|
||||
$ECHO "$_dosbash -c \"export -p\" > localdevenvtmp.export1" >> localdevenvtmp.bat
|
||||
# Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell
|
||||
# script (executable by bash) that will setup the important variables.
|
||||
EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat"
|
||||
$ECHO "@echo off" > $EXTRACT_VC_ENV_BAT_FILE
|
||||
# This will end up something like:
|
||||
# call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat
|
||||
$ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
# These will end up something like:
|
||||
# C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
|
||||
# The trailing space for everyone except PATH is no typo, but is needed due
|
||||
# to trailing \ in the Windows paths. These will be stripped later.
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
|
||||
|
||||
# Now execute the newly created bat file.
|
||||
# The | cat is to stop SetEnv.Cmd to mess with system colors on msys
|
||||
cmd /c localdevenvtmp.bat | cat
|
||||
|
||||
# apply the diff (less some non-vs10 vars named by "!")
|
||||
$SORT localdevenvtmp.export0 | $GREP -v "!" > localdevenvtmp.export0.sort
|
||||
$SORT localdevenvtmp.export1 | $GREP -v "!" > localdevenvtmp.export1.sort
|
||||
$COMM -1 -3 localdevenvtmp.export0.sort localdevenvtmp.export1.sort > localdevenv.sh
|
||||
|
||||
# cleanup
|
||||
$RM localdevenvtmp*
|
||||
#----
|
||||
# The | cat is to stop SetEnv.Cmd to mess with system colors on msys.
|
||||
# Change directory so we don't need to mess with Windows paths in redirects.
|
||||
cd $VS_ENV_TMP_DIR
|
||||
cmd /c extract-vs-env.bat | $CAT
|
||||
cd $CURDIR
|
||||
if test ! -s $OUTPUT_ROOT/localdevenv.sh; then
|
||||
AC_MSG_RESULT([no])
|
||||
|
||||
if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then
|
||||
AC_MSG_NOTICE([Could not succesfully extract the envionment variables needed for the VS setup.])
|
||||
AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation])
|
||||
AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.])
|
||||
@ -190,30 +188,36 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
|
||||
# Now set all paths and other env variables. This will allow the rest of
|
||||
# the configure script to find and run the compiler in the proper way.
|
||||
AC_MSG_NOTICE([Setting extracted environment variables])
|
||||
. $OUTPUT_ROOT/localdevenv.sh
|
||||
. $VS_ENV_TMP_DIR/set-vs-env.sh
|
||||
# Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we
|
||||
# also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR.
|
||||
else
|
||||
# We did not find a vsvars bat file, let's hope we are run from a VS command prompt.
|
||||
AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment])
|
||||
fi
|
||||
|
||||
# At this point, we should have corrent variables in the environment, or we can't continue.
|
||||
# At this point, we should have correct variables in the environment, or we can't continue.
|
||||
AC_MSG_CHECKING([for Visual Studio variables])
|
||||
|
||||
if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then
|
||||
if test "x$INCLUDE" = x || test "x$LIB" = x; then
|
||||
if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then
|
||||
AC_MSG_RESULT([present but broken])
|
||||
AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
|
||||
else
|
||||
AC_MSG_RESULT([ok])
|
||||
# Remove any trailing \ from INCLUDE and LIB to avoid trouble in spec.gmk.
|
||||
VS_INCLUDE=`$ECHO "$INCLUDE" | $SED 's/\\\\$//'`
|
||||
VS_LIB=`$ECHO "$LIB" | $SED 's/\\\\$//'`
|
||||
# Remove any paths containing # (typically F#) as that messes up make
|
||||
PATH=`$ECHO "$PATH" | $SED 's/[[^:#]]*#[^:]*://g'`
|
||||
VS_PATH="$PATH"
|
||||
# Remove any trailing "\" and " " from the variables.
|
||||
VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'`
|
||||
VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'`
|
||||
VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
|
||||
WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
|
||||
WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
|
||||
# Remove any paths containing # (typically F#) as that messes up make. This
|
||||
# is needed if visual studio was installed with F# support.
|
||||
VS_PATH=`$ECHO "$VS_PATH" | $SED 's/[[^:#]]*#[^:]*://g'`
|
||||
|
||||
AC_SUBST(VS_PATH)
|
||||
AC_SUBST(VS_INCLUDE)
|
||||
AC_SUBST(VS_LIB)
|
||||
AC_SUBST(VS_PATH)
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([not found])
|
||||
|
@ -114,7 +114,7 @@ diff_text() {
|
||||
fi
|
||||
if test "x$SUFFIX" = "xproperties"; then
|
||||
# Run through nawk to add possibly missing newline at end of file.
|
||||
$CAT $OTHER_FILE | $NAWK '{ print }' > $OTHER_FILE.cleaned
|
||||
$CAT $OTHER_FILE | $NAWK '{ print }' | LC_ALL=C $SORT > $OTHER_FILE.cleaned
|
||||
# Disable this exception since we aren't changing the properties cleaning method yet.
|
||||
# $CAT $OTHER_FILE | $SED -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
|
||||
# | $SED -f "$SRC_ROOT/common/makefiles/support/unicode2x.sed" \
|
||||
|
@ -24,12 +24,58 @@
|
||||
#
|
||||
|
||||
# Shell script for a fast parallel forest command
|
||||
command="$1"
|
||||
pull_extra_base="$2"
|
||||
|
||||
if [ "" = "$command" ] ; then
|
||||
echo No command to hg supplied!
|
||||
exit 1
|
||||
global_opts=""
|
||||
status_output="/dev/stdout"
|
||||
qflag="false"
|
||||
vflag="false"
|
||||
sflag="false"
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
case $1 in
|
||||
-q | --quiet )
|
||||
qflag="true"
|
||||
global_opts="${global_opts} -q"
|
||||
status_output="/dev/null"
|
||||
;;
|
||||
|
||||
-v | --verbose )
|
||||
vflag="true"
|
||||
global_opts="${global_opts} -v"
|
||||
;;
|
||||
|
||||
-s | --sequential )
|
||||
sflag="true"
|
||||
;;
|
||||
|
||||
'--' ) # no more options
|
||||
shift; break
|
||||
;;
|
||||
|
||||
-*) # bad option
|
||||
usage
|
||||
;;
|
||||
|
||||
* ) # non option
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
|
||||
command="$1"; shift
|
||||
command_args="$@"
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 [-q|--quiet] [-v|--verbose] [-s|--sequential] [--] <command> [commands...]" > ${status_output}
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if [ "x" = "x$command" ] ; then
|
||||
echo "ERROR: No command to hg supplied!"
|
||||
usage
|
||||
fi
|
||||
|
||||
# Clean out the temporary directory that stores the pid files.
|
||||
@ -40,17 +86,17 @@ mkdir -p ${tmp}
|
||||
safe_interrupt () {
|
||||
if [ -d ${tmp} ]; then
|
||||
if [ "`ls ${tmp}/*.pid`" != "" ]; then
|
||||
echo "Waiting for processes ( `cat ${tmp}/*.pid | tr '\n' ' '`) to terminate nicely!"
|
||||
echo "Waiting for processes ( `cat ${tmp}/*.pid | tr '\n' ' '`) to terminate nicely!" > ${status_output}
|
||||
sleep 1
|
||||
# Pipe stderr to dev/null to silence kill, that complains when trying to kill
|
||||
# a subprocess that has already exited.
|
||||
kill -TERM `cat ${tmp}/*.pid | tr '\n' ' '` 2> /dev/null
|
||||
wait
|
||||
echo Interrupt complete!
|
||||
echo "Interrupt complete!" > ${status_output}
|
||||
fi
|
||||
rm -f -r ${tmp}
|
||||
fi
|
||||
rm -f -r ${tmp}
|
||||
exit 1
|
||||
exit 130
|
||||
}
|
||||
|
||||
nice_exit () {
|
||||
@ -58,39 +104,44 @@ nice_exit () {
|
||||
if [ "`ls ${tmp}`" != "" ]; then
|
||||
wait
|
||||
fi
|
||||
rm -f -r ${tmp}
|
||||
fi
|
||||
rm -f -r ${tmp}
|
||||
}
|
||||
|
||||
trap 'safe_interrupt' INT QUIT
|
||||
trap 'nice_exit' EXIT
|
||||
|
||||
subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
|
||||
subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
|
||||
|
||||
# Only look in specific locations for possible forests (avoids long searches)
|
||||
pull_default=""
|
||||
repos=""
|
||||
repos_extra=""
|
||||
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
||||
subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
|
||||
if [ -f .hg/hgrc ] ; then
|
||||
pull_default=`hg paths default`
|
||||
if [ "${pull_default}" = "" ] ; then
|
||||
echo "ERROR: Need initial clone with 'hg paths default' defined"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ "${pull_default}" = "" ] ; then
|
||||
echo "ERROR: Need initial repository to use this script"
|
||||
if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
|
||||
if [ ! -f .hg/hgrc ] ; then
|
||||
echo "ERROR: Need initial repository to use this script" > ${status_output}
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pull_default=`hg paths default`
|
||||
if [ "${pull_default}" = "" ] ; then
|
||||
echo "ERROR: Need initial clone with 'hg paths default' defined" > ${status_output}
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for i in ${subrepos} ; do
|
||||
if [ ! -f ${i}/.hg/hgrc ] ; then
|
||||
repos="${repos} ${i}"
|
||||
fi
|
||||
done
|
||||
if [ "${pull_extra_base}" != "" ] ; then
|
||||
subrepos_extra="closed jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
|
||||
if [ "${command_args}" != "" ] ; then
|
||||
pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
|
||||
pull_extra="${pull_extra_base}/${pull_default_tail}"
|
||||
if [ "x${pull_default}" = "x${pull_default_tail}" ] ; then
|
||||
echo "ERROR: Need initial clone from non-local source" > ${status_output}
|
||||
exit 1
|
||||
fi
|
||||
pull_extra="${command_args}/${pull_default_tail}"
|
||||
for i in ${subrepos_extra} ; do
|
||||
if [ ! -f ${i}/.hg/hgrc ] ; then
|
||||
repos_extra="${repos_extra} ${i}"
|
||||
@ -100,78 +151,115 @@ if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
||||
at_a_time=2
|
||||
# Any repos to deal with?
|
||||
if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
|
||||
echo "No repositories to process." > ${status_output}
|
||||
exit
|
||||
fi
|
||||
else
|
||||
hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
|
||||
# Derive repository names from the .hg directory locations
|
||||
for i in ${hgdirs} ; do
|
||||
repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"
|
||||
for i in . ${subrepos} ${subrepos_extra} ; do
|
||||
if [ -d ${i}/.hg ] ; then
|
||||
repos="${repos} ${i}"
|
||||
fi
|
||||
done
|
||||
|
||||
# Any repos to deal with?
|
||||
if [ "${repos}" = "" ] ; then
|
||||
echo "No repositories to process." > ${status_output}
|
||||
exit
|
||||
fi
|
||||
|
||||
# any of the repos locked?
|
||||
for i in ${repos} ; do
|
||||
if [ -h ${i}/.hg/store/lock -o -f ${i}/.hg/store/lock ] ; then
|
||||
locked="${i} ${locked}"
|
||||
fi
|
||||
done
|
||||
at_a_time=8
|
||||
# Any repos to deal with?
|
||||
if [ "${repos}" = "" ] ; then
|
||||
echo "No repositories to process."
|
||||
exit
|
||||
fi
|
||||
if [ "${locked}" != "" ] ; then
|
||||
echo "These repositories are locked: ${locked}"
|
||||
exit
|
||||
echo "ERROR: These repositories are locked: ${locked}" > ${status_output}
|
||||
exit 1
|
||||
fi
|
||||
at_a_time=8
|
||||
fi
|
||||
|
||||
# Echo out what repositories we do a command on.
|
||||
echo "# Repositories: ${repos} ${repos_extra}"
|
||||
echo
|
||||
echo "# Repositories: ${repos} ${repos_extra}" > ${status_output}
|
||||
|
||||
# Run the supplied command on all repos in parallel.
|
||||
n=0
|
||||
for i in ${repos} ${repos_extra} ; do
|
||||
n=`expr ${n} '+' 1`
|
||||
repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
|
||||
reponame=`echo ${i} | sed -e :a -e 's/^.\{1,20\}$/ &/;ta'`
|
||||
pull_base="${pull_default}"
|
||||
for j in $repos_extra ; do
|
||||
if [ "${command}" = "serve" ] ; then
|
||||
# "serve" is run for all the repos.
|
||||
(
|
||||
(
|
||||
(
|
||||
echo "[web]"
|
||||
echo "description = $(basename $(pwd))"
|
||||
echo "allow_push = *"
|
||||
echo "push_ssl = False"
|
||||
|
||||
echo "[paths]"
|
||||
for i in ${repos} ${repos_extra} ; do
|
||||
if [ "${i}" != "." ] ; then
|
||||
echo "/$(basename $(pwd))/${i} = ${i}"
|
||||
else
|
||||
echo "/$(basename $(pwd)) = $(pwd)"
|
||||
fi
|
||||
done
|
||||
) > ${tmp}/serve.web-conf
|
||||
|
||||
echo "serving root repo $(basename $(pwd))"
|
||||
|
||||
(PYTHONUNBUFFERED=true hg${global_opts} serve -A ${status_output} -E ${status_output} --pid-file ${tmp}/serve.pid --web-conf ${tmp}/serve.web-conf; echo "$?" > ${tmp}/serve.pid.rc ) 2>&1 &
|
||||
) 2>&1 | sed -e "s@^@serve: @" > ${status_output}
|
||||
) &
|
||||
else
|
||||
# Run the supplied command on all repos in parallel.
|
||||
n=0
|
||||
for i in ${repos} ${repos_extra} ; do
|
||||
n=`expr ${n} '+' 1`
|
||||
repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
|
||||
reponame=`echo ${i} | sed -e :a -e 's/^.\{1,20\}$/ &/;ta'`
|
||||
pull_base="${pull_default}"
|
||||
for j in $repos_extra ; do
|
||||
if [ "$i" = "$j" ] ; then
|
||||
pull_base="${pull_extra}"
|
||||
fi
|
||||
done
|
||||
(
|
||||
done
|
||||
(
|
||||
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
||||
pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
|
||||
echo hg clone ${pull_newrepo} ${i}
|
||||
path="`dirname ${i}`"
|
||||
if [ "${path}" != "." ] ; then
|
||||
times=0
|
||||
while [ ! -d "${path}" ] ## nested repo, ensure containing dir exists
|
||||
do
|
||||
times=`expr ${times} '+' 1`
|
||||
if [ `expr ${times} '%' 10` -eq 0 ] ; then
|
||||
echo ${path} still not created, waiting...
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
(
|
||||
if [ "${command}" = "clone" -o "${command}" = "fclone" -o "${command}" = "tclone" ] ; then
|
||||
pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
|
||||
path="`dirname ${i}`"
|
||||
if [ "${path}" != "." ] ; then
|
||||
times=0
|
||||
while [ ! -d "${path}" ] ## nested repo, ensure containing dir exists
|
||||
do
|
||||
times=`expr ${times} '+' 1`
|
||||
if [ `expr ${times} '%' 10` -eq 0 ] ; then
|
||||
echo "${path} still not created, waiting..." > ${status_output}
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
echo "hg clone ${pull_newrepo} ${i}" > ${status_output}
|
||||
(PYTHONUNBUFFERED=true hg${global_opts} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
|
||||
else
|
||||
echo "cd ${i} && hg${global_opts} ${command} ${command_args}" > ${status_output}
|
||||
cd ${i} && (PYTHONUNBUFFERED=true hg${global_opts} ${command} ${command_args}; echo "$?" > ${tmp}/${repopidfile}.pid.rc ) 2>&1 &
|
||||
fi
|
||||
(PYTHONUNBUFFERED=true hg clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
|
||||
else
|
||||
echo "cd ${i} && hg $*"
|
||||
cd ${i} && (PYTHONUNBUFFERED=true hg "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
|
||||
fi
|
||||
echo $! > ${tmp}/${repopidfile}.pid
|
||||
) 2>&1 | sed -e "s@^@${reponame}: @") &
|
||||
|
||||
if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
|
||||
sleep 2
|
||||
echo Waiting 5 secs before spawning next background command.
|
||||
sleep 3
|
||||
fi
|
||||
done
|
||||
echo $! > ${tmp}/${repopidfile}.pid
|
||||
) 2>&1 | sed -e "s@^@${reponame}: @" > ${status_output}
|
||||
) &
|
||||
|
||||
if [ `expr ${n} '%' ${at_a_time}` -eq 0 -a "${sflag}" = "false" ] ; then
|
||||
sleep 2
|
||||
echo "Waiting 5 secs before spawning next background command." > ${status_output}
|
||||
sleep 3
|
||||
fi
|
||||
|
||||
if [ "${sflag}" = "true" ] ; then
|
||||
wait
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Wait for all hg commands to complete
|
||||
wait
|
||||
|
||||
@ -181,7 +269,8 @@ if [ -d ${tmp} ]; then
|
||||
for rc in ${tmp}/*.pid.rc ; do
|
||||
exit_code=`cat ${rc} | tr -d ' \n\r'`
|
||||
if [ "${exit_code}" != "0" ] ; then
|
||||
echo "WARNING: ${rc} exited abnormally."
|
||||
repo="`echo ${rc} | sed -e s@^${tmp}@@ -e 's@/*\([^/]*\)\.pid\.rc$@\1@' -e 's@_@/@g'`"
|
||||
echo "WARNING: ${repo} exited abnormally." > ${status_output}
|
||||
ec=1
|
||||
fi
|
||||
done
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2014, 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
|
||||
@ -29,7 +29,7 @@
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
|
||||
void report_error()
|
||||
void report_error(char const * msg)
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
DWORD dw = GetLastError();
|
||||
@ -46,8 +46,8 @@ void report_error()
|
||||
NULL);
|
||||
|
||||
fprintf(stderr,
|
||||
"Could not start process! Failed with error %d: %s\n",
|
||||
dw, lpMsgBuf);
|
||||
"%s Failed with error %d: %s\n",
|
||||
msg, dw, lpMsgBuf);
|
||||
|
||||
LocalFree(lpMsgBuf);
|
||||
}
|
||||
@ -56,7 +56,7 @@ void report_error()
|
||||
* Test if pos points to /cygdrive/_/ where _ can
|
||||
* be any character.
|
||||
*/
|
||||
int is_cygdrive_here(int pos, char *in, int len)
|
||||
int is_cygdrive_here(int pos, char const *in, int len)
|
||||
{
|
||||
// Length of /cygdrive/c/ is 12
|
||||
if (pos+12 > len) return 0;
|
||||
@ -81,16 +81,17 @@ int is_cygdrive_here(int pos, char *in, int len)
|
||||
* Works in place since drive letter is always
|
||||
* shorter than /cygdrive/
|
||||
*/
|
||||
char *replace_cygdrive_cygwin(char *in)
|
||||
char *replace_cygdrive_cygwin(char const *in)
|
||||
{
|
||||
int len = strlen(in);
|
||||
char *out = malloc(len+1);
|
||||
size_t len = strlen(in);
|
||||
char *out = (char*) malloc(len+1);
|
||||
int i,j;
|
||||
|
||||
if (len < 12) {
|
||||
strcpy(out, in);
|
||||
memmove(out, in, len + 1);
|
||||
return out;
|
||||
}
|
||||
|
||||
for (i = 0, j = 0; i<len;) {
|
||||
if (is_cygdrive_here(i, in, len)) {
|
||||
out[j++] = in[i+10];
|
||||
@ -102,7 +103,7 @@ char *replace_cygdrive_cygwin(char *in)
|
||||
j++;
|
||||
}
|
||||
}
|
||||
out[j] = 0;
|
||||
out[j] = '\0';
|
||||
return out;
|
||||
}
|
||||
|
||||
@ -110,7 +111,7 @@ void append(char **b, size_t *bl, size_t *u, char *add, size_t addlen)
|
||||
{
|
||||
while ( (addlen+*u+1) > *bl) {
|
||||
*bl *= 2;
|
||||
*b = realloc(*b, *bl);
|
||||
*b = (char*) realloc(*b, *bl);
|
||||
}
|
||||
memcpy(*b+*u, add, addlen);
|
||||
*u += addlen;
|
||||
@ -125,7 +126,7 @@ char *replace_substring(char *in, char *sub, char *rep)
|
||||
int in_len = strlen(in);
|
||||
int sub_len = strlen(sub);
|
||||
int rep_len = strlen(rep);
|
||||
char *out = malloc(in_len - sub_len + rep_len + 1);
|
||||
char *out = (char *) malloc(in_len - sub_len + rep_len + 1);
|
||||
char *p;
|
||||
|
||||
if (!(p = strstr(in, sub))) {
|
||||
@ -145,7 +146,7 @@ char *replace_substring(char *in, char *sub, char *rep)
|
||||
char* msys_path_list; // @-separated list of paths prefix to look for
|
||||
char* msys_path_list_end; // Points to last \0 in msys_path_list.
|
||||
|
||||
void setup_msys_path_list(char* argument)
|
||||
void setup_msys_path_list(char const * argument)
|
||||
{
|
||||
char* p;
|
||||
char* drive_letter_pos;
|
||||
@ -173,7 +174,7 @@ void setup_msys_path_list(char* argument)
|
||||
} while (p != NULL);
|
||||
}
|
||||
|
||||
char *replace_cygdrive_msys(char *in)
|
||||
char *replace_cygdrive_msys(char const *in)
|
||||
{
|
||||
char* str;
|
||||
char* prefix;
|
||||
@ -195,12 +196,12 @@ char *replace_cygdrive_msys(char *in)
|
||||
return str;
|
||||
}
|
||||
|
||||
char*(*replace_cygdrive)(char *in) = NULL;
|
||||
char*(*replace_cygdrive)(char const *in) = NULL;
|
||||
|
||||
char *files_to_delete[1024];
|
||||
int num_files_to_delete = 0;
|
||||
|
||||
char *fix_at_file(char *in)
|
||||
char *fix_at_file(char const *in)
|
||||
{
|
||||
char *tmpdir;
|
||||
char name[2048];
|
||||
@ -222,9 +223,13 @@ char *fix_at_file(char *in)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
tmpdir = getenv("TMP");
|
||||
tmpdir = getenv("TEMP");
|
||||
if (tmpdir == NULL) {
|
||||
#if _WIN64
|
||||
tmpdir = "c:/cygwin64/tmp";
|
||||
#else
|
||||
tmpdir = "c:/cygwin/tmp";
|
||||
#endif
|
||||
}
|
||||
_snprintf(name, sizeof(name), "%s\\atfile_XXXXXX", tmpdir);
|
||||
|
||||
@ -240,7 +245,7 @@ char *fix_at_file(char *in)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
buffer = malloc(buflen);
|
||||
buffer = (char*) malloc(buflen);
|
||||
while((blocklen = fread(block,1,sizeof(block),atin)) > 0) {
|
||||
append(&buffer, &buflen, &used, block, blocklen);
|
||||
}
|
||||
@ -257,84 +262,229 @@ char *fix_at_file(char *in)
|
||||
fclose(atout);
|
||||
free(fixed);
|
||||
free(buffer);
|
||||
files_to_delete[num_files_to_delete] = malloc(strlen(name)+1);
|
||||
files_to_delete[num_files_to_delete] = (char*) malloc(strlen(name)+1);
|
||||
strcpy(files_to_delete[num_files_to_delete], name);
|
||||
num_files_to_delete++;
|
||||
atname = malloc(strlen(name)+2);
|
||||
atname = (char*) malloc(strlen(name)+2);
|
||||
atname[0] = '@';
|
||||
strcpy(atname+1, name);
|
||||
return atname;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
// given an argument, convert it to the windows command line safe quoted version
|
||||
// using rules from:
|
||||
// http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx
|
||||
// caller is responsible for freeing both input and output.
|
||||
char * quote_arg(char const * in_arg) {
|
||||
char *quoted = NULL;
|
||||
char *current = quoted;
|
||||
int pass;
|
||||
|
||||
if(strpbrk(in_arg, " \t\n\v\r\\\"") == NULL) {
|
||||
return _strdup(in_arg);
|
||||
}
|
||||
|
||||
// process the arg twice. Once to calculate the size and then to copy it.
|
||||
for(pass=1; pass<=2; pass++) {
|
||||
char const *arg = in_arg;
|
||||
|
||||
// initial "
|
||||
if(pass == 2) {
|
||||
*current = '\"';
|
||||
}
|
||||
current++;
|
||||
|
||||
// process string to be quoted until NUL
|
||||
do {
|
||||
int escapes = 0;
|
||||
|
||||
while (*arg == '\\') {
|
||||
// count escapes.
|
||||
escapes++;
|
||||
arg++;
|
||||
}
|
||||
|
||||
if (*arg == '\0') {
|
||||
// escape the escapes before final "
|
||||
escapes *= 2;
|
||||
} else if (*arg == '"') {
|
||||
// escape the escapes and the "
|
||||
escapes = escapes * 2 + 1;
|
||||
} else {
|
||||
// escapes aren't special, just echo them.
|
||||
}
|
||||
|
||||
// emit some escapes
|
||||
while (escapes > 0) {
|
||||
if (pass == 2) {
|
||||
*current = '\\';
|
||||
}
|
||||
current++;
|
||||
escapes--;
|
||||
}
|
||||
|
||||
// and the current char
|
||||
if (pass == 2) {
|
||||
*current = *arg;
|
||||
}
|
||||
current++;
|
||||
} while( *arg++ != '\0');
|
||||
|
||||
// allocate the buffer
|
||||
if (pass == 1) {
|
||||
size_t alloc = (size_t) (current - quoted + (ptrdiff_t) 2);
|
||||
current = quoted = (char*) calloc(alloc, sizeof(char));
|
||||
}
|
||||
}
|
||||
|
||||
// final " and \0
|
||||
*(current - 1) = '"';
|
||||
*current = '\0';
|
||||
|
||||
return quoted;
|
||||
}
|
||||
|
||||
int main(int argc, char const ** argv)
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
unsigned short rc;
|
||||
|
||||
char *new_at_file;
|
||||
char *old_at_file;
|
||||
char *line;
|
||||
int i;
|
||||
char *current;
|
||||
int i, cmd;
|
||||
DWORD exitCode;
|
||||
|
||||
if (argc<3 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm')) {
|
||||
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> /cygdrive/c/WINDOWS/notepad.exe /cygdrive/c/x/test.txt\n");
|
||||
if (argc<2 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm')) {
|
||||
fprintf(stderr, "Usage: fixpath -c|m<path@path@...> /cygdrive/c/WINDOWS/notepad.exe [/cygdrive/c/x/test.txt|@/cygdrive/c/x/atfile]\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "fixpath input line >%s<\n", strstr(GetCommandLine(), argv[1]));
|
||||
char const * cmdline = GetCommandLine();
|
||||
fprintf(stderr, "fixpath input line >%s<\n", strstr( cmdline , argv[1]));
|
||||
}
|
||||
|
||||
if (argv[1][1] == 'c' && argv[1][2] == '\0') {
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "using cygwin mode\n");
|
||||
fprintf(stderr, "fixpath using cygwin mode\n");
|
||||
}
|
||||
replace_cygdrive = replace_cygdrive_cygwin;
|
||||
} else if (argv[1][1] == 'm') {
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "using msys mode, with path list: %s\n", &argv[1][2]);
|
||||
fprintf(stderr, "fixpath using msys mode, with path list: %s\n", &argv[1][2]);
|
||||
}
|
||||
setup_msys_path_list(argv[1]);
|
||||
replace_cygdrive = replace_cygdrive_msys;
|
||||
} else {
|
||||
fprintf(stderr, "Unknown mode: %s\n", argv[1]);
|
||||
fprintf(stderr, "fixpath Unknown mode: %s\n", argv[1]);
|
||||
exit(-1);
|
||||
}
|
||||
line = replace_cygdrive(strstr(GetCommandLine(), argv[2]));
|
||||
|
||||
for (i=1; i<argc; ++i) {
|
||||
if (argv[i][0] == '@') {
|
||||
// Found at-file! Fix it!
|
||||
old_at_file = replace_cygdrive(argv[i]);
|
||||
new_at_file = fix_at_file(old_at_file);
|
||||
line = replace_substring(line, old_at_file, new_at_file);
|
||||
}
|
||||
i = 2;
|
||||
|
||||
// handle assignments
|
||||
while (i < argc) {
|
||||
char const * assignment = strchr(argv[i], '=');
|
||||
if (assignment != NULL && assignment != argv[i]) {
|
||||
size_t var_len = (size_t) (assignment - argv[i] + (ptrdiff_t) 1);
|
||||
char *var = (char *) calloc(var_len, sizeof(char));
|
||||
char *val = replace_cygdrive(assignment + 1);
|
||||
memmove(var, argv[i], var_len);
|
||||
var[var_len - 1] = '\0';
|
||||
strupr(var);
|
||||
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "fixpath setting var >%s< to >%s<\n", var, val);
|
||||
}
|
||||
|
||||
rc = SetEnvironmentVariable(var, val);
|
||||
if(!rc) {
|
||||
// Could not set var for some reason. Try to report why.
|
||||
const int msg_len = 80 + var_len + strlen(val);
|
||||
char * msg = (char *) alloca(msg_len);
|
||||
_snprintf_s(msg, msg_len, _TRUNCATE, "Could not set environment variable [%s=%s]", var, val);
|
||||
report_error(msg);
|
||||
exit(1);
|
||||
}
|
||||
free(var);
|
||||
free(val);
|
||||
} else {
|
||||
// no more assignments;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
// remember index of the command
|
||||
cmd = i;
|
||||
|
||||
// handle command and it's args.
|
||||
while (i < argc) {
|
||||
char const *replaced = replace_cygdrive(argv[i]);
|
||||
if(replaced[0] == '@') {
|
||||
// Found at-file! Fix it!
|
||||
replaced = fix_at_file(replaced);
|
||||
}
|
||||
argv[i] = quote_arg(replaced);
|
||||
i++;
|
||||
}
|
||||
|
||||
// determine the length of the line
|
||||
line = NULL;
|
||||
// args
|
||||
for(i = cmd; i < argc; i++) {
|
||||
line += (ptrdiff_t) strlen(argv[i]);
|
||||
}
|
||||
// spaces and null
|
||||
line += (ptrdiff_t) (argc - cmd + 1);
|
||||
// allocate
|
||||
line = (char*) calloc(line - (char*) NULL, sizeof(char));
|
||||
|
||||
// copy in args.
|
||||
current = line;
|
||||
for(i = cmd; i < argc; i++) {
|
||||
ptrdiff_t len = strlen(argv[i]);
|
||||
if (i != cmd) {
|
||||
*current++ = ' ';
|
||||
}
|
||||
memmove(current, argv[i], len);
|
||||
current += len;
|
||||
}
|
||||
*current = '\0';
|
||||
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "fixpath converted line >%s<\n", line);
|
||||
}
|
||||
|
||||
if(cmd == argc) {
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "fixpath no command provided!\n");
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
ZeroMemory(&si,sizeof(si));
|
||||
si.cb=sizeof(si);
|
||||
ZeroMemory(&pi,sizeof(pi));
|
||||
|
||||
fflush(stderr);
|
||||
fflush(stdout);
|
||||
|
||||
rc = CreateProcess(NULL,
|
||||
line,
|
||||
0,
|
||||
0,
|
||||
TRUE,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
&si,
|
||||
&pi);
|
||||
if(!rc) {
|
||||
// Could not start process for some reason. Try to report why:
|
||||
report_error();
|
||||
exit(rc);
|
||||
report_error("Could not start process!");
|
||||
exit(126);
|
||||
}
|
||||
|
||||
WaitForSingleObject(pi.hProcess,INFINITE);
|
||||
@ -342,15 +492,21 @@ int main(int argc, char **argv)
|
||||
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
for (i=0; i<num_files_to_delete; ++i) {
|
||||
fprintf(stderr, "Not deleting temporary fixpath file %s\n",
|
||||
fprintf(stderr, "fixpath Not deleting temporary file %s\n",
|
||||
files_to_delete[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
for (i=0; i<num_files_to_delete; ++i) {
|
||||
remove(files_to_delete[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (exitCode != 0) {
|
||||
if (getenv("DEBUG_FIXPATH") != NULL) {
|
||||
fprintf(stderr, "fixpath exit code %d\n",
|
||||
exitCode);
|
||||
}
|
||||
}
|
||||
|
||||
exit(exitCode);
|
||||
}
|
||||
|
@ -369,6 +369,10 @@ define SetupNativeCompilation
|
||||
$$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
|
||||
endif
|
||||
|
||||
# Add sys root specific cflags last
|
||||
$1_EXTRA_CFLAGS += $(SYSROOT_CFLAGS)
|
||||
$1_EXTRA_CXXFLAGS += $(SYSROOT_CFLAGS)
|
||||
|
||||
# Now call add_native_source for each source file we are going to compile.
|
||||
$$(foreach p,$$($1_SRCS), \
|
||||
$$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \
|
||||
@ -414,6 +418,8 @@ define SetupNativeCompilation
|
||||
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
|
||||
endif
|
||||
|
||||
$1_EXTRA_LDFLAGS += $(SYSROOT_LDFLAGS)
|
||||
|
||||
# Need to make sure TARGET is first on list
|
||||
$1 := $$($1_TARGET)
|
||||
ifeq ($$($1_STATIC_LIBRARY),)
|
||||
@ -476,7 +482,7 @@ define SetupNativeCompilation
|
||||
# to be rebuilt properly.
|
||||
$$($1_DEBUGINFO_ZIP): $$($1_DEBUGINFO_FILES) $$($1_TARGET)
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$($1_DEBUGINFO_FILES)
|
||||
&& $(ZIP) -q $$@ $$(notdir $$($1_DEBUGINFO_FILES))
|
||||
|
||||
else
|
||||
$1 += $$(subst $$($1_OBJECT_DIR),$$($1_OUTPUT_DIR),$$($1_DEBUGINFO_FILES))
|
||||
|
@ -75,7 +75,7 @@ ifeq (,$(SKIP_ME))
|
||||
$(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me)))
|
||||
endif
|
||||
|
||||
OUTPUT_ROOT = $(abspath ../../../build/devkit)
|
||||
OUTPUT_ROOT = $(abspath ../../build/devkit)
|
||||
RESULT = $(OUTPUT_ROOT)/result
|
||||
|
||||
submakevars = HOST=$@ BUILD=$(me) \
|
||||
|
@ -49,8 +49,8 @@ ARCH := $(word 1,$(subst -, ,$(TARGET)))
|
||||
# Define external dependencies
|
||||
|
||||
# Latest that could be made to work.
|
||||
gcc_ver := gcc-4.7.3
|
||||
binutils_ver := binutils-2.22
|
||||
gcc_ver := gcc-4.8.2
|
||||
binutils_ver := binutils-2.24
|
||||
ccache_ver := ccache-3.1.9
|
||||
mpfr_ver := mpfr-3.0.1
|
||||
gmp_ver := gmp-4.3.2
|
||||
@ -64,6 +64,7 @@ GMP := http://ftp.gnu.org/pub/gnu/gmp/${gmp_ver}.tar.bz2
|
||||
MPC := http://www.multiprecision.org/mpc/download/${mpc_ver}.tar.gz
|
||||
|
||||
# RPMs in OEL5.5
|
||||
LINUX_VERSION := OEL5.5
|
||||
RPM_LIST := \
|
||||
kernel-headers \
|
||||
glibc-2 glibc-headers glibc-devel \
|
||||
@ -121,7 +122,7 @@ RESULT := $(OUTPUT_ROOT)/result
|
||||
BUILDDIR := $(OUTPUT_ROOT)/$(HOST)/$(TARGET)
|
||||
PREFIX := $(RESULT)/$(HOST)
|
||||
TARGETDIR := $(PREFIX)/$(TARGET)
|
||||
SYSROOT := $(TARGETDIR)/sys-root
|
||||
SYSROOT := $(TARGETDIR)/sysroot
|
||||
DOWNLOAD := $(OUTPUT_ROOT)/download
|
||||
SRCDIR := $(OUTPUT_ROOT)/src
|
||||
|
||||
@ -184,7 +185,7 @@ $(foreach p,$(RPM_FILE_LIST),$(eval $(call unrpm,$(p))))
|
||||
|
||||
##########################################################################################
|
||||
|
||||
# Note: MUST create a <sys-root>/usr/lib even if not really needed.
|
||||
# Note: MUST create a <sysroot>/usr/lib even if not really needed.
|
||||
# gcc will use a path relative to it to resolve lib64. (x86_64).
|
||||
# we're creating multi-lib compiler with 32bit libc as well, so we should
|
||||
# have it anyway, but just to make sure...
|
||||
@ -459,15 +460,31 @@ $(TARGETDIR)/%.done : $(BUILDDIR)/%/Makefile
|
||||
|
||||
##########################################################################################
|
||||
|
||||
$(PREFIX)/devkit.info: FRC
|
||||
@echo 'Creating devkit.info in the root of the kit'
|
||||
rm -f $@
|
||||
touch $@
|
||||
echo '# This file describes to configure how to interpret the contents of this' >> $@
|
||||
echo '# devkit' >> $@
|
||||
echo '' >> $@
|
||||
echo 'DEVKIT_NAME="$(gcc_ver) - $(LINUX_VERSION)"' >> $@
|
||||
echo 'DEVKIT_TOOLCHAIN_PATH="$$DEVKIT_ROOT/bin"' >> $@
|
||||
echo 'DEVKIT_SYSROOT="$$DEVKIT_ROOT/$$host/sysroot"' >> $@
|
||||
|
||||
##########################################################################################
|
||||
|
||||
bfdlib : $(bfdlib)
|
||||
binutils : $(binutils)
|
||||
rpms : $(rpms)
|
||||
libs : $(libs)
|
||||
sysroot : rpms libs
|
||||
gcc : sysroot $(gcc) $(gccpatch)
|
||||
all : binutils gcc bfdlib
|
||||
all : binutils gcc bfdlib $(PREFIX)/devkit.info
|
||||
|
||||
# this is only built for host. so separate.
|
||||
ccache : $(ccache)
|
||||
|
||||
# Force target
|
||||
FRC:
|
||||
|
||||
.PHONY : gcc all binutils bfdlib link_libs rpms libs sysroot
|
||||
|
Loading…
x
Reference in New Issue
Block a user