Harbour for Android - first building tests

Visto 315 veces
Saltar al primer mensaje no leído

Antonio Linares

no leída,
13 abr 2011, 23:54:1813/4/11
a Harbour Developers
Viktor,

I am reviewing the Android NDK makefiles and I have created this small
test:

file Android.mk contains:

LOCAL_PATH := ~/harbour/harbour/src

include $(CLEAR_VARS)

LOCAL_MODULE := libhbvm
LOCAL_SRC_FILES := vm/arrays.c vm/arrayshb.c vm/asort.c vm/vm.c
LOCAL_CFLAGS := -I/Users/anto/harbour/harbour/include

include $(BUILD_STATIC_LIBRARY)

file Application.mk contains:

APP_MODULES=libhbvm

then I run this:

antos-iMac:jni anto$ pwd
/Users/anto/Desktop/android-ndk-r5b/samples/harbour/jni
antos-iMac:jni anto$ ../../../ndk-build
Compile thumb : hbvm <= arrays.c
Compile thumb : hbvm <= arrayshb.c
Compile thumb : hbvm <= asort.c
Compile thumb : hbvm <= vm.c
StaticLibrary : libhbvm.a
antos-iMac:jni anto$

And libhbvm.a gets properly built :-)

In android-ndk-r5b/toolchain there is the gcc compiler, so I guess
that we could avoid the call to ndk-build and adapt the Harbour
makefile.

Are you interested in this ?

Antonio

Antonio Linares

no leída,
14 abr 2011, 0:39:5614/4/11
a Harbour Developers
I have modified Harbour global.mk and added:

ifeq ($(HB_PLATFORM),android)
HB_COMP_PATH:=/Users/anto/Desktop/android-ndk-r5b/toolchains/
arm-linux-androideabi-4.4.3/prebuilt/darwin-x86
HB_COMPILER:=arm-linux-androideabi
else
...
endif

and added config/android/global.mk and arm-linux-androideabi.mk

Testing...
antos-iMac:harbour anto$ export HB_PLATFORM=android
antos-iMac:harbour anto$ make
! Building Harbour 2.1.0rc2 from source - http://harbour-project.org
! MAKE: make 3.81 /bin/sh
! HB_HOST_PLAT: darwin (x86_64) HB_SHELL: sh
! LD_LIBRARY_PATH: /Users/anto/harbour/harbour/lib/android/arm-linux-
androideabi:
! HB_PLATFORM: android (x86_64)
! HB_COMPILER: arm-linux-androideabi (autodetected: /Users/anto/
Desktop/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/
prebuilt/)
...

Antonio

Viktor Szakáts

no leída,
14 abr 2011, 3:56:4914/4/11
a harbou...@googlegroups.com
Hi Antonio,

What is the content of arm-linux-androideabi.mk?
(BTW I'd suggest to name this gccarm.mk for now)

On Thu, Apr 14, 2011 at 6:39 AM, Antonio Linares
<antonio....@gmail.com> wrote:
> I have modified Harbour global.mk and added:
>
>      ifeq ($(HB_PLATFORM),android)
>         HB_COMP_PATH:=/Users/anto/Desktop/android-ndk-r5b/toolchains/
> arm-linux-androideabi-4.4.3/prebuilt/darwin-x86
>         HB_COMPILER:=arm-linux-androideabi
>      else
>         ...
>      endif

You've added this where? Can you send a .dif file?
(svn diff > patch.dif)

BTW for global.mk (or instead of above modification)
I'd suggest to use HB_CCPATH (and HB_CCPREFIX)
to specify the toolchain on your system.

> and added config/android/global.mk and arm-linux-androideabi.mk
>
> Testing...
> antos-iMac:harbour anto$ export HB_PLATFORM=android
> antos-iMac:harbour anto$ make
> ! Building Harbour 2.1.0rc2 from source - http://harbour-project.org
> ! MAKE: make 3.81 /bin/sh
> ! HB_HOST_PLAT: darwin (x86_64)  HB_SHELL: sh
> ! LD_LIBRARY_PATH: /Users/anto/harbour/harbour/lib/android/arm-linux-
> androideabi:
> ! HB_PLATFORM: android (x86_64)
> ! HB_COMPILER: arm-linux-androideabi (autodetected: /Users/anto/
> Desktop/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/
> prebuilt/)

It's a nice start, though is a lot more to modify.

I see you use a beta version of the NDK. Does it work
with a stable release? If it does, which is this version?

Viktor

Massimo Belgrano

no leída,
14 abr 2011, 4:49:1114/4/11
a harbou...@googlegroups.com
Yes

2011/4/14 Antonio Linares <antonio....@gmail.com>:
> Viktor,

> In android-ndk-r5b/toolchain there is the gcc compiler, so I guess
> that we could avoid the call to ndk-build and adapt the Harbour
> makefile.
>
> Are you interested in this ?
>
> Antonio
>

--
Massimo Belgrano

Viktor Szakáts

no leída,
14 abr 2011, 5:02:5514/4/11
a harbou...@googlegroups.com

Oh I missed that question until Massimo felt to
answer it instead of me.

Well, this is our only option, so if we ever plan to
add android as Harbour platform, we just _have to_
use gcc. Which is perfectly alright and was known
from the beginning.

[ Any Android specific build solutions are useless
for us. ]

Viktor

Massimo Belgrano

no leída,
14 abr 2011, 5:03:3214/4/11
a harbou...@googlegroups.com
r5b is last version of ndk
afaik is not a beta
http://developer.android.com/sdk/ndk/index.html

Here's my incomplete instructions for starting. If you've already got
the NDK and SDK
installed you can skip a lot of it.

1. Download and install Java JDK 1.6 u24, 32bit or 64bit (if using
64bit Windows, though 32bit should also work on 64bit Windows) and set
the following environment variable:
JAVA_HOME=<where you installed Java>, e.g. C:\Program Files\Java
\jdk1.6.0_24

2. Install Google's SDK I used the .exe (http://dl.google.com/android/
installer_r10-windows.exe) and installed it to the default location (C:
\Program Files (x86)\Android). Run "SDK Manager.exe" and download the
android-4 platform (for minimum SDK testing) and android-9 (or above)
for debugging. Create an android-9 (or above) AVD too. Sometimes it falsely
reports that Java is not installed, if this happens, click back then
next again. When you exit the SDK Manager, it may tell you to add Java
to your path..


