Re: Static and dynamic linkage

2007-12-04 Thread Frantisek Dufka
[EMAIL PROTECTED] wrote:
> 
> Which would mean having to deal with SQLite as a dependency of this 
> package...
> 

I have similar problem with ScummVM. I really do not want to deal with 
all the dependencies and maintain them in Maemo extras repository so I 
am linking libmad, Tremor, FLAC, libmpeg etc. statically.

I don't know how to easily solve static vs dynamic linking flags too so 
my solution was to compile and install all those libraries inside 
scratchbox only statically (i.e. no .so, just .a) and point scummvm to 
them so linker does not find their dynamic libraries at all. Then you 
don't need to mess with linking flags and package builds fine.

Frantisek
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Static and dynamic linkage

2007-12-03 Thread maemo
On Thu, 29 Nov 2007, Guillem Jover wrote:

> Better do something like:
> 
>   $ gcc -o test \
>   -lsomedynamiclib \
>   -Wl,-Bstatic -lsomestaticlib -Wl,-Bdynamic \
>   -lsomeotherdynamiclib \
>   ...
> 
> > > Specifically, I want to statically link in the SQLite library but leave 
> > > the rest of the linkage as is.
> 
> I'd say better not to statically link at all.


Which would mean having to deal with SQLite as a dependency of this 
package...




-- 
Aj.

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Static and dynamic linkage

2007-12-03 Thread maemo
On Wed, 28 Nov 2007, Eero Tamminen wrote:

> Just specify the static library you want to link with:
>   gcc -o test -lsomedynamiclib my-static-libs/foobar.a


Using autotools?


-- 
Aj.

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Static and dynamic linkage

2007-11-29 Thread Guillem Jover
On Wed, 2007-11-28 at 10:19:17 +0200, ext Eero Tamminen wrote:
> [EMAIL PROTECTED] wrote:
> > Is there a standard way to ask for a specific library to be linked in 
> > statically and the rest to be dynamic?
> 
> Just specify the static library you want to link with:
>   gcc -o test -lsomedynamiclib my-static-libs/foobar.a

Better do something like:

  $ gcc -o test \
  -lsomedynamiclib \
  -Wl,-Bstatic -lsomestaticlib -Wl,-Bdynamic \
  -lsomeotherdynamiclib \
  ...

> > Specifically, I want to statically link in the SQLite library but leave 
> > the rest of the linkage as is.

I'd say better not to statically link at all.

regards,
guillem
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Static and dynamic linkage

2007-11-28 Thread Frantisek Dufka
[EMAIL PROTECTED] wrote:
> Is there a standard way to ask for a specific library to be linked in 
> statically and the rest to be dynamic?
> 
> Specifically, I want to statically link in the SQLite library but leave 
> the rest of the linkage as is.
> 

It may work in your case but in general there may be unexpected issues 
when mixing this especially when using c++
check http://www.trilithium.com/johan/2005/06/static-libstdc/

Also in plain C linking some library foo statically while linking other 
library bar dynamically that is already linked dynamically to foo (and 
similar variations of this when using multiple dependent libraries) may 
give you unexpected issues both at link time and also later at run time.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Static and dynamic linkage

2007-11-28 Thread Eero Tamminen
Hi,

ext [EMAIL PROTECTED] wrote:
> Is there a standard way to ask for a specific library to be linked in 
> statically and the rest to be dynamic?

Just specify the static library you want to link with:
gcc -o test -lsomedynamiclib my-static-libs/foobar.a


> Specifically, I want to statically link in the SQLite library but leave 
> the rest of the linkage as is.


- Eero
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Static and dynamic linkage

2007-11-27 Thread maemo

Is there a standard way to ask for a specific library to be linked in 
statically and the rest to be dynamic?

Specifically, I want to statically link in the SQLite library but leave 
the rest of the linkage as is.



-- 
A

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers