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)\
$(if $(filter check,$(MAKECMDGOALS)),subsequentcheck)\
$(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@
BUILDDIR := @BUILDDIR@
GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T)
......
......@@ -39,7 +39,7 @@ PathFormat()
fi
done
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
AC_MSG_ERROR([path conversion failed for "$1".])
fi
......@@ -2309,15 +2309,15 @@ pathmunge ()
if test -n "$1"; then
if test "$build_os" = "cygwin"; then
PathFormat "$1"
new_path=`cygpath -u "$formatted_path"`
new_path=`cygpath -sm "$formatted_path"`
else
new_path="$1"
fi
if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
if test "$2" = "after"; then
LO_PATH="$LO_PATH:$new_path"
LO_PATH="$LO_PATH${P_SEP}$new_path"
else
LO_PATH="$new_path:$LO_PATH"
LO_PATH="$new_path${P_SEP}$LO_PATH"
fi
fi
unset new_path
......@@ -3676,8 +3676,7 @@ if test "$_os" = "WINNT"; then
fi
fi
VC_PRODUCT_DIR=`cygpath -d "$VC_PRODUCT_DIR"`
VC_PRODUCT_DIR=`cygpath -u "$VC_PRODUCT_DIR"`
VC_PRODUCT_DIR=`cygpath -sm "$VC_PRODUCT_DIR"`
AC_MSG_RESULT([$VC_PRODUCT_DIR])
dnl ===========================================================
......@@ -3727,8 +3726,7 @@ if test "$_os" = "WINNT"; then
fi
# This gives us a posix path with 8.3 filename restrictions
CC=`cygpath -d "$CC"`
CC=`cygpath -u "$CC"`
CC=`cygpath -sm "$CC"`
fi
if test -n "$CC"; then
......@@ -4985,7 +4983,11 @@ for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
if test -n "$a"; then
$a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
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
fi
fi
......@@ -5060,6 +5062,9 @@ fi
# find if gnumake support file function
AC_MSG_CHECKING([whether GNU make supports the 'file' function])
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
\$(file >test.txt,Success )
......@@ -5086,6 +5091,13 @@ if test "$_make_ver_check" = ""; then
STALE_MAKE=TRUE
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
WITH_LINKER_HASH_STYLE=
AC_MSG_CHECKING( for --hash-style gcc linker support )
......@@ -5382,8 +5394,7 @@ if test "$build_os" = "cygwin"; then
fi
# Convert to posix path with 8.3 filename restrictions ( No spaces )
MIDL_PATH=`cygpath -d "$MIDL_PATH"`
MIDL_PATH=`cygpath -u "$MIDL_PATH"`
MIDL_PATH=`cygpath -sm "$MIDL_PATH"`
dnl Check csc.exe
AC_MSG_CHECKING([for csc.exe])
......@@ -5397,8 +5408,7 @@ if test "$build_os" = "cygwin"; then
AC_MSG_RESULT([$CSC_PATH/csc.exe])
fi
CSC_PATH=`cygpath -d "$CSC_PATH"`
CSC_PATH=`cygpath -u "$CSC_PATH"`
CSC_PATH=`cygpath -sm "$CSC_PATH"`
dnl Check al.exe
AC_MSG_CHECKING([for al.exe])
......@@ -5423,8 +5433,7 @@ if test "$build_os" = "cygwin"; then
AC_MSG_RESULT([$AL_PATH/al.exe])
fi
AL_PATH=`cygpath -d "$AL_PATH"`
AL_PATH=`cygpath -u "$AL_PATH"`
AL_PATH=`cygpath -sm "$AL_PATH"`
dnl Check mscoree.lib / .NET Framework dir
AC_MSG_CHECKING(.NET Framework)
......@@ -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])
fi
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"
fi
fi
......@@ -6885,8 +6894,7 @@ if test "$ENABLE_JAVA" != ""; then
if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
fi
JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
JAVAINTERPRETER=`cygpath -sm "$JAVAINTERPRETER"`
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 and Tiger Java complains about -d32 while Snow Leopard Java needs it
......@@ -7032,8 +7040,7 @@ if test "$ENABLE_JAVA" != ""; then
if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
JAVACOMPILER="${JAVACOMPILER}.exe"
fi
JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
JAVACOMPILER=`cygpath -sm "$JAVACOMPILER"`
fi
if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
......@@ -7077,8 +7084,7 @@ if test "$ENABLE_JAVA" != ""; then
if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
JAVADOC="${JAVADOC}.exe"
fi
JAVADOC=`cygpath -d "$JAVADOC"`
JAVADOC=`cygpath -u "$JAVADOC"`
JAVADOC=`cygpath -sm "$JAVADOC"`
fi
if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
......@@ -7500,6 +7506,9 @@ AC_PATH_PROG(GPERF, gperf)
if test -z "$GPERF"; then
AC_MSG_ERROR([gperf not found but needed. Install it.])
fi
if test "$build_os" = "cygwin"; then
GPERF=`cygpath -m $GPERF`
fi
AC_MSG_CHECKING([gperf version])
if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
AC_MSG_RESULT([OK])
......@@ -9874,6 +9883,9 @@ else
fi
AC_PATH_PROG(FLEX, flex)
if test "$build_os" = "cygwin"; then
FLEX=`cygpath -m $FLEX`
fi
if test -z "$FLEX"; then
AC_MSG_ERROR([no flex found in \$PATH, install it])
else
......@@ -9914,6 +9926,10 @@ else
GNUPATCH=$PATCH
fi
if test "$build_os" = "cygwin"; then
GNUPATCH=`cygpath -m $GNUPATCH`
fi
dnl We also need to check for --with-gnu-cp
if test -z "$with_gnu_cp"; then
......@@ -9934,6 +9950,10 @@ else
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])
if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
AC_MSG_RESULT([yes])
......@@ -12059,6 +12079,7 @@ if test "$ENABLE_JAVA" != ""; then
AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
else
if test "$_os" = "WINNT"; then
# AC_PATH_PROGS needs unix path
with_ant_home=`cygpath -u "$with_ant_home"`
fi
AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
......@@ -12131,7 +12152,7 @@ EOF
PathFormat "$ANT_HOME"
ANT_HOME="$formatted_path"
PathFormat "$ANT"
ANT="$ANT"
ANT="$formatted_path"
fi
AC_SUBST(ANT_HOME)
AC_SUBST(ANT)
......@@ -12918,6 +12939,8 @@ else
;;
cygwin*)
# Win32 make needs native paths
LO_PATH=`cygpath -p -m "$PATH"`
pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
pathmunge "$ASM_HOME" "before"
pathmunge "$WINDOWS_SDK_HOME/bin" "before"
......
......@@ -52,8 +52,12 @@ MAKEFLAGS += r
ifdef gb_SHELL
SHELL := $(gb_SHELL)
else
ifeq ($(OS_FOR_BUILD),WNT)
SHELL := $(shell cygpath -m /bin/sh)
else
SHELL := /bin/sh
endif
endif
true := T
false :=
......
......@@ -364,7 +364,7 @@ endef
# CppunitTest class
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_ilibfilename = itest_$(1).lib
......
......@@ -294,10 +294,10 @@ gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
# 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
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
# 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