-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

in the auxililary library gwenhywfar we've added a new feature: The
runtime paths are now looked up in a relocatable way, i.e. the --prefix
at runtime doesn't necessarily have to be the same as the --prefix at
compile time. This is implemented by the help of the "binreloc" source
snippet, and in any case it's a pure additional feature - if it doesn't
work, the code will always fall back to the conventional compiled-in paths.

If you want to test this: Apply the attached patch which simply adds a
number of printf's. Then install gwenhywfar as normal (I did this with
- --prefix=/home/stimming/usr) and in src/, run the ./testlib, which will
give you this output:

$ ./testlib
br_init_lib: Found /home/stimming/usr/lib/libgwenhywfar.so.38.7.1
br_find_prefix: Returning /home/stimming/usr
br_find_prefix: Returning /home/stimming/usr
br_find_prefix: Returning /home/stimming/usr
get_plugindir: Found /home/stimming/usr/lib/gwenhywfar/plugins/38
Check 1 ...PASSED.

which says the binreloc code could successfully lookup the installation
location of the libgwenhywfar.so file at runtime, and it derived the
$prefix and the plugindir accordingly. So far, so good. Now change the
actual install prefix, like this:

  mv $HOME/usr $HOME/ussr

which will clearly fail if we still relied on the compiled-in paths. But
with the latest SVN code (and the necessary LD_LIBRARY_PATH), you will get

$ LD_LIBRARY_PATH=$HOME/ussr/lib ./testlib
br_init_lib: Found /home/stimming/ussr/lib/libgwenhywfar.so.38.7.1
br_find_prefix: Returning /home/stimming/ussr
br_find_prefix: Returning /home/stimming/ussr
br_find_prefix: Returning /home/stimming/ussr
get_plugindir: Found /home/stimming/ussr/lib/gwenhywfar/plugins/38
Check 1 ...PASSED.

which says the binreloc code could successfully lookup the *changed*
installation location, and it derived the $prefix and plugindir
accordingly. VoilĂ .

Note that this won't work for *compiling* a derived application with
such a changed installation path though, but this whole feature is
designed for *running* an application at an arbitrary installation path,
as is used by http://www.autopackage.org . Also note that this feature
is used on Linux/Unix only (no idea about Mac OSX); on Windows, we've
been looking up the paths from registry keys that have been written at
install-time.

Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRSy43WXAi+BfhivFAQJfnQP/SrnxFAxbicBRWlZZVQJ+epLn0hy4lZhr
EOtR2BSw+Iohf7EaVNn3DszRuWV+fComsJJAgDs8dns8DRRtuvG7WYsyWGT18Q02
B4o8KN6c93HgFCrA+LG9DCzP/VKmupptJ9ULzCnlGjq8iBsWR+qwmjbtrCwHI7tM
TJMHBf5oVHo=
=7s7G
-----END PGP SIGNATURE-----
Index: testlib.c
===================================================================
--- testlib.c   (revision 1095)
+++ testlib.c   (working copy)
@@ -6,9 +6,9 @@
 #include <gwenhywfar/debug.h>
 #include <gwenhywfar/md.h>
 #include <gwenhywfar/padd.h>
+#include "gwenhywfar.h"
 
 
-
 int check1() {
   const char *testString="01234567890123456789";
   int rv;
@@ -320,6 +320,7 @@
   else
     cmd="check";
 
+  GWEN_Init();
   if (strcasecmp(cmd, "check")==0) {
     rv=check1();
     if (rv)
Index: gwenhywfar.c
===================================================================
--- gwenhywfar.c        (revision 1096)
+++ gwenhywfar.c        (working copy)
@@ -533,6 +533,7 @@
   free (pkglibdir);
   free (tmp);
 
+  printf("get_plugindir: Found %s\n", result);
   return result;
 }
 
Index: binreloc.c
===================================================================
--- binreloc.c  (revision 1095)
+++ binreloc.c  (working copy)
@@ -313,6 +313,7 @@
 br_init (BrInitError *error)
 {
        exe = _br_find_exe (error);
+       printf("br_init: Found %s\n", exe);
        return exe != NULL;
 }
 
@@ -335,6 +336,7 @@
 br_init_lib (BrInitError *error)
 {
        exe = _br_find_exe_for_symbol ((const void *) "", error);
+       printf("br_init_lib: Found %s\n", exe);
        return exe != NULL;
 }
 
@@ -420,6 +422,7 @@
        dir1 = br_dirname (exe);
        dir2 = br_dirname (dir1);
        free (dir1);
+       printf("br_find_prefix: Returning %s\n", dir2);
        return dir2;
 }
 
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Aqbanking-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aqbanking-devel

Reply via email to