yashsingh1/xdaforums huggingface dataset:
[Android Software Development] smitna:
Hm, sounds very interesting. A market for Open Source software as good alternatives will be fine. I hope Koush will be successful with it. But I don't think that my scripts will fit the requirements for it. That's not my main target, but a repository in Debian/Ubuntu style would be nice, but a little bit difficult because of the bandwidth of devices.

I hope my script will help some people to compile software a little bit easier as usual or they can use it for other things.
[Android Software Development] smitna:
The whole internet with all possibilities in your pocket, why not? But don't try to replace the Google hosting with your phone ;)
[Android Software Development] Droidzone:
This is too simple...I was doing this the hard way!
[Android Software Development] Droidzone:
You guys will be interested in this project...

Glibc and Enlightenment on Android

http://xdaforums.com/showthread.php?t=1299962
[Android Software Development] smitna:
There are some projects here on XDA and on other sites to bring Java on the phone respectively the ARM target. I don't know how practical this is and if it is working with complex projects. I tried to cross-compile OpenJDK with very limited success for now. But basically it is work, yes. There are always some problems with compiling on the device: The long time to be ready, heavy load (battery, memory?) and the huge writes to the flash...
[Android Software Development] smitna:
Congratulations to theGanymedes! Hard work, I know it. And he has won the fight against Perl...
[Android Software Development] theGanymedes:
You don't need to set ARMv5, unless you want to distribute this package to pre-2004 CPU's.. New devices use ARMv7 system already; and unless you turn on Thumb-interworking; there is a high possibility that your binaries will work on most applications.

Using ARMv7-a is OK, because "-a" denotes "user space" applications - which is what you build.

---------- Post added at 02:30 PM ---------- Previous post was at 02:25 PM ----------

Thanks a lot. Btw, I think you can start adding GTK2 applications to your list too, because I compiled them as well, and they might run on the system of mine :)
[Android Software Development] smitna:
Ok, thank you very much for this. I was very unsure about the safe setting and older phones. I could not find a really helpful information particularly about the -mfpu and -mfloat-abi switches

Edit: I will add your information to my README if you give me your permission.

There are a lot of packages on my todo list, also GTK2. For the next steps I hope to get Perl and others running in the script. One problem is as well a functional VNC server. I have a successful build but with terrible graphic troubles...
[Android Software Development] grojas:
Hi smitna,

My english is very poor, because of that I've 2 question to clarify what I can do with this script:

1.- This is a script to "convert" linux applications to android applications?

2.- I mean, if I've LibreOfficeWriter linux program, I can compile it with this script and I get a Android version of LibreOfficeWriter?

My apologize for noob questions but I want to know if I understand well.

Cheers!
[Android Software Development] smitna:
With this script there is no "conversion" in any way. It's a cross-compilation of the original linux software and the software remains "Linux" software and make use of the standard C library. Cross-compile means building let's say an application on a device (the PC) for another architecture (ARM, the phone).

If we have a compatible GUI on the phone, e.g. the Xorg Server and Gnome (the desktop), it's possible to compile and run programs like LibreOffice and others. But I heard, that the Libre Office devs have plans to port the suite in a modified version to Android in the next future. But don't ask me about the details.

The script is only an automation tool for the cross compiling process (parameter settings etc.). It's possible to add more "packages" if you have the informations about the right compiling switches for the new packages and some other things. It's always simplest if the sources follows the configure/make/make install rules, but not all of them do so.
[Android Software Development] Droidzone:
Supposing I cross compile a package which is depended upon by another package, how do I use the first package to compile the bigger one?

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] smitna:
Hope I've got your question right. The bigger one?

Only a not inevitably example:

OpenSSH needs zlib and OpenSSL, OpenSSL need also zlib and -for all features- ncurses, ncurses has no further dependencies (hopefully).

1. Building ncurses and make install in the sysroot "container" on the build pc as ready to use ARM bins/libs and headers

2. Build of zlib and make install in sysroot

