From 251a3a00eecd89a3a4c9f4b560ad5353ffbe2f58 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 22 Feb 2011 12:13:08 +0000 Subject: [PATCH] 2011-02-22 13:11 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * config/postinst.hbs * config/global.mk * config/bin.mk * config/darwin/gcc.mk * config/darwin/icc.mk * config/darwin/clang.mk * config/linux/gcc.mk * config/dyn.mk * config/os2/gcc.mk * Trying to cleanup the harbour dynlib name situation. Here's the plan (which is similar to what's used in contrib area): win, wce: harbour-21[-subtype][.dll/.lib] dos, os2: harbour[.dll|.???] darwin: libharbour.2.1.0.dylib libharbour.2.1.dylib -> (symlink) [compatibility level] libharbour.dylib -> (symlink) *nix: # libharbour.s?.2.1.0 # libharbour.s?.2.1 -> (symlink) [soname] # libharbour.s? -> (symlink) ; It's possible it's broken now. Pls test linux/gcc and darwin. 'install' was not tested. ; TODO: Clean variable usage, there is some redundancy, plus some places where current solution is not generic, f.e. using HB_VER_*, HB_DYNLIB_BASE vs. HB_DYNLIB_NAME, etc. * harbour/src/rtl/fscopy.c * Reverted 2011-02-22 12:27 UTC+0200 Mindaugas Kavaliauskas which made behavior inconsistent with rest of similar functions like FERASE(), FRENAME(), which also don't throw RTE if bad parameter is passed, but return FERROR() and failure instead. Also restored _SET_DEFAULT handling to not create a special case compared to __COPYFILE() behavior, ia. some features like FXO_SHARELOCK are still enabled while FXO_DEFAULT is not). Pls rewrite it using hb_fsOpen()/hb_fsCreate() if that behavior bothers you. --- harbour/ChangeLog | 52 +++++++++++++-- harbour/config/bin.mk | 4 +- harbour/config/darwin/clang.mk | 2 +- harbour/config/darwin/gcc.mk | 2 +- harbour/config/darwin/icc.mk | 2 +- harbour/config/dyn.mk | 2 +- harbour/config/global.mk | 113 ++++++++++++++++++++------------- harbour/config/linux/gcc.mk | 2 +- harbour/config/os2/gcc.mk | 2 +- harbour/config/postinst.hbs | 20 +++--- harbour/src/rtl/fscopy.c | 10 +-- 11 files changed, 142 insertions(+), 69 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f221800e23..dbea9d7577 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,16 +16,56 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-22 13:11 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * config/postinst.hbs + * config/global.mk + * config/bin.mk + * config/darwin/gcc.mk + * config/darwin/icc.mk + * config/darwin/clang.mk + * config/linux/gcc.mk + * config/dyn.mk + * config/os2/gcc.mk + * Trying to cleanup the harbour dynlib name situation. + Here's the plan (which is similar to what's used in contrib area): + win, wce: harbour-21[-subtype][.dll/.lib] + dos, os2: harbour[.dll|.???] + darwin: + libharbour.2.1.0.dylib + libharbour.2.1.dylib -> (symlink) [compatibility level] + libharbour.dylib -> (symlink) + *nix: + # libharbour.s?.2.1.0 + # libharbour.s?.2.1 -> (symlink) [soname] + # libharbour.s? -> (symlink) + ; It's possible it's broken now. Pls test linux/gcc and darwin. + 'install' was not tested. + ; TODO: Clean variable usage, there is some redundancy, plus + some places where current solution is not generic, f.e. + using HB_VER_*, HB_DYNLIB_BASE vs. HB_DYNLIB_NAME, etc. + + * harbour/src/rtl/fscopy.c + * Reverted 2011-02-22 12:27 UTC+0200 Mindaugas Kavaliauskas + which made behavior inconsistent with rest of similar + functions like FERASE(), FRENAME(), which also don't throw + RTE if bad parameter is passed, but return FERROR() + and failure instead. + Also restored _SET_DEFAULT handling to not create a special case + compared to __COPYFILE() behavior, ia. some features like + FXO_SHARELOCK are still enabled while FXO_DEFAULT is not). + Pls rewrite it using hb_fsOpen()/hb_fsCreate() if that behavior + bothers you. + 2011-02-22 12:27 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) * harbour/src/rtl/fscopy.c * added runtime error for HB_FCOPY() bad param types only - * made a function HB_FCOPY() a pure file system function + * made a function HB_FCOPY() a pure file system function does not dependent on _SET_DEFAULT setting - ; File open mode is not altered a avoid any influence on OS/2 - behaviour if source and destination files are the same (see - ChangeLog entry at 2009-11-24 16:57). I guess, hb_fsExpOpen() - still can be changed to hb_fsOpen() with FO_EXCLUSIVE, - FO_CREAT, and FO_TRUNC but I'm unable to test it, so, I leave + ; File open mode is not altered a avoid any influence on OS/2 + behaviour if source and destination files are the same (see + ChangeLog entry at 2009-11-24 16:57). I guess, hb_fsExpOpen() + still can be changed to hb_fsOpen() with FO_EXCLUSIVE, + FO_CREAT, and FO_TRUNC but I'm unable to test it, so, I leave current code. 2011-02-21 20:15 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) diff --git a/harbour/config/bin.mk b/harbour/config/bin.mk index 4908018f29..d2c9870e7f 100644 --- a/harbour/config/bin.mk +++ b/harbour/config/bin.mk @@ -45,8 +45,8 @@ ifeq ($(BUILD_SHARED),yes) endif endif - HB_LIBS_ST_RDD := $(HB_LIBS_TPL) $(HB_DYNLIB_NAME) - HB_LIBS_MT_RDD := $(HB_LIBS_TPL) $(HB_DYNLIB_NAME) + HB_LIBS_ST_RDD := $(HB_LIBS_TPL) $(HB_DYNLIB_BASE) + HB_LIBS_MT_RDD := $(HB_LIBS_TPL) $(HB_DYNLIB_BASE) HB_LIBS_ST_NORDD := $(HB_LIBS_ST_RDD) HB_LIBS_MT_NORDD := $(HB_LIBS_ST_RDD) diff --git a/harbour/config/darwin/clang.mk b/harbour/config/darwin/clang.mk index 86e143d93f..5d58b0e52e 100644 --- a/harbour/config/darwin/clang.mk +++ b/harbour/config/darwin/clang.mk @@ -61,6 +61,6 @@ DFLAGS += -dynamic -flat_namespace -undefined warning -multiply_defined suppress DY_OUT := -o$(subst x,x, ) DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) -DY_RULE = $(DY) $(DFLAGS) -install_name "$(LIB_PREF)$(DYNNAME2)$(DYN_EXT)" -compatibility_version $(HB_VER_MAJOR).$(HB_VER_MINOR) -current_version $(HB_VER_MAJOR).$(HB_VER_MINOR).$(HB_VER_RELEASE) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE2) && $(LN) $(@F) $(DYN_DIR)/$(DYN_PREF)$(DYNNAME2).$(HB_VER_MAJOR)$(DYN_EXT) +DY_RULE = $(DY) $(DFLAGS) -install_name "$(LIB_PREF)$(DYNNAME2)$(DYN_EXT)" -compatibility_version $(HB_VER_MAJOR).$(HB_VER_MINOR) -current_version $(HB_VER_MAJOR).$(HB_VER_MINOR).$(HB_VER_RELEASE) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE2) && $(LN) $(@F) $(DYN_DIR)/$(DYN_PREF)$(DYNNAME2).$(HB_VER_MAJOR).$(HB_VER_MINOR)$(DYN_EXT) include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/config/darwin/gcc.mk b/harbour/config/darwin/gcc.mk index 9dba6a1ad3..b3567460e0 100644 --- a/harbour/config/darwin/gcc.mk +++ b/harbour/config/darwin/gcc.mk @@ -65,6 +65,6 @@ DFLAGS += -dynamic -flat_namespace -undefined warning -multiply_defined suppress DY_OUT := -o$(subst x,x, ) DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) -DY_RULE = $(DY) $(DFLAGS) -install_name "$(LIB_PREF)$(DYNNAME2)$(DYN_EXT)" -compatibility_version $(HB_VER_MAJOR).$(HB_VER_MINOR) -current_version $(HB_VER_MAJOR).$(HB_VER_MINOR).$(HB_VER_RELEASE) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE2) && $(LN) $(@F) $(DYN_DIR)/$(DYN_PREF)$(DYNNAME2).$(HB_VER_MAJOR)$(DYN_EXT) +DY_RULE = $(DY) $(DFLAGS) -install_name "$(LIB_PREF)$(DYNNAME2)$(DYN_EXT)" -compatibility_version $(HB_VER_MAJOR).$(HB_VER_MINOR) -current_version $(HB_VER_MAJOR).$(HB_VER_MINOR).$(HB_VER_RELEASE) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE2) && $(LN) $(@F) $(DYN_DIR)/$(DYN_PREF)$(DYNNAME2).$(HB_VER_MAJOR).$(HB_VER_MINOR)$(DYN_EXT) include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/config/darwin/icc.mk b/harbour/config/darwin/icc.mk index e42bbbbe1e..28198333cd 100644 --- a/harbour/config/darwin/icc.mk +++ b/harbour/config/darwin/icc.mk @@ -58,7 +58,7 @@ define create_dynlib $(foreach file,$^,$(dynlib_object)) $(DY) $(DFLAGS) -install_name "$(LIB_PREF)$(DYNNAME2)$(DYN_EXT)" -compatibility_version $(HB_VER_MAJOR).$(HB_VER_MINOR) -current_version $(HB_VER_MAJOR).$(HB_VER_MINOR).$(HB_VER_RELEASE) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ -filelist __dyn__.tmp $(DLIBS) $(DYSTRIP) $(LN) $(@F) $(DYN_FILE2) - $(LN) $(@F) $(DYN_DIR)/$(DYN_PREF)$(DYNNAME2).$(HB_VER_MAJOR)$(DYN_EXT) + $(LN) $(@F) $(DYN_DIR)/$(DYN_PREF)$(DYNNAME2).$(HB_VER_MAJOR).$(HB_VER_MINOR)$(DYN_EXT) endef DY_RULE = $(create_dynlib) diff --git a/harbour/config/dyn.mk b/harbour/config/dyn.mk index 16cb9720bd..09f6b04535 100644 --- a/harbour/config/dyn.mk +++ b/harbour/config/dyn.mk @@ -83,7 +83,7 @@ IMP_FILE := ifneq ($(HB_BUILD_DYN),no) ifneq ($(DY_RULE),) -DYN_NAME := $(DYN_PREF)$(DYNNAME)$(DYN_EXT) +DYN_NAME := $(DYN_PREF)$(DYNNAME)$(DYN_EXT)$(HB_DYNLIB_PEXT) DYN_FILE := $(DYN_DIR)/$(DYN_NAME) DYN_NAME2 := $(DYN_PREF)$(DYNNAME2)$(DYN_EXT) DYN_FILE2 := $(DYN_DIR)/$(DYN_NAME2) diff --git a/harbour/config/global.mk b/harbour/config/global.mk index 5f204c6caf..b51d5b1745 100644 --- a/harbour/config/global.mk +++ b/harbour/config/global.mk @@ -1747,57 +1747,84 @@ endif ifeq ($(HB_INIT_DONE),) ifneq ($(HB_BUILD_DYN),no) - ifeq ($(HB_PLATFORM_UNIX),) - HB_DYN_VER := $(HB_VER_MAJOR)$(HB_VER_MINOR) - else - HB_DYN_VER := $(HB_VER_MAJOR).$(HB_VER_MINOR).$(HB_VER_RELEASE) - endif + HB_DYNLIB_POSC := + HB_DYNLIB_PEXC := - ifeq ($(HB_PLATFORM),darwin) - DYNNAME_POST := .$(HB_DYN_VER) + ifneq ($(filter $(HB_PLATFORM),win wce),) + + # harbour-xy[-subtype][.dll|.lib] + + HB_DYNLIB_POST := -$(HB_VER_MAJOR)$(HB_VER_MINOR) + HB_DYNLIB_PEXT := + + ifeq ($(HB_PLATFORM),win) + ifeq ($(HB_COMPILER),bcc) + HB_DYNLIB_POST := $(HB_DYNLIB_POST)-bcc + else + ifeq ($(HB_CPU),x86_64) + HB_DYNLIB_POST := $(HB_DYNLIB_POST)-x64 + else + ifeq ($(HB_CPU),ia64) + HB_DYNLIB_POST := $(HB_DYNLIB_POST)-ia64 + endif + endif + endif + else + ifeq ($(HB_PLATFORM),wce) + HB_DYNLIB_POST := $(HB_DYNLIB_POST)-wce + ifeq ($(HB_CPU),arm) + HB_DYNLIB_POST := $(HB_DYNLIB_POST)-arm + else + ifeq ($(HB_CPU),x86) + HB_DYNLIB_POST := $(HB_DYNLIB_POST)-x86 + else + ifeq ($(HB_CPU),mips) + HB_DYNLIB_POST := $(HB_DYNLIB_POST)-mips + else + ifeq ($(HB_CPU),sh) + HB_DYNLIB_POST := $(HB_DYNLIB_POST)-sh + endif + endif + endif + endif + endif + endif else ifneq ($(filter $(HB_PLATFORM),dos os2),) - DYNNAME_POST := + # harbour[.dll|.???] + HB_DYNLIB_POST := + HB_DYNLIB_PEXT := else - DYNNAME_POST := -$(HB_DYN_VER) + HB_DYN_VERCPT := $(HB_VER_MAJOR).$(HB_VER_MINOR) + HB_DYN_VER := $(HB_VER_MAJOR).$(HB_VER_MINOR).$(HB_VER_RELEASE) + + ifeq ($(HB_PLATFORM),darwin) + # libharbour.2.1.0.dylib + # libharbour.2.1.dylib -> + # libharbour.dylib -> + HB_DYNLIB_POST := .$(HB_DYN_VER) + HB_DYNLIB_PEXT := + HB_DYNLIB_POSC := .$(HB_DYN_VERCPT) + HB_DYNLIB_PEXC := + else + # libharbour.s?.2.1.0 + # libharbour.s?.2.1 -> + # libharbour.s? -> + HB_DYNLIB_POST := + HB_DYNLIB_PEXT := .$(HB_DYN_VER) + HB_DYNLIB_POSC := + HB_DYNLIB_PEXC := .$(HB_DYN_VERCPT) + endif endif endif - ifeq ($(HB_PLATFORM),win) - ifeq ($(HB_COMPILER),bcc) - DYNNAME_POST := $(DYNNAME_POST)-bcc - else - ifeq ($(HB_CPU),x86_64) - DYNNAME_POST := $(DYNNAME_POST)-x64 - else - ifeq ($(HB_CPU),ia64) - DYNNAME_POST := $(DYNNAME_POST)-ia64 - endif - endif - endif - else - ifeq ($(HB_PLATFORM),wce) - DYNNAME_POST := $(DYNNAME_POST)-wce - ifeq ($(HB_CPU),arm) - DYNNAME_POST := $(DYNNAME_POST)-arm - else - ifeq ($(HB_CPU),x86) - DYNNAME_POST := $(DYNNAME_POST)-x86 - else - ifeq ($(HB_CPU),mips) - DYNNAME_POST := $(DYNNAME_POST)-mips - else - ifeq ($(HB_CPU),sh) - DYNNAME_POST := $(DYNNAME_POST)-sh - endif - endif - endif - endif - endif - endif + export HB_DYNLIB_POST + export HB_DYNLIB_PEXT + export HB_DYNLIB_POSC + export HB_DYNLIB_PEXC HB_DYNLIB_BASE := harbour - HB_DYNLIB_NAME := $(HB_DYNLIB_BASE)$(DYNNAME_POST) + HB_DYNLIB_NAME := $(HB_DYNLIB_BASE)$(HB_DYNLIB_POST) export HB_DYNLIB_BASE export HB_DYNLIB_NAME @@ -1808,7 +1835,7 @@ ifeq ($(HB_INIT_DONE),) else HB_DYNLIB_BASE_2ND := harbourst endif - HB_DYNLIB_NAME_2ND := $(HB_DYNLIB_BASE_2ND)$(DYNNAME_POST) + HB_DYNLIB_NAME_2ND := $(HB_DYNLIB_BASE_2ND)$(HB_DYNLIB_POST) export HB_DYNLIB_BASE_2ND export HB_DYNLIB_NAME_2ND diff --git a/harbour/config/linux/gcc.mk b/harbour/config/linux/gcc.mk index c92b199c9a..0b76669c1d 100644 --- a/harbour/config/linux/gcc.mk +++ b/harbour/config/linux/gcc.mk @@ -55,6 +55,6 @@ DFLAGS += -shared $(LIBPATHS) DY_OUT := -o$(subst x,x, ) DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) -DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(LIB_PREF)$(DYNNAME2)$(DYN_EXT).$(HB_VER_MAJOR).$(HB_VER_MINOR) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE2) +DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(DYN_PREF)$(DYNNAME2)$(DYN_EXT).$(HB_VER_MAJOR).$(HB_VER_MINOR) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE2) && $(LN) $(@F) $(DYN_DIR)/$(DYN_PREF)$(DYNNAME2)$(DYN_EXT).$(HB_VER_MAJOR).$(HB_VER_MINOR) include $(TOP)$(ROOT)config/rules.mk diff --git a/harbour/config/os2/gcc.mk b/harbour/config/os2/gcc.mk index 146936bc27..b95700ec5d 100644 --- a/harbour/config/os2/gcc.mk +++ b/harbour/config/os2/gcc.mk @@ -130,7 +130,7 @@ endef define create_dynlib $(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,) $(if $(wildcard __dyn__.def),@$(RM) __dyn__.def,) - @$(ECHO) $(ECHOQUOTE)LIBRARY $(DYNNAME) INITINSTANCE TERMINSTANCE$(ECHOQUOTE) >> __dyn__.def + @$(ECHO) $(ECHOQUOTE)LIBRARY $(DYNNAME2) INITINSTANCE TERMINSTANCE$(ECHOQUOTE) >> __dyn__.def @$(ECHO) $(ECHOQUOTE)PROTMODE$(ECHOQUOTE) >> __dyn__.def @$(ECHO) $(ECHOQUOTE)CODE PRELOAD MOVEABLE DISCARDABLE$(ECHOQUOTE) >> __dyn__.def @$(ECHO) $(ECHOQUOTE)DATA PRELOAD MOVEABLE MULTIPLE NONSHARED$(ECHOQUOTE) >> __dyn__.def diff --git a/harbour/config/postinst.hbs b/harbour/config/postinst.hbs index 86ad6eced4..d976e3e52b 100644 --- a/harbour/config/postinst.hbs +++ b/harbour/config/postinst.hbs @@ -35,7 +35,8 @@ PROCEDURE Main( ... ) LOCAL cSH_Script LOCAL nAttr - LOCAL cDynVersioned + LOCAL cDynVersionFull + LOCAL cDynVersionComp LOCAL cDynVersionless IF Empty( GetEnvC( "HB_PLATFORM" ) ) .OR. ; @@ -136,10 +137,12 @@ PROCEDURE Main( ... ) OutStd( "! Creating dynamic lib symlinks..." + hb_eol() ) - cDynVersioned := GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_NAME" ) + GetEnvC( "HB_DYNLIB_EXT" ) - cDynVersionless := GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_BASE" ) + GetEnvC( "HB_DYNLIB_EXT" ) + cDynVersionFull := GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_BASE" ) + GetEnvC( "HB_DYNLIB_POST" ) + GetEnvC( "HB_DYNLIB_EXT" ) + GetEnvC( "HB_DYNLIB_PEXT" ) + cDynVersionComp := GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_BASE" ) + GetEnvC( "HB_DYNLIB_POSC" ) + GetEnvC( "HB_DYNLIB_EXT" ) + GetEnvC( "HB_DYNLIB_PEXC" ) + cDynVersionless := GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_BASE" ) + GetEnvC( "HB_DYNLIB_EXT" ) - mk_hb_FLinkSym( cDynVersioned, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + cDynVersionless ) + mk_hb_FLinkSym( cDynVersionFull, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + cDynVersionComp ) + mk_hb_FLinkSym( cDynVersionFull, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + cDynVersionless ) DO CASE CASE EndsWith( GetEnvC( "HB_INSTALL_DYN" ), "/usr/lib/harbour" ) .OR. ; @@ -147,8 +150,9 @@ PROCEDURE Main( ... ) EndsWith( GetEnvC( "HB_INSTALL_DYN" ), "/usr/local/lib/harbour" ) .OR. ; EndsWith( GetEnvC( "HB_INSTALL_DYN" ), "/usr/local/lib64/harbour" ) - mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersioned, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionless ) - mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersioned, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersioned ) + mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersionFull, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionless ) + mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersionFull, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionComp ) + mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersionFull, PathSepToSelf( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionFull ) CASE GetEnvC( "HB_INSTALL_DYN" ) == "/usr/local/harbour/lib" /* TOFIX: Rewrite this in .prg */ @@ -464,10 +468,10 @@ STATIC FUNCTION mk_extern_core() LOCAL aExtern IF GetEnvC( "HB_REBUILD_EXTERN" ) == "yes" .AND. ; - ! Empty( GetEnvC( "HB_DYNLIB_NAME" ) ) + ! Empty( GetEnvC( "HB_DYNLIB_BASE" ) ) /* TOFIX: Use list of libs instead of dynamic lib */ - IF ( aExtern := __hb_extern_get_list( PathSepToSelf( GetEnvC( "HB_DYNLIB_DIR" ) ) + hb_ps() + GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_NAME" ) + GetEnvC( "HB_DYNLIB_EXT" ) ) ) != NIL + IF ( aExtern := __hb_extern_get_list( PathSepToSelf( GetEnvC( "HB_DYNLIB_DIR" ) ) + hb_ps() + GetEnvC( "HB_DYNLIB_PREF" ) + GetEnvC( "HB_DYNLIB_BASE" ) + GetEnvC( "HB_DYNLIB_POST" ) + GetEnvC( "HB_DYNLIB_EXT" ) + GetEnvC( "HB_DYNLIB_PEXT" ) ) ) != NIL OutStd( "! Generating core extern headers..." + hb_eol() ) diff --git a/harbour/src/rtl/fscopy.c b/harbour/src/rtl/fscopy.c index a6a095f909..01ce6d0c98 100644 --- a/harbour/src/rtl/fscopy.c +++ b/harbour/src/rtl/fscopy.c @@ -51,7 +51,6 @@ */ #include "hbapi.h" -#include "hbapierr.h" #include "hbapifs.h" #if defined( HB_OS_UNIX ) @@ -68,9 +67,9 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest ) HB_FHANDLE fhndSource; HB_FHANDLE fhndDest; - if( ( fhndSource = hb_fsExtOpen( pszSource, NULL, FO_READ | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) + if( ( fhndSource = hb_fsExtOpen( pszSource, NULL, FO_READ | FXO_DEFAULTS | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) { - if( ( fhndDest = hb_fsExtOpen( pszDest, NULL, FXO_TRUNCATE | FO_READWRITE | FO_EXCLUSIVE | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) + if( ( fhndDest = hb_fsExtOpen( pszDest, NULL, FXO_TRUNCATE | FO_READWRITE | FO_EXCLUSIVE | FXO_DEFAULTS | FXO_SHARELOCK, NULL, NULL ) ) != FS_ERROR ) { #if defined( HB_OS_UNIX ) struct stat struFileInfo; @@ -133,5 +132,8 @@ HB_FUNC( HB_FCOPY ) if( pszSource && pszDest ) hb_retni( hb_fsCopy( pszSource, pszDest ) ? 0 : F_ERROR ); else - hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); + { + hb_fsSetFError( 2 /* file not found */ ); + hb_retni( F_ERROR ); + } }