3. Download Google's NDK r5b from
http://dl.google.com/android/ndk/android-ndk-r5b-windows.zip
and unzip it into a path without any spaces in it. I used
%ProgramFiles%\android\android-ndk-r5b

4. Set the following environment variables:
ANDROID_NDK_HOST=windows
ANDROID_NDK_ROOT=%ProgramFiles%\android\android-ndk-r5b
ANDROID_SDK_ROOT=%ProgramFiles%\android\android-sdk
set JAVA_HOME=%ProgramFiles%\Java\jdk1.6.0_24
set PATH=?????

cd C:/devl/android-ndk-r5b/android_ndk/samples/hello-jni
ndk build

------------------------------------------------test.c--
#include <stdio.h>
int main (int argc, char *argv[])
{
printf ("Hello world!\n");
return 0;
}
-----------------------------------------------------
--
Other tool will be usefull?
1. http://prdownloads.sourceforge.net/project/gnuwin32/coreutils/5.3.0/coreutils-5.3.0-bin.zip,
2. http://prdownloads.sourceforge.net/project/gnuwin32/coreutils/5.3.0/coreutils-5.3.0-dep.zip
3. http://mingw-and-ndk.googlecode.com/files/make-3.7z


2011/4/14 Viktor Szakáts <harbo...@syenar.hu>:


>> ! HB_COMPILER: arm-linux-androideabi (autodetected: /Users/anto/
>> Desktop/android-ndk-r5b/toolchains/arm-linux-androideabi-4.4.3/
>> prebuilt/)
>
> It's a nice start, though is a lot more to modify.
>
> I see you use a beta version of the NDK. Does it work
> with a stable release? If it does, which is this version?
>
> Viktor
>

--
Massimo Belgrano

Delta Informatica S.r.l. (http://www.deltain.it/) (+39 0321 455962)
Analisi e sviluppo software per Lan e Web -  Consulenza informatica - Formazione

Viktor Szakáts

no leída,
14 abr 2011, 5:12:0914/4/11
a harbou...@googlegroups.com
Phew, this is everything but slim or simple.

Would it hurt the to put all the crap in one .zip?

The earliest for me to try this will be once I'm finished with
everything on my table right now, which is quite a lot.

Viktor

Viktor Szakáts

no leída,
14 abr 2011, 5:12:2914/4/11
a harbou...@googlegroups.com
On Thu, Apr 14, 2011 at 11:12 AM, Viktor Szakáts <harbo...@syenar.hu> wrote:
> Phew, this is everything but slim or simple.
>
> Would it hurt the to put all the crap in one .zip?

them

Viktor Szakáts

no leída,
14 abr 2011, 5:16:1014/4/11
a harbou...@googlegroups.com
BTW. Is it yet possible to create Android UI from Harbour code?

How?

Viktor

Massimo Belgrano

no leída,
14 abr 2011, 5:24:3514/4/11
a harbou...@googlegroups.com
ndk contain gcc,ndk require skd,sdk require java
This file is present in
ndk:android-ndk-r5b\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-gcc-4.4.3.exe
(sorry for reply instead Viktor)
2011/4/14 Viktor Szakáts <harbo...@syenar.hu>:

--
Massimo Belgrano

Antonio Linares

no leída,
14 abr 2011, 7:49:5314/4/11
a Harbour Developers
Viktor,

> BTW. Is it yet possible to create Android UI from Harbour code?

My plan is to implement it the same way as we have created FivePhone,
which lets us create iOS UI from Harbour code and nicely integrates
with OSX xcode ide, tools, etc :-)