3. Configure and build of OpenSSL with announcement to OpenSSL to find the needed headers from zlib and ncurses in sysroot/include and the libs in sysroot/lib (all ready in ARM and not usable/runable on the PC)

4. Finally Configure and build of OpenSSH, same game play

Sometimes it's necessary to "force" (a box punch :D) the configure/make to use the ARM libs and not the totally wrong headers and libs from the build system e.g. in /usr/lib or to (I hope the word is technical correct) "inject" the right and necessary lib with an added switch (LDFLAG or LIB). There are also some tricks to bypass test checks by preset check vars ("Yes, we have this feature, don't try to find it out"). Some sources are very easy to compile, because the devs knows about the stony cross-compiling way. Sometimes there is a multi-pass build necessary, because the make want's to build a temporary binary on the machine to test something or other things. That's the harder way, because we need a first native build (runable binaries for the build PC) and a second run to generate the ARM binaries.

Edit, a remark (a little bit off topic...):

One question and a mystery for me is the build of the "very first" compiler. There were no other compiler before.

In Germany we have a saying: Who was the first one, the chicken or the egg?
[Android Software Development] Droidzone:
The chicken egg problem was also described very effectively by TheGanymedes on his 5th post where he describes building a cross compiler. The solution seems to be to build a part chicken from a part hen and make it a full hen, then use it lay full eggs, lol ;)

