Francis Galiegue wrote:
> 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.

Hi,

Using native scripts is a very bad idea in my opinion. You would have to 
write a separate file for different versions of windows, different 
versions of linux and different versions of Mac OS X and .bat syntax is 
painfully complex if you want to do anything non-trivial.

By doing this in Java, you stay within the java language realm so you 
don't add the bash/sh/csh/zsh/.bat complexity to the build system, plus 
you can structure the code nicely so others can maintain and understand 
it, regardless of background.

If searching through java.library.path is not enough, then the simple 
fix would be to add to the PlatformJarTask.java some additional search 
paths.

best regards,
Gunnar


> 
> ----
> #!/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?
> 

_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to