2009-08-22 03:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* config/common/watcom.mk
  * config/win/bcc.mk
    % Yet another experiment, maybe it won't have any bad side
      effects: For compilers where $(AR) command supports differential
               command (bcc and watcom), we're only passing the list
               of changed objects instead of all of them. Should be
               much more efficient for incremental builds.

  * config/globsh.mk
  * config/instsh.mk
    ! Reset nt shell dirbase and clean rules to previous state
      (using 'if [not] exist' instead of $(wildcard)).
      New solution had several side effects. Some of them easy
      understandable, some others outright mysterious, so more
      research will be needed here. Some experiences:
      - the whole rule is evaluated before starting to execute the resulting commands.
      - multiple rules with the same target are merged before evaluating them
      - $(wildcard) is tricky with dirs, especially ones with spaces
      - if we use conditional lines ($if()) and all lines are ruled out,
      -     the rule will become empty, igniting a confusing GNU Make message.
      - strange behavior when using 'CLEAN INSTALL'
      - $(RM) stayed at default value in one /source/pp/Makefile rule.
    ; TOFIX: dos/os2 rules are still slightly wrong because of similar problems,
             and there 'if [not] exist' isn't a working option either, so
             we will need to think about something, like splitting clean
             rules to two levels internally, or more make function tricks.

  * config/readme.txt
  + config/os2-make.exe
  * INSTALL
    + Added os2 GNU Make binary (3.81 static build). Just to be in
      sync with other non-*nix platforms. Maybe it will be removed or
      renamed.

  * config/globsh.mk
    + Minor wording change.

  * contrib/hbwin/axcore.c
    * Very minor formatting.

  - make_gnu_xmingw.sh
  - make_gnu_xmingwce.sh
    % Deleted two cross-build starter scripts. Their functionality
      has been largely moved into our GNU Make system.
      Please use these commands for equivalent functionality:
         [g]make HB_ARCHITECTURE=[win|wce]
    ; NOTE: Comments are still welcome regarding experiences
            especially from original authors of these scripts.
            Maybe I missed something. $(TARGET) var support.
            Please comment.
This commit is contained in:
Viktor Szakats
2009-08-22 01:13:51 +00:00
parent 49bbccd676
commit 64e24f559d
12 changed files with 134 additions and 270 deletions

View File

