OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Simplest way to an executable ?, Compiling a single C file...
fpp
post Jun 24 2004, 03:28 AM
Post #1





Group: Members
Posts: 188
Joined: 1-February 04
Member No.: 1,647



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>
Go to the top of the page
 
+Quote Post
lardman
post Jun 24 2004, 04:38 AM
Post #2





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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
Go to the top of the page
 
+Quote Post
Stubear
post Jun 24 2004, 04:59 AM
Post #3





Group: Members
Posts: 1,164
Joined: 17-December 03
From: Melbourne, AUSTRALIA
Member No.: 1,219



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
Go to the top of the page
 
+Quote Post
fpp
post Jun 24 2004, 06:22 AM
Post #4





Group: Members
Posts: 188
Joined: 1-February 04
Member No.: 1,647



QUOTE(Stubear @ Jun 24 2004, 04:59 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

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/

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.
Go to the top of the page
 
+Quote Post
tumnus
post Jun 24 2004, 07:51 AM
Post #5





Group: Members
Posts: 1,176
Joined: 3-October 03
From: UK
Member No.: 547



What about the Handhelds.org Dev Cluster?

http://www.handhelds.org/projects/devcluster.html
Go to the top of the page
 
+Quote Post
lardman
post Jun 24 2004, 07:55 AM
Post #6





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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.
Go to the top of the page
 
+Quote Post
fpp
post Jun 24 2004, 08:29 AM
Post #7





Group: Members
Posts: 188
Joined: 1-February 04
Member No.: 1,647



QUOTE(tumnus @ Jun 24 2004, 07:51 AM)
What about the Handhelds.org Dev Cluster?

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 ?...
Go to the top of the page
 
+Quote Post
fpp
post Jun 24 2004, 08:31 AM
Post #8





Group: Members
Posts: 188
Joined: 1-February 04
Member No.: 1,647



QUOTE(lardman @ Jun 24 2004, 07:55 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.

P.S. I'll try to compile the code later on when I've got some time.

Thanks a lot !
Go to the top of the page
 
+Quote Post
Stubear
post Jun 24 2004, 08:32 AM
Post #9





Group: Members
Posts: 1,164
Joined: 17-December 03
From: Melbourne, AUSTRALIA
Member No.: 1,219



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
Go to the top of the page
 
+Quote Post
fpp
post Jun 24 2004, 09:07 AM
Post #10





Group: Members
Posts: 188
Joined: 1-February 04
Member No.: 1,647



QUOTE(Stubear @ Jun 24 2004, 08:32 AM)
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...
Go to the top of the page
 
+Quote Post
fpp
post Jun 24 2004, 02:01 PM
Post #11





Group: Members
Posts: 188
Joined: 1-February 04
Member No.: 1,647



QUOTE(fpp @ Jun 24 2004, 08:29 AM)
QUOTE(tumnus @ Jun 24 2004, 07:51 AM)
What about the Handhelds.org Dev Cluster?

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 :-)
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 17th September 2014 - 09:41 AM