So yes, there should be no problems to create a FiveDroid this time,
building from Eclipse, everything standard.

Antonio

Viktor Szakáts

no leída,
14 abr 2011, 8:00:0414/4/11
a harbou...@googlegroups.com
Hi Antonio,

Probably my question wasn't clear. What I meant is
what Android UI APIs are available, which is usable
for Harbour, aka accessible from .c/.cpp code and/or
linkable with Habour HVM apps?

[ Last time such UI API was only offered via Java.
Which in turn cannot interface with Harbour code. ]

Viktor

Antonio Linares

no leída,
17 abr 2011, 7:47:3817/4/11
a Harbour Developers
Viktor,

I have modified harbour/config/global.mk this way, as a start:

anto@ubuntu:~/harbour/harbour/config$ diff global.mk global_old.mk
970,975d969
< ifeq ($(HB_PLATFORM),android)
< HB_COMP_PATH := ~/Desktop/android-ndk-r5b/toolchains/arm-
linux-androideabi-4.4.3/prebuilt/linux-x86/bin
< HB_COMPILER := arm-linux-androideabi-gcc
< HB_CPU := arm
< HB_CROSS_PLATFORM := yes
< HB_HOST_BIN := ~/harbour/harbour/bin/android/arm
1036d1029
< endif

Then I have created a folder harbour/config/android and copied gcc.mk
and global.mk from harbour/config/linux, then renamed gcc.mk as
arm-linux-androideabi-gcc.mk

Finally I do:
export HB_PLATFORM=android
make

Next I will set the right headers files path for the used gcc and test
it again

Thanks

Antonio

Antonio Linares

no leída,
17 abr 2011, 8:05:4817/4/11
a Harbour Developers
Also:

anto@ubuntu:~/harbour/harbour$ diff config/android/arm-linux-
androideabi-gcc.mk config/linux/gcc.mk
9c9
< HB_CMP := ~/Desktop/android-ndk-r5b/toolchains/arm-linux-
androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
---
> HB_CMP := gcc
anto@ubuntu:~/harbour/harbour$

Antonio

Antonio Linares

no leída,
17 abr 2011, 8:20:4217/4/11
a Harbour Developers
In the same arm...mk file:

#CFLAGS += -I. -I$(HB_HOST_INC)
CFLAGS += -I.
CFLAGS += -I~/Desktop/android-ndk-r5b/platforms/android-9/arch-arm/usr/
include

Antonio

Antonio Linares

no leída,
17 abr 2011, 19:09:0517/4/11
a Harbour Developers
Viktor,

I am running the make and need to avoid -I/usr/include

In:

/Users/anto/Desktop/android-ndk-r5b/toolchains/arm-linux-
androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc -
I/Users/anto/harbour/harbour/include -I/Users/anto/Desktop/android-ndk-
r5b/platforms/android-9/arch-arm/usr/include -Wmissing-braces -
Wreturn-type -Wformat -Wimplicit-int -Wimplicit-function-declaration -
O3 -DHB_LEGACY_TYPES_OFF -I/usr/include -opng.o -c ../../../png.c

Do you know where -I/usr/include comes from ? How to remove it ?

thanks

Antonio

Antonio Linares

no leída,
17 abr 2011, 19:13:5517/4/11
a Harbour Developers
Viktor,

If I manually remove -I/usr/include then it compiles fine:

antos-iMac:harbour anto$ /Users/anto/Desktop/android-ndk-r5b/
toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-
linux-androideabi-gcc -I/Users/anto/harbour/harbour/include -I/Users/
anto/Desktop/android-ndk-r5b/platforms/android-9/arch-arm/usr/include
-Wmissing-braces -Wreturn-type -Wformat -Wimplicit-int -Wimplicit-
function-declaration -O3 -DHB_LEGACY_TYPES_OFF -opng.o -c /Users/anto/
harbour/harbour/src/3rd/png/png.c