@@ -17,6 +17,58 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-08-22 03:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/common/watcom.mk
* config/win/bcc.mk
% Yet another experiment, maybe it won't have any bad side
effects: For compilers where $(AR) command supports differential
command (bcc and watcom), we're only passing the list
of changed objects instead of all of them. Should be
much more efficient for incremental builds.
* config/globsh.mk
* config/instsh.mk
! Reset nt shell dirbase and clean rules to previous state
(using 'if [not] exist' instead of $(wildcard)).
New solution had several side effects. Some of them easy
understandable, some others outright mysterious, so more
research will be needed here. Some experiences:
- the whole rule is evaluated before starting to execute the resulting commands.
- multiple rules with the same target are merged before evaluating them
- $(wildcard) is tricky with dirs, especially ones with spaces
- if we use conditional lines ($if()) and all lines are ruled out,
- the rule will become empty, igniting a confusing GNU Make message.
- strange behavior when using 'CLEAN INSTALL'
- $(RM) stayed at default value in one /source/pp/Makefile rule.
; TOFIX: dos/os2 rules are still slightly wrong because of similar problems,
and there 'if [not] exist' isn't a working option either, so
we will need to think about something, like splitting clean
rules to two levels internally, or more make function tricks.
* config/readme.txt
+ config/os2-make.exe
* INSTALL
+ Added os2 GNU Make binary (3.81 static build). Just to be in
sync with other non-*nix platforms. Maybe it will be removed or
renamed.
* config/globsh.mk
+ Minor wording change.
* contrib/hbwin/axcore.c
* Very minor formatting.
- make_gnu_xmingw.sh
- make_gnu_xmingwce.sh
% Deleted two cross-build starter scripts. Their functionality
has been largely moved into our GNU Make system.
Please use these commands for equivalent functionality:
[g]make HB_ARCHITECTURE=[win|wce]
; NOTE: Comments are still welcome regarding experiences
especially from original authors of these scripts.
Maybe I missed something. $(TARGET) var support.
Please comment.
2009-08-21 22:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/Makefile
* config/lib.mk
@@ -78,50 +130,50 @@
+ Added solution to 'move' problem on nt (and other) shells.
2009-08-21 19:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/dynlib/mt/Makefile
* source/dynlib/Makefile
+ Added 'install' logic for dynamic lib implibs.
* source/dynlib/mt/Makefile
* source/dynlib/Makefile
+ Added 'install' logic for dynamic lib implibs.
* config/global.mk
+ Added useful GNU Make link.
! Added HB_HOST_CPU "detection" for os2 and dos to avoid
situation where cross-build is detected due to different
to HB_CPU value. (HB_CPU autodetection for os2 dos was
added yesterday). It's quite theoretical, as os2 dos
has CPU type set to constant 'x86'.
+ Added IMP_DIR value. This hold where to store implibs
for dynamic libs. Empty if platform don't need implibs
(huge relief BTW). For *nix this value is set empty, for
non-*nix it's set to LIB_DIR.
+ Added initialization for DYN_PREF (to empty).
* config/global.mk
+ Added useful GNU Make link.
! Added HB_HOST_CPU "detection" for os2 and dos to avoid
situation where cross-build is detected due to different
to HB_CPU value. (HB_CPU autodetection for os2 dos was
added yesterday). It's quite theoretical, as os2 dos
has CPU type set to constant 'x86'.
+ Added IMP_DIR value. This hold where to store implibs
for dynamic libs. Empty if platform don't need implibs
(huge relief BTW). For *nix this value is set empty, for
non-*nix it's set to LIB_DIR.
+ Added initialization for DYN_PREF (to empty).
* config/dyn.mk
+ Added handling of IMP_DIR, IMP_FILE.
! Dyn lib build rule guarded with HB_BUILD_DLL and DY_RULE
checks.
* config/dyn.mk
+ Added handling of IMP_DIR, IMP_FILE.
! Dyn lib build rule guarded with HB_BUILD_DLL and DY_RULE
checks.
* config/globsh.mk
+ Added dirbase and clean rules for implibs.
! Fixed using OS version of dirs in $(wildcard) for nt
clean rules for OBJ_DIR and PKG_DIR.
* config/globsh.mk
+ Added dirbase and clean rules for implibs.
! Fixed using OS version of dirs in $(wildcard) for nt
clean rules for OBJ_DIR and PKG_DIR.
* config/wce/mingwarm.mk
* config/wce/poccarm.mk
* config/wce/msvcarm.mk
* config/win/xcc.mk
* config/win/mingw.mk
* config/win/pocc.mk
* config/win/bcc.mk
* config/win/watcom.mk
* config/win/icc.mk
* config/win/cygwin.mk
* config/win/msvc.mk
+ Dynamic lib rules extended to generate implib in IMP_DIR.
This goes smoothly with all compiler except bcc, which requires
a copy and a delete to move the implib to lib dir. 'move'
doesn't work (says 'command not found' or equivalent and
requires '$(COMSPEC) /C' with GNU Make + nt shell), so I
didn't use it finally. Anyhow bcc implib is small.
* config/wce/mingwarm.mk
* config/wce/poccarm.mk
* config/wce/msvcarm.mk
* config/win/xcc.mk
* config/win/mingw.mk
* config/win/pocc.mk
* config/win/bcc.mk
* config/win/watcom.mk
* config/win/icc.mk
* config/win/cygwin.mk
* config/win/msvc.mk
+ Dynamic lib rules extended to generate implib in IMP_DIR.
This goes smoothly with all compiler except bcc, which requires
a copy and a delete to move the implib to lib dir. 'move'
doesn't work (says 'command not found' or equivalent and
requires '$(COMSPEC) /C' with GNU Make + nt shell), so I
didn't use it finally. Anyhow bcc implib is small.
* config/globsh.mk
- Deleted $(MV) variable with move command.
@@ -135,7 +187,7 @@
* config/readme.txt
- Deleted DJGPP mv tool.
; NOTE: dynamic library handling seems to be about feature complete.
; NOTE: dynamic library handling seems to be about feature complete.
2009-08-21 19:07 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/hbwin/axcore.c
@@ -243,8 +295,8 @@
; After these changes no more 'if [not] exist' shell specific
commands are used in Harbour GNU Make system.
; TOFIX: Except sh shell. Probably the rules there can be synced now
with other shells and special bash logic dropped.
; TODO: Except sh shell. Probably the rules there can be synced now
with other shells and special bash logic dropped. [POSTPONED]
2009-08-21 14:41 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/hb-func.sh
@@ -288,8 +340,8 @@
* config/win/bcc.mk
* config/win/watcom.mk
+ Added new .dll build rules.
; TODO: Solve handling of generated implib.
; TODO: Add dynlib generation logic for *nix targets.
; TODO: Solve handling of generated implib. [DONE]
; TODO: Add dynlib generation logic for *nix targets. [DONE]
; TODO: Delete postinst script if the new method turns out to
work alright.
@@ -718,6 +770,7 @@
F.e. watcom/dos -> os2 builds will end with:
Bad command or filename - "@..\..\..\..\..\config\dj-echo".
watcom/dos -> linux builds will choke because of too long cmdlines.
[DONE]
2009-08-20 15:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* config/dos/watcom.mk

