diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5dd7f0101a..903ee5fc6b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,30 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-15 20:02 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/harbour.spec + ! fixed RPM building after recent modification in Makefiles + + * harbour/harbour-win-spec + * harbour/harbour-wce-spec + * updated for new binary files directory and HB_BIN_COMPILE meaning + + * harbour/source/pp/Makefile + * harbour/config/rules.cf + ! fixed binary extension used to execute hbpp and harbour, + AFAIK in current version it should be HB_HOST_BIN_EXT not EXE_EXT + + * harbour/config/global.cf + ! fixed host architecture autodetection: + @uname = $(shell uname -a) + does not execute command silently but creates envvar '@uname' + % added function for host detection and extended host detection + rules to work with some envvars + % test some known OS envvars before calling uname + ! use 'uname -s' instead of 'uname -a' which may cause wrong host + detection when host name contains some string we are looking for + ! set .exe in HB_HOST_BIN_EXT for win_amd64 + 2009-07-15 20:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/Makefile + include/hbextcdp.ch diff --git a/harbour/config/global.cf b/harbour/config/global.cf index 9a66a4a7fe..441fa47d2e 100644 --- a/harbour/config/global.cf +++ b/harbour/config/global.cf @@ -28,6 +28,44 @@ ARCH_COMP := $(HB_ARCHITECTURE)/$(HB_COMPILER) OBJ_DIR := $(OBJ_BASE)/$(ARCH_COMP) OBJ_ARCH_DIR := $(OBJ_BASE)/$(HB_ARCHITECTURE) +define check_host + +ifneq ($(findstring MINGW,$(1)),) + HB_HOST_ARCH := win +else ifneq ($(findstring MSys,$(1)),) + HB_HOST_ARCH := win +else ifneq ($(findstring Windows,$(1)),) + HB_HOST_ARCH := win +else ifneq ($(findstring CYGWIN,$(1)),) + HB_HOST_ARCH := win +else ifneq ($(findstring Darwin,$(1)),) + HB_HOST_ARCH := darwin +else ifneq ($(findstring OS/2,$(1)),) + HB_HOST_ARCH := os2 +else ifneq ($(findstring darwin,$(1)),) + HB_HOST_ARCH := darwin +else ifneq ($(findstring Linux,$(1)),) + HB_HOST_ARCH := linux +else ifneq ($(findstring linux,$(1)),) + HB_HOST_ARCH := linux +else ifneq ($(findstring BSD,$(1)),) + HB_HOST_ARCH := bsd +else ifneq ($(findstring bsd,$(1)),) + HB_HOST_ARCH := bsd +else ifneq ($(findstring HP-UX,$(1)),) + HB_HOST_ARCH := hpux +else ifneq ($(findstring hp-ux,$(1)),) + HB_HOST_ARCH := hpux +else ifneq ($(findstring SunOS,$(1)),) + HB_HOST_ARCH := sunos +else ifneq ($(findstring sunos,$(1)),) + HB_HOST_ARCH := sunos +else ifneq ($(findstring msdos,$(1)),) + HB_HOST_ARCH := dos +endif + +endef + # Directory separator default ifeq ($(DIRSEP),) DIRSEP = / @@ -59,11 +97,21 @@ ifneq ($(HB_SHELL),bash) endif endif -# trickery to avoid process_create failed message with @uname := ... -@uname = $(shell uname -a) -uname := $(uname) +ifeq ($(HB_HOST_ARCH),) + $(eval $(call check_host,$(OSTYPE),)) + ifeq ($(HB_HOST_ARCH),) + $(eval $(call check_host,$(MACHTYPE),)) + ifeq ($(HB_HOST_ARCH),) + $(eval $(call check_host,$(OS),)) + ifeq ($(HB_HOST_ARCH),) + $(eval $(call check_host,$(shell uname -s),)) + endif + endif + endif +endif -ifeq ($(uname),) + +ifeq ($(HB_HOST_ARCH),) ifneq ($(OS2_SHELL),) HB_HOST_ARCH := os2 else ifneq ($(windir),) @@ -73,24 +121,6 @@ ifeq ($(uname),) else HB_HOST_ARCH := dos endif -else ifneq ($(findstring MINGW,$(uname)),) - HB_HOST_ARCH := win -else ifneq ($(findstring CYGWIN,$(uname)),) - HB_HOST_ARCH := win -else ifneq ($(findstring Darwin,$(uname)),) - HB_HOST_ARCH := darwin -else ifneq ($(findstring OS/2,$(uname)),) - HB_HOST_ARCH := os2 -else ifneq ($(findstring Linux,$(uname)),) - HB_HOST_ARCH := linux -else ifneq ($(findstring BSD,$(uname)),) - HB_HOST_ARCH := bsd -else ifneq ($(findstring HP-UX,$(uname)),) - HB_HOST_ARCH := hpux -else ifneq ($(findstring SunOS,$(uname)),) - HB_HOST_ARCH := sunos -else - HB_HOST_ARCH := linux endif $(info Detected host platform: $(HB_HOST_ARCH)) @@ -107,7 +137,7 @@ ifneq ($(HB_HOST_ARCH),$(HB_ARCHITECTURE)) endif endif -ifneq ($(findstring $(HB_HOST_ARCH),win wce dos os2),) +ifneq ($(findstring $(HB_HOST_ARCH),win win_amd64 wce dos os2),) HB_HOST_BIN_EXT := .exe else HB_HOST_BIN_EXT := diff --git a/harbour/config/rules.cf b/harbour/config/rules.cf index db0f8e0867..03bf4a3998 100644 --- a/harbour/config/rules.cf +++ b/harbour/config/rules.cf @@ -19,12 +19,7 @@ endif # # How to run Harbour. # -HB := $(notdir $(HB_BIN_COMPILE)) -ifneq ($(HB),) -# there is no slash at the end -HB := $(HB_BIN_COMPILE)/ -endif -HB := $(HB)harbour$(EXE_EXT) +HB := $(HB_BIN_COMPILE)/harbour$(HB_HOST_BIN_EXT) ifeq ($(HB_GCMODE),) HB_GCMODE=0 diff --git a/harbour/harbour-wce-spec b/harbour/harbour-wce-spec index 296f6c19be..052fb62781 100644 --- a/harbour/harbour-wce-spec +++ b/harbour/harbour-wce-spec @@ -96,10 +96,7 @@ export HB_HOST_BUILD=lib export HB_ARCHITECTURE=wce export HB_COMPILER=mingwarm -mkdir -p source/pp/${HB_ARCHITECTURE}/${HB_COMPILER} -ln -s ../../linux/gcc/hbpp source/pp/${HB_ARCHITECTURE}/${HB_COMPILER}/hbpp.exe -mkdir -p source/main/${HB_ARCHITECTURE}/${HB_COMPILER} -ln -s ../../linux/gcc/harbour source/main/${HB_ARCHITECTURE}/${HB_COMPILER}/harbour.exe +export HB_BIN_COMPILE="$(pwd)/bin/linux/gcc" export CC_HB_USER_CFLAGS="" export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS" @@ -128,6 +125,12 @@ make %{?_smp_mflags} # Install harbour itself. +export HB_HOST_BUILD=lib +export HB_ARCHITECTURE=wce +export HB_COMPILER=mingwarm + +export HB_BIN_COMPILE="$(pwd)/bin/linux/gcc" + export CC_HB_USER_CFLAGS="" export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS" export HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" @@ -138,9 +141,6 @@ export HB_CCPATH="%{hb_ccpath}:" export HB_CCPREFIX="%{hb_ccpref}" export PATH="$HB_CCPATH$PATH" -export HB_HOST_BUILD=lib -export HB_ARCHITECTURE=wce -export HB_COMPILER=mingwarm export HB_XBUILD=wce export HB_BIN_INSTALL=%{_bindir} export HB_INC_INSTALL=%{_includedir}/%{name} diff --git a/harbour/harbour-win-spec b/harbour/harbour-win-spec index 5cf27abe87..1c23debed0 100644 --- a/harbour/harbour-win-spec +++ b/harbour/harbour-win-spec @@ -96,10 +96,7 @@ export HB_HOST_BUILD=lib export HB_ARCHITECTURE=win export HB_COMPILER=mingw -mkdir -p source/pp/${HB_ARCHITECTURE}/${HB_COMPILER} -ln -s ../../linux/gcc/hbpp source/pp/${HB_ARCHITECTURE}/${HB_COMPILER}/hbpp.exe -mkdir -p source/main/${HB_ARCHITECTURE}/${HB_COMPILER} -ln -s ../../linux/gcc/harbour source/main/${HB_ARCHITECTURE}/${HB_COMPILER}/harbour.exe +export HB_BIN_COMPILE="$(pwd)/bin/linux/gcc" export CC_HB_USER_CFLAGS="" export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS" @@ -128,6 +125,12 @@ make %{?_smp_mflags} # Install harbour itself. +export HB_HOST_BUILD=lib +export HB_ARCHITECTURE=win +export HB_COMPILER=mingw + +export HB_BIN_COMPILE="$(pwd)/bin/linux/gcc" + export CC_HB_USER_CFLAGS="" export HB_USER_CFLAGS="$CC_HB_USER_CFLAGS" export CC_HB_USER_PRGFLAGS="-D__PLATFORM__WINDOWS -undef:__PLATFORM__UNIX -undef:__PLATFORM__LINUX" @@ -138,9 +141,6 @@ export HB_CCPATH="%{hb_ccpath}:" export HB_CCPREFIX="%{hb_ccpref}" export PATH="$HB_CCPATH$PATH" -export HB_HOST_BUILD=lib -export HB_ARCHITECTURE=win -export HB_COMPILER=mingw export HB_XBUILD=win export HB_BIN_INSTALL=%{_bindir} export HB_INC_INSTALL=%{_includedir}/%{name} diff --git a/harbour/harbour.spec b/harbour/harbour.spec index 18252945c6..f363f48028 100644 --- a/harbour/harbour.spec +++ b/harbour/harbour.spec @@ -73,10 +73,10 @@ %define hb_cc export HB_COMPILER=gcc %define hb_cflag export HB_USER_CFLAGS= %define hb_lflag export HB_USER_LDFLAGS="${CC_HB_USER_LDFLAGS} %{?_with_static:-static}" -%define hb_gpm export HB_GPM_MOUSE=%{!?_without_gpm:yes} -%define hb_crs export HB_WITHOUT_GTCRS=%{?_without_gtcrs:yes} -%define hb_sln export HB_WITHOUT_GTSLN=%{?_without_gtsln:yes} -%define hb_x11 export HB_WITHOUT_X11=%{?_without_x11:yes} +%define hb_gpm export HB_GPM_MOUSE=%{!?_without_gpm:yes}%{?_without_gpm:no} +%define hb_crs export HB_WITHOUT_GTCRS=%{?_without_gtcrs:yes}%{!?_without_gtcrs:no} +%define hb_sln export HB_WITHOUT_GTSLN=%{?_without_gtsln:yes}%{!?_without_gtsln:no} +%define hb_x11 export HB_WITHOUT_X11=%{?_without_x11:yes}%{!?_without_x11:no} %define hb_bdir export HB_BIN_INSTALL=%{_bindir} %define hb_idir export HB_INC_INSTALL=%{_includedir}/%{name} %define hb_ldir export HB_LIB_INSTALL=%{_libdir}/%{name} diff --git a/harbour/source/pp/Makefile b/harbour/source/pp/Makefile index e914199d0c..70ac104145 100644 --- a/harbour/source/pp/Makefile +++ b/harbour/source/pp/Makefile @@ -29,7 +29,7 @@ pptable.c : $(HB_PP_RULES) $(CP) $(subst /,$(DIRSEP),$<) $@ else pptable.c : hbpp$(EXE_EXT) - $(HB_BIN_COMPILE)/hbpp$(EXE_EXT) $(TOP)$(ROOT)include/hbstdgen.ch -opptable.c -q -c$(TOP)$(ROOT) -v$(HB_VERHEADER) + $(HB_BIN_COMPILE)/hbpp$(HB_HOST_BIN_EXT) $(TOP)$(ROOT)include/hbstdgen.ch -opptable.c -q -c$(TOP)$(ROOT) -v$(HB_VERHEADER) endif ifneq ($(HB_BIN_INSTALL),)