Hello,
Right now, Java is used to compute the library search path when
creating the native jar. But that does not work very well in some
cases, such as here, where libstdc++.so is not anywhere in
java.library.path.
Why not use native scripts to compute the search path instead? Here is
one that works for Linux, using only simple commands.
----
#!/bin/bash
which gcc &>/dev/null
if [ "$?" != "0" ]; then
echo >&2 "gcc not found! Cannot continue"
exit 1
fi
ALL="$(gcc -print-search-dirs | grep "^libraries:")"
ALL=${ALL#*=}
ALL="$LD_LIBRARY_PATH:$ALL"
echo $ALL | sed 's,:,\n,g' | while read dir; do
#
# Some paths may not exist
#
if [ ! -d $dir ]; then
continue
fi
D=$( (cd $dir && pwd -P) )
echo $D
done | sort | uniq
exit 0
---
We then just need to <exec failonerror="true"> in ant, put the result
in a file, and we're set. There is still the need for a simple Java
file that will output the java.library.path system property since ant
doesn't know about it (even though the ant manual says that all system
properties are supposedly available - that's the case of os.name,
os.arch and many others, just not this one...).
Comments?
--
Francis Galiegue, [email protected]
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest