Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
155 user(s) are online (131 user(s) are browsing Forums)

Members: 3
Guests: 152

Petrol, Mr_byte, NinjaCyborg, more...

Support us!

Headlines

 
  Register To Post  

Help me make a tutorial on compiling shared objects!
Just can't stay away
Just can't stay away


See User information
I've been away for a while as you all know...

And since i left some things have changed/I never really learnt how to properly compile shared objects.
I know that extra care has to be taken when compiling shared objects, but i don't know how to do it.

Could someone here walk me through compiling a lib?

Preferably this lib, as this is what i need:
http://sourceforge.net/projects/libircclient/

I will then make a guide out of it and include it in my porting for dummies guide, for all to benefit from!

Thanks!

Go to top
Re: Help me make a tutorial on compiling shared objects!
Amigans Defender
Amigans Defender


See User information
Quote:

I will then make a guide out of it and include it in my porting for dummies guide, for all to benefit from!

I think this kind of information should be on the AmigaOS Documentation Wiki including your "porting guide".

ExecSG Team Lead
Go to top
Re: Help me make a tutorial on compiling shared objects!
Just can't stay away
Just can't stay away


See User information
@spotUP

When compiling a .so on AmigaOS the deplib_check_method and link_all_deplibs settings need to be changed in the configured generated libtool to pass_all and yes respectively:
Quote:

# Method to check whether dependent libraries are shared objects.
deplibs_check_method="pass_all"

# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=yes


I also like to set need_version and version_type so that an API version number is appended to the name of the .so file:
Quote:

# Do we need a version for libraries?
need_version=yes

# Library versioning type.
version_type=freebsd-elf


If the configure script generates a really weird libtool that tries to create some kind of .ixlibrary file instead of a .so file then I usually just copy in a working libtool from another project instead.

Go to top
Re: Help me make a tutorial on compiling shared objects!
Just can't stay away
Just can't stay away


See User information
so i edit the configure script before configuring or how do you set these?

Go to top
Re: Help me make a tutorial on compiling shared objects!
Just can't stay away
Just can't stay away


See User information
ssolie, yea, it might be a good idea, but as it is now it is a combination of scripts and an amigaguide. amigaguides can be converted to html with a tool, but the scripts and the installer is harder.. but yes, it holds a lot of info for the non-programmer to port apps.

Go to top
Re: Help me make a tutorial on compiling shared objects!
Just can't stay away
Just can't stay away


See User information
spotUP: generally speaking, when building a shared object, the library should be compiled with -fPIC (position independent code) option, and linked with -shared switch.

Later on, when you link the .so with your app, you use -use-dynld switch.

IIRC.

Go to top
Re: Help me make a tutorial on compiling shared objects!
Amigans Defender
Amigans Defender


See User information
Further to what salass00 said, you can also set env-vars rather than editing the libtool script.

I just use this, and it seems to work fine:
setenv SAVE lt_cv_deplibs_check_method pass_all

Go to top
Re: Help me make a tutorial on compiling shared objects!
Just can't stay away
Just can't stay away


See User information
Chris, wow, that's an elegant solution, and it works?

Go to top
Re: Help me make a tutorial on compiling shared objects!
Amigans Defender
Amigans Defender


See User information
Yes, it does. You'll probably want to set the versioning type as well though, and I'm not sure if there's an env-var for that.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project