2017-05-19 16:08 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* config/android/gcc.mk
  * config/global.mk
  * config/linux/gcc.mk
  * config/postinst.hb
  * contrib/hbpost.hbm
    ! removed version number from dynamic libraries for Android.
      Pure Linux style dynamic library numbers in Android systems can be used
      only with system libraries but it's not supported inside .apk packages
      so our dynamic libraries were unusable for Android programmers unless
      someone plans to install more then one version of Harbour dynamic
      libraries as Android system libraries. It's rather unusual situation
      and I believe that in such case he can easy create such libraries
      building Harbour for Linux with NDK.
    * enabled by default building contrib dynamic libraries in Harbour
      Android build.
    + added -Wl,--no-undefined to linker parameters when dynamic libraries
      are created to verify if dynamic libraries can be used in Android .apk
      packages during Harbour build process.
    ; After above modification dynamic (*.so) libraries created in Harbour
      build process can be used in .apk packages. It means that projects
      like HDroidGUI do not longer need their own custom versions of
      libharbour.so but can use the one from standard Harbour Android build.
      They can also use Harbour contrib dynamic libraries.
    ; TODO: add support for automatic NDK detection in Harbour build process
    ; TODO: add to HBMK2 basic support for generating .apk packages

  * contrib/gtqtc/gtqtc.hbp
    * disabled dynamic GTQTC library in Android builds until we set explicit
      bindings with QT/C++ dynamic libs
This commit is contained in:
Przemysław Czerpak
2017-05-19 16:08:57 +02:00
parent 640164f606
commit 1eb4121bd9
7 changed files with 64 additions and 18 deletions

View File

@@ -1 +1,3 @@
DFLAGS += -Wl,--no-undefined -Wl,-z,noexecstack
include $(TOP)$(ROOT)config/linux/gcc.mk

View File

@@ -396,8 +396,8 @@ ifeq ($(HB_HOST_PLAT),)
endif
endif
ifneq ($(filter $(HB_HOST_PLAT),win),)
ifeq ($(HB_BUILD_CONTRIB_DYN),)
ifeq ($(HB_BUILD_CONTRIB_DYN),)
ifneq ($(filter $(HB_HOST_PLAT),win android),)
export HB_BUILD_CONTRIB_DYN := yes
endif
endif
@@ -2004,11 +2004,13 @@ ifeq ($(HB_INIT_DONE),)
HB_DYNLIB_POST := .$(HB_DYN_VER)
HB_DYNLIB_POSC := .$(HB_DYN_VERCPT)
else
# libharbour.s?.2.1.0
# libharbour.s?.2.1 ->
# libharbour.s? ->
HB_DYNLIB_PEXT := .$(HB_DYN_VER)
HB_DYNLIB_PEXC := .$(HB_DYN_VERCPT)
ifneq ($(HB_PLATFORM),android)
# libharbour.s?.2.1.0
# libharbour.s?.2.1 ->
# libharbour.s? ->
HB_DYNLIB_PEXT := .$(HB_DYN_VER)
HB_DYNLIB_PEXC := .$(HB_DYN_VERCPT)
endif
endif
endif
endif

View File

@@ -68,7 +68,7 @@ DY_OUT := -o$(subst x,x, )
DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib))
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)
DY_RULE = $(DY) $(DFLAGS) -Wl,-soname,$(DYN_NAME_CPT) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && ([ "$(@F)" = "$(notdir $(DYN_FILE_NVR))" ] || $(LN) $(@F) $(DYN_FILE_NVR)) && ([ "$(@F)" = "$(notdir $(DYN_FILE_CPT))" ] || $(LN) $(@F) $(DYN_FILE_CPT))
else
# NOTE: The empty line directly before 'endef' HAVE TO exist!

View File

@@ -140,8 +140,12 @@ PROCEDURE Main( ... )
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( cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + cDynVersionComp )
mk_hb_FLinkSym( cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + cDynVersionless )
IF ! cDynVersionFull == cDynVersionComp
mk_hb_FLinkSym( cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + cDynVersionComp )
ENDIF
IF ! cDynVersionFull == cDynVersionless
mk_hb_FLinkSym( cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + cDynVersionless )
ENDIF
DO CASE
CASE EndsWith( GetEnvC( "HB_INSTALL_DYN" ), "/usr/lib/harbour" ) .OR. ;
@@ -149,8 +153,12 @@ 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() + cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionless )
mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionComp )
IF ! cDynVersionFull == cDynVersionless
mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionless )
ENDIF
IF ! cDynVersionFull == cDynVersionComp
mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionComp )
ENDIF
mk_hb_FLinkSym( "harbour" + hb_ps() + cDynVersionFull, hb_DirSepToOS( GetEnvC( "HB_INSTALL_DYN" ) ) + hb_ps() + ".." + hb_ps() + cDynVersionFull )
CASE GetEnvC( "HB_INSTALL_DYN" ) == "/usr/local/harbour/lib"