View File

@@ -141,6 +141,7 @@ HOW TO BUILD AND INSTALL HARBOUR FROM SOURCE
ftp://hobbes.nmsu.edu/pub/os2/dev/util/make-3.81-r2-bin-static.zip
If you use other host, please refer to other platform instructions
in this section.
For convenience you may also use included config/os2-make.exe instead.
[ > set HB_COMPILER=<gcc|watcom> ]
> make install

View File

@@ -27,14 +27,14 @@ comma := ,
LDFILES_COMMA = $(subst $(subst x,x, ),$(comma) ,$(^F))
LDLIBS_COMMA := $(subst $(subst x,x, ),$(comma) ,$(strip $(LDLIBS)))
LD_RULE = $(LD) $(LDFLAGS) $(HB_USER_LDFLAGS) NAME $(BIN_DIR)/$@$(BIN_EXT) FILE $(LDFILES_COMMA) $(if $(LDLIBS_COMMA), LIB $(LDLIBS_COMMA),)
AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) $(LIB_DIR)/$@ $(foreach file,$(^F),-+$(file))
AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) $(LIB_DIR)/$@ $(foreach file,$(?F),-+$(file))
ifeq ($(HB_SHELL),os2)
# maximum size of command line in OS2 is limited to 1024 characters
# the trick with divided 'wordlist' is workaround for it:
# -$(if $(wordlist 1,100,$(^F)), $(ECHO) $(wordlist 1,100,$(addprefix -+,$(^F))) >> __lib__.tmp,)
# -$(if $(wordlist 101,200,$(^F)), $(ECHO) $(wordlist 101,200,$(addprefix -+,$(^F))) >> __lib__.tmp,)
# -$(if $(wordlist 201,300,$(^F)), $(ECHO) $(wordlist 301,300,$(addprefix -+,$(^F))) >> __lib__.tmp,)
# -$(if $(wordlist 1,100,$(?F)), $(ECHO) $(wordlist 1,100,$(addprefix -+,$(?F))) >> __lib__.tmp,)
# -$(if $(wordlist 101,200,$(?F)), $(ECHO) $(wordlist 101,200,$(addprefix -+,$(?F))) >> __lib__.tmp,)
# -$(if $(wordlist 201,300,$(?F)), $(ECHO) $(wordlist 301,300,$(addprefix -+,$(?F))) >> __lib__.tmp,)
# anyhow OS/2 port# of GNU make 3.81 seems to have bug and GPFs when total
# commands length is too big so for %i in ( *$(OBJ_EXT) ) do ... below is
# ugly workaround for both problems
@@ -65,7 +65,7 @@ ifeq ($(HB_SHELL),dos)
define link_exe_file
@$(ECHO) $(LDFLAGS) NAME $(BIN_DIR)/$@ > __link__.tmp
$(foreach file,$(^F),$(link_file))
$(foreach file,$(?F),$(link_file))
$(foreach lib,$(LDLIBS),$(link_lib))
-$(LD) @__link__.tmp
endef
@@ -80,7 +80,7 @@ ifeq ($(HB_SHELL),dos)
define create_library
@$(ECHO) $(LIB_DIR)/$@ > __lib__.tmp
$(foreach file,$(^F),$(lib_object))
$(foreach file,$(?F),$(lib_object))
$(AR) $(ARFLAGS) $(HB_USER_AFLAGS) @__lib__.tmp
endef

View File

@@ -1029,7 +1029,7 @@ export HB_INSTALL_PREFIX
ifneq ($(HB_INSTALL_PREFIX_ORI),$(HB_INSTALL_PREFIX))
ifneq ($(MAKE_381),)
$(info ! HB_INSTALL_PREFIX set to: $(HB_INSTALL_PREFIX))
$(info ! HB_INSTALL_PREFIX automatically set to: $(HB_INSTALL_PREFIX))
endif
endif

View File

@@ -93,28 +93,28 @@ ECHO := echo
ECHOQUOTE :=
dirbase::
$(if $(wildcard $(OBJ_DIR)),,-@$(MDP) "$(OBJ_DIR_OS)")
$(if $(LIB_FILE),$(if $(wildcard $(LIB_DIR)),,-@$(MDP) "$(LIB_DIR_OS)"),)
$(if $(BIN_FILE),$(if $(wildcard $(BIN_DIR)),,-@$(MDP) "$(BIN_DIR_OS)"),)
$(if $(DYN_FILE),$(if $(wildcard $(DYN_DIR)),,-@$(MDP) "$(DYN_DIR_OS)"),)
$(if $(IMP_FILE),$(if $(wildcard $(IMP_DIR)),,-@$(MDP) "$(IMP_DIR_OS)"),)
-@if not exist "$(OBJ_DIR_OS)" $(MDP) "$(OBJ_DIR_OS)"
$(if $(LIB_FILE),-@if not exist "$(LIB_DIR_OS)" $(MDP) "$(LIB_DIR_OS)",)
$(if $(BIN_FILE),-@if not exist "$(BIN_DIR_OS)" $(MDP) "$(BIN_DIR_OS)",)
$(if $(DYN_FILE),-@if not exist "$(DYN_DIR_OS)" $(MDP) "$(DYN_DIR_OS)",)
$(if $(IMP_FILE),-@if not exist "$(IMP_DIR_OS)" $(MDP) "$(IMP_DIR_OS)",)
clean::
$(if $(wildcard $(OBJ_DIR)),-@$(RDP) "$(OBJ_DIR_OS)",)
$(if $(wildcard $(PKG_DIR)),-@$(RDP) "$(PKG_DIR_OS)",)
$(if $(LIB_FILE),$(if $(wildcard $(LIB_FILE)),-@$(RM) "$(LIB_FILE_OS)",),)
$(if $(LIB_FILE),$(if $(wildcard $(basename $(LIB_FILE)).bak),-@$(RM) "$(basename $(LIB_FILE_OS)).bak",),)
$(if $(LIB_FILE),$(if $(wildcard $(LIB_DIR)),$(if $(wildcard $(LIB_DIR)/*),,-@$(RDP) "$(LIB_DIR_OS)"),),)
$(if $(BIN_FILE),$(if $(wildcard $(BIN_FILE)),-@$(RM) "$(BIN_FILE_OS)",),)
$(if $(BIN_FILE),$(if $(wildcard $(basename $(BIN_FILE)).tds),-@$(RM) "$(basename $(BIN_FILE_OS)).tds",),)
$(if $(BIN_FILE),$(if $(wildcard $(BIN_DIR)),$(if $(wildcard $(BIN_DIR)/*),,-@$(RDP) "$(BIN_DIR_OS)"),),)
$(if $(DYN_FILE),$(if $(wildcard $(DYN_FILE)),-@$(RM) "$(DYN_FILE_OS)",),)
$(if $(DYN_FILE),$(if $(wildcard $(basename $(DYN_FILE)).def),-@$(RM) "$(basename $(DYN_FILE_OS)).def",),)
$(if $(DYN_FILE),$(if $(wildcard $(basename $(DYN_FILE)).exp),-@$(RM) "$(basename $(DYN_FILE_OS)).exp",),)
$(if $(DYN_FILE),$(if $(wildcard $(DYN_DIR)),$(if $(wildcard $(DYN_DIR)/*),,-@$(RDP) "$(DYN_DIR_OS)"),),)
$(if $(IMP_FILE),$(if $(wildcard $(IMP_FILE)),-@$(RM) "$(IMP_FILE_OS)",),)
$(if $(IMP_FILE),$(if $(wildcard $(basename $(IMP_FILE)).exp),-@$(RM) "$(basename $(IMP_FILE_OS)).exp",),)
$(if $(IMP_FILE),$(if $(wildcard $(IMP_DIR)),$(if $(wildcard $(IMP_DIR)/*),,-@$(RDP) "$(IMP_DIR_OS)"),),)
-@if exist "$(OBJ_DIR_OS)" $(RDP) "$(OBJ_DIR_OS)"
-@if exist "$(PKG_DIR_OS)" $(RDP) "$(PKG_DIR_OS)"
$(if $(LIB_FILE),-@if exist "$(LIB_FILE_OS)" $(RM) "$(LIB_FILE_OS)",)
$(if $(LIB_FILE),-@if exist "$(basename $(LIB_FILE_OS)).bak" $(RM) "$(basename $(LIB_FILE_OS)).bak",)
$(if $(LIB_FILE),-@if exist "$(LIB_DIR_OS)" if not exist "$(LIB_DIR_OS)\*" $(RDP) "$(LIB_DIR_OS)",)
$(if $(BIN_FILE),-@if exist "$(BIN_FILE_OS)" $(RM) "$(BIN_FILE_OS)",)
$(if $(BIN_FILE),-@if exist "$(basename $(BIN_FILE_OS)).tds" $(RM) "$(basename $(BIN_FILE_OS)).tds",)
$(if $(BIN_FILE),-@if exist "$(BIN_DIR_OS)" if not exist "$(BIN_DIR_OS)\*" $(RDP) "$(BIN_DIR_OS)",)
$(if $(DYN_FILE),-@if exist "$(DYN_FILE_OS)" $(RM) "$(DYN_FILE_OS)",)
$(if $(DYN_FILE),-@if exist "$(basename $(DYN_FILE_OS)).def" $(RM) "$(basename $(DYN_FILE_OS)).def",)
$(if $(DYN_FILE),-@if exist "$(basename $(DYN_FILE_OS)).exp" $(RM) "$(basename $(DYN_FILE_OS)).exp",)
$(if $(DYN_FILE),-@if exist "$(DYN_DIR_OS)" if not exist "$(DYN_DIR_OS)\*" $(RDP) "$(DYN_DIR_OS)",)
$(if $(IMP_FILE),-@if exist "$(IMP_FILE_OS)" $(RM) "$(IMP_FILE_OS)",)
$(if $(IMP_FILE),-@if exist "$(basename $(IMP_FILE_OS)).exp" $(RM) "$(basename $(IMP_FILE_OS)).exp",)
$(if $(IMP_FILE),-@if exist "$(IMP_DIR_OS)" if not exist "$(IMP_DIR_OS)\*" $(RDP) "$(IMP_DIR_OS)",)
endif

View File

@@ -41,7 +41,7 @@ endif
ifeq ($(HB_SHELL),nt)
define inst_file_all
$(if $(wildcard $(subst $(subst x,x, ),\ ,$(INSTALL_DIR))),,-@$(MDP) "$(INSTALL_DIR_OS)")
-@if not exist "$(INSTALL_DIR_OS)" $(MDP) "$(INSTALL_DIR_OS)"
-@for %%f in ($(INSTALL_FILES_OS)) do $(CP) "%%f" "$(INSTALL_DIR_OS)"
endef

BIN
harbour/config/os2-make.exe Normal file

Binary file not shown.

View File

@@ -22,6 +22,10 @@ Included utilities are:
ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/
ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/mak381b.zip
ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/mak381s.zip
- OS/2 (os2-make.exe)
http://www.os2site.com/sw/dev/make/index.html
http://www.os2site.com/sw/dev/make/make-3.81-r2-bin.zip
http://www.os2site.com/sw/dev/make/make-3.81-r2.zip
- GNU coreutils (mkdir, rm, cp, echo)
Licence:

View File

@@ -50,7 +50,7 @@ LDFLAGS += $(LIBPATHS)
AR := tlib.exe
ARFLAGS := /P64
AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) "$(subst /,\,$(LIB_DIR)/$@)" $(foreach file,$(^F),-+$(file))
AR_RULE = $(AR) $(ARFLAGS) $(HB_USER_AFLAGS) "$(subst /,\,$(LIB_DIR)/$@)" $(foreach file,$(?F),-+$(file))
ifneq ($(HB_SHELL),sh)
ifeq ($(HB_SHELL_XP),)
@@ -73,7 +73,7 @@ ifneq ($(HB_SHELL),sh)
define create_library
$(if $(wildcard __lib__.tmp),@$(RM) __lib__.tmp,)
$(foreach file,$(^F),$(lib_object))
$(foreach file,$(?F),$(lib_object))
@$(ECHO) -+>> __lib__.tmp
$(AR) $(ARFLAGS) $(HB_USER_AFLAGS) "$(subst /,\,$(LIB_DIR)/$@)" @__lib__.tmp
endef

View File

@@ -279,7 +279,7 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
if( ! IsEqualIID( riid, HB_ID_REF( IID_NULL ) ) )
return DISP_E_UNKNOWNINTERFACE;
if( ! ( ( ISink* ) lpThis)->pItemHandler )
if( ! ( ( ISink* ) lpThis )->pItemHandler )
return S_OK;
pAction = ( ( ISink* ) lpThis )->pItemHandler;

View File

@@ -1,114 +0,0 @@
#!/bin/sh
[ "$BASH" ] || exec bash `which $0` ${1+"$@"}
#
# $Id$
#
# This script simplifies cross-compiling Harbour for Windows from Unix systems.
#
# Copyright 2003-2005 by Phil Krylov <phil a t newstar.rinet.ru>
#
UNAME=`uname`
UNAMEL=`echo "$UNAME"|tr A-Z a-z`
UNAMEU=`echo "$UNAME"|tr a-z A-Z`
export HB_ARCHITECTURE=win
export HB_COMPILER=mingw
if [ "$OSTYPE" = "msdosdjgpp" ]; then
HB_HOST_ARCH="dos"
HB_HOST_COMP="djgpp"
else
HB_HOST_ARCH="${UNAMEL}"
HB_HOST_COMP="gcc"
case "$HB_HOST_ARCH" in
*windows*|*mingw32*|msys*) HB_HOST_ARCH="win"; HB_HOST_COMP="mingw" ;;
*dos) HB_HOST_ARCH="dos" ;;
*bsd) HB_HOST_ARCH="bsd" ;;
esac
fi
if [ "$HB_HOST_ARCH" != "win" ]; then
export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__$UNAMEU"
fi
[ -n "$HB_INSTALL_PREFIX" ] || \
export HB_INSTALL_PREFIX="/usr/local/mingw32-harbour"
# try to detect MinGW cross-compiler location
# using some default platform settings
if [ -f /etc/debian_version ]; then
MINGW_PREFIX=/usr
[ -n "$TARGET" ] || TARGET=i586-mingw32msvc
HB_CCPREFIX="$TARGET-"
elif [ -f /etc/gentoo-release ]; then
if [ -x /opt/xmingw/bin/i386-mingw32msvc-gcc ]; then
MINGW_PREFIX=/opt/xmingw
[ -n "$TARGET" ] || TARGET=i386-mingw32msvc
else
MINGW_PREFIX=/usr
[ -n "$TARGET" ] || TARGET=i686-mingw32
fi
HB_CCPREFIX="$TARGET-"
elif [ "$UNAME" = "FreeBSD" ]; then
MINGW_PREFIX=/usr/local/mingw32
[ -n "$TARGET" ] || TARGET="."
HB_CCPREFIX=""
UNAMEL=bsd
elif [ -x /usr/local/bin/i[3456]86-mingw*-gcc ]; then
MINGW_PREFIX=/usr/local
[ -n "$TARGET" ] || TARGET=`echo /usr/local/bin/i[3456]86-mingw*-gcc|sed -e '1 !d' -e 's/.*\(i[3456]86-mingw[^-]*\).*/\1/g'`
HB_CCPREFIX="$TARGET-"
fi
if [ -z "${MINGW_PREFIX}" ] || \
[ ! -x ${MINGW_PREFIX}/bin/${HB_CCPREFIX}gcc ]; then
# MinGW cross-compiler not found in default location
# scan some usually used locations and names
for d in /usr /usr/local /usr/local/mingw32 /opt/xmingw; do
if [ -z "${MINGW_PREFIX}" ] && [ -d $d/bin ]; then
MINGWGCC=`echo $d/bin/i[3456]86-mingw*-gcc`
if [ -x $MINGWGCC ]; then
MINGW_PREFIX=$d
[ -n "$TARGET" ] || TARGET=`echo "$MINGWGCC"|sed -e '1 !d' -e 's/.*\(i[3456]86-mingw[^-]*\).*/\1/g'`
HB_CCPREFIX="$TARGET-"
else
MINGWGCC=`echo $d/i[3456]86-mingw*/bin/gcc`
if [ -x $MINGWGCC ]; then
MINGW_PREFIX=$d
[ -n "$TARGET" ] || TARGET=`echo "$MINGWGCC"|sed -e '1 !d' -e 's!.*\(i[3456]86-mingw[^/]*\).*!\1!g'`
HB_CCPREFIX=""
fi
fi
fi
done
fi
if [ ! -x ${MINGW_PREFIX}/bin/${HB_CCPREFIX}gcc ]; then
echo "Can't determine the location for the MinGW32 cross-compiler."
echo "Please install it or add your platform to the $0 script."
exit 1
fi
export HB_CCPATH="${MINGW_PREFIX}/bin/"
export PATH="${HB_CCPATH%/}${PATH}"
export HB_CCPREFIX
export HB_TOOLS_PREF="hbw"
export HB_XBUILD="win"
[ "${HB_HOST_BUILD}" = "all" ] || export HB_HOST_BUILD="lib"
case "$1" in
tgz)
ext=$1
shift
. `dirname $0`/make_${ext}.sh "$@"
;;
*)
if [ "$HB_HOST_ARCH" = "bsd" ] || [ "$HB_HOST_ARCH" = "hpux" ]
then
gmake $*
else
make $*
fi
;;
esac

View File

@@ -1,80 +0,0 @@
#!/bin/sh
[ "$BASH" ] || exec bash `which $0` ${1+"$@"}
#
# $Id$
#
# This script simplifies cross-compiling Harbour for Windows-CE from Unix systems.
#
# Copyright 2007 by Przemyslaw Czerpak (druzus/at/priv.onet.pl)
#
UNAME=`uname`
UNAMEL=`echo "$UNAME"|tr A-Z a-z`
UNAMEU=`echo "$UNAME"|tr a-z A-Z`
export HB_ARCHITECTURE=wce
export HB_COMPILER=mingwarm
if [ "$OSTYPE" = "msdosdjgpp" ]; then
HB_HOST_ARCH="dos"
HB_HOST_COMP="djgpp"
else
HB_HOST_ARCH="${UNAMEL}"
HB_HOST_COMP="gcc"
case "$HB_HOST_ARCH" in
*windows*|*mingw32*|msys*) HB_HOST_ARCH="win"; HB_HOST_COMP="mingw" ;;
*dos) HB_HOST_ARCH="dos" ;;
*bsd) HB_HOST_ARCH="bsd" ;;
esac
fi
if [ "$HB_HOST_ARCH" != "win" ] && \
[ "$HB_HOST_ARCH" != "wce" ]; then
export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__$UNAMEU"
fi
[ -n "$HB_INSTALL_PREFIX" ] || \
export HB_INSTALL_PREFIX="/usr/local/arm-wince-mingwce-harbour"
# default mingwce installation path
[ -n "$HB_CCPATH" ] && HB_CCPATH="${HB_CCPATH%/}/"
[ -z "$HB_CCPATH" ] && HB_CCPATH="/opt/mingw32ce/bin/"
# mingwce executables prefix - this
if [ -z "$HB_CCPREFIX" ]; then
if [ -x "${HB_CCPATH}arm-wince-mingw32ce-gcc" ]; then
HB_CCPREFIX="arm-wince-mingw32ce-"
else
if [ -x "${HB_CCPATH}arm-mingw32ce-gcc" ]; then
HB_CCPREFIX="arm-mingw32ce-"
else
echo "mingwce compiler executable not found. Ensure you have mingwce package installed in"
echo "/opt/mingw32ce dir, or (alternatively) set environment variable HB_CCPATH to a mingwce"
echo "installation directory"
exit 1
fi
fi
fi
export HB_CCPATH
export PATH="${HB_CCPATH%/}:${PATH}"
export HB_CCPREFIX
export HB_TOOLS_PREF="hbce"
export HB_XBUILD="wce"
[ "${HB_HOST_BUILD}" = "all" ] || export HB_HOST_BUILD="lib"
case "$1" in
tgz)
ext=$1
shift
. `dirname $0`/make_${ext}.sh "$@"
;;
*)
if [ "$HB_HOST_ARCH" = "bsd" ] || [ "$HB_HOST_ARCH" = "hpux" ]
then
gmake $*
else
make $*
fi
;;
esac