Kaydet (Commit) 2768d783 authored tarafından Michael Stahl's avatar Michael Stahl

configure, gbuild: remove Cygwin paths from make environment

All environment variables contain native Win32 paths.

This allows building with Win32 make and Cygwin sh.exe,
but Cygwin make cannot build any more with the Win32 entries in PATH.

Requires adding "bash" detection to configure since /usr/bin/env
can't be invoked by Win32 make and it's possible to install cygwin
somewhere else than C:/cygwin.

Change-Id: Ia8f4ee3c91222e8f5919cfbfc452f12ffbfadd40
Reviewed-on: https://gerrit.libreoffice.org/9698Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 08e3e6c2
...@@ -15,7 +15,7 @@ build_goal:=$(if $(filter build check,$(MAKECMDGOALS)),all)\ ...@@ -15,7 +15,7 @@ build_goal:=$(if $(filter build check,$(MAKECMDGOALS)),all)\
$(if $(filter check,$(MAKECMDGOALS)),subsequentcheck)\ $(if $(filter check,$(MAKECMDGOALS)),subsequentcheck)\
$(filter all build-l10n-only build-non-l10n-only debugrun help slowcheck translations unitcheck subsequentcheck check packageinfo,$(MAKECMDGOALS)) $(filter all build-l10n-only build-non-l10n-only debugrun help slowcheck translations unitcheck subsequentcheck check packageinfo,$(MAKECMDGOALS))
SHELL=/usr/bin/env bash SHELL := @SHELL_BASH@
SRCDIR := @SRC_ROOT@ SRCDIR := @SRC_ROOT@
BUILDDIR := @BUILDDIR@ BUILDDIR := @BUILDDIR@
GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T) GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T)
......
...@@ -39,7 +39,7 @@ PathFormat() ...@@ -39,7 +39,7 @@ PathFormat()
fi fi
done done
if test "$pf_conv_to_dos" = "yes"; then if test "$pf_conv_to_dos" = "yes"; then
formatted_path=`cygpath -d "$formatted_path"` formatted_path=`cygpath -sm "$formatted_path"`
if test $? -ne 0; then if test $? -ne 0; then
AC_MSG_ERROR([path conversion failed for "$1".]) AC_MSG_ERROR([path conversion failed for "$1".])
fi fi
...@@ -2309,15 +2309,15 @@ pathmunge () ...@@ -2309,15 +2309,15 @@ pathmunge ()
if test -n "$1"; then if test -n "$1"; then
if test "$build_os" = "cygwin"; then if test "$build_os" = "cygwin"; then
PathFormat "$1" PathFormat "$1"
new_path=`cygpath -u "$formatted_path"` new_path=`cygpath -sm "$formatted_path"`
else else
new_path="$1" new_path="$1"
fi fi
if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
if test "$2" = "after"; then if test "$2" = "after"; then
LO_PATH="$LO_PATH:$new_path" LO_PATH="$LO_PATH${P_SEP}$new_path"
else else
LO_PATH="$new_path:$LO_PATH" LO_PATH="$new_path${P_SEP}$LO_PATH"
fi fi
fi fi
unset new_path unset new_path
...@@ -3676,8 +3676,7 @@ if test "$_os" = "WINNT"; then ...@@ -3676,8 +3676,7 @@ if test "$_os" = "WINNT"; then
fi fi
fi fi
VC_PRODUCT_DIR=`cygpath -d "$VC_PRODUCT_DIR"` VC_PRODUCT_DIR=`cygpath -sm "$VC_PRODUCT_DIR"`
VC_PRODUCT_DIR=`cygpath -u "$VC_PRODUCT_DIR"`
AC_MSG_RESULT([$VC_PRODUCT_DIR]) AC_MSG_RESULT([$VC_PRODUCT_DIR])
dnl =========================================================== dnl ===========================================================
...@@ -3727,8 +3726,7 @@ if test "$_os" = "WINNT"; then ...@@ -3727,8 +3726,7 @@ if test "$_os" = "WINNT"; then
fi fi
# This gives us a posix path with 8.3 filename restrictions # This gives us a posix path with 8.3 filename restrictions
CC=`cygpath -d "$CC"` CC=`cygpath -sm "$CC"`
CC=`cygpath -u "$CC"`
fi fi
if test -n "$CC"; then if test -n "$CC"; then
...@@ -4985,7 +4983,11 @@ for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do ...@@ -4985,7 +4983,11 @@ for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
if test -n "$a"; then if test -n "$a"; then
$a --version 2> /dev/null | grep GNU 2>&1 > /dev/null $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
if test $? -eq 0; then if test $? -eq 0; then
GNUMAKE=`which $a` if test "$build_os" = "cygwin"; then
GNUMAKE=$(cygpath -m $(which $(cygpath -u $a)))
else
GNUMAKE=`which $a`
fi
break break
fi fi
fi fi
...@@ -5060,6 +5062,9 @@ fi ...@@ -5060,6 +5062,9 @@ fi
# find if gnumake support file function # find if gnumake support file function
AC_MSG_CHECKING([whether GNU make supports the 'file' function]) AC_MSG_CHECKING([whether GNU make supports the 'file' function])
TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`" TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
if test "$build_os" = "cygwin"; then
TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
fi
$SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
\$(file >test.txt,Success ) \$(file >test.txt,Success )
...@@ -5086,6 +5091,13 @@ if test "$_make_ver_check" = ""; then ...@@ -5086,6 +5091,13 @@ if test "$_make_ver_check" = ""; then
STALE_MAKE=TRUE STALE_MAKE=TRUE
fi fi
if test "$build_os" = "cygwin"; then
SHELL_BASH=$(cygpath -m $(which bash))
else
SHELL_BASH=`which bash`
fi
AC_SUBST(SHELL_BASH)
HAVE_LD_HASH_STYLE=FALSE HAVE_LD_HASH_STYLE=FALSE
WITH_LINKER_HASH_STYLE= WITH_LINKER_HASH_STYLE=
AC_MSG_CHECKING( for --hash-style gcc linker support ) AC_MSG_CHECKING( for --hash-style gcc linker support )
...@@ -5382,8 +5394,7 @@ if test "$build_os" = "cygwin"; then ...@@ -5382,8 +5394,7 @@ if test "$build_os" = "cygwin"; then
fi fi
# Convert to posix path with 8.3 filename restrictions ( No spaces ) # Convert to posix path with 8.3 filename restrictions ( No spaces )
MIDL_PATH=`cygpath -d "$MIDL_PATH"` MIDL_PATH=`cygpath -sm "$MIDL_PATH"`
MIDL_PATH=`cygpath -u "$MIDL_PATH"`
dnl Check csc.exe dnl Check csc.exe
AC_MSG_CHECKING([for csc.exe]) AC_MSG_CHECKING([for csc.exe])
...@@ -5397,8 +5408,7 @@ if test "$build_os" = "cygwin"; then ...@@ -5397,8 +5408,7 @@ if test "$build_os" = "cygwin"; then
AC_MSG_RESULT([$CSC_PATH/csc.exe]) AC_MSG_RESULT([$CSC_PATH/csc.exe])
fi fi
CSC_PATH=`cygpath -d "$CSC_PATH"` CSC_PATH=`cygpath -sm "$CSC_PATH"`
CSC_PATH=`cygpath -u "$CSC_PATH"`
dnl Check al.exe dnl Check al.exe
AC_MSG_CHECKING([for al.exe]) AC_MSG_CHECKING([for al.exe])
...@@ -5423,8 +5433,7 @@ if test "$build_os" = "cygwin"; then ...@@ -5423,8 +5433,7 @@ if test "$build_os" = "cygwin"; then
AC_MSG_RESULT([$AL_PATH/al.exe]) AC_MSG_RESULT([$AL_PATH/al.exe])
fi fi
AL_PATH=`cygpath -d "$AL_PATH"` AL_PATH=`cygpath -sm "$AL_PATH"`
AL_PATH=`cygpath -u "$AL_PATH"`
dnl Check mscoree.lib / .NET Framework dir dnl Check mscoree.lib / .NET Framework dir
AC_MSG_CHECKING(.NET Framework) AC_MSG_CHECKING(.NET Framework)
...@@ -6845,7 +6854,7 @@ if test "$ENABLE_JAVA" != ""; then ...@@ -6845,7 +6854,7 @@ if test "$ENABLE_JAVA" != ""; then
AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK]) AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
fi fi
else else
test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"` test "$build_os" = "cygwin" && with_jdk_home=`cygpath -sm "$with_jdk_home"`
howfound="you passed" howfound="you passed"
fi fi
fi fi
...@@ -6885,8 +6894,7 @@ if test "$ENABLE_JAVA" != ""; then ...@@ -6885,8 +6894,7 @@ if test "$ENABLE_JAVA" != ""; then
if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
JAVAINTERPRETER="${JAVAINTERPRETER}.exe" JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
fi fi
JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"` JAVAINTERPRETER=`cygpath -sm "$JAVAINTERPRETER"`
JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
elif test $_os = Darwin -a "$BITNESS_OVERRIDE" = ""; then elif test $_os = Darwin -a "$BITNESS_OVERRIDE" = ""; then
dnl HACK: There currently is only a 32 bit version of LibreOffice for Mac OS X, dnl HACK: There currently is only a 32 bit version of LibreOffice for Mac OS X,
dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
...@@ -7032,8 +7040,7 @@ if test "$ENABLE_JAVA" != ""; then ...@@ -7032,8 +7040,7 @@ if test "$ENABLE_JAVA" != ""; then
if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
JAVACOMPILER="${JAVACOMPILER}.exe" JAVACOMPILER="${JAVACOMPILER}.exe"
fi fi
JAVACOMPILER=`cygpath -d "$JAVACOMPILER"` JAVACOMPILER=`cygpath -sm "$JAVACOMPILER"`
JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
fi fi
if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
...@@ -7077,8 +7084,7 @@ if test "$ENABLE_JAVA" != ""; then ...@@ -7077,8 +7084,7 @@ if test "$ENABLE_JAVA" != ""; then
if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
JAVADOC="${JAVADOC}.exe" JAVADOC="${JAVADOC}.exe"
fi fi
JAVADOC=`cygpath -d "$JAVADOC"` JAVADOC=`cygpath -sm "$JAVADOC"`
JAVADOC=`cygpath -u "$JAVADOC"`
fi fi
if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
...@@ -7500,6 +7506,9 @@ AC_PATH_PROG(GPERF, gperf) ...@@ -7500,6 +7506,9 @@ AC_PATH_PROG(GPERF, gperf)
if test -z "$GPERF"; then if test -z "$GPERF"; then
AC_MSG_ERROR([gperf not found but needed. Install it.]) AC_MSG_ERROR([gperf not found but needed. Install it.])
fi fi
if test "$build_os" = "cygwin"; then
GPERF=`cygpath -m $GPERF`
fi
AC_MSG_CHECKING([gperf version]) AC_MSG_CHECKING([gperf version])
if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
AC_MSG_RESULT([OK]) AC_MSG_RESULT([OK])
...@@ -9874,6 +9883,9 @@ else ...@@ -9874,6 +9883,9 @@ else
fi fi
AC_PATH_PROG(FLEX, flex) AC_PATH_PROG(FLEX, flex)
if test "$build_os" = "cygwin"; then
FLEX=`cygpath -m $FLEX`
fi
if test -z "$FLEX"; then if test -z "$FLEX"; then
AC_MSG_ERROR([no flex found in \$PATH, install it]) AC_MSG_ERROR([no flex found in \$PATH, install it])
else else
...@@ -9914,6 +9926,10 @@ else ...@@ -9914,6 +9926,10 @@ else
GNUPATCH=$PATCH GNUPATCH=$PATCH
fi fi
if test "$build_os" = "cygwin"; then
GNUPATCH=`cygpath -m $GNUPATCH`
fi
dnl We also need to check for --with-gnu-cp dnl We also need to check for --with-gnu-cp
if test -z "$with_gnu_cp"; then if test -z "$with_gnu_cp"; then
...@@ -9934,6 +9950,10 @@ else ...@@ -9934,6 +9950,10 @@ else
fi fi
fi fi
if test "$build_os" = "cygwin"; then
GNUCP=`cygpath -m $GNUCP`
fi
AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support]) AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
...@@ -12059,6 +12079,7 @@ if test "$ENABLE_JAVA" != ""; then ...@@ -12059,6 +12079,7 @@ if test "$ENABLE_JAVA" != ""; then
AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd]) AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
else else
if test "$_os" = "WINNT"; then if test "$_os" = "WINNT"; then
# AC_PATH_PROGS needs unix path
with_ant_home=`cygpath -u "$with_ant_home"` with_ant_home=`cygpath -u "$with_ant_home"`
fi fi
AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH) AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
...@@ -12131,7 +12152,7 @@ EOF ...@@ -12131,7 +12152,7 @@ EOF
PathFormat "$ANT_HOME" PathFormat "$ANT_HOME"
ANT_HOME="$formatted_path" ANT_HOME="$formatted_path"
PathFormat "$ANT" PathFormat "$ANT"
ANT="$ANT" ANT="$formatted_path"
fi fi
AC_SUBST(ANT_HOME) AC_SUBST(ANT_HOME)
AC_SUBST(ANT) AC_SUBST(ANT)
...@@ -12918,6 +12939,8 @@ else ...@@ -12918,6 +12939,8 @@ else
;; ;;
cygwin*) cygwin*)
# Win32 make needs native paths
LO_PATH=`cygpath -p -m "$PATH"`
pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before" pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
pathmunge "$ASM_HOME" "before" pathmunge "$ASM_HOME" "before"
pathmunge "$WINDOWS_SDK_HOME/bin" "before" pathmunge "$WINDOWS_SDK_HOME/bin" "before"
......
...@@ -52,8 +52,12 @@ MAKEFLAGS += r ...@@ -52,8 +52,12 @@ MAKEFLAGS += r
ifdef gb_SHELL ifdef gb_SHELL
SHELL := $(gb_SHELL) SHELL := $(gb_SHELL)
else else
ifeq ($(OS_FOR_BUILD),WNT)
SHELL := $(shell cygpath -m /bin/sh)
else
SHELL := /bin/sh SHELL := /bin/sh
endif endif
endif
true := T true := T
false := false :=
......
...@@ -364,7 +364,7 @@ endef ...@@ -364,7 +364,7 @@ endef
# CppunitTest class # CppunitTest class
gb_CppunitTest_DEFS := -D_DLL gb_CppunitTest_DEFS := -D_DLL
gb_CppunitTest_CPPTESTPRECOMMAND := $(call gb_Helper_prepend_ld_path,$(shell cygpath -u $(gb_Library_DLLDIR)):$(shell cygpath -u $(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/$(if $(MSVC_USE_DEBUG_RUNTIME),DebugDll,ReleaseDll))) gb_CppunitTest_CPPTESTPRECOMMAND := $(call gb_Helper_prepend_ld_path,$(shell cygpath -w $(gb_Library_DLLDIR));$(shell cygpath -w $(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/$(if $(MSVC_USE_DEBUG_RUNTIME),DebugDll,ReleaseDll)))
gb_CppunitTest_get_filename = test_$(1).dll gb_CppunitTest_get_filename = test_$(1).dll
gb_CppunitTest_get_ilibfilename = itest_$(1).lib gb_CppunitTest_get_ilibfilename = itest_$(1).lib
......
...@@ -294,10 +294,10 @@ gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL) ...@@ -294,10 +294,10 @@ gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
# Helper class # Helper class
gb_Helper_set_ld_path := PATH="$$PATH:$(shell cygpath -u $(INSTDIR)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR)/$(LIBO_BIN_FOLDER))" gb_Helper_set_ld_path := PATH="$$PATH;$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(LIBO_BIN_FOLDER))"
define gb_Helper_prepend_ld_path define gb_Helper_prepend_ld_path
PATH="$(shell cygpath -u $(INSTDIR)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR)/$(LIBO_BIN_FOLDER)):$(1):$$PATH" PATH="$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(LIBO_BIN_FOLDER));$(1);$$PATH"
endef endef
# vim: set noet sw=4: # vim: set noet sw=4:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment