diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b7732b90f7..c623957ded 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,56 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-17 00:58 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * source/Makefile + * config/lib.mk + + Added Przemek's patch to add local hbzlib and hbpcre + libs to Harbour dynlib. + ; TODO: Add some ways to disable this because it has some + drawbacks (it f.e. makes it impossible to link 3rd + party libs also exporting zlib / pcre interfaces). + This information needs to be passed to hbmk2, too. + I don't have any elegant way to solve this problem ATM. + + * utils/hbmk2/hbmk2.prg + * Changed to only add local hbzlib and hbpcre libs to liblist + in static mode. (this is needed to support change above). + + Enabled lib grouping for beos/gcc. + + Added supc++/supcxx lib to liblist of gcc family compilers. + This aims to solve link problems when Harbour is built + in C++, but hbmk2 is used in C mode. + + * contrib/hbqt/hbqts.hbc + * contrib/hbqt/hbqt.hbc + * contrib/gtqtc/gtqtcs.hbc + * contrib/gtqtc/gtqtc.hbc + - Deleted explicit supc++ libspec. Now it's added by + hbmk2 automatically. + + * config/dyn.mk + ! Modified to add local hbpcre and hbzlib to syslib + list to make it link with beos/haiku. + Please test/confirm this change. + - Disabled above logic, since it's not needed. + + * config/global.mk + + Added autodetection for linux/sunpro, linux/icc, + darwin/clang, darwin/gcc, darwin/icc. + On darwin clang became the default, if available. + + * external/sqlite3/Makefile + + Tweak for linux/watcom. Based on Przemek patch sent to the devlist. + + * config/detfun.mk + * config/bin.mk + * config/dyn.mk + * source/Makefile + * config/lib.mk + % Minor modification to HB_HAS_*_LOCAL logic to make + it safe to use this var without first checking HB_HAS_*. + + ; Please test/review these. I didn't restest everything after above changes. + 2009-09-16 22:49 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg * utils/hbmk2/hbmk2.pt_BR.po diff --git a/harbour/config/bin.mk b/harbour/config/bin.mk index 9d30c50512..757e3a7356 100644 --- a/harbour/config/bin.mk +++ b/harbour/config/bin.mk @@ -26,10 +26,8 @@ HB_LIBS_TPL = \ hbpp \ hbcommon -ifneq ($(HB_HAS_PCRE),) - ifneq ($(HB_HAS_PCRE_LOCAL),) - HB_LIBS_TPL += hbpcre - endif +ifneq ($(HB_HAS_PCRE_LOCAL),) + HB_LIBS_TPL += hbpcre endif ifneq ($(HB_HAS_ZLIB_LOCAL),) HB_LIBS_TPL += hbzlib diff --git a/harbour/config/detfun.mk b/harbour/config/detfun.mk index 5966b8dbf9..f5d32ce525 100644 --- a/harbour/config/detfun.mk +++ b/harbour/config/detfun.mk @@ -20,7 +20,7 @@ # _DET_INC_DEFP - default location to look at. Not effective in 'HB_BUILD_EXTDEF=no' mode. # _DET_INC_LOCL - embedded location to look at. # _DET_INC_HEAD - header filename to look for. Unless looking for a directory, prefix with forward slash. -# - variable name specified by _DET_VAR_INC_ (typically "HB_INC_*") should contains: +# - variable name specified by _DET_VAR_INC_ (typically "HB_INC_*") containing: # (empty) or yes - will enable external component if found on default locations. # no - will disable external component. # force - will forcibly enable external component, bypassing location checks, @@ -54,6 +54,7 @@ endif _DET_RES_TEXT := ifeq ($($(_DET_VAR_HAS_)),) + $(_DET_VAR_HAS_)_LOCAL := ifneq ($($(_DET_VAR_INC_)),no) _DET_POS := $(filter-out !%,$(_DET_FLT_PLAT)) _DET_NEG := $(subst !,,$(filter !%,$(_DET_FLT_PLAT))) @@ -95,7 +96,6 @@ ifeq ($($(_DET_VAR_HAS_)),) $(call do_info,$(_DET_RES_TEXT)) else # detect if the component was found in locally hosted dir - $(_DET_VAR_HAS_)_LOCAL := ifneq ($(_DET_INC_LOCL),) ifneq ($(filter $(_DET_INC_LOCL),$($(_DET_VAR_HAS_))),) $(_DET_VAR_HAS_)_LOCAL := (local) diff --git a/harbour/config/dyn.mk b/harbour/config/dyn.mk index 3008335782..9377f3842c 100644 --- a/harbour/config/dyn.mk +++ b/harbour/config/dyn.mk @@ -19,14 +19,13 @@ endif -include $(TOP)$(ROOT)config/$(HB_PLATFORM)/libs.mk -ifneq ($(HB_HAS_PCRE),) - ifneq ($(HB_HAS_PCRE_LOCAL),) - LIBS += hbpcre - endif -endif -ifneq ($(HB_HAS_ZLIB_LOCAL),) - LIBS += hbzlib -endif +# We're linking them directly to Harbour dynlib now. +#ifneq ($(HB_HAS_PCRE_LOCAL),) +# SYSLIBS += hbpcre +#endif +#ifneq ($(HB_HAS_ZLIB_LOCAL),) +# SYSLIBS += hbzlib +#endif include $(TOP)$(ROOT)config/$(HB_PLATFORM)/$(HB_COMPILER).mk include $(TOP)$(ROOT)config/c.mk diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 0fcca6136b..473f0b360d 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -778,42 +778,56 @@ ifeq ($(HB_COMPILER),) HB_COMP_PATH := $(call find_in_path,gcc) ifneq ($(HB_COMP_PATH),) HB_COMPILER := gcc + else + HB_COMP_PATH := $(call find_in_path,suncc) + ifneq ($(HB_COMP_PATH),) + HB_COMPILER := sunpro + else + HB_COMP_PATH := $(call find_in_path,icc) + ifneq ($(HB_COMP_PATH),) + HB_COMPILER := icc + endif + endif endif endif else - ifneq ($(filter $(HB_PLATFORM),darwin hpux bsd),) + ifneq ($(filter $(HB_PLATFORM),hpux bsd),) HB_COMP_PATH := $(call find_in_path,gcc) ifneq ($(HB_COMP_PATH),) HB_COMPILER := gcc endif else - ifeq ($(HB_PLATFORM),sunos) - HB_COMP_PATH := $(call find_in_path,suncc) + ifeq ($(HB_PLATFORM),darwin) + HB_COMP_PATH := $(call find_in_path,clang) ifneq ($(HB_COMP_PATH),) - HB_COMPILER := sunpro + HB_COMPILER := clang else HB_COMP_PATH := $(call find_in_path,gcc) ifneq ($(HB_COMP_PATH),) HB_COMPILER := gcc + else + HB_COMP_PATH := $(call find_in_path,icc) + ifneq ($(HB_COMP_PATH),) + HB_COMPILER := icc + endif endif endif else - ifeq ($(HB_PLATFORM),dos) - HB_COMP_PATH := $(call find_in_path,gcc) + ifeq ($(HB_PLATFORM),sunos) + HB_COMP_PATH := $(call find_in_path,suncc) ifneq ($(HB_COMP_PATH),) - HB_COMPILER := djgpp + HB_COMPILER := sunpro else - HB_COMP_PATH := $(call find_in_path,wpp386) - ifneq ($(HB_COMP_PATH),) - HB_COMPILER := watcom - $(eval $(call detect_watcom_platform)) - endif - endif - else - ifeq ($(HB_PLATFORM),os2) HB_COMP_PATH := $(call find_in_path,gcc) ifneq ($(HB_COMP_PATH),) HB_COMPILER := gcc + endif + endif + else + ifeq ($(HB_PLATFORM),dos) + HB_COMP_PATH := $(call find_in_path,gcc) + ifneq ($(HB_COMP_PATH),) + HB_COMPILER := djgpp else HB_COMP_PATH := $(call find_in_path,wpp386) ifneq ($(HB_COMP_PATH),) @@ -822,13 +836,26 @@ ifeq ($(HB_COMPILER),) endif endif else - ifeq ($(HB_PLATFORM),beos) + ifeq ($(HB_PLATFORM),os2) HB_COMP_PATH := $(call find_in_path,gcc) ifneq ($(HB_COMP_PATH),) HB_COMPILER := gcc + else + HB_COMP_PATH := $(call find_in_path,wpp386) + ifneq ($(HB_COMP_PATH),) + HB_COMPILER := watcom + $(eval $(call detect_watcom_platform)) + endif endif + else + ifeq ($(HB_PLATFORM),beos) + HB_COMP_PATH := $(call find_in_path,gcc) + ifneq ($(HB_COMP_PATH),) + HB_COMPILER := gcc + endif + endif + # add other platforms here endif - # add other platforms here endif endif endif diff --git a/harbour/config/lib.mk b/harbour/config/lib.mk index 05682d4e84..f49ca713a0 100644 --- a/harbour/config/lib.mk +++ b/harbour/config/lib.mk @@ -38,6 +38,13 @@ HB_DYN_LIBS := \ hbvmmt \ hbmaindllh +ifneq ($(HB_HAS_PCRE_LOCAL),) + HB_DYN_LIBS += hbpcre +endif +ifneq ($(HB_HAS_ZLIB_LOCAL),) + HB_DYN_LIBS += hbzlib +endif + # Added only for hbpp -include $(TOP)$(ROOT)config/$(HB_PLATFORM)/libs.mk include $(TOP)$(ROOT)config/$(HB_PLATFORM)/$(HB_COMPILER).mk diff --git a/harbour/contrib/gtqtc/gtqtc.hbc b/harbour/contrib/gtqtc/gtqtc.hbc index 0ca8e38a44..ffd3a531bb 100644 --- a/harbour/contrib/gtqtc/gtqtc.hbc +++ b/harbour/contrib/gtqtc/gtqtc.hbc @@ -10,7 +10,6 @@ libs=QtCore4 QtGui4 QtNetwork4 QtWebKit4 {darwin}libs=/Library/Frameworks/QtGui.framework/QtGui {darwin}libs=/Library/Frameworks/QtNetwork.framework/QtNetwork {darwin}libs=/Library/Frameworks/QtWebKit.framework/QtWebKit -{allgcc}libs=supc++ gui=yes gt=gtqtc # optional diff --git a/harbour/contrib/gtqtc/gtqtcs.hbc b/harbour/contrib/gtqtc/gtqtcs.hbc index 8bf0551847..232a1a411b 100644 --- a/harbour/contrib/gtqtc/gtqtcs.hbc +++ b/harbour/contrib/gtqtc/gtqtcs.hbc @@ -5,7 +5,6 @@ {allwin}libpaths=${HB_DIR_QT}\lib libs=QtCore QtGui QtNetwork QtWebKit -{allgcc}libs=supc++ gui=yes gt=gtqtcs # optional diff --git a/harbour/contrib/hbqt/hbqt.hbc b/harbour/contrib/hbqt/hbqt.hbc index 963497ab5d..e87dc02a63 100644 --- a/harbour/contrib/hbqt/hbqt.hbc +++ b/harbour/contrib/hbqt/hbqt.hbc @@ -14,6 +14,5 @@ libs=hbqt {darwin}libs=/Library/Frameworks/QtGui.framework/QtGui {darwin}libs=/Library/Frameworks/QtNetwork.framework/QtNetwork {darwin}libs=/Library/Frameworks/QtWebKit.framework/QtWebKit -{allgcc}libs=supc++ gui=yes gt=gtnul diff --git a/harbour/contrib/hbqt/hbqts.hbc b/harbour/contrib/hbqt/hbqts.hbc index 4f76066668..4c372980a0 100644 --- a/harbour/contrib/hbqt/hbqts.hbc +++ b/harbour/contrib/hbqt/hbqts.hbc @@ -9,6 +9,5 @@ incpaths=. libs=hbqts {win}libs=version shlwapi {allwin}libs=QtCore QtGui QtNetwork QtWebKit -{allgcc}libs=supc++ gui=yes gt=gtnul diff --git a/harbour/external/sqlite3/Makefile b/harbour/external/sqlite3/Makefile index 04355cb924..4dd22a1861 100644 --- a/harbour/external/sqlite3/Makefile +++ b/harbour/external/sqlite3/Makefile @@ -56,6 +56,10 @@ ifeq ($(HB_SUPPORTED),yes) # 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 diff --git a/harbour/source/Makefile b/harbour/source/Makefile index 883e889346..d2a95648d6 100644 --- a/harbour/source/Makefile +++ b/harbour/source/Makefile @@ -104,6 +104,13 @@ else DYNDIRLIST_BASE += source/vm/maindllh endif + ifneq ($(HB_HAS_PCRE_LOCAL),) + DYNDIRLIST_BASE += external/pcre + endif + ifneq ($(HB_HAS_ZLIB_LOCAL),) + DYNDIRLIST_BASE += external/zlib + endif + export DYNDIRLIST_BASE export DYNNAME_POST endif diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index d50c7d90b5..04c09f8eba 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -2140,6 +2140,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) cLibLibExt := ".a" IF l_lLIBGROUPING .AND. ; ( hbmk[ _HBMK_cPLAT ] == "linux" .OR. ; + hbmk[ _HBMK_cPLAT ] == "beos" .OR. ; hbmk[ _HBMK_cPLAT ] == "bsd" ) AAdd( hbmk[ _HBMK_aOPTL ], "-Wl,--start-group {LL} {LB} -Wl,--end-group" ) AAdd( hbmk[ _HBMK_aOPTD ], "-Wl,--start-group {LL} {LB} -Wl,--end-group" ) @@ -2260,6 +2261,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) AAdd( l_aLIBSYS, "X11" ) ENDIF + AAdd( l_aLIBSYS, "supc++" ) /* NOTE: or stdc++? */ + CASE ( hbmk[ _HBMK_cPLAT ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" ) .OR. ; ( hbmk[ _HBMK_cPLAT ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "mingw" ) .OR. ; ( hbmk[ _HBMK_cPLAT ] == "win" .AND. hbmk[ _HBMK_cCOMP ] == "mingw64" ) .OR. ; @@ -2375,6 +2378,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) ENDIF ENDIF + AAdd( l_aLIBSYS, "supc++" ) /* NOTE: or stdc++? */ + CASE hbmk[ _HBMK_cPLAT ] == "os2" .AND. hbmk[ _HBMK_cCOMP ] == "gcc" IF hbmk[ _HBMK_lDEBUG ] @@ -2441,6 +2446,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) cBin_Res := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Res, nCmd_Esc ) ENDIF + AAdd( l_aLIBSYS, "supc++" ) /* NOTE: or stdc++? */ + CASE hbmk[ _HBMK_cPLAT ] == "dos" .AND. hbmk[ _HBMK_cCOMP ] == "djgpp" IF hbmk[ _HBMK_lDEBUG ] @@ -2501,6 +2508,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) cBin_Link := FN_Escape( hbmk[ _HBMK_cCCPATH ] + hb_osPathSeparator() + cBin_Link, nCmd_Esc ) ENDIF + AAdd( l_aLIBSYS, "supcxx" ) /* NOTE: or stdcxx? */ + /* Watcom family */ CASE hbmk[ _HBMK_cCOMP ] == "watcom" @@ -3521,11 +3530,13 @@ FUNCTION hbmk( aArgs, /* @ */ lPause ) ENDIF ENDIF - IF ! Empty( cLIB_BASE_PCRE ) .AND. hb_FileExists( DirAddPathSep( l_cHB_LIB_INSTALL ) + hb_osPathSeparator() + cLibLibPrefix + cLIB_BASE_PCRE + cLibLibExt ) - AAdd( l_aLIBSYS, cLIB_BASE_PCRE ) - ENDIF - IF ! Empty( cLIB_BASE_ZLIB ) .AND. hb_FileExists( DirAddPathSep( l_cHB_LIB_INSTALL ) + hb_osPathSeparator() + cLibLibPrefix + cLIB_BASE_ZLIB + cLibLibExt ) - AAdd( l_aLIBSYS, cLIB_BASE_ZLIB ) + IF ! hbmk[ _HBMK_lSHARED ] + IF ! Empty( cLIB_BASE_PCRE ) .AND. hb_FileExists( DirAddPathSep( l_cHB_LIB_INSTALL ) + hb_osPathSeparator() + cLibLibPrefix + cLIB_BASE_PCRE + cLibLibExt ) + AAdd( l_aLIBSYS, cLIB_BASE_PCRE ) + ENDIF + IF ! Empty( cLIB_BASE_ZLIB ) .AND. hb_FileExists( DirAddPathSep( l_cHB_LIB_INSTALL ) + hb_osPathSeparator() + cLibLibPrefix + cLIB_BASE_ZLIB + cLibLibExt ) + AAdd( l_aLIBSYS, cLIB_BASE_ZLIB ) + ENDIF ENDIF /* Library list assembly */