From 2be78e8125feb6b1dbd57f254ddf4ca297fab23e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 11 Jul 2009 16:50:59 +0000 Subject: [PATCH] 2009-07-11 18:50 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL + Added OS/2 cross-build examples for both Windows and Linux hosts (Thanks Przemek for the Linux one). + Added information that DOS and OS/2 builds can be created on other host OSes. * config/os2/global.cf * config/os2/install.cf + Added support for non-bash non-OS/2 shell for Windows NT cross compilation. ! Fixed syntax error in one of the OS/2 specific rules. --- harbour/ChangeLog | 13 +++++++++ harbour/INSTALL | 50 ++++++++++++++++++++++++++++++++--- harbour/config/os2/global.cf | 41 ++++++++++++++++++++-------- harbour/config/os2/install.cf | 13 ++++++++- 4 files changed, 102 insertions(+), 15 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 54ab63d7c0..d88bbc6362 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,19 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-11 18:50 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * INSTALL + + Added OS/2 cross-build examples for both Windows and Linux + hosts (Thanks Przemek for the Linux one). + + Added information that DOS and OS/2 builds can be created + on other host OSes. + + * config/os2/global.cf + * config/os2/install.cf + + Added support for non-bash non-OS/2 shell for + Windows NT cross compilation. + ! Fixed syntax error in one of the OS/2 specific rules. + 2009-07-11 18:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * config/os2/global.cf * Casing. diff --git a/harbour/INSTALL b/harbour/INSTALL index 16fa848a1d..eb110e140d 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -37,8 +37,8 @@ HOW TO BUILD AND INSTALL HARBOUR FROM SOURCE $ ./hello You should see 'Hello world!' on screen. - Windows - ------- + Windows/Windows CE + ------------------ Platform specific prerequisites: 1.) Windows NT or compatible system is required to build Harbour. @@ -68,7 +68,7 @@ HOW TO BUILD AND INSTALL HARBOUR FROM SOURCE - With mingw, sh.exe (part of MSYS) mustn't be in the PATH. Windows with MinGW + MSYS or Cygwin - ----------------------------------- + ---------------------------------------------- This is an *alternative build method* using bash script directly. For the primary and recommended method: see above @@ -87,6 +87,8 @@ HOW TO BUILD AND INSTALL HARBOUR FROM SOURCE DOS --- + You can use MS-DOS or Windows NT compatible hosts to create DOS builds. + > set HB_ARCHITECTURE=dos > set HB_COMPILER=<[djgpp]|watcom> > set HB_INSTALL_PREFIX= @@ -94,6 +96,10 @@ HOW TO BUILD AND INSTALL HARBOUR FROM SOURCE OS/2 ---- + You can use OS/2, Windows NT compatible, or Linux hosts to create + OS/2 builds. + Some tricks are required when non-OS/2 host is used, see in examples. + > set HB_COMPILER=<[gcc]|watcom> > set HB_INSTALL_PREFIX= > make_gnu_os2.cmd install @@ -582,6 +588,44 @@ EXAMPLES call make_gnu_os2.cmd %1 %2 > log-%HB_COMPILER%.txt 2>&1 --- + --- Open Watcom C++ on Windows NT (requires native Windows Harbour binaries) + SET WATCOM=C:\watcom + SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH% + SET BEGINLIBPATH=%WATCOM%\BINP\DLL + SET EDPATH=%WATCOM%\EDDAT + SET INCLUDE=%WATCOM%\H;%WATCOM%\H\OS2 + rem + rem ; Native Windows Harbour binaries need to be installed on this path + set HB_BIN_COMPILE=C:\hb-watcom\bin + set HB_PPGEN_PATH=%HB_BIN_COMPILE% + rem + set HB_ARCHITECTURE=os2 + set HB_COMPILER=watcom + set 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 + --- + + --- Open Watcom C++ on Linux (requires native Linux Harbour binaries) + #!/bin/sh + if [ -z "${WATCOM}" ]; then + export WATCOM="/opt/lng/watcom" + export INCLUDE="${WATCOM}/h:${WATCOM}/h/os2" + export PATH="${WATCOM}/binl:$PATH" + fi + # ; eliminate libraries which scans for local host header files + export HB_XBUILD=yes + # ; Native Linux binaries need to be installed on this path + export HB_PPGEN_PATH="/tmp/cros-hb" + export HB_BIN_COMPILE="/tmp/cros-hb" + # ; + 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 "$@" + --- + HOW TO GET THE HARBOUR SOURCES ============================== diff --git a/harbour/config/os2/global.cf b/harbour/config/os2/global.cf index 1ba4f20ca8..c1bc9bfc09 100644 --- a/harbour/config/os2/global.cf +++ b/harbour/config/os2/global.cf @@ -26,17 +26,34 @@ DIRSEP = $(subst /,\,\) MK = $(subst /,\,$(subst \~,~,$(MAKE))) -ifeq ($(OS2_SHELL),) - # Not running on OS/2 (which comes in handy for 'make -r clean') - RM = del /q -else - # Running on OS/2 - RM = del /n -endif -RD = rmdir -CP = copy -MV = move -MD = md +ifeq ($(OS2_SHELL),) # non-OS/2 + ifneq ($(ComSpec),) + COMSPEC := $(ComSpec) + else + ifeq ($(COMSPEC),) + COMSPEC := cmd.exe + endif + endif + RM = del /q /f + RD = rmdir /q /s + MD = mkdir + CP = $(COMSPEC) /c copy + MV = move + +dirbase:: + -@$(COMSPEC) /c if not exist $(ARCH_DOS)\. $(MD) $(ARCH_DOS) + $(if $(LIB_DIR_DOS),-@$(COMSPEC) /c if not exist $(LIB_DIR_DOS)\. $(MD) $(LIB_DIR_DOS),) + +clean:: + -@$(COMSPEC) /c if exist $(ARCH_DOS) $(RD) $(ARCH_DOS) + $(if $(LIB_ARCH_DOS),-@$(COMSPEC) /c if exist $(LIB_ARCH_DOS) $(RM) $(LIB_ARCH_DOS),) + +else # OS/2 + RM = del /n + RD = rmdir + MD = md + CP = copy + MV = move ifeq ($(LIB_PATH),) @@ -59,6 +76,8 @@ clean:: endif +endif + else # bash ARCH_DIR = $(HB_ARCH) diff --git a/harbour/config/os2/install.cf b/harbour/config/os2/install.cf index 0137b30ee1..d384986655 100644 --- a/harbour/config/os2/install.cf +++ b/harbour/config/os2/install.cf @@ -10,17 +10,28 @@ else ifeq ($(SHLVL),) # non-bash +ifeq ($(OS2_SHELL),) # non-OS/2 + +INSTALL_LIST = $(subst /,\,$(INSTALL_OBJS)) + +INSTALL_RULE = \ + -$(COMSPEC) /c for %%f in ($(INSTALL_LIST)) do copy "%%f" "$(subst /,\,$(INSTALL_DIR))" + +else # OS/2 + # We have to use script to overcome the max command size limit # NOTE: The empty line directly before 'endef' HAVE TO exist! # It causes that every commands will be separated by LF define inst_file -$(COMSPEC) /C $(CP) $(file) $(subst /,\,$(INSTALL_DIR) +$(COMSPEC) /C $(CP) $(file) $(subst /,\,$(INSTALL_DIR)) endef INSTALL_LIST = $(subst /,\,$(INSTALL_OBJS)) INSTALL_RULE = $(foreach file, $(INSTALL_LIST), $(inst_file)) +endif + else # bash INSTALL_RULE =\