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

@@ -10,6 +10,37 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
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
2017-05-19 00:54 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/rddads/ads1.c
+ added support for "VarCharFox" and "VarBinaryFox" field types.

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"

View File

@@ -5,7 +5,7 @@
-w3 -es2
-stop{dos|watcom|bcc|pocc|pocc64|poccarm|msvcia64|pcc}
-stop{dos|watcom|bcc|pocc|pocc64|poccarm|msvcia64|pcc|(hbdyn&android)}
-pic

View File

@@ -29,23 +29,26 @@
{hbdyn}-implib=../lib/${hb_plat}/${hb_comp}${hb_build}/
{hbdyn&hb_dynsuffix}-implib=${hb_outputname}${hb_dynsuffix}
{hbdyn&!hb_dynsuffix}-implib=${hb_outputname}_dll
{hbdyn&unix&!cygwin}-ln=${hb_dynprefix}${hb_outputname}${hb_dynext}
{hbdyn&unix&!darwin&!cygwin}-ln=${hb_dynprefix}${hb_outputname}${hb_dynext}.${hb_major}.${hb_minor}
{hbdyn&unix&!android&!cygwin}-ln=${hb_dynprefix}${hb_outputname}${hb_dynext}
{hbdyn&unix&!darwin&!android&!cygwin}-ln=${hb_dynprefix}${hb_outputname}${hb_dynext}.${hb_major}.${hb_minor}
{hbdyn&unix&darwin}-ln=${hb_dynprefix}${hb_outputname}.${hb_major}.${hb_minor}${hb_dynext}
{hbdyn&android}-lharbour
{hbdyn&android}-lm
{hbdyn&(allwin|cygwin)}-lhbmaindllp
{hbdyn}-depimplib-
"{hbdyn&darwin}-dflag=-install_name '${hb_dynprefix}${hb_outputname}${hb_dynext}'"
"{hbdyn&darwin}-dflag=-compatibility_version ${hb_major}.${hb_minor}"
"{hbdyn&darwin}-dflag=-current_version ${hb_major}.${hb_minor}.${hb_release}"
"{hbdyn&linux}-dflag=-Wl,-soname,${hb_dynprefix}${hb_outputname}${hb_dynext}.${hb_major}.${hb_minor}"
"{hbdyn&android}-dflag=-Wl,-soname,${hb_dynprefix}${hb_outputname}${hb_dynext} -Wl,--no-undefined -Wl,-z,noexecstack"
"{hbdyn&linux&!android}-dflag=-Wl,-soname,${hb_dynprefix}${hb_outputname}${hb_dynext}.${hb_major}.${hb_minor}"
"{hbdyn&sunos}-dflag=-Wl,-h,${hb_dynprefix}${hb_outputname}${hb_dynext}.${hb_major}.${hb_minor}"
# output name tweaks for dynamic libs
# NOTE: We're altering previously set output name value here
{hbdyn&unix&!darwin&!cygwin}-o${hb_outputname}${hb_dynext}.${hb_major}.${hb_minor}.${hb_release}
{hbdyn&unix&!darwin&!android&!cygwin}-o${hb_outputname}${hb_dynext}.${hb_major}.${hb_minor}.${hb_release}
{hbdyn&unix&darwin}-o${hb_outputname}.${hb_major}.${hb_minor}.${hb_release}${hb_dynext}
{hbdyn&unix&cygwin}-o${hb_outputname}${hb_dynext}
{hbdyn&unix&(cygwin|android)}-o${hb_outputname}${hb_dynext}
{hbdyn&!unix&allwin}-o${hb_outputname}-${hb_major}${hb_minor}${hb_dynsuffix}
{hbdyn&!unix&!allwin}-o${hb_outputname}${hb_dynsuffix}