thanks

Antonio

Antonio Linares

no leída,
17 abr 2011, 19:27:0517/4/11
a Harbour Developers
Ok, I did it this way:

#CFLAGS += -I. -I$(HB_HOST_INC)
CFLAGS += -I/Users/anto/harbour/harbour/include
CFLAGS += -I/Users/anto/Desktop/android-ndk-r5b/platforms/android-9/
arch-arm/usr/include
HB_CFLAGS :=

It is building it :-)

Antonio

ToninhoFWi

no leída,
17 abr 2011, 21:15:4217/4/11
a harbou...@googlegroups.com
Antonio,

Thanks for you implementation.

Let me know: what is your plan for the graphical interface for Android?

Regards,

Toninho.

Antonio Linares

no leída,
17 abr 2011, 21:21:0317/4/11
a Harbour Developers
Toninho,

> Let me know: what is your plan for the graphical interface for Android?

I have some ideas about it, but first of all we need to build Harbour
for Android, so we can start making tests

Antonio

Antonio Linares

no leída,
17 abr 2011, 21:24:1617/4/11
a Harbour Developers
The built process stopped not finding crtbegin_dynamic.o that is
provided in the NDK. After trying all sort of flags to provide it to
gcc (used as linker) I solved it just copying such file to android-ndk-
r5b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/arm-
linux-androideabi/lib.

Now I get:
libhbnortl.a: could not read symbols: Archive has no index; run ranlib
to add one

Antonio

Antonio Linares

no leída,
17 abr 2011, 21:36:5017/4/11
a Harbour Developers
libhbnortl.a the table of contents is empty (no object file members in
the library define global symbols)

Any hints ?

Antonio

Antonio Linares

no leída,
17 abr 2011, 22:00:0017/4/11
a Harbour Developers
I solved it calling the right ranlib but we need to know where to
define it from the makefile:

antos-iMac:harbour anto$ /Users/anto/Desktop/android-ndk-r5b/
toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-
linux-androideabi-ranlib /Users/anto/harbour/harbour/lib/android/gcc/
libhbcommon.a

Next: some unresolved symbols...

hbprintf.c:(.text+0xc8c): undefined reference to `__isfinite'
hbprintf.c:(.text+0xcb4): undefined reference to `__isinf'
hbprintf.c:(.text+0x1388): undefined reference to `__signbit'
hbprintf.c:(.text+0x1420): undefined reference to `modfl'
hbprintf.c:(.text+0x1494): undefined reference to `modfl'
hbprintf.c:(.text+0x15dc): undefined reference to `modfl'
hbprintf.c:(.text+0x1684): undefined reference to `modfl'
hbprintf.c:(.text+0x17bc): undefined reference to `__isfinite'
hbprintf.c:(.text+0x17e8): undefined reference to `__isinf'
../../../../../lib/android/gcc/libhbcommon.a(hbstr.o): In function
`hb_numInt':
hbstr.c:(.text+0xb48): undefined reference to `modf'
../../../../../lib/android/gcc/libhbcommon.a(hbstr.o): In function
`hb_numExpConv':
hbstr.c:(.text+0xd5c): undefined reference to `pow'
hbstr.c:(.text+0xd94): undefined reference to `pow'
../../../../../lib/android/gcc/libhbcommon.a(hbstr.o): In function
`hb_compStrToNum':
hbstr.c:(.text+0x12e4): undefined reference to `pow'
../../../../../lib/android/gcc/libhbcommon.a(hbstr.o): In function
`hb_numRound':
hbstr.c:(.text+0x1428): undefined reference to `modf'
hbstr.c:(.text+0x14b0): undefined reference to `pow'
hbstr.c:(.text+0x14e8): undefined reference to `pow'
../../../../../lib/android/gcc/libhbcommon.a(hbstr.o): In function
`hb_numDecConv':
hbstr.c:(.text+0x15ac): undefined reference to `pow'
hbstr.c:(.text+0x15d0): undefined reference to `pow'
../../../../../lib/android/gcc/libhbcommon.a(hbstr.o): In function
`hb_strValInt':
hbstr.c:(.text+0x17e8): undefined reference to `pow'
../../../../../lib/android/gcc/libhbcommon.a(hbstr.o):hbstr.c:(.text
+0x1cac): more undefined references to `pow' follow


Antonio

Antonio Linares

no leída,
17 abr 2011, 22:02:2317/4/11
a Harbour Developers
Android uses a stripped down version of libc, called bionic, so that
may be the reason...

Antonio

Antonio Linares

