[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using a different C++ Standard Library
From: |
Liviu Nicoara |
Subject: |
Using a different C++ Standard Library |
Date: |
Tue, 13 Dec 2005 12:17:38 -0700 |
User-agent: |
Mozilla Thunderbird 1.0.7 (X11/20050923) |
Hello all,
I have problems in trying to get libtool to use the C++ standard library
I want.
I have my own C++ stdlib created with gcc on Linux. This library is
compiled using gcc and linked with gcc; the only C++ library it links is
libsupc++ which provides the language support. This C++ standard library
is built using its own infrastructure, not autotools based.
I want to use this library further in building another library - this
library has an autotools based infrastructure. I indicate the include
paths and the link paths and libraries (my stdlib and libsupc++) via
CXXFLAGS, LDFLAGS, etc. in configure.ac and I see all the flags and
options PRESENT in the Makefiles. Also, I set CXX to gcc in configure.ac
in order to prevent the usage of g++. This results in the compilation of
the library sources going as (trimmed for clarity):
../libtool --tag=CXX --mode=compile gcc -DHAVE_CONFIG_H -I. -I..
-I/build/nicoara/11d-mystdlib/include
-I/build/nicoara/11d-mystdlib/include/ansi -g ......
gcc -DHAVE_CONFIG_H -I. -I.. -I/build/nicoara/11d-mystdlib/include
-I/build/nicoara/11d-mystdlib/include/ansi -g ........
But the linking goes like this:
../libtool --tag=CXX --mode=link gcc -g
-L/build/nicoara/11d-mystdlib/lib -lmystdlib -o libtools.la -rpath
/usr/local/lib lib.lo
g++ -shared -nostdlib
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crti.o
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/crtbeginS.o .libs/lib.o
-Wl,--rpath -Wl,/usr/lib/. -Wl,--rpath -Wl,/usr/lib/.
-L/usr/lib/gcc-lib/i486-slackware-linux/../..
-L/usr/lib/gcc-lib/i486-slackware-linux/../../../i486-slackware-linux/lib
-L/usr/i486-slackware-linux/lib -L/usr/i486-slackware-linux/bin
-L/build/nicoara/11d-mystdlib/lib -lmystdlib
-L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4
-L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/lib
-L/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../..
/usr/lib/./libstdc++.so -lm -lc -lgcc_s
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/crtendS.o
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../crtn.o -Wl,-soname
-Wl,libtools.so.0 -o .libs/libtools.so.0.0.0
My stdlib is buried deep within the list of lib paths and the linking
process uses g++ although please notice that both compilation and
linking phase use --tag=CXX and only the link uses g++. The end result
is that I end up with symbols linked in from both gnu's stdc++ and my
stdlib.
My approach is probably fundamentally flawed as a consequence of my
limited understanding of libtool's inner workings.
Any suggestion in how to implement this building process is welcome.
Specifically I am interested in how to instruct the building process to
use the C compiler instead of the C++ one when using my stdlib and/or
how to instruct (force?) libtool in not bringing in the compiler's C++
stdlib (GNU) in the link phase.
Thanks,
Liviu
- Using a different C++ Standard Library,
Liviu Nicoara <=