[xmlsec] link error on linux (NSS)

Tejkumar Arora tej at netscape.com
Mon May 12 00:27:28 PDT 2003


  Would you mind checking in this hack to set
-rpath for NSS/NSPR if GNU ld is used?...

thanks,
-Tej


Index: configure.in
===================================================================
RCS file: /cvs/gnome/xmlsec/configure.in,v
retrieving revision 1.63
diff -u -r1.63 configure.in
--- configure.in	5 May 2003 15:02:49 -0000	1.63
+++ configure.in	12 May 2003 07:21:08 -0000
@@ -445,7 +445,12 @@
        if test "$with_nspr" != "" ; then
           NSPR_PREFIX="$with_nspr"
           NSPR_CFLAGS="-I$with_nspr/include"
-         NSPR_LIBS="-L$with_nspr/lib $NSPR_LIBS_LIST"
+         if test "$with_gnu_ld" = yes
+         then
+           NSPR_LIBS="-Wl,-rpath -Wl,$with_nspr/lib -L$with_nspr/lib
$NSPR_LIBS_LIST"
+         else
+           NSPR_LIBS="-L$with_nspr/lib $NSPR_LIBS_LIST"
+         fi
           NSPR_LDADDS="-L$with_nspr/lib $NSPR_LIBS_LIST"
           NSPR_INCLUDES_FOUND="yes"
           NSPR_LIBS_FOUND="yes"
@@ -472,7 +477,12 @@
                 if test "$dir" = "/usr/lib" ; then
                    NSPR_LIBS="$NSPR_LIBS_LIST"
                 else
-                  NSPR_LIBS="-L$dir $NSPR_LIBS_LIST"
+                  if test "$with_gnu_ld" = yes
+                  then
+                     NSPR_LIBS="-Wl,-rpath -Wl,$dir -L$dir
$NSPR_LIBS_LIST"
+                  else
+                     NSPR_LIBS="-L$dir $NSPR_LIBS_LIST"
+                  fi
                 fi
                 NSPR_LIBS_FOUND="yes"
                 break
@@ -509,7 +519,12 @@
      if test "$with_nss" != "" ; then
         NSS_PREFIX="$with_nss"
         NSS_CFLAGS="-I$with_nss/include"
-       NSS_LIBS="-L$with_nss/lib $NSS_LIBS_LIST"
+       if test "$with_gnu_ld" = yes
+       then
+          NSS_LIBS="-Wl,-rpath -Wl,$with_nss/lib -L$with_nss/lib
$NSS_LIBS_LIST"
+       else
+          NSS_LIBS="-L$with_nss/lib $NSS_LIBS_LIST"
+       fi
         NSS_LDADDS="-L$with_nss/lib $NSS_LIBS_LIST"
         NSS_INCLUDES_FOUND="yes"
         NSS_LIBS_FOUND="yes"
@@ -535,7 +550,12 @@
               if test "$dir" = "/usr/lib" ; then
                  NSS_LIBS="$NSS_LIBS_LIST"
               else
-                NSS_LIBS="-L$dir $NSS_LIBS_LIST"
+                if test "$with_gnu_ld" = yes
+                then
+                   NSS_LIBS="-Wl,-rpath -Wl,$dir -L$dir
$NSS_LIBS_LIST"
+                else
+                   NSS_LIBS="-L$dir $NSS_LIBS_LIST"
+                fi
               fi
               NSS_LIBS_FOUND="yes"
               break





Aleksey Sanin wrote:

 > In your case, '-rpath' is added by libtool. You are linking with
 > '-lxmlsec1' and
 > libtool processes libxmlsec1.la and inserts necessary flags. NSS does
 > not use
 > autoconf/libtool/... and it does not create *.la files. As the result
 > libtool links directly
 > with *.so files.
 >
 > Aleksey
 >
 > Tejkumar Arora wrote:
 >
 > > What's needed is the -rpath linker option for the NSS libraries.
 > > Does anyone know why libtool inserts -rpath options for XMLSEC,
 > > LIBXSLT, and LIBXML2 but not for NSS?.  Is there some hint
 > > in configure.in that makes -rpath happen?. I couldn't find that 
hint...
 > >
 > > make logs are below....
 > >
 > > thanks.
 > > -Tej
 > >
 >





More information about the xmlsec mailing list