no leída,
17 abr 2011, 21:42:0117/4/11
a Harbour Developers
I was using a wrong ranlib

How to define the ranlib to use ? which define ?

Antonio

francesco perillo

no leída,
18 abr 2011, 4:50:3818/4/11
a harbou...@googlegroups.com
Antonio,
I'm replaying all the steps you did on a linux pc
I reached this stage, please have a look at the messages (to see if
they are similar to yours) and the error...

How did you solve the ranlib ?


Thanks,
Francesco

! Building Harbour 2.1.0rc2 from source - http://harbour-project.org
! MAKE: make 3.81 /bin/sh

! HB_HOST_PLAT: linux (x86) HB_SHELL: sh
! LD_LIBRARY_PATH:
/usr/local/src/harbour-project/harbour/lib/android/arm-linux-androideabi-gcc:/usr/lib/mpi/gcc/openmpi/lib
! HB_PLATFORM: android (arm)
! HB_COMPILER: arm-linux-androideabi-gcc (autodetected:
/root/iii/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/)
! HB_HOST_BIN: /root/iii/harbour/harbour/bin/android/arm
! Component: 'zlib' found in /usr/include
! Component: 'pcre' found in
/usr/local/src/harbour-project/harbour/src/3rd/pcre (local)
! Component: 'gpm' not supported on android platform
! Component: 'slang' found in /usr/include
! Component: 'curses' found in /usr/include
! Component: 'x11' found in /usr/include
! Component: 'wattcp/watt-32' not supported on android platform
! HB_INSTALL_PREFIX automatically set to:
/usr/local/harbour-android-arm-linux-androideabi-gcc
! REVISION: exported
! HB_HOST_BIN not specified. Automatically set to:
/usr/local/src/harbour-project/harbour/bin/linux/gcc
make[1]: Nothing to be done for `all'.
! HB_HOST_BIN not specified. Automatically set to:
/usr/local/src/harbour-project/harbour/bin/linux/gcc
make[1]: Nothing to be done for `all'.
! HB_HOST_BIN not specified. Automatically set to:
/usr/local/src/harbour-project/harbour/bin/linux/gcc
! 'hbpmcom' library skipped (platform or compiler not supported)
! 'png' library skipped (unused)
! 'jpeg' library skipped (unused)
/root/iii/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-I/usr/local/src/harbour-project/harbour/include/
-I/root/iii/ndk/platforms/android-9/arch-arm/usr/include/
-Wmissing-braces -Wreturn-type -Wformat -Wimplicit-int
-Wimplicit-function-declaration -O3 -DHB_LEGACY_TYPES_OFF
-ochartabs.o -DPCRE_STATIC -c ../../../chartabs.c
In file included from ../../../chartabs.c:27:
../../../pcreinal.h:386:2: error: #error LINK_SIZE must be either 2, 3, or 4
make[4]: *** [chartabs.o] Error 1
make[3]: *** [descend] Error 2
make[2]: *** [pcre] Error 2
make[1]: *** [3rd] Error 2
make: *** [src] Error 2

Antonio Linares

no leída,
18 abr 2011, 5:07:4018/4/11
a Harbour Developers
antos-iMac:gcc anto$ file hbpp
hbpp: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically
linked (uses shared libs), not stripped
antos-iMac:gcc anto$

:-)

Antonio

Massimo Belgrano

no leída,
18 abr 2011, 5:19:4318/4/11
a harbou...@googlegroups.com
Can Help me
Follow with summary step after the installation ndk under desktop

I have
created a folder harbour/config/android and
copied gcc.mk and global.mk from harbour/config/linux,
then renamed gcc.mk as arm-linux-androideabi-gcc.mk

2011/4/18 Antonio Linares <antonio....@gmail.com>:

--
Massimo Belgrano

Antonio Linares

no leída,
18 abr 2011, 5:23:4118/4/11
a Harbour Developers
Francesco,

I am building on OSX but I plan to test it on Linux too in a while. I
have not seen such error. Please review pcreinal.h 286 and lets see
what there is and if we can find a solution.

I manually called ranlib and worked fine then :-) Its not the
solution, but it works for now.

antos-iMac:platform-tools anto$ /Users/anto/Desktop/android-ndk-r5b/
toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-
linux-androideabi-ranlib /Users/anto/harbour/harbour/lib/android/gcc/
libhbcommon.a

for each lib

Welcome aboard, the more we try it, the better

Antonio

