From 4819870aabc45e697d9814827d3dfef620647f47 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 12 Sep 2009 09:18:34 +0000 Subject: [PATCH] 2009-09-12 11:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/global.mk + Added logic for host CPU detection on *nix systems. Please extend 'check_host_cpu' with more real-world values. + HB_CPU made equal to HB_HOST_CPU for *nix systems. This should be fine-tuned on the compiler level depending on default compiler behaviour and ABI modifier options. (if we do this further tweaks in global.mk will be needed) * INSTALL ! Deleted wrong (and duplicate) HB_INC_* value. --- harbour/ChangeLog | 12 ++++++++++++ harbour/INSTALL | 3 +-- harbour/config/global.mk | 18 ++++++++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7b334903dc..0e7eb36489 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,18 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-12 11:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/global.mk + + Added logic for host CPU detection on *nix systems. + Please extend 'check_host_cpu' with more real-world values. + + HB_CPU made equal to HB_HOST_CPU for *nix systems. + This should be fine-tuned on the compiler level depending + on default compiler behaviour and ABI modifier options. + (if we do this further tweaks in global.mk will be needed) + + * INSTALL + ! Deleted wrong (and duplicate) HB_INC_* value. + 2009-09-12 11:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL + Minor tuning here and there. diff --git a/harbour/INSTALL b/harbour/INSTALL index c240041e5e..f163390887 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -214,12 +214,11 @@ HOW TO ENABLE OPTIONAL COMPONENTS BEFORE BUILD HB_INC_GD=C:\gd\include HB_INC_GPM= (on Linux only) HB_INC_LIBHARU=C:\libharu\include (defaults to locally hosted version) - HB_INC_LIBPNG=C:\libpng (defaults to locally hosted version if not found) HB_INC_MYSQL=C:\mysql\include HB_INC_ODBC= (may only be needed on non-Windows systems) HB_INC_OPENSSL=C:\openssl\inc32 OR C:\openssl\include HB_INC_PCRE=C:\pcre (defaults to locally hosted version if not found) - HB_INC_PNG= (defaults to locally hosted version if not found) + HB_INC_PNG=C:\libpng (defaults to locally hosted version if not found) HB_INC_PGSQL=C:\pgsql\include HB_INC_QT=C:\Qt\include HB_INC_SLANG= (on *nix systems) diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 65889e4fc4..fac9800401 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -112,6 +112,18 @@ define check_host endef +define check_host_cpu + + # TODO: Please extend + + ifneq ($(findstring 86,$(1)),) + HB_HOST_CPU := x86 + else ifneq ($(findstring 64,$(1)),) + HB_HOST_CPU := x86_64 + endif + +endef + # Some presets based on HB_BUILD_NAME ifneq ($(HB_BUILD_NAME),) ifeq ($(HB_BUILD_NAME),.r) @@ -399,7 +411,7 @@ else ifneq ($(filter $(HB_HOST_PLAT),dos os2),) HB_HOST_CPU := x86 else - # TODO: CPU detection for rest of systems. + $(eval $(call check_host_cpu,$(shell uname -m),)) endif endif @@ -842,7 +854,7 @@ endif # Assemble relative path from OBJ_DIR to source. GRANDP := $(subst $(subst x,x, ),,$(foreach item, $(subst /, ,$(OBJ_DIR)), ../)) -# TODO: Set this in /.mk +# TODO: Set this in /.mk (compiler switches may influence it) HB_CPU := ifeq ($(HB_PLATFORM),win) ifneq ($(filter $(HB_COMPILER),msvc64 mingw64 pocc64),) @@ -866,6 +878,8 @@ else else ifneq ($(filter $(HB_PLATFORM),dos os2),) HB_CPU := x86 + else + HB_CPU := $(HB_HOST_CPU) endif endif endif