On Fri, Mar 06, 2009 at 05:30:22PM +0100, Ralf Wildenhues wrote: > Hello Francesco, > > * Francesco Paolo Lovergine wrote on Fri, Mar 06, 2009 at 04:59:02PM CET: > > While trying to build gdal with the experimental libtool > > I found that in --mode=link the -shared mod-arg is stripped by 2.2 and that > > renders gdal ruby binding no more buildable. > > > > make -f RubyMakefile.mk build > > make[1]: Entering directory > > `/users/frankie/debian/debian-gis/gdal/gdal-1.6.0/swig/ruby' > > /bin/sh /users/frankie/debian/debian-gis/gdal/gdal-1.6.0/libtool > > --mode=link g++ -fPIC -DPIC -shared -L/usr/lib -L/usr/lib -lgeos_c > > -I/usr/include -lsqlite3 -lodbc -lodbcinst -L/usr/lib -lexpat -L/usr/lib > > -lxerces-c -lpthread -ljasper -lhdf5 -lmfhdf -ldf -logdi -lgif -ljpeg > > -ltiff -lpng -lnetcdf -lpq -L/usr/lib -lpq -lz -lpthread -lm -lrt -ldl > > -lcurl -rdynamic -L/usr/lib/mysql -lmysqlclient > > -L/users/frankie/debian/debian-gis/gdal/gdal-1.6.0 -lgdal1.6.0 -lruby1.8 > > gdal_wrap.o -o gdal.so > > This line looks wrong. The Makefile should invoke libtool somehow like > this: > .../libtool --mode=link g++ -o gdal.la -module -avoid-version -rpath ... > -L... -l... > > There is no need to pass -shared, -fPIC, -DPIC, and the actual name of > the library. If you do all of that, then you can pretty much just not > use libtool, and invoke g++ directly. The point of using libtool is to > get portably the various system-dependent spellings of the above flags. > > And the -rpath argument is to specify the directory where the module > will be installed to, not an rpath that will be put into this library > (just in case that wasn't clear). > > That being said, the -shared argument is eaten by libtool because it is > interpreted by libtool, but not in the way GCC interprets it (see the > Libtool manual for details). In order to pass flags by libtool, > directly to the compiler driver or to the linker, you can use > '-Wc,FLAG', '-Wl,FLAG', '-Xcompiler FLAG', or '-Xlinker FLAG' > In this case, > -Xcompiler -shared > > would be appropriate (and backward-compatible to Libtool 1.5.x). > > Hope that helps. Please reassign this bug to the package you're > building (gdal?). >
Thanks, -Wc,-shared or -Xcompiler fixes the issue, I was looking for something like that. And I agree about the bad usage of libtool, but properly fixing that is an upstream issue... -- Francesco P. Lovergine -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

