Kaydet (Commit) c5b1441e authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Use separate config_*.h files for BUILD and HOST when cross-compiling

We have only been lucky so far that there hasn't been any compilation errors
caused by using the HOST platform config_*.h files also for the BUILD
platform. But as more and more information found out during configury is
stored in config_*.h files, sooner or later it will be a problem.

Move config/* to config_host/*. When not cross-compiling, the config_*.h files
in config_host expanded from config_*.h.in are all there is. When
cross-compiling, the generated config_*.h files for the BUILD platform are
put into a config_build folder.

Then use config_build when building the cross_toolset and config_host
otherwise.

Change-Id: I3c28cc83866bffd696b45d00dfb68e00bc2ae538
üst 0e63a970
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
/config_host.mk /config_host.mk
/config_host.mk.last /config_host.mk.last
/config_host.mk.stamp /config_host.mk.stamp
/config_build/config_*.h
/config_build.mk /config_build.mk
/configure /configure
/Makefile /Makefile
......
...@@ -46,7 +46,7 @@ else # MAKE_RESTARTS ...@@ -46,7 +46,7 @@ else # MAKE_RESTARTS
all: build all: build
ifeq ($(gb_Side),) ifeq ($(gb_Side),)
gb_Side:=host export gb_Side:=host
endif endif
include $(BUILDDIR)/config_$(gb_Side).mk include $(BUILDDIR)/config_$(gb_Side).mk
......
...@@ -4114,7 +4114,7 @@ if test "$cross_compiling" = "yes"; then ...@@ -4114,7 +4114,7 @@ if test "$cross_compiling" = "yes"; then
config_host.mk.in \ config_host.mk.in \
configure \ configure \
Makefile.in \ Makefile.in \
config/config_*.h.in \ config_host/config_*.h.in \
bin/get_config_variables \ bin/get_config_variables \
solenv/bin/getcompver.awk \ solenv/bin/getcompver.awk \
solenv/inc/langlist.mk \ solenv/inc/langlist.mk \
...@@ -4170,6 +4170,8 @@ if test "$cross_compiling" = "yes"; then ...@@ -4170,6 +4170,8 @@ if test "$cross_compiling" = "yes"; then
test -f ./config_host.mk 2>/dev/null || exit test -f ./config_host.mk 2>/dev/null || exit
cp config_host.mk ../config_build.mk cp config_host.mk ../config_build.mk
cp config.log ../config.Build.log cp config.log ../config.Build.log
mkdir -p ../config_build
cp config_host/*.h ../config_build
. ./bin/get_config_variables COM GUI OS PATH CPU CPUNAME CC CXX DISABLE_PYTHON MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH PYTHON SYSTEM_LIBXSLT OUTDIR SOLARINC SOLARLIB WORKDIR . ./bin/get_config_variables COM GUI OS PATH CPU CPUNAME CC CXX DISABLE_PYTHON MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH PYTHON SYSTEM_LIBXSLT OUTDIR SOLARINC SOLARLIB WORKDIR
for V in COM GUI OS CPU CPUNAME CC CXX DISABLE_PYTHON MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \ for V in COM GUI OS CPU CPUNAME CC CXX DISABLE_PYTHON MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
...@@ -12308,12 +12310,12 @@ else ...@@ -12308,12 +12310,12 @@ else
fi fi
AC_CONFIG_FILES([config_host.mk Makefile solenv/inc/minor.mk instsetoo_native/util/openoffice.lst]) AC_CONFIG_FILES([config_host.mk Makefile solenv/inc/minor.mk instsetoo_native/util/openoffice.lst])
AC_CONFIG_HEADERS([config/config_clang.h]) AC_CONFIG_HEADERS([config_host/config_clang.h])
AC_CONFIG_HEADERS([config/config_global.h]) AC_CONFIG_HEADERS([config_host/config_global.h])
AC_CONFIG_HEADERS([config/config_graphite.h]) AC_CONFIG_HEADERS([config_host/config_graphite.h])
AC_CONFIG_HEADERS([config/config_telepathy.h]) AC_CONFIG_HEADERS([config_host/config_telepathy.h])
AC_CONFIG_HEADERS([config/config_vclplug.h]) AC_CONFIG_HEADERS([config_host/config_vclplug.h])
AC_CONFIG_HEADERS([config/config_version.h]) AC_CONFIG_HEADERS([config_host/config_version.h])
AC_OUTPUT AC_OUTPUT
# touch the config timestamp file # touch the config timestamp file
......
...@@ -30,6 +30,8 @@ ifeq ($(strip $(SOLARENV)),) ...@@ -30,6 +30,8 @@ ifeq ($(strip $(SOLARENV)),)
include $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/../config_build.mk include $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/../config_build.mk
endif endif
export gb_Side=build
include $(SOLARENV)/gbuild/gbuild.mk include $(SOLARENV)/gbuild/gbuild.mk
$(eval $(call gb_Module_make_global_targets,$(SRCDIR)/Module_cross_tail_build.mk)) $(eval $(call gb_Module_make_global_targets,$(SRCDIR)/Module_cross_tail_build.mk))
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
SHELL=/usr/bin/env bash SHELL=/usr/bin/env bash
include ../config_build.mk include ../config_build.mk
export gb_Side=build
.PHONY : build .PHONY : build
build: build:
......
...@@ -157,7 +157,7 @@ gb_DEBUG_CXXFLAGS := $(FNO_DEFAULT_INLINE) ...@@ -157,7 +157,7 @@ gb_DEBUG_CXXFLAGS := $(FNO_DEFAULT_INLINE)
gb_LinkTarget_INCLUDE :=\ gb_LinkTarget_INCLUDE :=\
$(subst -I. , ,$(SOLARINC)) \ $(subst -I. , ,$(SOLARINC)) \
-I$(BUILDDIR)/config \ -I$(BUILDDIR)/config_$(gb_Side) \
ifeq ($(COM_GCC_IS_CLANG),TRUE) ifeq ($(COM_GCC_IS_CLANG),TRUE)
ifeq ($(COMPILER_PLUGIN_TOOL),) ifeq ($(COMPILER_PLUGIN_TOOL),)
......
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