Subject: GD Library on MIPS Processor

From: Inpreet Singh <[email-masked]>
Date: Thu, 28 Apr 2005 20:20:23 +0530

Sir I am using gd library on Linux intel processor sucessfully but now I
want to do same on MIPS. I don't know to how install, configure and test
gd library on MIPS. Sir please give me some clue or link to study for
the same.
 
I tried to configure gd library compilation using following command from
linux intel processor:
 
./configure --host=mips
and it makes Makefile with some differences
***************************************************
host_triplet = mips-unknown-elf
host = mips-unknown-elf
host_alias = mips
host_cpu = mips
***************************************************
Now I tried to build a example using this Makefile "make gddemo". What I
expect that it will create gddemo binary that will output in correctly
on MIPS processor. But when I run this binary on MIPS it is showing
errors.
**************************************************************
/launchpad # ./gddemo
./gddemo: 1: Syntax error: "(" unexpected
**************************************************************
Also I have downloaded debian packages for gd library on MIPS processor
but don't know how to install them. I tried dpkg command but it shows no
such command. So sir please help me out.
So please help me how should I proceed.
Regards
 
Inpreet singh

---

From: "Stuart Longland" <[email-masked]>
Date: Fri, 29 Apr 2005 06:51:02 -0000 (Local time zone must be set--see zic manual page)

Okay, before I start... can you please turn off HTML message composition?
Some users here don't take kindly to HTML email. ;-)

> I tried to configure gd library compilation using following command from

Try ./configure --host=mips-unknown-linux-gnu (or mips-unknown-linux-uclibc if
you use µClibc).  Setting --build and --target may help too.

> and it makes Makefile with some differences

I'm not sure what's going on there... but I'd presume it's related to the
wrong `host` option being set.

Also, make sure you run the compiled binaries on the MIPS machine... they
won't work on x86 (you'll get a "cannot execute binary file" error message).

> So please help me how should I proceed.

That's odd.  Do you have Debian installed correctly on the MIPS machine?  What
version/distribution did you install?

- --
+-------------------------------------------------------------+
| Stuart Longland -oOo- http://stuartl.longlandclan.hopto.org |
| Atomic Linux Project     -oOo-    http://atomicl.berlios.de |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| I haven't lost my mind - it's backed up on a tape somewhere |
+-------------------------------------------------------------+

---

From: Inpreet Singh <[email-masked]>
Date: Fri, 29 Apr 2005 13:43:58 +0530

I want to use gd library on MIPS processor. Due to limited memory on mips, I
cannot compile gd library on it. So I need to compile it on linux intel
processor and transfer executable files on MIPS. I have compiled gd library
on intel linux and successfully tested it. But how to compile gd library for
MIPS processor? I tried to configure it with these commands
1. ./configure --host=mips-unknown-linux-gnu
2. ./configure --host=mips-linux
3. ./configure --host=mips-linux --build=mips-linux --target=mips-linux
4. ./configure --host=mips-linux --build=mips-linux

but none of them had worked for me. Whenever after compiling I place my
executables and try to test them, they fails to return results.

gd library after configure command dynamically generates Makefile. Now
method to test your application which you have to write in a c program is so
make this program with this Makefile. Lets suppose you make an example and
name it as test.c so what you have to do is enter test.c in this dynamically
generated Makefile and write command make test this will outputs in test
executable file. Which we can run using command ./test on our command
prompt.

Whenever I perform this task it always shows errors:
**************************************************************
/launchpad # ./gddemo
./gddemo: 1: Syntax error: "(" unexpected
**************************************************************
eval: 1: gcc: not found
**************************************************************
I have used Source-Navigator and tried to compile my project using mips
compiling option but doesn't workout. So please help me. please tell me what
is best procedure to compile and test gd library on MIPS processor when due
to memory limitation I cannot compile project on MIPS itself, on my MIPS
processor I have installed linux with very limited command set.
_____________________________________________________________________
Regards
Inpreet Singh

---

From: Ulrich Eckhardt <[email-masked]>
Date: Fri, 29 Apr 2005 12:09:33 +0200

Inpreet Singh wrote:
> I want to use gd library on MIPS processor. Due to limited memory on mips,
> I cannot compile gd library on it. So I need to compile it on linux intel
> on intel linux and successfully tested it. But how to compile gd library
> for MIPS processor? I tried to configure it with these commands

If you're building on Linux/x86, using '--build=mips-linux' is obviously 
completely bogus.

> executables and try to test them, they fails to return results.

This could have another reason, see below...

> method to test your application which you have to write in a c program is
> so make this program with this Makefile. Lets suppose you make an example
> and name it as test.c so what you have to do is enter test.c in this
> dynamically generated Makefile and write command make test this will
> outputs in test executable file. Which we can run using command ./test on
> our command prompt.
>

If this program gives this message, then it is running. Why it gives it is a 
totally unrelated thing. 

 Now, what could also be the case is that you didn't grab the executable but a 
script. Autotools usually generate a script in the builddir that setup the 
runtime linker so it finds the (not yet installed) libraries and then calls 
the executable inside the hidden .lib directory.

If this all fails, create a minimal hello-world and compile it with
'mips-linux-gcc -Wall -o hw hello.c' and try that on the host machine.

Uli