From 575b574c53a312cd698b53fce515bb3a64f6be9e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 7 Nov 2010 15:02:55 +0000 Subject: [PATCH] 2010-11-07 15:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/version.c + HB_VERSION( HB_VERSION_PLATFORM ) changed to use hb_verPlatformMacro(). This means it will now supported recently added platforms. ; NOTE: For consistency, __PLATFORM__WINDOWS should pbly be changed to __PLATFORM__WIN, and __PLATFORM__WINCE to __PLATFORM__WCE. * utils/hbmk2/hbmk2.prg + Added HB_HOST_PLAT macro, returning: hb_Version( HB_VERSION_PLATFORM ) + Added HB_HOST_PLAT_UNIX macro. ! Fixed cygwin to be detected as cross target platform. ! Few cygwin related TOFIX-es cleared. * external/Makefile - external/sqlite3 + contrib/3rd + contrib/3rd/sqlite3 * contrib/3rd/sqlite3/sqlite3.hbc + contrib/3rd/sqlite3/sqlite3.hbp - contrib/3rd/sqlite3/Makefile * Moved sqlite3 foreign code to contrib/3rd dir from global 3rd party code dir. + Migrated remaining platform tweaks from Makefile to sqlite3.hbp Bumps are expected, pls test. * contrib/hbsqlit3/hbsqlit3.hbp * contrib/sddsqlt3/sddsqlt3.hbp * Changed sqlite3 position. + Added sqlite3 reference. ; Please note that after above changes sqlite3 will only be built if required. * src/common/hbver.c * Formatting. --- harbour/ChangeLog | 35 ++++++++ .../3rd}/sqlite3/sqlite3.c | 0 .../3rd}/sqlite3/sqlite3.dif | 0 .../3rd}/sqlite3/sqlite3.h | 0 harbour/contrib/3rd/sqlite3/sqlite3.hbc | 5 ++ harbour/contrib/3rd/sqlite3/sqlite3.hbp | 39 +++++++++ harbour/contrib/hbsqlit3/hbsqlit3.hbp | 4 +- harbour/contrib/sddsqlt3/sddsqlt3.hbp | 4 +- harbour/external/Makefile | 2 - harbour/external/sqlite3/Makefile | 87 ------------------- harbour/external/sqlite3/sqlite3.hbc | 5 -- harbour/external/sqlite3/sqlite3.hbp | 29 ------- harbour/src/common/hbver.c | 30 +++---- harbour/src/rtl/version.c | 20 +---- harbour/utils/hbmk2/hbmk2.prg | 22 +++-- 15 files changed, 119 insertions(+), 163 deletions(-) rename harbour/{external => contrib/3rd}/sqlite3/sqlite3.c (100%) rename harbour/{external => contrib/3rd}/sqlite3/sqlite3.dif (100%) rename harbour/{external => contrib/3rd}/sqlite3/sqlite3.h (100%) create mode 100644 harbour/contrib/3rd/sqlite3/sqlite3.hbc create mode 100644 harbour/contrib/3rd/sqlite3/sqlite3.hbp delete mode 100644 harbour/external/sqlite3/Makefile delete mode 100644 harbour/external/sqlite3/sqlite3.hbc delete mode 100644 harbour/external/sqlite3/sqlite3.hbp diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9644f5e6e2..a7055f086d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,41 @@ The license applies to all entries newer than 2009-04-28. */ +2010-11-07 15:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/version.c + + HB_VERSION( HB_VERSION_PLATFORM ) changed to use hb_verPlatformMacro(). + This means it will now supported recently added platforms. + ; NOTE: For consistency, __PLATFORM__WINDOWS should pbly be changed to __PLATFORM__WIN, + and __PLATFORM__WINCE to __PLATFORM__WCE. + + * utils/hbmk2/hbmk2.prg + + Added HB_HOST_PLAT macro, returning: hb_Version( HB_VERSION_PLATFORM ) + + Added HB_HOST_PLAT_UNIX macro. + ! Fixed cygwin to be detected as cross target platform. + ! Few cygwin related TOFIX-es cleared. + + * external/Makefile + - external/sqlite3 + + contrib/3rd + + contrib/3rd/sqlite3 + * contrib/3rd/sqlite3/sqlite3.hbc + + contrib/3rd/sqlite3/sqlite3.hbp + - contrib/3rd/sqlite3/Makefile + * Moved sqlite3 foreign code to contrib/3rd dir from + global 3rd party code dir. + + Migrated remaining platform tweaks from Makefile to sqlite3.hbp + Bumps are expected, pls test. + + * contrib/hbsqlit3/hbsqlit3.hbp + * contrib/sddsqlt3/sddsqlt3.hbp + * Changed sqlite3 position. + + Added sqlite3 reference. + ; Please note that after above changes sqlite3 will only be built + if required. + + * src/common/hbver.c + * Formatting. + 2010-11-07 13:49 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg * Changed the way target selection (-hblib, -hbdyn*, -hbexe, etc) diff --git a/harbour/external/sqlite3/sqlite3.c b/harbour/contrib/3rd/sqlite3/sqlite3.c similarity index 100% rename from harbour/external/sqlite3/sqlite3.c rename to harbour/contrib/3rd/sqlite3/sqlite3.c diff --git a/harbour/external/sqlite3/sqlite3.dif b/harbour/contrib/3rd/sqlite3/sqlite3.dif similarity index 100% rename from harbour/external/sqlite3/sqlite3.dif rename to harbour/contrib/3rd/sqlite3/sqlite3.dif diff --git a/harbour/external/sqlite3/sqlite3.h b/harbour/contrib/3rd/sqlite3/sqlite3.h similarity index 100% rename from harbour/external/sqlite3/sqlite3.h rename to harbour/contrib/3rd/sqlite3/sqlite3.h diff --git a/harbour/contrib/3rd/sqlite3/sqlite3.hbc b/harbour/contrib/3rd/sqlite3/sqlite3.hbc new file mode 100644 index 0000000000..86f6254c46 --- /dev/null +++ b/harbour/contrib/3rd/sqlite3/sqlite3.hbc @@ -0,0 +1,5 @@ +# +# $Id$ +# + +libs=${hb_name}${__HB_DYN__} diff --git a/harbour/contrib/3rd/sqlite3/sqlite3.hbp b/harbour/contrib/3rd/sqlite3/sqlite3.hbp new file mode 100644 index 0000000000..c57879d4a9 --- /dev/null +++ b/harbour/contrib/3rd/sqlite3/sqlite3.hbp @@ -0,0 +1,39 @@ +# +# $Id$ +# + +-stop{poccarm} +# NOTE: old msvcarm can't cope with some PP directives. [vszakats] +-stop{msvcarm&HB_COMP_VER!='1200'&HB_COMP_VER!='1300'&HB_COMP_VER!='1310')} +# NOTE: dos based watcom runs out of memory. [vszakats] +-stop{HB_HOST_PLAT='dos'&watcom} +# NOTE: disable *nix builds on non-*nix platforms; [vszakats] +# except for cygwin-on-win +-stop{!(HB_HOST_PLAT='win'&cygwin)&HB_HOST_PLAT_UNIX=''&unix} + +-hblib +-inc + +-o${hb_targetname} + +-warn=no +-cpp=no + +-cflag=-DSQLITE_OMIT_DEPRECATED +-cflag=-D_WIN32_WCE{wce} +# DJGPP and OpenWatcom in DOS aren't correctly recognized by SQLite, +# so we're forcing the next best available option. This will cause missing +# externals though. [vszakats] +-cflag=-DSQLITE_OS_OTHER{dos} +# Watcom Linux builds cannot use system header files +-cflag=-DSQLITE_OS_OTHER{linux&watcom} + +sqlite3.c + +# ORIGIN http://www.sqlite.org/ +# VER 3.7.3 +# URL http://www.sqlite.org/sqlite-amalgamation-3_7_3.zip +# DIFF sqlite3.dif +# +# MAP sqlite3.c +# MAP sqlite3.h diff --git a/harbour/contrib/hbsqlit3/hbsqlit3.hbp b/harbour/contrib/hbsqlit3/hbsqlit3.hbp index 68efabd198..258039a991 100644 --- a/harbour/contrib/hbsqlit3/hbsqlit3.hbp +++ b/harbour/contrib/hbsqlit3/hbsqlit3.hbp @@ -14,8 +14,10 @@ -depcontrol=sqlite3:${HB_WITH_SQLITE3} -depincpath=sqlite3:/usr/include -depincpath=sqlite3:/boot/common/include --depincpathlocal=sqlite3:../../external/sqlite3 +-depincpathlocal=sqlite3:../3rd/sqlite3 -instfile=inc:hbsqlit3.ch hbsqlit3.c + +../3rd/sqlite3/sqlite3.hbc diff --git a/harbour/contrib/sddsqlt3/sddsqlt3.hbp b/harbour/contrib/sddsqlt3/sddsqlt3.hbp index b509f02e8a..8114df53e0 100644 --- a/harbour/contrib/sddsqlt3/sddsqlt3.hbp +++ b/harbour/contrib/sddsqlt3/sddsqlt3.hbp @@ -16,6 +16,8 @@ -depcontrol=sqlite3:${HB_WITH_SQLITE3} -depincpath=sqlite3:/usr/include -depincpath=sqlite3:/boot/common/include --depincpathlocal=sqlite3:../../external/sqlite3 +-depincpathlocal=sqlite3:../3rd/sqlite3 sddsqlt3.c + +../3rd/sqlite3/sqlite3.hbc diff --git a/harbour/external/Makefile b/harbour/external/Makefile index 112b2e02df..b415e9cefc 100644 --- a/harbour/external/Makefile +++ b/harbour/external/Makefile @@ -5,7 +5,6 @@ ROOT := ../ DIRS := \ - sqlite3 \ bzip2 \ libhpdf \ hbpmcom \ @@ -13,6 +12,5 @@ DIRS := \ jpeg \ pcre \ zlib \ - minizip \ include $(TOP)$(ROOT)config/dir.mk diff --git a/harbour/external/sqlite3/Makefile b/harbour/external/sqlite3/Makefile deleted file mode 100644 index 856eb5cb70..0000000000 --- a/harbour/external/sqlite3/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# -# $Id$ -# - -ROOT := ../../ - -include $(TOP)$(ROOT)config/global.mk - -LIBNAME := sqlite3 - -HB_BUILD_WARN := no -HB_BUILD_MODE := c - -C_SOURCES := \ - sqlite3.c \ - -# decide if it's supported at all -HB_SUPPORTED := yes -ifeq ($(HB_COMPILER),poccarm) - HB_SUPPORTED := no -endif -# NOTE: old msvcarm can't cope with some PP directives. [vszakats] -ifeq ($(HB_COMPILER),msvcarm) - ifneq ($(filter $(HB_COMPILER_VER),1200 1300 1310),) - HB_SUPPORTED := no - endif -endif -# NOTE: dos based watcom runs out of memory. [vszakats] -ifeq ($(HB_HOST_PLAT)-$(HB_COMPILER),dos-watcom) - HB_SUPPORTED := no -endif -# NOTE: disable *nix builds on non-*nix platforms; [vszakats] -# except for cygwin-on-win -ifneq ($(HB_HOST_PLAT)-$(HB_PLATFORM),win-cygwin) - ifeq ($(HB_HOST_PLAT_UNIX),) - ifneq ($(HB_PLATFORM_UNIX),) - HB_SUPPORTED := no - endif - endif -endif - -ifeq ($(HB_SUPPORTED),yes) - - _DET_DSP_NAME := sqlite3 - _DET_VAR_INC_ := HB_INC_SQLITE3 - _DET_VAR_HAS_ := HB_HAS_SQLITE3 - _DET_FLT_PLAT := - _DET_FLT_COMP := - _DET_INC_DEFP := /usr/include - _DET_INC_LOCL := external/sqlite3 - _DET_INC_HEAD := /sqlite3.h - include $(TOP)$(ROOT)config/detfun.mk - - ifneq ($(HB_HAS_SQLITE3_LOCAL),) - - HB_CFLAGS += -DSQLITE_OMIT_DEPRECATED - ifeq ($(HB_PLATFORM),wce) - HB_CFLAGS += -D_WIN32_WCE - endif - ifeq ($(HB_PLATFORM),dos) - # DJGPP and OpenWatcom in DOS aren't correctly recognized by SQLite, - # so we're forcing the next best available option. This will cause missing - # externals though. [vszakats] - HB_CFLAGS += -DSQLITE_OS_OTHER - endif - ifeq ($(HB_PLATFORM)-$(HB_COMPILER),linux-watcom) - # Watcom Linux builds cannot use system header files - HB_CFLAGS += -DSQLITE_OS_OTHER - endif - - include $(TOP)$(ROOT)config/lib.mk - else - HB_SKIP_REASON := unused - include $(TOP)$(ROOT)config/none.mk - endif -else - HB_SKIP_REASON := platform or compiler not supported - include $(TOP)$(ROOT)config/none.mk -endif - -# ORIGIN http://www.sqlite.org/ -# VER 3.7.3 -# URL http://www.sqlite.org/sqlite-amalgamation-3_7_3.zip -# DIFF sqlite3.dif -# -# MAP sqlite3.c -# MAP sqlite3.h diff --git a/harbour/external/sqlite3/sqlite3.hbc b/harbour/external/sqlite3/sqlite3.hbc deleted file mode 100644 index 1763330ae6..0000000000 --- a/harbour/external/sqlite3/sqlite3.hbc +++ /dev/null @@ -1,5 +0,0 @@ -# -# $Id$ -# - -libs=${hb_name} diff --git a/harbour/external/sqlite3/sqlite3.hbp b/harbour/external/sqlite3/sqlite3.hbp deleted file mode 100644 index e7b31c92f3..0000000000 --- a/harbour/external/sqlite3/sqlite3.hbp +++ /dev/null @@ -1,29 +0,0 @@ -# -# $Id$ -# - --stop{poccarm} -# NOTE: old msvcarm can't cope with some PP directives. [vszakats] --stop{msvcarm&HB_COMP_VER!='1200'&HB_COMP_VER!='1300'&HB_COMP_VER!='1310')} - -# TODO: Some restrictions were not migrated from Makefile - --hblib --inc - --o${hb_targetname} - --warn=no --cpp=no - --cflag=-DSQLITE_OMIT_DEPRECATED - -sqlite3.c - -# ORIGIN http://www.sqlite.org/ -# VER 3.7.3 -# URL http://www.sqlite.org/sqlite-amalgamation-3_7_3.zip -# DIFF sqlite3.dif -# -# MAP sqlite3.c -# MAP sqlite3.h diff --git a/harbour/src/common/hbver.c b/harbour/src/common/hbver.c index 8f4e7598bd..3fdff2d9f4 100644 --- a/harbour/src/common/hbver.c +++ b/harbour/src/common/hbver.c @@ -165,35 +165,35 @@ const char * hb_verHostCPU( void ) const char * hb_verPlatformMacro( void ) { #if defined( HB_OS_WIN_CE ) /* Must precede HB_OS_WIN */ - return "WINCE"; /* TODO: Change this to WCE for consistency? */ + return "WINCE"; /* TODO: Change this to WCE for consistency? */ #elif defined( HB_OS_WIN ) - return "WINDOWS"; /* TODO: Change this to WIN for consistency? */ + return "WINDOWS"; /* TODO: Change this to WIN for consistency? */ #elif defined( HB_OS_DOS ) - return "DOS"; + return "DOS"; #elif defined( HB_OS_OS2 ) - return "OS2"; + return "OS2"; #elif defined( HB_OS_LINUX ) - return "LINUX"; + return "LINUX"; #elif defined( HB_OS_DARWIN ) - return "DARWIN"; + return "DARWIN"; #elif defined( HB_OS_BSD ) - return "BSD"; + return "BSD"; #elif defined( HB_OS_SUNOS ) - return "SUNOS"; + return "SUNOS"; #elif defined( HB_OS_HPUX ) - return "HPUX"; + return "HPUX"; #elif defined( HB_OS_BEOS ) - return "BEOS"; + return "BEOS"; #elif defined( HB_OS_QNX ) - return "QNX"; + return "QNX"; #elif defined( HB_OS_VXWORKS ) - return "VXWORKS"; + return "VXWORKS"; #elif defined( HB_OS_SYMBIAN ) - return "SYMBIAN"; + return "SYMBIAN"; #elif defined( HB_OS_CYGWIN ) - return "CYGWIN"; + return "CYGWIN"; #else - return NULL; + return NULL; #endif } diff --git a/harbour/src/rtl/version.c b/harbour/src/rtl/version.c index 116f08590c..95de5c5af1 100644 --- a/harbour/src/rtl/version.c +++ b/harbour/src/rtl/version.c @@ -147,24 +147,12 @@ HB_FUNC( HB_VERSION ) break; case HB_VERSION_PLATFORM: - #if defined( HB_OS_DOS ) - hb_retc_const( "DOS" ); - #elif defined( HB_OS_OS2 ) - hb_retc_const( "OS2" ); + #if defined( HB_OS_WIN_CE ) /* NOTE: Must precede HB_OS_WIN */ + hb_retc_const( "WCE" ); #elif defined( HB_OS_WIN ) - hb_retc_const( "WINDOWS" ); - #elif defined( HB_OS_LINUX ) - hb_retc_const( "LINUX" ); - #elif defined( HB_OS_SUNOS ) - hb_retc_const( "SUNOS" ); - #elif defined( HB_OS_HPUX ) - hb_retc_const( "HPUX" ); - #elif defined( HB_OS_DARWIN ) - hb_retc_const( "DARWIN" ); - #elif defined( HB_OS_BSD ) - hb_retc_const( "BSD" ); + hb_retc_const( "WIN" ); #else - hb_retc_null(); + hb_retc_const( hb_verPlatformMacro() ); #endif break; diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 01308f3b9e..23467eea8a 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -188,6 +188,7 @@ REQUEST hbmk_KEYW #define _COMPDET_cCOMP 2 #define _COMPDET_cCCPREFIX 3 /* optional */ #define _COMPDET_cCCPOSTFIX 4 /* optional */ +#define _COMPDET_cPLAT 5 /* optional */ #define _COMPDETE_bBlock 1 #define _COMPDETE_cPLAT 2 @@ -1358,7 +1359,7 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) /* Order is significant. watcom also keeps a cl.exe in its binary dir. */ #if ! defined( __PLATFORM__UNIX ) - aCOMPDET := { { {|| FindInSamePath( "cygstart.exe", "gcc" ) }, "cygwin" },; /* TOFIX: cygwin is now a platform */ + aCOMPDET := { { {|| FindInSamePath( "cygstart.exe", "gcc" ) }, "gcc",,, "cygwin" },; { {|| FindInPath( "gcc-dw2" ) }, "mingw", "", "-dw2" },; /* tdragon DWARF-2 build */ { {|| FindInPath( "x86_64-pc-mingw32-gcc" ) }, "mingw64" },; /* Equation Solution build */ { {|| FindInPath( hbmk[ _HBMK_cCCPREFIX ] + "gcc" + hbmk[ _HBMK_cCCPOSTFIX ] ) }, "mingw" },; @@ -1606,12 +1607,15 @@ FUNCTION hbmk2( aArgs, nArgTarget, /* @ */ lPause, nLevel ) hb_ps() + aCOMPDET[ tmp ][ _COMPDET_cCOMP ] +; PathSepToSelf( hbmk[ _HBMK_cBUILD ] ) ) hbmk[ _HBMK_cCOMP ] := aCOMPDET[ tmp ][ _COMPDET_cCOMP ] - IF Len( aCOMPDET[ tmp ] ) >= _COMPDET_cCCPREFIX + IF Len( aCOMPDET[ tmp ] ) >= _COMPDET_cCCPREFIX .AND. aCOMPDET[ tmp ][ _COMPDET_cCCPREFIX ] != NIL hbmk[ _HBMK_cCCPREFIX ] := aCOMPDET[ tmp ][ _COMPDET_cCCPREFIX ] ENDIF - IF Len( aCOMPDET[ tmp ] ) >= _COMPDET_cCCPOSTFIX + IF Len( aCOMPDET[ tmp ] ) >= _COMPDET_cCCPOSTFIX .AND. aCOMPDET[ tmp ][ _COMPDET_cCCPOSTFIX ] != NIL hbmk[ _HBMK_cCCPOSTFIX ] := aCOMPDET[ tmp ][ _COMPDET_cCCPOSTFIX ] ENDIF + IF Len( aCOMPDET[ tmp ] ) >= _COMPDET_cPLAT .AND. aCOMPDET[ tmp ][ _COMPDET_cPLAT ] != NIL + hbmk[ _HBMK_cPLAT ] := aCOMPDET[ tmp ][ _COMPDET_cPLAT ] + ENDIF /* Hack autodetect watcom platform by looking at the header path config. TODO: Do it properly */ IF hbmk[ _HBMK_cCOMP ] == "watcom" DO CASE @@ -8171,7 +8175,7 @@ STATIC FUNCTION ListCookLib( hbmk, aLIB, aLIBA, array, cPrefix, cExtNew ) LOCAL cLibNameCooked LOCAL cName, cExt - IF HBMK_ISCOMP( "gcc|mingw|mingw64|mingwarm|djgpp|cygwin|gccomf|clang|open64" ) /* TOFIX: cygwin is now a platform */ + IF HBMK_ISCOMP( "gcc|mingw|mingw64|mingwarm|djgpp|gccomf|clang|open64" ) FOR EACH cLibName IN array hb_FNameSplit( cLibName, @cDir ) IF Empty( cDir ) @@ -9568,7 +9572,7 @@ STATIC FUNCTION MacroGet( hbmk, cMacro, cFileName ) CASE "HB_TARGETTYPE" cMacro := hbmk_TARGETTYPE( hbmk ) ; EXIT CASE "HB_PLAT" - CASE "HB_PLATFORM" + CASE "HB_PLATFORM" /* Compatibility */ CASE "HB_ARCH" /* Compatibility */ cMacro := hbmk[ _HBMK_cPLAT ] ; EXIT CASE "HB_COMP" @@ -9600,6 +9604,10 @@ STATIC FUNCTION MacroGet( hbmk, cMacro, cFileName ) cMacro := hb_Version( HB_VERSION_STATUS ) ; EXIT CASE "HB_REVISION" cMacro := hb_ntos( hb_Version( HB_VERSION_REVISION ) ) ; EXIT + CASE "HB_HOST_PLAT" + cMacro := hb_Version( HB_VERSION_PLATFORM ) ; EXIT + CASE "HB_HOST_PLAT_UNIX" + cMacro := iif( hb_Version( HB_VERSION_UNIX_COMPAT ), "1", "" ) ; EXIT CASE "HB_BIN" cMacro := hbmk[ _HBMK_cHB_INSTALL_BIN ] ; EXIT CASE "HB_LIB" @@ -10787,8 +10795,8 @@ STATIC FUNCTION hbmk_TARGETTYPE( hbmk ) STATIC FUNCTION hbmk_CPU( hbmk ) DO CASE - CASE HBMK_ISPLAT( "dos|os2" ) .OR. ; - HBMK_ISCOMP( "mingw|cygwin|msvc|pocc|watcom|bcc|xcc" ) .OR. ; /* TOFIX: cygwin is now a platform */ + CASE HBMK_ISPLAT( "dos|os2|cygwin" ) .OR. ; + HBMK_ISCOMP( "mingw|msvc|pocc|watcom|bcc|xcc" ) .OR. ; ( hbmk[ _HBMK_cPLAT ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "icc" ) RETURN "x86" CASE HBMK_ISCOMP( "gcc|icc|clang|sunpro|diab|pcc" )