On 18 abr, 10:50, francesco perillo <fperi...@gmail.com> wrote:
> Antonio,
> I'm replaying all the steps you did on a linux pc
> I reached this stage, please have a look at the messages (to see if
> they are similar to yours) and the error...
>
> How did you solve the ranlib ?
>
> Thanks,
> Francesco
>
> ! Building Harbour 2.1.0rc2 from source -http://harbour-project.org
> ! MAKE: make 3.81 /bin/sh
> ! HB_HOST_PLAT: linux (x86)  HB_SHELL: sh
> ! LD_LIBRARY_PATH:
> /usr/local/src/harbour-project/harbour/lib/android/arm-linux-androideabi-gc c:/usr/lib/mpi/gcc/openmpi/lib

Antonio Linares

no leída,
18 abr 2011, 5:26:1718/4/11
a Harbour Developers
Massimo,

Keep gcc.mk with its name, don't rename it to arm-linux-androideabi-
gcc.mk

Antonio

On 18 abr, 11:19, Massimo Belgrano <mbelgr...@deltain.it> wrote:
> Can Help me
> Follow with summary step after the installation ndk under desktop
>
> I have
> created a folder harbour/config/android and
> copied gcc.mk and global.mk from harbour/config/linux,
> then renamed gcc.mk as arm-linux-androideabi-gcc.mk
>
> 2011/4/18 Antonio Linares <antonio.fivet...@gmail.com>:

Massimo Belgrano

no leída,
18 abr 2011, 5:30:3918/4/11
a harbou...@googlegroups.com
ok
and what in harbour/config/global.mk?
Wich step must do?

2011/4/18 Antonio Linares <antonio....@gmail.com>:

--
Massimo Belgrano

francesco perillo

no leída,
18 abr 2011, 5:37:3418/4/11
a harbou...@googlegroups.com
Actually pcre/config.h is not read due to this code in chartabs.c:


#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

There is
src/3rd/pcre/Makefile: HB_CFLAGS += -DHAVE_CONFIG_H

but in config/android/(compiler).mk
you put
HB_CFLAGS :=

Antonio Linares

no leída,
18 abr 2011, 5:40:2718/4/11
a Harbour Developers
Francesco,

Please change it to HB_CFLAGS += -DHAVE_CONFIG_H and try it

Antonio

Antonio Linares

no leída,
18 abr 2011, 5:43:0118/4/11
a Harbour Developers
Massimo,

Search for darwin inside harbour/config/global.mk then copy this just
avobe it:

ifeq ($(HB_PLATFORM),android)
HB_COMP_PATH := /Users/anto/Desktop/android-ndk-r5b/
toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/arm-linux-
androideabi/bin
HB_COMPILER := gcc
# HB_CCPREFIX := arm-linux-androideabi-
HB_CPU := arm
else
ifeq ($(HB_PLATFORM),darwin)
...
and add another endif below:

endif
endif
endif
endif
endif
endif
endif
endif
endif
endif

thats all I did

Antonio

Antonio Linares

no leída,
18 abr 2011, 5:51:1518/4/11
a Harbour Developers
hbpp running on the Android emulator !!! :-D

antos-iMac:platform-tools anto$ ./adb push /Users/anto/harbour/harbour/
bin/android/gcc/hbpp /data/local/hbpp
705 KB/s (578597 bytes in 0.800s)
antos-iMac:platform-tools anto$ ./adb shell
root@android:/ # cd /data/local
root@android:/data/local # ls
hbpp
tmp
root@android:/data/local # ./hbpp
Harbour Preprocessor 2.1.0rc2
Copyright (c) 1999-2011, http://harbour-project.org/

Syntax: ./hbpp <file[.prg]> [options]

Options: -d<id>[=<val>] #define <id>
-e[<func>] use <func> as entry function in generated .c
-i<path> add #include file search path
-u[<file>] use command def set in <file> (or none)
-c[<file>] look for ChangeLog file
-o<file> creates .c file with PP rules
-v<file> creates .h file with version information
-w write preprocessed (.ppo) file
-q[012] disable information messages

Note: if neither -o nor -v is specified then -w is default action

1|root@android:/data/local #

Cool !!!! :-D

Antonio

Massimo Belgrano

no leída,
18 abr 2011, 5:52:4318/4/11
a harbou...@googlegroups.com
Compliment
+1


2011/4/18 Antonio Linares <antonio....@gmail.com>:

--
Massimo Belgrano

francesco perillo

no leída,
18 abr 2011, 6:17:2918/4/11
a harbou...@googlegroups.com
Solved the problem, copied crtbegin_dynamic.o file, now the problem is

/root/iii/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:
cannot find -lc
collect2: ld returned 1 exit status
make[3]: *** [hbpp] Error 1
rm hbpp.o
make[2]: *** [descend] Error 2
make[1]: *** [pp] Error 2

