A Little Assistance With Libraries...


naerylan

Still Fresh
Joined
Jul 6, 2006
Messages
7
This is probably going to sound very newb-ish to all you masterful coders here, but... how the heck do you add new libraries to your ARM toolchain? :huh:
I mean, the ones I have are great; I think I'm finally getting the hang of the whole SDL/C++ thing.
But SDL (and a few choice others) is about all I've got: I haven't the foggiest idea how one might take, say, zziplib for example, and turn it from a ball of source code into something I can link with my own GP2X project. I considered rebooting to Debian and trying to work out how to cross-compile there, but I just spent quite a bit of time learning how to make this shiny new Code::Blocks package do things and I'd like to continue using it if possible. :unsure:

A long and frustrating search of the forum history reveals that either no one has ever discussed the problem or I'm too dense to get the keywords right. I suspect the latter. Also the handful of times that zziplib has specifically come up, the context of the post suggests the guy in question already had it working, easily even.

I know I'm missing something simple... In theory all you'd have to do to produce the lib is compile with the same tools (arm-linux-c++, etc) that work for games and such, right? But the source has one of those crazy autoconf/makefile thingies I can never wrap my brain around. Working from WinXP, how do you even run the ./configure? The Minsys directory looked promising until I tried it out and got completely lost. :blink: Somehow there has to be a way to configure this thing, I just can't see how.

Any help would be appreciated; I hope to resolve this soon so I can finally get my projects going. Thanks in advance (and also many, many thanks to those kind folks who put together all the prebuilt stuff I'm working with currently ^^).
 
Hmm... I feel invisible. All this time and no one has said a single thing? Not a "here's how you do it", no "I don't know" or even so much as a "go freaking google it and leave us alone"?

The mysteries continue to pile up... I even installed cygwin and soon realized I had no idea how to make it work either. Sad, huh? :unsure:

So here's where I'm at - the Open2x files are all where they should be, but how exactly do you tell a *specific* program, with its own configure script, where and how to find the ARM compiler, and where to place the resulting library after it compiles? I've never seen a generalized, step by step guide on how to do that. The one page I did locate was talking about changing a file called "config.sub", but I don't have any file like that and I can't seem to figure out whether I should write one myself, nor what should go into it.

Any ideas? Comments? Flames? I'll take anything at this point. :)
 
Hi, I am not to clear on linking yet either so if anyone can correct me please do. ;)

I would download the prebuilt libraries and not the sourcecode, zziplib-0.10.82-msvc6-lib.zip is the name from sourceForge. Then try and link it as you would SDL Image. :)


I have hardly any knowledge of makefiles and configure so I cant really help.

Here are some tutorials you might find useful about them though.

This one is for compiling in linux -
http://www.codecoffee.com/tipsforlinux/articles/27.html

One for makefiles
http://www.cprogramming.com/tutorial/makefiles.html
 
NnT042 said:
Hmm... I feel invisible. All this time and no one has said a single thing? Not a "here's how you do it", no "I don't know" or even so much as a "go freaking google it and leave us alone"?

The mysteries continue to pile up... I even installed cygwin and soon realized I had no idea how to make it work either. Sad, huh? :unsure:

So here's where I'm at - the Open2x files are all where they should be, but how exactly do you tell a *specific* program, with its own configure script, where and how to find the ARM compiler, and where to place the resulting library after it compiles? I've never seen a generalized, step by step guide on how to do that. The one page I did locate was talking about changing a file called "config.sub", but I don't have any file like that and I can't seem to figure out whether I should write one myself, nor what should go into it.

Any ideas? Comments? Flames? I'll take anything at this point. :)
I ain't exactly the expert either, but I'll try to help you anyway :)

You're using Code::Blocks, so choose File > New > Project. Select "static library" from the templates and click through the wizard window. It'll give you an example, so if you compile (Ctrl+F9 obv.) you get a lib<insert_name_here>.a file. Link that to your project (with the right .h file of course) and you should be good to go.
 
Last edited by a moderator:
Uprising said:
Hi, I am not to clear on linking yet either so if anyone can correct me please do. ;)

I would download the prebuilt libraries and not the sourcecode, zziplib-0.10.82-msvc6-lib.zip is the name from sourceForge. Then try and link it as you would SDL Image. :)

Well, the trouble with the prebuilt file you refer to is that it's compiled for "x86" processors, and I want one that I can link with my "arm920t" program. (also the author says 0.10.x is buggy and shouldn't be used) Thanks for the makefile tutorial though, it was pretty informative. If possible, I would like to test the lib from Windows, but I'm going to figure it out one architecture at a time.

For the record, I have essentially ruled out using CodeBlocks to compile this library. You can indeed start a "library project" but the problem is that the source to zzip is put together by the mysterious and byzantine makefiles generated by Autoconf. I've since installed a Cygwin environment on my other PC, and within it extracted the prebuilt Open2x tools and libraries.
So the questions I have are these...
How do you inform a "./configure" of the fact that the compiler I want it to use is not the default (mingw32, I believe), but rather the arm-gp2x-whatever located under /opt/open2x?
And further, that when it finishes the compiling I want the lipzzip.[ah] moved to where they need to be for that compiler to find them later, when my own program calls upon them?
What options is the compiler supposed to have for building gp2x programs, and why?

I swear if I ever get this thing put together I'm uploading the binary to the archive so other newbie programmers can benefit from it. ;)
 
Last edited by a moderator:
I apologize for bumping my own thread, but I really need to figure this out sooner or later, and I'd prefer sooner.

What I've got so far is this:
* A Cygwin environment with Open2x installed in it.
* A very basic idea of the sort of options I can give the configure script
* This error:

CODE
$ ./configure --prefix=/opt/open2x/gcc-4.1.1-glibc-2.3.6 --build=`uname -m` --h
ost=gp2x --enable-static --enable-shared
checking build system type... i686-pc-none
checking host system type... arm-gp2x-linux-gnu
checking target system type... arm-gp2x-linux-gnu
checking for gsed... sed
continue configure in default builddir ./arm-gp2x-linux-gnu
checking default prefix system... is /opt-package
...using thread-safe linkage
checking zlib install prefix... none
checking rpm spec file... ../zziplib.spec
checking for spec package... zziplib
checking for spec version... 0.12.83
checking for spec license type... GNU LGPL (fallback)
checking for spec summary... ZZipLib - libZ-based ZIP-access Library
checking for spec category... Development/Libraries
checking for spec icon... zziplib-icon.png (fallback)
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for mawk... no
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for gp2x-gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot cr
eate executables

What am I doing wrong? I set my PATH and CFLAGS and everything the way this guy says to (and yes, I know he's not using the same tools, but this is literally the ONLY reference material I can find on the whole interweb. I tried to adapt it to my situation after failing to get any help elsewhere). Config.log says this:
CODE
configure:2423: checking for C compiler version
configure:2426: gcc --version </dev/null >&5
gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2429: $? = 0
configure:2431: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/configure --ver
bose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libe
xecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-langu
ages=c,ada,c++,d,f77,pascal,java,objc --enable-nls --without-included-gettext --
enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-
awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-thre
ads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptio


among other things. Why is configure testing the native compiler anyway when it should be *cross* compiling in the first place?

Can anyone explain what I should do differently?
 
If you are still having trouble, I recommend going onto IRC. You are more likely to get a response there. (EFnet #gp2xdev).
 
Back
Top