Thanks for the explanation. Will look into your code for openssl to find more.. I have my own toolchain and will see inserting it into your script to see if it can build it as effectively as the codesourcery tc .. a kind of benchmark ;)

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] dateno1:
retry after clean (delete sysroot folder, /sddata/ircd/*, run remove_all_file.sh)

it make almost package

but i can't found named and openssh sever's binary :(

make[1]: Entering directory `/built/sources/openssh-5.9p1/openbsd-compat'

make[1]: `all'를 위해 할 일이 없습니다

make[1]: Leaving directory `/built/sources/openssh-5.9p1/openbsd-compat'

./mkinstalldirs /sddata/ircd/bin

./mkinstalldirs /sddata/ircd/sbin

./mkinstalldirs /built/sysroot/share/man

./mkinstalldirs /built/sysroot/share/man/man1

./mkinstalldirs /built/sysroot/share/man/man5

./mkinstalldirs /built/sysroot/share/man/man8

./mkinstalldirs /sddata/ircd/libexec

(umask 022 ; ./mkinstalldirs /var/empty)

mkdir /var/empty

mkdir: `/var/empty' 디렉터리를 만들 수 없습니다: Permission denied

make: *** [install-files] 오류 1

chmod: `/built/sysroot/bin/ssh'에 접근할 수 없습니다.: No such file or directory

`all'를 위해 할 일이 없습니다 : no job for 'all'

`/var/empty' 디렉터리를 만들 수 없습니다 : can't make 'var/empty' directory

오류 1 : error 1

`/built/sysroot/bin/ssh'에 접근할 수 없습니다 : can't access to '/built/sysroot/bin/ssh'

attaching full build log
[Android Software Development] grojas:
Thank you for your explanation, now I understand :cool:

I`ve a linux program (for PC, ubuntu) that I want to "port" to Android (phone) that follows "configure/make/make install" rules. I`ve Ubuntu on my phone (via chroot) but that program doesn`t work because, and I quote, "...this program is not for arm architecture" (obviously, I know). Cross compiling the ubuntu program with your scripts, may I run that program on ubuntu via chroot on my phone?. If yes, how I send the ubuntu program in order to include it into your scripts` "packages?.

Thank you for your time, I apreciate.

Cheers!
[Android Software Development] dragonnn:
Thanks for info. That means it's hard to make:mad:. Will you try make it (I think I don't have enough knowledge to do it self:mad:)?
[Android Software Development] dateno1:
i was try to test

ircd, pure-ftpd

it seen to work well

but pure-ftpd has problem

when i add test account and connect to server but it say 'fail to authorization'

i try to change password but it not work (even run with -e it can allow connection)

ircd is work very well :D (thank you very much)

this is screenshots http://dateno1.egloos.com/1094306

but if you can add support 2byte character nickname please add that (it was common on korea and many user want that)
[Android Software Development] smitna:
Hello dateno1,

try following:

1 .add the switch --with-privsep-path=$TARGET_SYSROOT at the end in the configure-line (should be near 2647) in file build.sh

to prevent the error with /var/empty permission (this is the default value)

2. check for the prog ssh-keygen (which ssh-keygen). You have no generation of the default keys. The installer ends here.

The OpenSSH server should be in sysroot/sbin as sshd

I have tried to reproduce this with the basic packages and OpenSSH, but OpenSSH is build and running fine on the phone (of course with the right configuration and priv/pubkey method)
[Android Software Development] smitna:
Pure-FTP:

Use the virtual users method, we have no multi user environment on the phone, so I doubt, that it's possible to use the system-users per default for the FTP-server.

Example for virtual users :

1. pure-pw useradd [USERNAME] -u 100 -g 100 -f /[SYSROOT]/etc/puredb.pass -D [/path/userhome]

2. pure-pw mkdb /[SYSROOT]/puredb -f /[SYSROOT]/etc/puredb.passwd

3. start for testing without daemonize

pure-ftpd -d -l puredb:/[SYSROOT]/etc/puredb

IRC:

I can't find a "2 byte character" function in ngircd. But please see my script as a "template" for further things. The script is open and should be simple enough to add packages or modify existing entries if you want. A feature can added via switch in the configure-line. I try to activate as much feature as possible as default, but I am not a "specialist" for every program in the delivered software list. It's possible that I miss a feature, but try to insert it, if you want it.
[Android Software Development] smitna:
I have added it on my "Todo"-list. But please don't expect a fixed release date for it. In the moment I know to few things about the prerequisites for successful use on the phone.
[Android Software Development] dateno1:
no i already has multi user environment on phone (it created by some version of busybox :) ) (that has command useradd, userdel, login and etc)

so i try with added account (has no password)

i can connect to server but i can't login to server

---------- Post added at 11:59 AM ---------- Previous post was at 11:33 AM ----------

1. it mean edit

./configure --prefix=$PREFIX $TARGET_SYSROOTBINDATACONF --host=$HOST ARCH=arm CC=$CC_NAME CROSS_COMPILE=$PREFIX_CROSS_COMPILER --without-shadow --with-md5-passwords --with-pid-dir=$TARGET_SYSROOT/var/run --with-lastlog=$TARGET_SYSROOT/var/log --with-maildir=$TARGET_SYSROOT/var/mail --with-ssl-dir=$SYSROOT -with-zlib=$SYSROOT

to

./configure --prefix=$PREFIX $TARGET_SYSROOTBINDATACONF --host=$HOST ARCH=arm CC=$CC_NAME CROSS_COMPILE=$PREFIX_CROSS_COMPILER --without-shadow --with-md5-passwords --with-pid-dir=$TARGET_SYSROOT/var/run --with-lastlog=$TARGET_SYSROOT/var/log --with-maildir=$TARGET_SYSROOT/var/mail --with-ssl-dir=$SYSROOT -with-zlib=$SYSROOT --with-privsep-path=$TARGET_SYSROOT

?

i can't find '--with-privsep-path=$TARGET_SYSROOT' any place on build.sh (i think it not default on 1.9)

2. where i save my key file?

or it mean i need to create my key file?

i will try ssh-gen -t rsa command and test again
[Android Software Development] smitna:
A program that is build with this scriptset is not compatible (glibc, paths etc.) to the Ubuntu installation on your phone, to be exactly it's totally different :(. Use the apt-get install command for this and you will be sure that the program is proved to be compatible. If you want a program that is not in the repository, then install a compiler and the build utils and build it in the Ubuntu chroot on the phone.
[Android Software Development] dateno1:
i can install ubuntu my phone by chroot

but it use so many disk space and so heavy resource using :( (over 2Gb and 70mb ram)

---------- Post added at 12:53 PM ---------- Previous post was at 12:51 PM ----------

now sshd is created :D

hmm...what is the file name of named's binary?
[Android Software Development] dragonnn:
Ok, will wait for you release. Don't worry I'm patient. Thanks:).
[Android Software Development] smitna:
Not so good news:

I think I have to disappoint you. set/getcap needs kernel support (capabilities) to work. In the kernel config the SECURITY_FILE_CAPABILITIES must be set. I don't know, if a custom root kernel uses this option, but I guess not. Neither in the samsung kernel sources nor in Siyah kernel I can find this option (both for a SGS 2). If Android supports this basically and your phone kernel or a custom root kernel supports capabilities, then you can use this tools.
[Android Software Development] smitna:
If you want to use your own toolchain (and break the speed record ;)), it should be no problem at all. Change the CS_BASEDIR var in file prepare_codesourcery.sh and adjust the other paths there. Also set the right paths to the bins (CS_BASEDIR_REGEX) in build.sh or make some symlinks.
[Android Software Development] smitna:
version 2.0 released

Not a big jump, but I think stable enough and with a few nice new features to give it the 2.0. Feel free to try it.
[Android Software Development] dragonnn:
I'm using custom kernel but he doesn't support it:(. Even so, can you add building libcap to you script? I will ask some developers to make kernel to support SECURITY_FILE_CAPABILITIES or will try it self (I think it is simpler then compiling libcap, I have already build Linux kernel for desktops).

EDIT

But I my desktop I can not find this entry in config.gz too. I have find this http://www.mail-archive.com/fedora-kernel-list@redhat.com/msg02073.html https://lwn.net/Articles/363565/ after riding this I have understand that the settings is removed and enabled by default (I am think wrong or not?). But can not find which version upwards have this enabled, on my phone I have 2.6.35.7.

EDIT2

http://cateee.net/lkddb/web-lkddb/SECURITY_FILE_CAPABILITIES.html that means that this option exist between 2.6.27–2.6.32, also 2.6.35.7 should support it :D.
[Android Software Development] Droidzone:
Is this an issue?

Python build finished, but the necessary bits to build these modules were not found:
_bsddb _ssl _tkinter
bsddb185 bz2 dbm
gdbm linuxaudiodev ossaudiodev
sunaudiodev

Are these to be installed on host system?
[Android Software Development] smitna:
I have successful build setcap/getcap and the needed libs. But if I try to get the capabilities, I get this error:

failed to get capabilities of file [THE_BINARY] (Operation not supported)

Well, I think this means, that my kernel lacks the support for it or the filesystem.
[Android Software Development] smitna:
No, only a feature ;) Python cannot cross-build these modules or there are no libraries in the sysroot/lib for it.
[Android Software Development] Droidzone:
Good.. :)

One suggestion/comment...

Once script starts, why not do the wget as one batch, then the make after that.. Makes it easy to schedule the job on the PC..stop using the net till wget finishes, at the same time, build a kernel; then stop doing work which needs too much CPU power while the make batch is active.. Just a suggestion.. :)
[Android Software Development] smitna:
Not a bad idea. I think about it.
[Android Software Development] dragonnn:
Evan this, I will try self to check this. Waiting for you script or small guide how can I compile libcap for my device.
[Android Software Development] smitna:
New version with support for setcap/getcap on first page...
[Android Software Development] dragonnn:
Small problem by linking (I think) http://pastebin.com/g8LHznUK
[Android Software Development] smitna:
One question:

Are the libattr.so.* in /home/dragonn/setcap-arm/sysroot/lib and the headers in /home/dragonn/setcap-arm/sysroot/include/attr?

Please check also the file permissions and with file libattr.so.* the correct arch
[Android Software Development] Droidzone:
By the way, does any of you have a statically compiled ssh binary to share? I'm having some network issues which prevents me from wgeting the sources ATM..

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] dragonnn:
I can not find the libattr.so:

└─[13:35 pią,27 sty 12:$]→ ls -l /home/dragonn/setcap-arm/sysroot/lib
razem 14000
drwxr-xr-x 2 dragonn dragonn 4096 01-09 00:41 build
drwxr-xr-x 2 dragonn dragonn 4096 01-26 23:03 engines
drwxr-xr-x 3 dragonn dragonn 4096 01-09 00:41 gcc
drwxr-xr-x 3 dragonn dragonn 4096 01-09 00:41 gdbus-2.0
drwxr-xr-x 2 dragonn dragonn 4096 01-09 00:41 gettext
drwxr-xr-x 3 dragonn dragonn 4096 01-09 00:41 gio
drwxr-xr-x 3 dragonn dragonn 4096 01-09 00:41 glib-2.0
drwxr-xr-x 4 dragonn dragonn 4096 01-09 00:41 ImageMagick-6.7.4
-rwxr-xr-x 1 dragonn dragonn 8293856 01-26 22:59 libcrypto.a
lrwxrwxrwx 1 dragonn dragonn 18 01-26 22:59 libcrypto.so -> libcrypto.so.1.0.0
-rwxr-xr-x 1 dragonn dragonn 1248920 01-26 23:03 libcrypto.so.1.0.0
-rwxr-xr-x 1 dragonn dragonn 97254 01-26 22:25 libhistory.a
-rwxr-xr-x 1 dragonn dragonn 97254 01-26 21:38 libhistory.old
-rwxr-xr-x 1 dragonn dragonn 200886 01-26 22:51 libintl.a
-rwxr-xr-x 1 dragonn dragonn 1311 01-26 22:51 libintl.la
lrwxrwxrwx 1 dragonn dragonn 16 01-26 22:51 libintl.so -> libintl.so.8.1.1
lrwxrwxrwx 1 dragonn dragonn 16 01-26 22:51 libintl.so.8 -> libintl.so.8.1.1
-rwxr-xr-x 1 dragonn dragonn 31488 01-26 23:03 libintl.so.8.1.1
drwxr-xr-x 2 dragonn dragonn 4096 01-09 00:41 libmcrypt
-rwxr-xr-x 1 dragonn dragonn 693700 01-26 22:25 libreadline.a
-rwxr-xr-x 1 dragonn dragonn 693700 01-26 21:38 libreadline.old
-rwxr-xr-x 1 dragonn dragonn 2305866 01-26 22:59 libssl.a
lrwxrwxrwx 1 dragonn dragonn 15 01-26 22:59 libssl.so -> libssl.so.1.0.0
-rwxr-xr-x 1 dragonn dragonn 275032 01-26 23:03 libssl.so.1.0.0
drwxr-xr-x 2 dragonn dragonn 4096 01-09 00:41 libxslt-plugins
-rwxr-xr-x 1 dragonn dragonn 234102 01-26 22:29 libz.a
lrwxrwxrwx 1 dragonn dragonn 13 01-26 22:29 libz.so -> libz.so.1.2.5
lrwxrwxrwx 1 dragonn dragonn 13 01-26 22:29 libz.so.1 -> libz.so.1.2.5
-rwxr-xr-x 1 dragonn dragonn 73164 01-26 23:03 libz.so.1.2.5
drwxr-xr-x 2 dragonn dragonn 4096 01-09 00:41 lighttpd
drwxr-xr-x 3 dragonn dragonn 4096 01-09 00:41 lua
drwxr-xr-x 2 dragonn dragonn 4096 01-09 00:41 php
drwxr-xr-x 2 dragonn dragonn 4096 01-26 22:11 pkgconfig
drwxr-xr-x 27 dragonn dragonn 4096 01-09 00:41 python2.7
drwxr-xr-x 3 dragonn dragonn 4096 01-09 00:41 slang

Only the headers are existing:

└─[13:35 pią,27 sty 12:$]→ ls -l /home/dragonn/setcap-arm/sysroot/include/attr
razem 20
-rw-r--r-- 1 dragonn dragonn 7232 01-26 23:03 attributes.h
-rw-r--r-- 1 dragonn dragonn 846 01-26 23:03 error_context.h
-rw-r--r-- 1 dragonn dragonn 688 01-26 23:03 libattr.h
-rw-r--r-- 1 dragonn dragonn 2297 01-26 23:03 xattr.h

Why? In the compile message i can't find errors by compiling attr:confused:? In the /sd-ext/external_linux/lib I have find the libattr.so.1.1.0:confused:.
[Android Software Development] smitna:
Not the OpenSSH one. But you can try ssh from dropbear.
[Android Software Development] Droidzone:
dropbear doesn't work for ssh into Sourceforge, something to do with syntax I think. SF requires the command:

ssh -t user,project@shell.sourceforge.net create

I can't get dropbear to pass user,project as an arguments.

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] smitna:
Hm, copy the libs and symlinks to the sysroot/lib folder and start a second run, only with libcap.
[Android Software Development] smitna:
Ok, a second question: Is it possible with putty?
[Android Software Development] Droidzone:
Yes it is. :)

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] smitna:
Yeah! Now I have to find out, how to cross-compile putty, right?
[Android Software Development] grojas:
Thank you smitna, I appreciate your explanation.

Cheers!!
[Android Software Development] Droidzone:
Or the ssh binary of openssh?

Swyped on my Htc Desire running on Supernova Extreme - Gingerbread goodness with 2 GB of Internal memory
[Android Software Development] smitna:
I have tried to build a static version of OpenSSH without success (and spend hours with this...). The problem is the OpenSSL part.
[Android Software Development] Droidzone:
One question... I usually work in the ssh environment I mentioned, without root access. What can I do to bypass the requirement of creating a symlink within the rootfs to my home folder? How to I configure the build system to work entirely within my home folder?
[Android Software Development] smitna:
This is only to prevent errors from some installers. They are bypassing/ignoring the --prefix switch and then fail on installing in the sysroot folder (I think MySQL is one of these candidates). It's possible, that there are some other tricks or not using make install. If you can't create folders in the root dir, deactivate this and comment out the check for existence of the root folder (about line 359 in build.sh).

It's also possible, that a chroot environment or something like that solves the problem.
[Android Software Development] dragonnn:
Better:rolleyes:, but not really success.http://dl.dropbox.com/u/1664131/log.txt.tar.bz2 full log of the build proces. In the archive I can find setcap and getcap, but can not launch it o my phone:

bash: /sd-ext/external_linux/sbin/setcap: cannot execute binary file

One question - can it make problem when I build it on x86_64 system not i686 (but I have most lib32 lib's - using for wine and other apps)?
[Android Software Development] smitna:
1. Do you have all cs libs on your phone (from the tar archive)?

2. What prints readelf -d setcap (is there a rpath line with the right library paths)?

x86_64 or i386 makes no difference. We are not using system libs or headers.

Edit: I have looked in your log. The files are NOT ARM binaries, this cannot work. For some reasons the compiler do not switch back to the arm gcc in pass 2
[Android Software Development] Droidzone:
With this configuration, I was expecting to compile OpenSSH with all shared dependencies..But it seems it didnt compile..

This is the content of my install dir:

bin
|-- busybox
| |-- bin
| |-- sbin
| `-- usr
| |-- bin
| `-- sbin
|-- captoinfo -> tic
|-- clear
|-- c_rehash
|-- curl
|-- curl-config
|-- iconv
|-- infocmp
|-- infotocap -> tic
|-- ncursesw5-config
|-- openssl
|-- python2.7
|-- reset -> tset
|-- sqlite3
|-- tabs
|-- tic
|-- toe
|-- tput
|-- tset
|-- xml2-config
|-- xmlcatalog
|-- xmllint
`-- xmlwf

Should I be looking for errors?
[Android Software Development] dragonnn:
Ok, and how can I fix it?
[Android Software Development] smitna:
I cannot reproduce your problem in the moment. If you want, use for now the attachement. I hope all setting are good for you.
[Android Software Development] smitna:
Please send me your log with the errors.