Kaydet (Commit) f4f4e3c0 authored tarafından Matúš Kukan's avatar Matúš Kukan Kaydeden (comit) Noel Power

gbuild: use mixed paths on cygwin

make 3.82 understands mixed paths, so use them.
This allows us to get rid of evil in BuildDirs.mk.
Hopefully, life will be simpler now.

Change-Id: I I I641f28c6af1948963f7004f8071af62e21caabb3
üst 4f01261a
......@@ -360,16 +360,10 @@ ifneq ($(filter-out clean distclean,$(MAKECMDGOALS)),)
# config_host.mk which is included in this
# Makefile
ifeq ($(OS_FOR_BUILD),WNT)
CONFIG_HOST_MK=$(shell cygpath -u $(SRCDIR))/config_host.mk
else
CONFIG_HOST_MK=$(SRCDIR)/config_host.mk
endif
Makefile: $(CONFIG_HOST_MK)
Makefile: $(SRCDIR)/config_host.mk
touch $@
$(CONFIG_HOST_MK) : config_host.mk.in bin/repo-list.in ooo.lst.in configure.in autogen.lastrun
$(SRCDIR)/config_host.mk: config_host.mk.in bin/repo-list.in ooo.lst.in configure.in autogen.lastrun
./autogen.sh
autogen.lastrun:
......@@ -390,18 +384,12 @@ endif
#
# Bootstap
#
ifeq ($(OS_FOR_BUILD),WNT)
WORKDIR_BOOTSTRAP=$(shell cygpath -u $(WORKDIR))/bootstrap
else
WORKDIR_BOOTSTRAP=$(WORKDIR)/bootstrap
endif
bootstrap: $(WORKDIR)/bootstrap
$(WORKDIR_BOOTSTRAP):
$(WORKDIR)/bootstrap:
@cd $(SRCDIR) && ./bootstrap
@mkdir -p $(dir $@) && touch $@
bootstrap: $(WORKDIR_BOOTSTRAP)
#
# Build
#
......
......@@ -36,6 +36,6 @@ $(ACBI)/WindowsAccessBridgeAdapter.h :| $(ACBI)/.dir \
$(call gb_Jar_get_target,java_uno_accessbridge)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),JVH,1)
cd $(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,java_uno_accessbridge)) && \
javah -classpath "$(call gb_Helper_native_path,$(OUTDIR)/bin/ridl.jar)$(gb_CLASSPATHSEP)$(call gb_Helper_native_path,$(OUTDIR)/bin/unoil.jar)$(gb_CLASSPATHSEP)." -o $(call gb_Helper_native_path,$@) org.openoffice.accessibility.WindowsAccessBridgeAdapter
javah -classpath "$(OUTDIR)/bin/ridl.jar$(gb_CLASSPATHSEP)$(OUTDIR)/bin/unoil.jar$(gb_CLASSPATHSEP)." -o $@ org.openoffice.accessibility.WindowsAccessBridgeAdapter
# vim: set ts=4 sw=4 et:
......@@ -3760,6 +3760,9 @@ if test "$_make_longver" -ge "038200"; then
AC_MSG_RESULT([$GNUMAKE $_make_version])
elif test "$_make_longver" -ge "038100"; then
if test "$build_os" = "cygwin"; then
AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
fi
AC_MSG_RESULT([$GNUMAKE $_make_version])
dnl ===================================================================
......
......@@ -54,7 +54,7 @@ $(eval $(call gb_Library_add_exception_objects,so_activex,\
))
$(eval $(call gb_Library_add_ldflags,so_activex,\
/DEF:$(call gb_Helper_native_path,$(SRCDIR)/extensions/source/activex/so_activex.def) \
/DEF:$(SRCDIR)/extensions/source/activex/so_activex.def \
))
$(eval $(call gb_Library_use_libraries,so_activex,\
......
......@@ -57,7 +57,7 @@ $(eval $(call gb_Library_add_x64_generated_exception_objects,so_activex_x64,\
))
$(eval $(call gb_Library_add_ldflags,so_activex_x64,\
/DEF:$(call gb_Helper_native_path,$(SRCDIR)/extensions/source/activex/so_activex.def) \
/DEF:$(SRCDIR)/extensions/source/activex/so_activex.def \
))
$(eval $(call gb_Library_use_libraries,so_activex_x64,\
......
......@@ -41,7 +41,7 @@ $(eval $(call gb_WinResTarget_add_file,activex_res,extensions/source/activex/so_
$(eval $(call gb_WinResTarget_set_defs,activex_res,\
$$(DEFS) \
-DSO_ACTIVEX_TLB_DIR=$(subst /,\\,$(subst $(call gb_Helper_native_path,$(SRCDIR)),../../..,$(call gb_Helper_native_path,$(WORKDIR)/CustomTarget/extensions/source/activex/idl))) \
-DSO_ACTIVEX_TLB_DIR=$(subst /,\\,$(subst $(SRCDIR),../../..,$(WORKDIR)/CustomTarget/extensions/source/activex/idl)) \
))
$(call gb_WinResTarget_get_target,activex_res) : $(WORKDIR)/CustomTarget/extensions/source/activex/idl/so_activex.tlb
......
......@@ -76,18 +76,6 @@
# #
#########################
# This is to undo the EVIL in solenv/gbuild/BuildDirs.mk
if ($ENV{OS_FOR_BUILD} eq 'WNT') {
$ENV{WORKDIR} = `cygpath -m '$ENV{WORKDIR}'`;
$ENV{OUTDIR} = `cygpath -m '$ENV{OUTDIR}'`;
$ENV{OUTDIR_FOR_BUILD} = `cygpath -m '$ENV{OUTDIR_FOR_BUILD}'`;
$ENV{SRCDIR} = `cygpath -m '$ENV{SRCDIR}'`;
chomp($ENV{WORKDIR});
chomp($ENV{OUTDIR});
chomp($ENV{OUTDIR_FOR_BUILD});
chomp($ENV{SRCDIR});
}
my $modules_number++;
my $perl = 'perl';
my $remove_command = 'rm -rf';
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#*************************************************************************
# The entire gbuild operates in unix paths, and then when calling the
# native tools, converts them back to the Windows native paths.
#
# The path overwriting below is EVIL, because after the recent changes when
# every module (even build.pl-based) is routed through gbuild, the modules
# using build.pl-based build will get OUTDIR in the cygwin format.
#
# To undo this, we explicitly set these vars to native Windows paths in
# build.pl again, otherwise we would have potentially different behavior in
# build.pl-based modules when you build them from the toplevel (using make
# all), and from the module itself (using cd module ; build )
ifeq ($(OS_FOR_BUILD),WNT)
override WORKDIR := $(shell cygpath -u $(WORKDIR))
override OUTDIR := $(shell cygpath -u $(OUTDIR))
override OUTDIR_FOR_BUILD := $(shell cygpath -u $(OUTDIR_FOR_BUILD))
override SRCDIR := $(shell cygpath -u $(SRCDIR))
endif
# vim: set noet sw=4:
......@@ -191,7 +191,7 @@ $(call gb_Extension_get_rootdir,$(1))/$(2) : $(gb_Extension_HELPEXTARGET)
$(call gb_Extension_get_rootdir,$(1))/$(2) : $(3)
$$(call gb_Output_announce,$(2),$(true),XHP,3)
mkdir -p $$(dir $$@) && \
$(gb_Extension_HELPEXCOMMAND) -i $$(call gb_Helper_native_path,$$<) -o $$(call gb_Helper_native_path,$$@) -l $(4) -m $$(call gb_Helper_native_path,$$(SDF))
$(gb_Extension_HELPEXCOMMAND) -i $$< -o $$@ -l $(4) -m $$(SDF)
endef
......
......@@ -44,25 +44,15 @@ define gb_Helper_abbreviate_dirs
S=$(SRCDIR) && \
$(subst $(SRCDIR)/,$$S/,O=$(OUTDIR)) && \
$(subst $(SRCDIR)/,$$S/,W=$(WORKDIR)) && \
$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,$(subst $(WORKDIR)/,$$W/,\
$(call gb_Helper_unix_path,$(1)))))
$(subst $(SRCDIR)/,$$S/,$(subst $(OUTDIR)/,$$O/,$(subst $(WORKDIR)/,$$W/,$(1))))
endef
define gb_Helper_abbreviate_dirs_native
$(call gb_Helper_native_path,$(call gb_Helper_abbreviate_dirs,$(1)))
$(call gb_Helper_abbreviate_dirs,$(1))
endef
# Convert path to native notation
# First convert to unix style to avoid problems when
# $(SRCDIR) is substring of $(gb_Helper_SRCDIR_NATIVE)
# and $(1) already contains $(gb_Helper_SRCDIR_NATIVE)
define gb_Helper_native_path
$(subst $(SRCDIR),$(gb_Helper_SRCDIR_NATIVE),$(call gb_Helper_unix_path,$(1)))
endef
# $(gb_Helper_SRCDIR_NATIVE) can't be substring of $(SRCDIR)
define gb_Helper_unix_path
$(subst $(gb_Helper_SRCDIR_NATIVE),$(SRCDIR),$(1))
$$(call gb_Output_error,gb_Helper_native_path: Do not use. Should not be necessary.)
endef
define gb_Helper_make_clean_target
......
......@@ -43,8 +43,7 @@ $(call gb_Helper_abbreviate_dirs_native,\
$(if $(filter-out $(JARDEPS),$(4)), \
rm -rf $(call gb_JavaClassSet_get_classdir,$(2))/* && \
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\
$(call gb_Helper_native_path,\
$(filter-out $(JARDEPS),$(4)))) && \
$(filter-out $(JARDEPS),$(4))) && \
$(if $(3),$(gb_JavaClassSet_JAVACCOMMAND) \
$(gb_JavaClassSet_JAVACDEBUG) \
-cp "$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \
......
......@@ -56,10 +56,10 @@ define gb_UnoApiPartTarget__command
$(call gb_Output_announce,$(2),$(true),IDL,2)
mkdir -p $(call gb_UnoApiPartTarget_get_target,$(dir $(2))) && \
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\
$(call gb_Helper_native_path,$(INCLUDE) \
$(INCLUDE) \
-M $(basename $(call gb_UnoApiPartTarget_get_dep_target,$(dir $(2)))) \
-O $(call gb_UnoApiPartTarget_get_target,$(dir $(2))) -verbose -C \
$(sort $(patsubst $(call gb_UnoApiPartTarget_get_target,%.urd),$(SRCDIR)/%.idl,$(3))))) && \
$(sort $(patsubst $(call gb_UnoApiPartTarget_get_target,%.urd),$(SRCDIR)/%.idl,$(3)))) && \
$(gb_UnoApiPartTarget_IDLCCOMMAND) @$${RESPONSEFILE} > /dev/null && \
rm -f $${RESPONSEFILE} && \
touch $(1)
......@@ -91,11 +91,11 @@ gb_UnoApiTarget_XML2CMPCOMMAND := $(gb_Helper_set_ld_path) $(gb_UnoApiTarget_XML
gb_UnoApiTarget_XMLRDB := $(call gb_UnoApiTarget_get_target,types)
define gb_UnoApiTarget__get_types
$(if $(1),$(foreach type,$(shell $(gb_UnoApiTarget_XML2CMPCOMMAND) -types stdout $(call gb_Helper_native_path,$(1))),$(addprefix -T,$(type))))
$(if $(1),$(foreach type,$(shell $(gb_UnoApiTarget_XML2CMPCOMMAND) -types stdout $(1)),$(addprefix -T,$(type))))
endef
define gb_UnoApiTarget__command_impl
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(call gb_Helper_native_path,$(2))) && \
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,$(2)) && \
$(1) @$${RESPONSEFILE} && \
rm -f $${RESPONSEFILE}
endef
......@@ -121,8 +121,8 @@ $(if $(UNOAPI_REFERENCE), \
$(call gb_Output_announce,$*,$(true),DBc,3) \
&& $(gb_UnoApiTarget_REGCOMPARECOMMAND) \
-f -t \
-r1 $(call gb_Helper_native_path,$(UNOAPI_REFERENCE)) \
-r2 $(call gb_Helper_native_path,$(1)))
-r1 $(UNOAPI_REFERENCE) \
-r2 $(1))
endef
define gb_UnoApiTarget__check_mode
......@@ -275,8 +275,8 @@ gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=
define gb_UnoApiHeadersTarget__command
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,\
$(call gb_Helper_native_path,-Gc $(4) -BUCR \
-O$(3) $(call gb_UnoApiTarget_get_target,$(2)) $(UNOAPI_DEPS))) && \
-Gc $(4) -BUCR \
-O$(3) $(call gb_UnoApiTarget_get_target,$(2)) $(UNOAPI_DEPS)) && \
$(gb_UnoApiHeadersTarget_CPPUMAKERCOMMAND) @$${RESPONSEFILE} && \
rm -f $${RESPONSEFILE} && \
touch $(1)
......
......@@ -69,9 +69,6 @@ endif
include $(GBUILDDIR)/Output.mk
# BuildDirs overrides *DIR variables for Windows
include $(GBUILDDIR)/BuildDirs.mk
ifneq ($(strip $(PRODUCT)$(product)),)
gb_PRODUCT := $(true)
......
......@@ -239,9 +239,8 @@ endif
gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/bin
gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/bin
gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR))
gb_Helper_set_ld_path := PATH="$${PATH}:$(OUTDIR)/bin"
gb_Helper_set_ld_path := PATH="$${PATH}:$(shell cygpath -u $(OUTDIR)/bin)"
# Convert path to file URL.
define gb_Helper_make_url
......@@ -331,13 +330,13 @@ $(call gb_Helper_abbreviate_dirs_native,\
mkdir -p $(dir $(1)) && \
rm -f $(1) && \
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \
$(call gb_Helper_native_path,$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
$(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \
$(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \
$(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \
$(NATIVERES))) && \
$(NATIVERES)) && \
$(if $(filter YES,$(LIBRARY_X64)), $(LINK_X64_BINARY), $(gb_LINK)) \
$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
$(if $(filter StaticLibrary,$(TARGETTYPE)),$(gb_StaticLibrary_TARGETTYPEFLAGS)) \
......@@ -567,9 +566,7 @@ endef
gb_CppunitTest_DEFS := -D_DLL
# cppunittester.exe is in the cppunit subdirectory of ${OUTDIR}/bin,
# thus it won't find its DLLs unless ${OUTDIR}/bin is added to PATH.
# PATH is the Cygwin one while ${OUTDIR} is a Win32 pathname, thus
# cygpath -u.
gb_CppunitTest_CPPTESTPRECOMMAND := PATH="`cygpath -u $(OUTDIR)`/bin:$${PATH}"
gb_CppunitTest_CPPTESTPRECOMMAND := $(gb_Helper_set_ld_path)
gb_CppunitTest_SYSPRE := itest_
gb_CppunitTest_EXT := .lib
......@@ -697,6 +694,6 @@ gb_WinResTarget__command_dep =
endif
# Python
gb_PYTHON_PRECOMMAND := PATH="$${PATH}:$(shell cygpath -m $(OUTDIR_FOR_BUILD)/bin)" PYTHONHOME="$(shell cygpath -m $(OUTDIR_FOR_BUILD))/lib/python" PYTHONPATH="$(shell cygpath -m $(OUTDIR_FOR_BUILD))/lib/python;$(shell cygpath -m $(OUTDIR_FOR_BUILD))/lib/python/lib-dynload"
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload"
# vim: set noet sw=4:
......@@ -160,6 +160,5 @@ endef
gb_Helper_OUTDIRLIBDIR := $(OUTDIR)/lib
gb_Helper_OUTDIR_FOR_BUILDLIBDIR := $(OUTDIR_FOR_BUILD)/lib
gb_Helper_SRCDIR_NATIVE := $(SRCDIR)
gb_Helper_get_rcfile = $(1)rc
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