Massimo Belgrano

no leída,
18 abr 2011, 6:34:5018/4/11
a harbou...@googlegroups.com
Can i try similar step from windows?


2011/4/18 Antonio Linares <antonio....@gmail.com>:

--
Massimo Belgrano

Antonio Linares

no leída,
18 abr 2011, 7:28:4618/4/11
a Harbour Developers
Francesco,

Copy libc.a also from the same place where crtbegin_dynamic.o
was !!! :-)

Antonio

Antonio Linares

no leída,
18 abr 2011, 7:29:2118/4/11
a Harbour Developers
Massimo,

Yes, NDK is available for Windows, Mac and Linux :-)

Antonio

On 18 abr, 12:34, Massimo Belgrano <mbelgr...@deltain.it> wrote:
> Can i try similar step from windows?
>
> 2011/4/18 Antonio Linares <antonio.fivet...@gmail.com>:
>
>
>
>
>
>
>
>
>
> > hbpp running on the Android emulator !!! :-D
>
> > antos-iMac:platform-tools anto$ ./adb push /Users/anto/harbour/harbour/
> > bin/android/gcc/hbpp /data/local/hbpp
> > 705 KB/s (578597 bytes in 0.800s)
> > antos-iMac:platform-tools anto$ ./adb shell
> > root@android:/ # cd /data/local
> > root@android:/data/local # ls
> > hbpp
> > tmp
> > root@android:/data/local # ./hbpp
> > Harbour Preprocessor 2.1.0rc2
> > Copyright (c) 1999-2011,http://harbour-project.org/

Antonio Linares

no leída,
18 abr 2011, 7:29:4918/4/11
a Harbour Developers

francesco perillo

no leída,
18 abr 2011, 9:37:5618/4/11
a harbou...@googlegroups.com
Antonio,
I didn't have the ranlib problem under linux, but I still have the
undefined references...

How did you solved it ?

Francesco
../../../../../lib/android/arm-linux-androideabi-gcc/libhbcommon.a(hbprintf.o):
In function `hb_vsnprintf':


hbprintf.c:(.text+0xc8c): undefined reference to `__isfinite'
hbprintf.c:(.text+0xcb4): undefined reference to `__isinf'
hbprintf.c:(.text+0x1388): undefined reference to `__signbit'
hbprintf.c:(.text+0x1420): undefined reference to `modfl'
hbprintf.c:(.text+0x1494): undefined reference to `modfl'
hbprintf.c:(.text+0x15dc): undefined reference to `modfl'
hbprintf.c:(.text+0x1684): undefined reference to `modfl'
hbprintf.c:(.text+0x17bc): undefined reference to `__isfinite'
hbprintf.c:(.text+0x17e8): undefined reference to `__isinf'

../../../../../lib/android/arm-linux-androideabi-gcc/libhbcommon.a(hbstr.o):

francesco perillo

no leída,
18 abr 2011, 10:24:4818/4/11
a harbou...@googlegroups.com
Ok I did these changes:

## to add library directories (unfortunately it doesn't find .o files)
LDFLAGS += -L/root/iii/ndk/platforms/android-9/arch-arm/usr/lib/
## to add __isfinite, __isinf, __signbit
LDFLAGS += -lm


Now I only get

> hbprintf.c:(.text+0x1420): undefined reference to `modfl'
> hbprintf.c:(.text+0x1494): undefined reference to `modfl'
> hbprintf.c:(.text+0x15dc): undefined reference to `modfl'
> hbprintf.c:(.text+0x1684): undefined reference to `modfl'

errors... I see that modfl is optionally compiled... it is present in
a stdc++ library in the source directory and not in the stdc++
library together with the other libraries...

Massimo Belgrano

no leída,
18 abr 2011, 10:46:4818/4/11
a harbou...@googlegroups.com
HB_COMP_PATH :=C:\devl\android-ndk-r5b\toolchains\arm-eabi-4.4.0\prebuilt\windows\arm-eabi\bin

set HB_PLATFORM=android
set path=C:\devl\android-ndk-r5b\toolchains\arm-eabi-4.4.0\prebuilt\windows\arm-eabi\bin;
%path%
win-make clean install

! Building Harbour 2.1.0rc2 from source - http://harbour-project.org

! MAKE: win-make 3.82 sh.exe clean install
! HB_HOST_PLAT: win (x86) HB_SHELL: nt
! LD_LIBRARY_PATH: C:/harbour/lib/android/gcc:
! HB_PLATFORM: android (arm)
! HB_COMPILER: gcc (autodetected: C:\devl\android-ndk-r5b\toolchains\arm-eabi-4.
4.0\prebuilt\windows\arm-eabi\)
! HB_HOST_BIN not specified. Automatically set to: C:/harbour/bin/win/bcc
! Component: 'zlib' found in C:/harbour/src/3rd/zlib (local)
! Component: 'pcre' found in C:/harbour/src/3rd/pcre (local)


