2013-10-09 21:59 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* config/globsh.mk
    * use $(CP) as workaround for missing soft links in NT shell.
      I know about mklink but it needs quite new Windows version
      and soft links need special privileges. Anyhow better solution
      is highly welcome.

  * config/postinst.hb
    * use hardlinks or copy files if symlinks do not work

  * config/linux/gcc.mk
    * added support for non SH shells - it allows to create Android
      builds in MS-Windows using Android NDK from Google.
This commit is contained in:
Przemysław Czerpak
2013-10-09 21:59:30 +02:00
parent 6752936b57
commit caaa1e1159
4 changed files with 63 additions and 4 deletions

View File

@@ -10,6 +10,20 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2013-10-09 21:59 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* config/globsh.mk
* use $(CP) as workaround for missing soft links in NT shell.
I know about mklink but it needs quite new Windows version
and soft links need special privileges. Anyhow better solution
is highly welcome.
* config/postinst.hb
* use hardlinks or copy files if symlinks do not work
* config/linux/gcc.mk
* added support for non SH shells - it allows to create Android
builds in MS-Windows using Android NDK from Google.
2013-10-09 20:05 UTC+0200 Viktor Szakáts (vszakats users.noreply.github.com)
* *
* use web url instead of obfuscated email

View File

@@ -93,7 +93,7 @@ MK := $(subst \,/,$(MAKE))
RM := del /q /f
RDP := rmdir /q /s
CP := copy
LN :=
LN := $(CP)
MD := mkdir
MDP := mkdir
ECHO := echo

View File

@@ -45,13 +45,45 @@ LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib))
LDFLAGS += $(LIBPATHS)
AR := $(HB_CCPREFIX)ar
AR_RULE = ( $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) rcs $(LIB_DIR)/$@ $(^F) $(ARSTRIP) ) || ( $(RM) $(LIB_DIR)/$@ && $(FALSE) )
ifeq ($(HB_SHELL),sh)
AR_RULE = ( $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) rcs $(LIB_DIR)/$@ $(^F) $(ARSTRIP) ) || ( $(RM) $(LIB_DIR)/$@ && $(FALSE) )
else
# NOTE: The empty line directly before 'endef' HAVE TO exist!
define library_object
@$(ECHO) $(ECHOQUOTE)$(subst \,/,$(file))$(ECHOQUOTE) >> __lib__.tmp
endef
define create_library
$(if $(wildcard __lib__.tmp),@$(RM) __lib__.tmp,)
$(foreach file,$^,$(library_object))
( $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) rcs $(LIB_DIR)/$@ @__lib__.tmp $(ARSTRIP) ) || ( $(RM) $(subst /,$(DIRSEP),$(LIB_DIR)/$@) && $(FALSE) )
endef
AR_RULE = $(create_library)
endif
DY := $(CC)
DFLAGS += -shared $(LIBPATHS)
DY_OUT := -o$(subst x,x, )
DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib))
DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(DYN_NAME_CPT) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT)
ifeq ($(HB_SHELL),sh)
DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(DYN_NAME_CPT) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE_NVR) && $(LN) $(@F) $(DYN_FILE_CPT)
else
# NOTE: The empty line directly before 'endef' HAVE TO exist!
define dynlib_object
@$(ECHO) $(ECHOQUOTE)INPUT($(subst \,/,$(file)))$(ECHOQUOTE) >> __dyn__.tmp
endef
define create_dynlib
$(if $(wildcard __dyn__.tmp),@$(RM) __dyn__.tmp,)
$(foreach file,$^,$(dynlib_object))
$(DY) $(DFLAGS) -Wl,-soname,$(DYN_NAME_CPT) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ __dyn__.tmp $(DLIBS) $(DYSTRIP) && $(LN) $(subst /,$(DIRSEP),$(DYN_DIR)/$@ $(DYN_FILE_NVR)) && $(LN) $(subst /,$(DIRSEP),$(DYN_DIR)/$@ $(DYN_FILE_CPT))
endef
DY_RULE = $(create_dynlib)
endif
include $(TOP)$(ROOT)config/rules.mk

View File

@@ -430,7 +430,20 @@ STATIC PROCEDURE mk_hb_FLinkSym( cDst, cSrc )
IF hb_FLinkSym( cDst, cSrc ) == 0
OutStd( hb_StrFormat( "! Symlink: %1$s <= %2$s", cDst, cSrc ) + hb_eol() )
ELSE
OutStd( hb_StrFormat( "! Error: Creating symlink %1$s <= %2$s", cDst, cSrc ) + hb_eol() )
OutStd( hb_StrFormat( "! Error: Creating symlink %1$s <= %2$s (%3$d)", cDst, cSrc, FError() ) + hb_eol() )
IF FError() == 5 .AND. Empty( hb_FNameDir( cDst ) )
cDst := hb_FnameMerge( hb_FNameDir( cSrc ), cDst )
IF hb_FLink( cDst, cSrc ) == 0
OutStd( hb_StrFormat( "! Hardlink: %1$s <= %2$s", cDst, cSrc ) + hb_eol() )
ELSE
OutStd( hb_StrFormat( "! Error: Creating hardlink %1$s <= %2$s (%3$d)", cDst, cSrc, FError() ) + hb_eol() )
IF hb_FCopy( cDst, cSrc ) == 0
OutStd( hb_StrFormat( "! Copyfile: %1$s <= %2$s", cDst, cSrc ) + hb_eol() )
ELSE
OutStd( hb_StrFormat( "! Error: Copping file %1$s <= %2$s (%3$d)", cDst, cSrc, FError() ) + hb_eol() )
ENDIF
ENDIF
ENDIF
ENDIF
RETURN