Patch by Samuel Rodriguez Perez, slightly modified by myself: New
configure flag "--use-32bit" enabling 32 bit builds with a 64 bit host compiler. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22046 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+20
-8
@@ -346,6 +346,12 @@ HAIKU_BUILD_DESCRIPTION ?= "Unknown Build" ;
|
|||||||
|
|
||||||
# host platform settings
|
# host platform settings
|
||||||
|
|
||||||
|
# enable GCC -m32 option, if requested
|
||||||
|
if $(HAIKU_HOST_USE_32BIT) = 1 {
|
||||||
|
HOST_GCC_BASE_FLAGS = -m32 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# save jam's variables for the build platform
|
# save jam's variables for the build platform
|
||||||
HOST_AR ?= $(AR) ;
|
HOST_AR ?= $(AR) ;
|
||||||
HOST_CC ?= $(CC) ;
|
HOST_CC ?= $(CC) ;
|
||||||
@@ -355,13 +361,14 @@ HOST_LD ?= ld ; # TODO: Fix this!
|
|||||||
HOST_OBJCOPY ?= objcopy ; #
|
HOST_OBJCOPY ?= objcopy ; #
|
||||||
HOST_RANLIB ?= $(RANLIB) ;
|
HOST_RANLIB ?= $(RANLIB) ;
|
||||||
HOST_CPPFLAGS ?= $(CPPFLAGS) ;
|
HOST_CPPFLAGS ?= $(CPPFLAGS) ;
|
||||||
HOST_CCFLAGS ?= $(CCFLAGS) ;
|
HOST_CCFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(CCFLAGS) ;
|
||||||
HOST_C++FLAGS ?= $(C++FLAGS) ;
|
HOST_C++FLAGS ?= $(HOST_GCC_BASE_FLAGS) $(C++FLAGS) ;
|
||||||
HOST_LDFLAGS ?= $(LDFLAGS) ;
|
HOST_LDFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(LDFLAGS) ;
|
||||||
HOST_LINKFLAGS ?= $(LINKFLAGS) ;
|
HOST_LINKFLAGS ?= $(HOST_GCC_BASE_FLAGS) $(LINKFLAGS) ;
|
||||||
HOST_DEFINES ?= $(DEFINES) ;
|
HOST_DEFINES ?= $(DEFINES) ;
|
||||||
HOST_HDRS ?= $(HDRS) ;
|
HOST_HDRS ?= $(HDRS) ;
|
||||||
|
|
||||||
|
|
||||||
# split up HOST_AR into the command name and flags
|
# split up HOST_AR into the command name and flags
|
||||||
HOST_AR = [ Match "([^ ]*) *(.*)" : $(HOST_AR[1]) ]
|
HOST_AR = [ Match "([^ ]*) *(.*)" : $(HOST_AR[1]) ]
|
||||||
$(HOST_AR[2-]) ;
|
$(HOST_AR[2-]) ;
|
||||||
@@ -415,10 +422,10 @@ HOST_C++FLAGS += -Wno-multichar ;
|
|||||||
HOST_PIC_CCFLAGS += -fPIC ;
|
HOST_PIC_CCFLAGS += -fPIC ;
|
||||||
HOST_PIC_C++FLAGS += -fPIC ;
|
HOST_PIC_C++FLAGS += -fPIC ;
|
||||||
|
|
||||||
HOST_KERNEL_CCFLAGS += -finline -fno-builtin
|
HOST_KERNEL_CCFLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
|
||||||
-DBOCHS_DEBUG_HACK=$(BOCHS_DEBUG_HACK) -D_KERNEL_MODE ;
|
|
||||||
HOST_KERNEL_C++FLAGS += -finline -fno-builtin -fno-exceptions
|
|
||||||
-DBOCHS_DEBUG_HACK=$(BOCHS_DEBUG_HACK) -D_KERNEL_MODE ;
|
-DBOCHS_DEBUG_HACK=$(BOCHS_DEBUG_HACK) -D_KERNEL_MODE ;
|
||||||
|
HOST_KERNEL_C++FLAGS += $(HOST_GCC_BASE_FLAGS) -finline -fno-builtin
|
||||||
|
-fno-exceptions -DBOCHS_DEBUG_HACK=$(BOCHS_DEBUG_HACK) -D_KERNEL_MODE ;
|
||||||
|
|
||||||
HOST_KERNEL_PIC_CCFLAGS = -fno-pic ;
|
HOST_KERNEL_PIC_CCFLAGS = -fno-pic ;
|
||||||
HOST_KERNEL_PIC_LINKFLAGS = ;
|
HOST_KERNEL_PIC_LINKFLAGS = ;
|
||||||
@@ -465,6 +472,11 @@ for level in $(HAIKU_DEBUG_LEVELS[2-]) {
|
|||||||
HOST_KERNEL_DEBUG_$(level)_C++FLAGS = $(flags) ;
|
HOST_KERNEL_DEBUG_$(level)_C++FLAGS = $(flags) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ld flags
|
||||||
|
if $(HOST_ARCH) = x86 && $(HAIKU_HOST_USE_32BIT) = 1 {
|
||||||
|
HOST_LDFLAGS += -melf_i386 ;
|
||||||
|
}
|
||||||
|
|
||||||
# private kernel headers do be used when compiling kernel code
|
# private kernel headers do be used when compiling kernel code
|
||||||
HOST_PRIVATE_KERNEL_HEADERS = ;
|
HOST_PRIVATE_KERNEL_HEADERS = ;
|
||||||
|
|
||||||
@@ -517,7 +529,7 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
|
|||||||
} else if $(HOST_PLATFORM) = darwin {
|
} else if $(HOST_PLATFORM) = darwin {
|
||||||
HOST_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
|
HOST_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# The BeOS compilers define __INTEL__ respectively __POWERPC__. On the
|
# The BeOS compilers define __INTEL__ respectively __POWERPC__. On the
|
||||||
# build platform we need to make sure, this is also defined.
|
# build platform we need to make sure, this is also defined.
|
||||||
|
|||||||
+19
-17
@@ -2,7 +2,7 @@
|
|||||||
rule AddSharedObjectGlueCode
|
rule AddSharedObjectGlueCode
|
||||||
{
|
{
|
||||||
# AddSharedObjectGlueCode <target> : <isExecutable> ;
|
# AddSharedObjectGlueCode <target> : <isExecutable> ;
|
||||||
|
|
||||||
# we link with -nostdlib and add the required libs manually, when building
|
# we link with -nostdlib and add the required libs manually, when building
|
||||||
# for Haiku
|
# for Haiku
|
||||||
local platform ;
|
local platform ;
|
||||||
@@ -94,7 +94,7 @@ rule Preference
|
|||||||
rule Server
|
rule Server
|
||||||
{
|
{
|
||||||
# Server <name> : <sources> : <libraries> : <res> ;
|
# Server <name> : <sources> : <libraries> : <res> ;
|
||||||
|
|
||||||
Executable $(1) : $(2) : $(3) : $(4) ;
|
Executable $(1) : $(2) : $(3) : $(4) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ rule StaticLibrary
|
|||||||
# <lib>: The static library to be built.
|
# <lib>: The static library to be built.
|
||||||
# <sources>: List of source files.
|
# <sources>: List of source files.
|
||||||
# <otherObjects>: List of additional object files.
|
# <otherObjects>: List of additional object files.
|
||||||
#
|
#
|
||||||
local lib = $(1) ;
|
local lib = $(1) ;
|
||||||
local sources = [ FGristFiles $(2) ] ;
|
local sources = [ FGristFiles $(2) ] ;
|
||||||
local otherObjects = $(3) ;
|
local otherObjects = $(3) ;
|
||||||
@@ -192,12 +192,12 @@ rule Ld
|
|||||||
NEEDLIBS on $(target) = $(NEEDLIBS) ;
|
NEEDLIBS on $(target) = $(NEEDLIBS) ;
|
||||||
LINKLIBS on $(target) = $(LINKLIBS) ;
|
LINKLIBS on $(target) = $(LINKLIBS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalClean clean : $(target) ;
|
LocalClean clean : $(target) ;
|
||||||
LocalDepends all : $(target) ;
|
LocalDepends all : $(target) ;
|
||||||
Depends $(target) : $(objects) ;
|
Depends $(target) : $(objects) ;
|
||||||
|
|
||||||
MakeLocateDebug $(target) ;
|
MakeLocateDebug $(target) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
actions Ld
|
actions Ld
|
||||||
@@ -224,8 +224,10 @@ rule MergeObjectFromObjects
|
|||||||
|
|
||||||
if $(PLATFORM) = host {
|
if $(PLATFORM) = host {
|
||||||
LINK on $(1) = $(HOST_LD) ;
|
LINK on $(1) = $(HOST_LD) ;
|
||||||
|
LINKFLAGS on $(target) = $(HOST_LDFLAGS) ;
|
||||||
} else {
|
} else {
|
||||||
LINK on $(1) = $(TARGET_LD) ;
|
LINK on $(1) = $(TARGET_LD) ;
|
||||||
|
LINKFLAGS on $(target) = $(TARGET_LDFLAGS) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +240,7 @@ rule MergeObjectFromObjects
|
|||||||
|
|
||||||
actions MergeObjectFromObjects1
|
actions MergeObjectFromObjects1
|
||||||
{
|
{
|
||||||
$(LINK) -r $(2) -o $(1) ;
|
$(LINK) $(LINKFLAGS) -r $(2) -o $(1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule MergeObject
|
rule MergeObject
|
||||||
@@ -362,7 +364,7 @@ rule LinkAgainst
|
|||||||
linkLibs += $(i) ;
|
linkLibs += $(i) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NEEDLIBS on $(1) = $(NEEDLIBS) $(needLibs) ;
|
NEEDLIBS on $(1) = $(NEEDLIBS) $(needLibs) ;
|
||||||
LINKLIBS on $(1) = $(LINKLIBS) -l$(linkLibs) ;
|
LINKLIBS on $(1) = $(LINKLIBS) -l$(linkLibs) ;
|
||||||
|
|
||||||
@@ -403,10 +405,10 @@ rule BuildPlatformObjects
|
|||||||
{
|
{
|
||||||
# Usage BuildPlatformObjects <sources> ;
|
# Usage BuildPlatformObjects <sources> ;
|
||||||
# <sources> The sources.
|
# <sources> The sources.
|
||||||
#
|
#
|
||||||
local sources = [ FGristFiles $(1) ] ;
|
local sources = [ FGristFiles $(1) ] ;
|
||||||
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
||||||
|
|
||||||
PLATFORM on $(objects) = host ;
|
PLATFORM on $(objects) = host ;
|
||||||
SUPPORTED_PLATFORMS on $(objects) = host ;
|
SUPPORTED_PLATFORMS on $(objects) = host ;
|
||||||
|
|
||||||
@@ -419,7 +421,7 @@ rule BuildPlatformMain
|
|||||||
# <target> The executable/library.
|
# <target> The executable/library.
|
||||||
# <sources> The sources.
|
# <sources> The sources.
|
||||||
# <libraries> Libraries to link against.
|
# <libraries> Libraries to link against.
|
||||||
#
|
#
|
||||||
local target = $(1) ;
|
local target = $(1) ;
|
||||||
local sources = $(2) ;
|
local sources = $(2) ;
|
||||||
local libs = $(3) ;
|
local libs = $(3) ;
|
||||||
@@ -440,7 +442,7 @@ rule BuildPlatformMain
|
|||||||
NEEDLIBS on $(target) += $(HOST_LIBROOT) ;
|
NEEDLIBS on $(target) += $(HOST_LIBROOT) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Main $(target) : $(sources) ;
|
Main $(target) : $(sources) ;
|
||||||
LinkAgainst $(target) : $(libs) ;
|
LinkAgainst $(target) : $(libs) ;
|
||||||
}
|
}
|
||||||
@@ -455,7 +457,7 @@ rule BuildPlatformSharedLibrary
|
|||||||
local target = $(1) ;
|
local target = $(1) ;
|
||||||
local sources = $(2) ;
|
local sources = $(2) ;
|
||||||
local libs = $(3) ;
|
local libs = $(3) ;
|
||||||
|
|
||||||
BuildPlatformMain $(target) : $(sources) : $(libs) ;
|
BuildPlatformMain $(target) : $(sources) : $(libs) ;
|
||||||
|
|
||||||
if $(HOST_PLATFORM) = darwin {
|
if $(HOST_PLATFORM) = darwin {
|
||||||
@@ -467,8 +469,8 @@ rule BuildPlatformSharedLibrary
|
|||||||
}
|
}
|
||||||
|
|
||||||
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
||||||
CCFLAGS on $(objects) += $(HOST_PIC_CCFLAGS) ;
|
CCFLAGS on $(objects) += $(HOST_PIC_CCFLAGS) ;
|
||||||
C++FLAGS on $(objects) += $(HOST_PIC_C++FLAGS) ;
|
C++FLAGS on $(objects) += $(HOST_PIC_C++FLAGS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule BuildPlatformMergeObject
|
rule BuildPlatformMergeObject
|
||||||
@@ -484,7 +486,7 @@ rule BuildPlatformMergeObject
|
|||||||
local sources = $(2) ;
|
local sources = $(2) ;
|
||||||
local otherObjects = $(3) ;
|
local otherObjects = $(3) ;
|
||||||
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
||||||
|
|
||||||
PLATFORM on $(target) = host ;
|
PLATFORM on $(target) = host ;
|
||||||
SUPPORTED_PLATFORMS on $(target) = host ;
|
SUPPORTED_PLATFORMS on $(target) = host ;
|
||||||
|
|
||||||
@@ -520,11 +522,11 @@ rule BuildPlatformStaticLibrary
|
|||||||
# Creates a static library from sources.
|
# Creates a static library from sources.
|
||||||
# <lib>: The library.
|
# <lib>: The library.
|
||||||
# <sources>: List of source files.
|
# <sources>: List of source files.
|
||||||
|
|
||||||
local lib = $(1) ;
|
local lib = $(1) ;
|
||||||
local sources = $(2) ;
|
local sources = $(2) ;
|
||||||
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
||||||
|
|
||||||
PLATFORM on $(lib) = host ;
|
PLATFORM on $(lib) = host ;
|
||||||
SUPPORTED_PLATFORMS on $(lib) = host ;
|
SUPPORTED_PLATFORMS on $(lib) = host ;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ usage()
|
|||||||
|
|
||||||
Usage: $0 <options>
|
Usage: $0 <options>
|
||||||
options:
|
options:
|
||||||
--bochs-debug Enables bochs serial debug emulation (activated
|
--bochs-debug Enables bochs serial debug emulation (activated
|
||||||
via kernel settings file).
|
via kernel settings file).
|
||||||
--build-cross-tools <build tools dir>
|
--build-cross-tools <build tools dir>
|
||||||
Assume cross compilation. <build tools dir>
|
Assume cross compilation. <build tools dir>
|
||||||
@@ -47,6 +47,7 @@ options:
|
|||||||
valid targets=r5,bone,dano,haiku
|
valid targets=r5,bone,dano,haiku
|
||||||
--use-gcc-pipe Build with GCC option -pipe. Speeds up the build
|
--use-gcc-pipe Build with GCC option -pipe. Speeds up the build
|
||||||
process, but uses more memory.
|
process, but uses more memory.
|
||||||
|
--use-32bit Use -m32 flag on 64bit host gcc compiler.
|
||||||
--use-xattr Use Linux xattr support for BeOS attribute
|
--use-xattr Use Linux xattr support for BeOS attribute
|
||||||
emulation. Warning: Make sure your file system
|
emulation. Warning: Make sure your file system
|
||||||
supports sufficient attribute sizes (4 KB per
|
supports sufficient attribute sizes (4 KB per
|
||||||
@@ -105,7 +106,7 @@ standard_gcc_settings()
|
|||||||
|
|
||||||
haikuGCCVersion=`$HAIKU_CC -dumpversion`
|
haikuGCCVersion=`$HAIKU_CC -dumpversion`
|
||||||
haikuGCCMachine=`$HAIKU_CC -dumpmachine`
|
haikuGCCMachine=`$HAIKU_CC -dumpmachine`
|
||||||
|
|
||||||
HAIKU_GCC_LIB_DIR=${gccdir}
|
HAIKU_GCC_LIB_DIR=${gccdir}
|
||||||
HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a
|
HAIKU_GCC_LIBGCC=${gccdir}/libgcc.a
|
||||||
HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o"
|
HAIKU_GCC_GLUE_CODE="crtbegin.o crtend.o"
|
||||||
@@ -131,8 +132,8 @@ standard_gcc_settings()
|
|||||||
$headers/$d"
|
$headers/$d"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
# when not building the crosscompiler, to use cpp headers from
|
# when not building the crosscompiler, to use cpp headers from
|
||||||
# tree first, but fallback to local C++ system headers (like <new>)
|
# tree first, but fallback to local C++ system headers (like <new>)
|
||||||
# if [ "$buildCrossTools" = "" ]; then
|
# if [ "$buildCrossTools" = "" ]; then
|
||||||
# haikuCxxHeadersDir="headers/cpp $haikuCxxHeadersDir"
|
# haikuCxxHeadersDir="headers/cpp $haikuCxxHeadersDir"
|
||||||
@@ -181,7 +182,7 @@ get_build_tool_path()
|
|||||||
local var="HAIKU_$1"
|
local var="HAIKU_$1"
|
||||||
local tool=$2
|
local tool=$2
|
||||||
local path="${crossToolsPrefix}$tool"
|
local path="${crossToolsPrefix}$tool"
|
||||||
|
|
||||||
if [ -f "$path" ]; then
|
if [ -f "$path" ]; then
|
||||||
# get absolute path
|
# get absolute path
|
||||||
local oldPwd=$(pwd)
|
local oldPwd=$(pwd)
|
||||||
@@ -194,7 +195,7 @@ get_build_tool_path()
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
eval "$var=$path"
|
eval "$var=$path"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,6 +221,7 @@ include_gpl_addons=0
|
|||||||
distroCompatibility=default
|
distroCompatibility=default
|
||||||
target=haiku
|
target=haiku
|
||||||
use_gcc_pipe=0
|
use_gcc_pipe=0
|
||||||
|
use_32bit=0
|
||||||
use_xattr=0
|
use_xattr=0
|
||||||
crossToolsPrefix=
|
crossToolsPrefix=
|
||||||
buildCrossTools=
|
buildCrossTools=
|
||||||
@@ -273,6 +275,7 @@ while [ $# -gt 0 ] ; do
|
|||||||
shift 2;;
|
shift 2;;
|
||||||
--target=*) target=`echo $1 | cut -d'=' -f2-`; shift 1;;
|
--target=*) target=`echo $1 | cut -d'=' -f2-`; shift 1;;
|
||||||
--use-gcc-pipe) use_gcc_pipe=1; shift 1;;
|
--use-gcc-pipe) use_gcc_pipe=1; shift 1;;
|
||||||
|
--use-32bit) use_32bit=1; shift 1;;
|
||||||
--use-xattr) use_xattr=1; shift 1;;
|
--use-xattr) use_xattr=1; shift 1;;
|
||||||
*) echo Invalid argument: \`$1\'; exit 1;;
|
*) echo Invalid argument: \`$1\'; exit 1;;
|
||||||
esac
|
esac
|
||||||
@@ -350,6 +353,7 @@ BOCHS_DEBUG_HACK ?= "${bochs_debug}" ;
|
|||||||
INCLUDE_GPL_ADDONS ?= "${include_gpl_addons}" ;
|
INCLUDE_GPL_ADDONS ?= "${include_gpl_addons}" ;
|
||||||
HAIKU_DISTRO_COMPATIBILITY ?= "${distroCompatibility}" ;
|
HAIKU_DISTRO_COMPATIBILITY ?= "${distroCompatibility}" ;
|
||||||
HAIKU_USE_GCC_PIPE ?= "${use_gcc_pipe}" ;
|
HAIKU_USE_GCC_PIPE ?= "${use_gcc_pipe}" ;
|
||||||
|
HAIKU_HOST_USE_32BIT ?= "${use_32bit}" ;
|
||||||
HAIKU_HOST_USE_XATTR ?= "${use_xattr}" ;
|
HAIKU_HOST_USE_XATTR ?= "${use_xattr}" ;
|
||||||
|
|
||||||
HAIKU_GCC_RAW_VERSION ?= ${haikuGCCVersion} ;
|
HAIKU_GCC_RAW_VERSION ?= ${haikuGCCVersion} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user