! Component: 'gpm' not supported on android platform

! Component: 'slang' not found. Configure with HB_WITH_SLANG.
! Component: 'curses' not found. Configure with HB_WITH_CURSES.
! Component: 'x11' not found. Configure with HB_WITH_X11.


! Component: 'wattcp/watt-32' not supported on android platform

../config/global.mk:1711: *** ! Please set HB_INSTALL_PREFIX and try again. For
more information: read INSTALL. Stop.
win-make: *** [doc.clean] Error 2

2011/4/18 Antonio Linares <antonio....@gmail.com>:


> Massimo,
>
> Yes, NDK is available for Windows, Mac and Linux :-)
>
> Antonio
>

--
Massimo Belgrano

Antonio Linares

no leída,
18 abr 2011, 19:13:4918/4/11
a Harbour Developers
Francesco,

> Solved the problem, copied crtbegin_dynamic.o file, now the problem is

I am testing in Linux now. Where have you copied crtbegin_dynamic.o
to ? thanks

Antonio

Antonio Linares

no leída,
18 abr 2011, 19:14:4618/4/11
a Harbour Developers
Francesco,

Create a dummy modf() just for testing purposes,

Antonio

francesco perillo

no leída,
19 abr 2011, 4:31:3619/4/11
a harbou...@googlegroups.com
> I am testing in Linux now. Where have you copied crtbegin_dynamic.o
> to ? thanks

cp ./platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o
./toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/arm-linux-androideabi/lib/

Luigi Grella

no leída,
19 abr 2011, 9:24:4819/4/11
a Harbour Developers
I am new to this. What is NDK, and how it improve my work?

On Apr 18, 7:29 am, Antonio Linares <antonio.fivet...@gmail.com>
wrote:

Viktor Szakáts

no leída,
19 abr 2011, 19:47:2319/4/11
a harbou...@googlegroups.com
Hi Antonio,

On Mon, Apr 18, 2011 at 3:21 AM, Antonio Linares
<antonio....@gmail.com> wrote:
> Toninho,
>
>> Let me know: what is your plan for the graphical interface for Android?
>
> I have some ideas about it, but first of all we need to build Harbour
> for Android, so we can start making tests

For me its extremely strange that you're pushing me (in
this case) here just to help with some secret plans. I don't
like it at all.

Openness and sincere interest in volunteer participation
in the community can do wonders with motivation and
moving things forward.

Viktor

Antonio Linares

no leída,
20 abr 2011, 3:25:4520/4/11
a Harbour Developers
Dear Viktor,

There are no secret plans at all :-) (except in your mind)

It has no sense to provide a long technical explanation of something
that I have not tested yet myself and that I don't know if it will
work or not.

Once I get something working, you have my word that I will provide
full source code and tech details about it.

Still I have not seen any help from you on this android issue... :-)

Antonio

On 20 abr, 01:47, Viktor Szakáts <harbour...@syenar.hu> wrote:
> Hi Antonio,
>
> On Mon, Apr 18, 2011 at 3:21 AM, Antonio Linares
>
> <antonio.fivet...@gmail.com> wrote:
> > Toninho,
>
> >> Let me know: what is your plan for the graphical interface forAndroid?
>
> > I have some ideas about it, but first of all we need to build Harbour
> > forAndroid, so we can start making tests

francesco perillo

no leída,
20 abr 2011, 3:37:4220/4/11
a harbou...@googlegroups.com
>
> Still I have not seen any help from you on this android issue... :-)
>


Absolutely not true !

Read thread about commit harbour-project:[16619] trunk/harbour and
the following commits, almost all about bringing harbour as a
supported platform.

Antonio Linares

no leída,
20 abr 2011, 3:55:2320/4/11
a Harbour Developers
I meant here, on this thread. I wasn't aware of such commits, thanks
for pointing them,

I am currently in Viena supporting a Harbour user and have no time to
review all commits, but I will do it asap.

Antonio

Massimo Belgrano

no leída,
20 abr 2011, 5:36:4820/4/11
a harbou...@googlegroups.com
ndk contain gcc for android os (os for mobile phone)
You can find same info here http://developer.android.com/sdk/ndk/index.html
So is like your c compiler for this os


2011/4/19 Luigi Grella <grell...@gmail.com>:

--
Massimo Belgrano

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos