diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 78424d0554..5f78e4d6f4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,31 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-16 01:11 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/global.cf + * config/win/global.cf + * config/linux/global.cf + * config/os2/global.cf + * config/wce/global.cf + + Changed host CPU detection. + + Added automatic __PLATFORM__* macro configuration in cross-build + situations. + + Enhanced target/host CPU detection and decisions based on them. + + Added automatic HB_BIN_COMPILE setup if not specified by user. + In such case Harbour build will automatically look for the first + available native build and use that. + + Protected detection related screen messages with HB_BUILD_VERBOSE=yes. + * Minor sync in shell command definition order. + + * INSTALL + % User set __PLATFORM__* macro tweaks not needed anymore. + + * bin/postinst.cmd + * bin/postinst.bat + * bin/hb-func.sh + * addins -> addons + (hm, which is better?) + 2009-07-15 22:28 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/rules.cf * config/dos/watcom.cf diff --git a/harbour/INSTALL b/harbour/INSTALL index f9f4a5b40d..c4ce5a02e1 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -595,7 +595,6 @@ EXAMPLES rem set HB_ARCHITECTURE=os2 set HB_COMPILER=watcom - set HB_USER_PRGFLAGS=%HB_USER_PRGFLAGS% -D__PLATFORM__OS2 -undef:__PLATFORM__WINDOWS set HB_INSTALL_PREFIX=C:\hb-%HB_COMPILER% call make_gnu.bat %1 %2 > log-%HB_COMPILER%.txt 2>&1 --- @@ -614,7 +613,6 @@ EXAMPLES # ; export HB_ARCHITECTURE=os2 export HB_COMPILER=watcom - export HB_USER_PRGFLAGS="${HB_USER_PRGFLAGS} -D__PLATFORM__OS2 -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" export HB_INSTALL_PREFIX="$(pwd)/hb-os2/watcom" ./make_gnu.sh "$@" --- @@ -633,7 +631,6 @@ EXAMPLES rem set HB_ARCHITECTURE=linux set HB_COMPILER=watcom - set HB_USER_PRGFLAGS=%HB_USER_PRGFLAGS% -D__PLATFORM__LINUX -D__PLATFORM__UNIX -undef:__PLATFORM__WINDOWS set HB_INSTALL_PREFIX=C:\hb-%HB_COMPILER% call make_gnu.bat %1 %2 > log-%HB_COMPILER%.txt 2>&1 --- diff --git a/harbour/bin/hb-func.sh b/harbour/bin/hb-func.sh index b0c6176511..e09abc159a 100755 --- a/harbour/bin/hb-func.sh +++ b/harbour/bin/hb-func.sh @@ -245,7 +245,7 @@ mk_hbtools() echo "">> ${hb_hbmkcfg} echo "libpaths=../contrib/%%{hb_name}">> ${hb_hbmkcfg} echo "libpaths=../contrib/rddsql/%%{hb_name}">> ${hb_hbmkcfg} - echo "libpaths=../addins/%%{hb_name}">> ${hb_hbmkcfg} + echo "libpaths=../addons/%%{hb_name}">> ${hb_hbmkcfg} echo "libpaths=../examples/%%{hb_name}">> ${hb_hbmkcfg} echo "">> ${hb_hbmkcfg} if [ -n "${hb_gt_ori}" ]; then diff --git a/harbour/bin/postinst.bat b/harbour/bin/postinst.bat index 25adc87a98..48614b78f2 100644 --- a/harbour/bin/postinst.bat +++ b/harbour/bin/postinst.bat @@ -19,7 +19,7 @@ echo # Generated by Harbour build process>> %HB_BIN_INSTALL%\hbmk.cfg echo.>> %HB_BIN_INSTALL%\hbmk.cfg echo libpaths=../contrib/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg echo libpaths=../contrib/rddsql/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg -echo libpaths=../addins/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg +echo libpaths=../addons/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg echo libpaths=../examples/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg rem ; Post-build installation diff --git a/harbour/bin/postinst.cmd b/harbour/bin/postinst.cmd index 90581aa23a..9311308846 100644 --- a/harbour/bin/postinst.cmd +++ b/harbour/bin/postinst.cmd @@ -19,7 +19,7 @@ echo # Generated by Harbour build process>> %HB_BIN_INSTALL%\hbmk.cfg echo.>> %HB_BIN_INSTALL%\hbmk.cfg echo libpaths=../contrib/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg echo libpaths=../contrib/rddsql/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg -echo libpaths=../addins/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg +echo libpaths=../addons/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg echo libpaths=../examples/%%{hb_name}>> %HB_BIN_INSTALL%\hbmk.cfg rem ; Post-build installation diff --git a/harbour/config/global.cf b/harbour/config/global.cf index eafd8d8bcf..2330c41e89 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -130,36 +130,95 @@ ifeq ($(HB_HOST_ARCH),) endif endif -$(info Detected host platform: $(HB_HOST_ARCH)) +ifeq ($(HB_BUILD_VERBOSE),yes) + $(info Detected host platform: $(HB_HOST_ARCH)) +endif +HB_HOST_CPU := ifeq ($(HB_HOST_ARCH),win) ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) - HB_HOST_ARCH := win_x86_64 + HB_HOST_CPU := x86_64 + else ifeq ($(PROCESSOR_ARCHITECTURE),IA64) + HB_HOST_CPU := ia64 else - ifeq ($(PROCESSOR_ARCHITECTURE),IA64) - HB_HOST_ARCH := win_ia64 - endif + HB_HOST_CPU := x86 endif endif -ifneq ($(HB_HOST_ARCH),$(HB_ARCHITECTURE)) - ifeq ($(HB_BIN_COMPILE),) - # Not required in these combinations: [vszakats] - ifneq ($(HB_HOST_ARCH)-$(HB_ARCHITECTURE),win_x86_64-win) - ifneq ($(HB_HOST_ARCH)-$(HB_ARCHITECTURE),win-dos) - $(warning Warning: HB_BIN_COMPILE must be specified for cross-builds.) - endif - endif +ifeq ($(HB_BUILD_VERBOSE),yes) + $(info Detected host CPU: $(HB_HOST_CPU)) +endif + +# TODO: Set this in /.cf +HB_CPU := +ifeq ($(HB_ARCHITECTURE),win) + ifeq ($(HB_COMPILER),msvc64) + HB_CPU := x86_64 + else ifeq ($(HB_COMPILER),mingw64) + HB_CPU := x86_64 + else ifeq ($(HB_COMPILER),pocc64) + HB_CPU := x86_64 + else ifeq ($(HB_COMPILER),msvcia64) + HB_CPU := ia64 + else ifeq ($(HB_COMPILER),iccia64) + HB_CPU := ia64 + else + HB_CPU := x86 endif endif -ifneq ($(findstring $(HB_HOST_ARCH),win win_x86_64 win_ia64 wce dos os2),) +ifeq ($(HB_BUILD_VERBOSE),yes) + $(info Detected target CPU: $(HB_CPU)) +endif + +ifneq ($(findstring $(HB_HOST_ARCH),win wce dos os2),) HB_HOST_BIN_EXT := .exe else HB_HOST_BIN_EXT := endif -$(info Detected host executable extension: $(HB_HOST_BIN_EXT)) +ifeq ($(HB_BUILD_VERBOSE),yes) + $(info Detected host executable extension: $(HB_HOST_BIN_EXT)) +endif + +ifneq ($(HB_HOST_ARCH)$(HB_HOST_CPU),$(HB_ARCHITECTURE)$(HB_CPU)) + ifeq ($(HB_BIN_COMPILE),) + # Not required in these combinations: [vszakats] + ifneq ($(HB_HOST_ARCH)-$(HB_HOST_CPU)-$(HB_ARCHITECTURE)-$(HB_CPU),win-x86_64-win-x86) + ifneq ($(HB_HOST_ARCH)-$(HB_HOST_CPU)-$(HB_ARCHITECTURE)-$(HB_CPU),win-x86-dos-) + # Try to autosetup + HB_BIN_COMPILE := $(dir $(firstword $(wildcard $(TOP)$(ROOT)bin/$(HB_HOST_ARCH)/*/harbour$(HB_HOST_BIN_EXT)))) + ifeq ($(HB_BIN_COMPILE),) + $(warning Warning: HB_BIN_COMPILE not specified. Couldn't find native build.) + else + $(info HB_BIN_COMPILE not specified. Automatically set to: $(HB_BIN_COMPILE)) + endif + endif + endif + else + # Setup platform macros (undefine host, define target) + ifeq ($(HB_HOST_ARCH),win) + HB_USER_PRGFLAGS += -undef:__PLATFORM__WINDOWS + else ifeq ($(HB_HOST_ARCH),dos) + HB_USER_PRGFLAGS += -undef:__PLATFORM__DOS + else ifeq ($(HB_HOST_ARCH),os2) + HB_USER_PRGFLAGS += -undef:__PLATFORM__OS2 + else ifeq ($(HB_HOST_ARCH),linux) + HB_USER_PRGFLAGS += -undef:__PLATFORM__LINUX -undef:__PLATFORM__UNIX + endif + ifeq ($(HB_ARCHITECTURE),win) + HB_USER_PRGFLAGS += -D__PLATFORM__WINDOWS + else ifeq ($(HB_ARCHITECTURE),wce) + HB_USER_PRGFLAGS += -D__PLATFORM__WINDOWS -D__PLATFORM__WINCE + else ifeq ($(HB_ARCHITECTURE),dos) + HB_USER_PRGFLAGS += -D__PLATFORM__DOS + else ifeq ($(HB_ARCHITECTURE),os2) + HB_USER_PRGFLAGS += -D__PLATFORM__OS2 + else ifeq ($(HB_ARCHITECTURE),linux) + HB_USER_PRGFLAGS += -D__PLATFORM__LINUX -D__PLATFORM__UNIX + endif + endif +endif # Names of valid RDD libraries HB_DB_DRIVERS=\ diff --git a/harbour/config/linux/global.cf b/harbour/config/linux/global.cf index b21edbcbfe..7c71463fde 100644 --- a/harbour/config/linux/global.cf +++ b/harbour/config/linux/global.cf @@ -28,9 +28,9 @@ ifneq ($(HB_SHELL),os2) MK = $(subst /,\,$(subst \~,~,$(MAKE))) RM = del /q /f RD = rmdir /q /s - MD = mkdir CP = $(COMSPEC) /c copy MV = move + MD = mkdir dirbase:: -@$(COMSPEC) /c if not exist $(OBJ_DIR_OS) $(MD) $(OBJ_DIR_OS) @@ -46,9 +46,9 @@ else # OS/2 MK = $(subst /,\,$(subst \~,~,$(MAKE))) RM = del /n RD = rmdir - MD = md CP = copy MV = move + MD = md dirbase:: -for %d in ($(OBJ_BASE) $(OBJ_ARCH_DIR_OS) $(OBJ_DIR_OS)) do if not exist %d $(MD) %d diff --git a/harbour/config/os2/global.cf b/harbour/config/os2/global.cf index 860423987d..d4005af9d0 100644 --- a/harbour/config/os2/global.cf +++ b/harbour/config/os2/global.cf @@ -28,9 +28,9 @@ ifneq ($(HB_SHELL),os2) MK = $(subst /,\,$(subst \~,~,$(MAKE))) RM = del /q /f RD = rmdir /q /s - MD = mkdir CP = $(COMSPEC) /c copy MV = move + MD = mkdir dirbase:: -@$(COMSPEC) /c if not exist $(OBJ_DIR_OS) $(MD) $(OBJ_DIR_OS) @@ -46,9 +46,9 @@ else # OS/2 MK = $(subst /,\,$(subst \~,~,$(MAKE))) RM = del /n RD = rmdir - MD = md CP = copy MV = move + MD = md dirbase:: -for %d in ($(OBJ_BASE) $(OBJ_ARCH_DIR_OS) $(OBJ_DIR_OS)) do if not exist %d $(MD) %d diff --git a/harbour/config/wce/global.cf b/harbour/config/wce/global.cf index d818e6717a..eeb0795ac6 100644 --- a/harbour/config/wce/global.cf +++ b/harbour/config/wce/global.cf @@ -36,9 +36,9 @@ EXE_FILE_OS = $(subst /,\,$(EXE_FILE)) MK = $(subst \,/,$(subst \~,~,$(MAKE))) RM = del /q /f RD = rmdir /q /s -MD = mkdir CP = $(COMSPEC) /c copy MV = move +MD = mkdir dirbase:: -@$(COMSPEC) /c if not exist $(OBJ_DIR_OS) $(MD) $(OBJ_DIR_OS) diff --git a/harbour/config/win/global.cf b/harbour/config/win/global.cf index 773cf8d78e..5241ed2578 100644 --- a/harbour/config/win/global.cf +++ b/harbour/config/win/global.cf @@ -32,9 +32,9 @@ EXE_FILE_OS = $(subst /,\,$(EXE_FILE)) MK = $(subst \,/,$(subst \~,~,$(MAKE))) RM = del /q /f RD = rmdir /q /s -MD = mkdir CP = $(COMSPEC) /c copy MV = move +MD = mkdir dirbase:: -@$(COMSPEC) /c if not exist $(OBJ_DIR_OS) $(MD) $(OBJ_DIR_OS)