OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Linux Applications => Topic started by: fpp on June 24, 2004, 07:28:17 am

Title: Simplest way to an executable ?
Post by: fpp on June 24, 2004, 07:28:17 am
Hi,

How hard would it be to compile a single C file to an executable that runs on the Z ?

This is a console-mode Linux app that has no user interface (sort of a combined Weblog + http server) and uses flat files for storage, no dependencies. It's quite portable as it runs on almost any Linux/unix and Windows too. It is just one C file.

What's the simplest way to try this on the Z ? is a cross-platform tool chain really necessary, or can it be done on the Z itself (a C760) ?

Thanks for any tips ; just in case it matters, below is the list of includes in the source for the Unix/Linux platforms :

#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <locale.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <dirent.h>
#include <errno.h>
#include <ctype.h>
#include <pwd.h>
#include <grp.h>
Title: Simplest way to an executable ?
Post by: lardman on June 24, 2004, 08:38:29 am
You could download a cross-toolchain but it seems to be a bit of an overkill. There are also a fair few native toolchain cramfs (compressed filesystem) files which you could mount and use.

Not sure off the top of my head but something like:

gcc -o exe_name source_name.c

should do the trick I expect.

Might actually be easier to post the source (or a link to it) and get someone with a toolchain already setup to compile it for you.


Si
Title: Simplest way to an executable ?
Post by: Stubear on June 24, 2004, 08:59:14 am
You can compile it on the Z if you install zgcc on the Z. Otherwise you will need to install a cross-compielr on your desktop.

The include files you listed seem like standard linux includes and should be no problem

As lardman recommend if you post the link or the file someone can compile it for you

Stu
Title: Simplest way to an executable ?
Post by: fpp on June 24, 2004, 10:22:07 am
Quote
You can compile it on the Z if you install zgcc on the Z. Otherwise you will need to install a cross-compielr on your desktop.

The include files you listed seem like standard linux includes and should be no problem

As lardman recommend if you post the link or the file someone can compile it for you
Well, that's what I thought too, but didn't dare ask ;-)

It's actually quite a nice little app, so I don't mind giving it a little advertising here, I'm sure it could have some interesting uses on a Z. Here's the link :

http://midas.psi.ch/elog/ (http://midas.psi.ch/elog/)

There are several source files but only the big one (elogd.c) is actually needed.

If I get the chance I'll still give zgcc a go, but in the meantime if anyone with the right tools can build the executable, TIA to him/her.
Title: Simplest way to an executable ?
Post by: tumnus on June 24, 2004, 11:51:26 am
What about the Handhelds.org Dev Cluster?

http://www.handhelds.org/projects/devcluster.html (http://www.handhelds.org/projects/devcluster.html)
Title: Simplest way to an executable ?
Post by: lardman on June 24, 2004, 11:55:27 am
Quote
What about the Handhelds.org Dev Cluster?

Last time I looked they were using libc 2.3 which means it'll work on my Z, but not the Sharp/pdaXrom ROMs.


Si

P.S. I'll try to compile the code later on when I've got some time.
Title: Simplest way to an executable ?
Post by: fpp on June 24, 2004, 12:29:48 pm
Quote
What about the Handhelds.org Dev Cluster?

http://www.handhelds.org/projects/devcluster.html (http://www.handhelds.org/projects/devcluster.html)
Wasn't aware of its existence, actually. Fun stuff though ! ;-)

I wonder if binaries compiled there would run on a C760 with maslovsky's Cacko ROM 1.21 ?...
Title: Simplest way to an executable ?
Post by: fpp on June 24, 2004, 12:31:01 pm
Quote
Quote
What about the Handhelds.org Dev Cluster?

Last time I looked they were using libc 2.3 which means it'll work on my Z, but not the Sharp/pdaXrom ROMs.

P.S. I'll try to compile the code later on when I've got some time.
Thanks a lot !
Title: Simplest way to an executable ?
Post by: Stubear on June 24, 2004, 12:32:59 pm
Okay, I've downloaded and compiled the source - actually compiled all the app (not sure what elconv does yet)

It looks like a pretty usefull little app. I tried to attach it here, but looks like we can't attach files to the new forum.

If you PM me your email address, I'll email it to you - the tarball with demo logbook and default theme is only 250K.

I'll also see if I can get web access to load it up so others can download it.

NOTE: Compiled with gcc-2.95.2 and tested on stock standard C760. So should work on any qtopia based Z (and maybe pdaX as well)

Stu
Title: Simplest way to an executable ?
Post by: fpp on June 24, 2004, 01:07:55 pm
Quote
Okay, I've downloaded and compiled the source - actually compiled all the app (not sure what elconv does yet)

It looks like a pretty usefull little app. I tried to attach it here, but looks like we can't attach files to the new forum.

If you PM me your email address, I'll email it to you - the tarball with demo logbook and default theme is only 250K.

I'll also see if I can get web access to load it up so others can download it.

NOTE: Compiled with gcc-2.95.2 and tested on stock standard C760. So should work on any qtopia based Z (and maybe pdaX as well)
Great, thanks a lot ! I've sent you the address.

elconv is pretty much legacy : at some point the storage format changed, and it's there in case some people still have very old version of Elog around, to convert their data to the new format.

if/when I succeed in compiling elogd myself, I was thinking of making it available on a web page of mine, or perhaps even maintaining a downsized ipk of sorts if it's not too much trouble.

Thanks for your help anyway, looking forward to try that out on my Z...
Title: Simplest way to an executable ?
Post by: fpp on June 24, 2004, 06:01:27 pm
Quote
Quote
What about the Handhelds.org Dev Cluster?

http://www.handhelds.org/projects/devcluster.html (http://www.handhelds.org/projects/devcluster.html)
I wonder if binaries compiled there would run on a C760 with maslovsky's Cacko ROM 1.21 ?...
Answering myself : yes, it seems they do !

It was a little awkward because the cluster does not work 100% as described on that page (could not get scp to connect). So once I was logged in a guest directory, I got the Elog tarball through wget, uncompressed it and ran make. Then I uploaded the elogd binary to my website, and from there to the Z.

I haven't tested it extensively, but it runs and displays the demo logbook, so I guess it's OK (right gcc/glibc/whatever). Thanks to Tumnus for pointing out this really useful resource !

Stubear sent me the binaries he built on his own Z ; they're not exactly the same size but they work just fine too.

Thanks to all of you, I now have Elog in my pocket... now let's find some interesting uses for it :-)