libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linking against static instead of shared libs


From: Benoit Sigoure
Subject: Linking against static instead of shared libs
Date: Tue, 19 Dec 2006 10:13:20 +0100
User-agent: Internet Messaging Program (IMP) H3 (4.0.2)

Hello folks.

I'm trying to distribute a project that depends on several libraries and in
order to make it easier to end users, I'd like to provide them with
self-contained binaries linked against static libs (so that they don't have to
install these libs).

I ran ./configure --disable-shared && make clean all LDFLAGS='-static
-all-static' and ended up with this:

/bin/sh ../../../../libtool --tag=CC --mode=link gcc -Wall -Wno-unused-label
-Wno-unused-variable -Wno-unused-function -Wno-unused-parameter
-DDEFAULT_XTC_REPOSITORY="\"/usr/local/share/xrm/XTC\"" -g -O2  -static
-all-static -o pctl-to-abox  pctl-to-abox.o
-L/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib
-L/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib -lstratego-lib
-lstratego-lib-native -lstratego-runtime -lm -lATerm  
-L/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib
-L/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib
-lstratego-runtime -lm -lATerm  
-L/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib -lATerm  
-L/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib
-L/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib -lstratego-xtc
-lstratego-lib -lstratego-lib-native -lstratego-runtime -lm -lATerm  
-L/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib
-L/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib -lstratego-lib
-lstratego-lib-native -lstratego-runtime -lm -lATerm  
-L/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib
-L/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib
-lstratego-runtime -lm -lATerm  
-L/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib -lATerm
mkdir .libs
gcc -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function
-Wno-unused-parameter -DDEFAULT_XTC_REPOSITORY=\"/usr/local/share/xrm/XTC\" -g
-O2 -static -o pctl-to-abox pctl-to-abox.o 
-L/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib
-L/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib
/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib/libstratego-xtc.so
-L/nix/store/99xjvlhngd4a4ljj7pdnk1fhi3x4z5qw-aterm-2.4.2/lib
/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib/libstratego-lib.so
/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib/libstratego-lib-native.so
/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib/libstratego-runtime.so
/nix/store/99xjvlhngd4a4ljj7pdnk1fhi3x4z5qw-aterm-2.4.2/lib/libATerm.so -lm
/nix/store/1m81p5qp9khb0bjscfmwgk8k0w6kq1h8-aterm-2.4.2/lib/libATerm.so
/usr/bin/ld: attempted static link of dynamic object
`/nix/store/09058krddyr8vwqk97yqz47jd111x1xl-strategoxt/lib/libstratego-xtc.so'
collect2: ld returned 1 exit status

I don't know why libtool always wants to pick up the .so instead of the .a, for
each lib I use I have the .la and .a along with the .so (in the same folder).

In case you ask, the project I'm trying to distribute is available (GPL) at
https://svn.lrde.epita.fr/svn/xrm/trunk/ but it has many dependencies that are
"hard" to install (because it uses the Stratego language so you'd need to
install the Stratego Compiler if you want to try to reproduce my problem. BTW
the Stratego Compiler produces standard C99 code that I then compile with GCC).

libtool --version = ltmain.sh (GNU libtool) 1.5.22 Debian 1.5.22-4 (1.1220.2.365
2005/12/18 22:14:06)

Thanks

-- 
SIGOURE Benoit aka Tsuna
   _____
  /EPITA\ Promo 2008, LRDE





reply via email to

[Prev in Thread] Current Thread [Next in Thread]