libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bindir for libtool


From: Roumen Petrov
Subject: bindir for libtool
Date: Mon, 24 Aug 2009 22:40:40 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.22) Gecko/20090624 SeaMonkey/1.1.17

Hi All,

I would like to share code and test case performed by me to add "bindir" support to libtool. The patch for libtool is attached as file "libtool-origin-bindir.patch". The patch propose absolute path for dlname in la-file. The attached file "bootstrap.sh" is the test case for a dlopen application. Bootstrap script apply following patched to test source tree .
- libtool-libltdl.patch (non required . help to trace dlopen)
- makefile-bindir_rule.patch - changed to automake rules, i.e. add bindir flag to libtool.


Charles Wilson in mails threads add a note that for "GNU Coding Standard".
Libtool create lai-files in link mode. So in install mode is too late to change prefix,bindir or libdir. "libdir" in installed la-file point to "libdir" directory as is set before in link mode.

For install mode the above patch install libraries in correct location - "libdir" for library related files and DLL in "bindir". Note that "libdir" in la-file left unchanged during install. As result dll can't be found even dlname contain relative path. I'm addressing the simple case when user try to override prefix for install.


Regards,
Roumen
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index d8c5749..c1c6acc 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -1129,6 +1129,8 @@ The following components of LINK-COMMAND are treated 
specially:
 
   -all-static       do not do any dynamic linking at all
   -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
   -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
@@ -1475,6 +1477,10 @@ func_mode_install ()
       *) install_cp=false ;;
     esac
 
+    # heuristic location of shared libraries for system without
+    # shared library path variable different from PATH
+    dlbindir=../bin
+
     # We need to accept at least all the BSD install flags.
     dest=
     files=
@@ -1507,16 +1513,29 @@ func_mode_install ()
        stripme=" -s"
        continue
        ;;
+      -bindir)
+       prev=bindir
+       continue
+       ;;
       -*)
        ;;
       *)
        # If the previous option needed an argument, then skip it.
        if test -n "$prev"; then
+         case "$prev" in
+           bindir)
+             dlbindir="$arg"
+             prev=
+             continue
+           ;;
+           *)
          if test "x$prev" = x-m && test -n "$install_override_mode"; then
            arg2=$install_override_mode
            no_mode=false
          fi
          prev=
+           ;;
+         esac
        else
          dest=$arg
          continue
@@ -1696,7 +1715,9 @@ func_mode_install ()
 
          # Do each command in the postinstall commands.
          lib="$destdir/$realname"
-         func_execute_cmds "$postinstall_cmds" 'exit $?'
+         inst_prefix_dir=
+         test -n "$DESTDIR" && inst_prefix_dir=$DESTDIR
+         func_execute_cmds 
"inst_prefix_dir=$inst_prefix_dir~dlbindir=$dlbindir~$postinstall_cmds" 'exit 
$?'
        fi
 
        # Install the pseudo-library for information purposes.
@@ -3674,6 +3695,9 @@ func_mode_link ()
     new_inherited_linker_flags=
 
     avoid_version=no
+    # heuristic location of shared libraries for system without
+    # shared library path variable different from PATH
+    dlbindir=../bin
     dlfiles=
     dlprefiles=
     dlself=no
@@ -3766,6 +3790,11 @@ func_mode_link ()
        esac
 
        case $prev in
+       bindir)
+         dlbindir="$arg"
+         prev=
+         continue
+         ;;
        dlfiles|dlprefiles)
          if test "$preload" = no; then
            # Add the symbol object into the linking commands.
@@ -4027,6 +4056,11 @@ func_mode_link ()
        continue
        ;;
 
+      -bindir)
+       prev=bindir
+       continue
+       ;;
+
       -dlopen)
        prev=dlfiles
        continue
@@ -7721,7 +7755,8 @@ EOF
          # place dlname in correct position for cygwin
          tdlname=$dlname
          case $host,$output,$installed,$module,$dlname in
-           *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | 
*cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+           *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | 
*cegcc*,*lai,yes,no,*.dll)
+             tdlname=$dlbindir/$dlname;;
          esac
          $ECHO > $output "\
 # $outputname - a libtool library file
@@ -7793,16 +7828,33 @@ func_mode_uninstall ()
     rmforce=
     exit_status=0
 
+    # heuristic location of shared libraries for system without
+    # shared library path variable different from PATH
+    dlbindir=../bin
+
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
     libtool_install_magic="$magic"
 
+    prev=
     for arg
     do
       case $arg in
+      -bindir)
+        prev=bindir
+        continue
+        ;;
       -f) RM="$RM $arg"; rmforce=yes ;;
       -*) RM="$RM $arg" ;;
-      *) files="$files $arg" ;;
+      *)
+        case $prev in
+          bindir)
+            dlbindir="$arg"
+            prev=
+            continue
+            ;;
+        esac
+        files="$files $arg" ;;
       esac
     done
 
@@ -7846,6 +7898,7 @@ func_mode_uninstall ()
 
       rmfiles="$file"
 
+      test -n "$DESTDIR" && inst_prefix_dir=$inst_prefix_dir
       case $name in
       *.la)
        # Possibly a libtool archive, so verify it.
@@ -7870,7 +7923,7 @@ func_mode_uninstall ()
          uninstall)
            if test -n "$library_names"; then
              # Do each command in the postuninstall commands.
-             func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || 
exit_status=1'
+             func_execute_cmds 
"inst_prefix_dir=$inst_prefix_dir~dlbindir=$dlbindir~$postuninstall_cmds" 'test 
"$rmforce" = yes || exit_status=1'
            fi
 
            if test -n "$old_library"; then
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 80b5675..ea5d51f 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -480,7 +480,7 @@ tryall_dlopen_module (lt_dlhandle *handle, const char 
*prefix,
   int      error       = 0;
   char     *filename   = 0;
   size_t   filename_len        = 0;
-  size_t   dirname_len = LT_STRLEN (dirname);
+  size_t   dirname_len = (*dlname == '/') ? (size_t)0: LT_STRLEN (dirname);
 
   assert (handle);
   assert (dirname);
@@ -494,7 +494,7 @@ tryall_dlopen_module (lt_dlhandle *handle, const char 
*prefix,
   if (dirname_len > 0)
     if (dirname[dirname_len -1] == '/')
       --dirname_len;
-  filename_len = dirname_len + 1 + LT_STRLEN (dlname);
+  filename_len = (*dlname == '/' ? (size_t)0 : (dirname_len + 1)) + LT_STRLEN 
(dlname);
 
   /* Allocate memory, and combine DIRNAME and MODULENAME into it.
      The PREFIX (if any) is handled below.  */
@@ -502,7 +502,10 @@ tryall_dlopen_module (lt_dlhandle *handle, const char 
*prefix,
   if (!filename)
     return 1;
 
-  sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname);
+  if (*dlname == '/')
+    strncpy (filename, dlname, filename_len + 1);
+  else
+    sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname);
 
   /* Now that we have combined DIRNAME and MODULENAME, if there is
      also a PREFIX to contend with, simply recurse with the arguments
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 3a65ec4..32f4c5d 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2163,10 +2163,15 @@ cygwin* | mingw* | pw32* | cegcc*)
   case $GCC,$host_os in
   yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
     library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    # Install DLL into specified location if path is absolute.
+    # Use -bindir command line argument to set it.
     postinstall_cmds='base_file=`basename \${file}`~
       dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo 
\$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
+      dldir=`dirname \$dlpath`~
+      case \$dldir in
+        /*) dldir=\$inst_prefix_dir\$dlbindir;;
+        *)  dldir=\$destdir;;
+      esac~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
       chmod a+x \$dldir/$dlname~
@@ -2174,7 +2179,11 @@ cygwin* | mingw* | pw32* | cegcc*)
         eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
       fi'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
+      case \$dldll in
+        /*) base_file=`basename \${dldll}`;
+            dlpath=\$inst_prefix_dir\$dlbindir/\$base_file;;
+        *)  dlpath=$dir/\$dldll;;
+      esac~
        $RM \$dlpath'
     shlibpath_overrides_runpath=yes
 
#! /bin/sh

cd `dirname "$0"` || exit $?
#set -e
ARCH=i386
#ltVERSION=2.2.6
ltVERSION=origin
PKG=lt-${ltVERSION}-dlopen

libtoolPREFIX=/usr/local/libtool/${ltVERSION}
automakePREFIX=/usr/local/automake/1.11
autoconfPREFIX=/usr/local/autoconf/2.63
aclocalVERSION=1.11


#===
PATH="$libtoolPREFIX/bin:$PATH"
PATH="$automakePREFIX/bin:$PATH"
PATH="$autoconfPREFIX/bin:$PATH"

aclocal() {
"$automakePREFIX"/bin/aclocal \
  -I "$libtoolPREFIX"/share/aclocal \
  -I "$automakePREFIX"/share/aclocal-${aclocalVERSION} \
  -I /usr/share/aclocal \
  ${1+"$@"}
#  -I "$mingwPREFIX"/share/aclocal \
}


#===
do_lib1() {
  test -d dir1 || mkdir dir1

  cat > dir1/foo.c <<EOF
#include <stdio.h>

extern void libfoo1(void) {
  fprintf(stderr, "foo1\n");
}
EOF

  cat > dir1/Makefile.am <<EOF
lib_LTLIBRARIES = libfoo1.la
libfoo1_la_SOURCES = foo.c
libfoo1_la_LDFLAGS = -no-undefined
EOF
}


do_lib2() {
  test -d dir2 || mkdir dir2

  cat > dir2/foo.c <<EOF
#include <stdio.h>
/* extern void libfoo1(void); */

extern void libfoo2(void) {
  fprintf(stderr, "foo2\n");
/*  fprintf(stderr, "+");  libfoo1(); */
}
EOF

  cat > dir2/Makefile.am <<EOF
lib_LTLIBRARIES = libfoo2.la
libfoo2_la_SOURCES = foo.c
#libfoo2_la_LIBADD = ../dir1/libfoo1.la
libfoo2_la_LDFLAGS = -no-undefined -module
EOF
}


do_appl() {
  test -d appl || mkdir appl

  cat > appl/foo.c <<EOF
#include <ltdl.h>
#include <stdio.h>

int
main (int argc, char* argv[])
{
  int err = 0;
  lt_dlhandle plugin_handle;
  void (*foo_entry)(void);

  if (argc < 2) {
    fprintf (stderr, "usage: %s plugin\n", argv[0]);
    err = 1;
    goto done;
  }

  lt_dlinit ();
  plugin_handle = lt_dlopenext (argv[1]);
  if (plugin_handle == NULL) {
    printf ("plugin failed to open: %s\n", lt_dlerror());
    err = 2;
    goto done;
  }

  printf ("plugin opened successfully!\n");

  foo_entry = lt_dlsym(plugin_handle, argv[1]);
  if (plugin_handle == NULL) {
    printf ("plugin failed to run \"%s\": %s\n", argv[1], lt_dlerror());
    err = 3;
    goto done;
  }

  foo_entry();

done:
  if (plugin_handle != NULL) lt_dlclose (plugin_handle);
  lt_dlexit ();
  return(err);
}
EOF

  cat > appl/Makefile.am <<EOF
bin_PROGRAMS = foo

foo_CPPFLAGS = \$(LTDLINCL)
foo_LDADD = \$(LIBLTDL)
foo_SOURCES = foo.c
EOF
}


do_top() {
  test -d build-aux || mkdir build-aux

  cat > configure.ac <<EOF
AC_INIT([test], [0.0])
AC_PREREQ(2.60)
AC_CONFIG_AUX_DIR(build-aux)

AC_CANONICAL_HOST
AM_INIT_AUTOMAKE

AC_PROG_CC
LT_INIT([shared win32-dll])
LT_CONFIG_LTDL_DIR([libltdl])
LTDL_INIT
# The lt_dladvise_init symbol was added with libtool-2.2
if test "x\$with_included_ltdl" != "xyes"; then
        save_CPPFLAGS="\$CPPFLAGS"
        save_LDFLAGS="\$LDFLAGS"
        CPPFLAGS="\$CFLAGS \$LTDLINCL"
        LDFLAGS="\$LDFLAGS \$LIBLTDL"
        AC_CHECK_LIB([ltdl], [lt_dladvise_init],
                [],
                [AC_MSG_ERROR([installed libltdl is too old])])
        LDFLAGS="\$save_LDFLAGS"
        CPPFLAGS="\$save_CPPFLAGS"
fi

AC_OUTPUT([
 dir1/Makefile
 dir2/Makefile
 appl/Makefile
 Makefile
])
EOF

  cat > Makefile.am <<EOF
AUTOMAKE_OPTIONS = foreign

SUBDIRS = libltdl dir1 dir2 appl
EOF
}


do_bootstrap() {
  do_lib1
  do_lib2
  do_appl
  do_top

  libtoolize --force --copy --automake --ltdl &&
  patch -b -z .ORIG -p0 < libtool-libltdl.patch &&
  aclocal &&
  automake --foreign --add-missing --copy &&
##patch -b -z .ORIG -p0 < libtool-bindir_rule.patch &&
  patch -b -z .ORIG -p0 < makefile-bindir_rule.patch &&
  autoconf
}


do_check () {
  echo === files
  find $1 -type f
  echo +++ data
  find $1 -name *.la -exec grep -nH -e dlname -e libdir \{\} \;
}

#===

case $1 in
  setup)
    do_bootstrap
    find -name '*.lo'  -exec rm -v {} \;
    find -name '*.la'  -exec rm -v {} \;
    find -name '*.lai' -exec rm -v {} \;
    ;;

  config-mingw3)
    ( DIRSUFFIX=mingw3
      test -d .build-$DIRSUFFIX || mkdir .build-$DIRSUFFIX
      cd .build-$DIRSUFFIX
      . /usr/local/src/mingw/mingw-env
      export PATH
      CPPFLAGS=-DLT_DEBUG_LOADERS \
      ../configure \
        --with-included-ltdl \
        --prefix=/tmp/test/pkg/$PKG-$DIRSUFFIX/zero/1 \
        --libdir=/tmp/test/pkg/$PKG-$DIRSUFFIX/zero/2/3 \
        --build=i486-gnu-linux --host=i386-mingw32msvc
    ) ;;
  config-linux)
    ( DIRSUFFIX=linux
      test -d .build-$DIRSUFFIX || mkdir .build-$DIRSUFFIX
      cd .build-$DIRSUFFIX
      CPPFLAGS=-DLT_DEBUG_LOADERS \
      ../configure \
        --prefix=/tmp/test/pkg/$PKG-$DIRSUFFIX/zero/1 \
        --libdir=/tmp/test/pkg/$PKG-$DIRSUFFIX/zero/2/3 \
        --build=i486-gnu-linux
    ) ;;

  make-mingw3)
    ( DIRSUFFIX=mingw3
      cd .build-$DIRSUFFIX
      . /usr/local/src/mingw/mingw-env
      export PATH
      make LDFLAGS='-avoid-version'
    ) ;;
  make-linux)
    ( DIRSUFFIX=linux
      cd .build-$DIRSUFFIX
      make
    ) ;;

  install-mingw3)
    ( DIRSUFFIX=mingw3
      cd .build-$DIRSUFFIX
      . /usr/local/src/mingw/mingw-env
      export PATH
      MAKE="make `echo $1 | sed -e 's|-mingw3$||'`"
#cd dir1

      DESTDIR=/ltdemo
      DESTDIR=
      export DESTDIR
      ROOT=/tmp/test/pkg/$PKG-$DIRSUFFIX
      #NOTE for la-files:
      #- dlname in libfoo1.la is 
'/tmp/test/pkg/lt-origin-dlopen-mingw3/zero/2/3' (!)
      #- libdir in la files is "/tmp/test/pkg/$PKG-$DIRSUFFIX/zero/2/3" (!)

      echo =====================================================================
      rm -rf ${DESTDIR}$ROOT
      make install
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/zero/1/bin              
${DESTDIR}$ROOT/zero/1/bin/foo.exe libfoo1
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/zero/2/3                
${DESTDIR}$ROOT/zero/1/bin/foo.exe libfoo2
      do_check ${DESTDIR}/tmp/test/pkg/$PKG-$DIRSUFFIX
      make uninstall
      do_check ${DESTDIR}/tmp/test/pkg/$PKG-$DIRSUFFIX

      echo =====================================================================
      rm -rf ${DESTDIR}$ROOT
      make install prefix=$ROOT/test1/1/2/3 libdir=$ROOT/test1/a/b/c
      #NOTE test on next line fail as dlname is incorect
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/test1/a/b/c             
${DESTDIR}$ROOT/test1/1/2/3/bin/foo.exe libfoo1
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/test1/1/2/3/bin         
${DESTDIR}$ROOT/test1/1/2/3/bin/foo.exe libfoo1
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/test1/a/b/c             
${DESTDIR}$ROOT/test1/1/2/3/bin/foo.exe libfoo2
      do_check ${DESTDIR}/tmp/test/pkg/$PKG-$DIRSUFFIX
      make uninstall prefix=$ROOT/test1/1/2/3 libdir=$ROOT/test1/a/b/c
      do_check ${DESTDIR}/tmp/test/pkg/$PKG-$DIRSUFFIX

      echo =====================================================================
      case $1 in install*) rm -rf ${DESTDIR}$ROOT;; esac
      make install prefix=$ROOT/test2/common
      #NOTE test on next line fail as dlname is incorect
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/zero/2/3                
${DESTDIR}$ROOT/test2/common/bin/foo.exe libfoo1
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/test2/common/bin        
${DESTDIR}$ROOT/test2/common/bin/foo.exe libfoo1
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/zero/2/3                
${DESTDIR}$ROOT/test2/common/bin/foo.exe libfoo2
      do_check ${DESTDIR}/tmp/test/pkg/$PKG-$DIRSUFFIX
      make uninstall prefix=$ROOT/test2/common
      do_check ${DESTDIR}/tmp/test/pkg/$PKG-$DIRSUFFIX

      echo =====================================================================
      case $1 in install*) rm -rf ${DESTDIR}$ROOT;; esac
      make install prefix=$ROOT/test3/common bindir=$ROOT/test3/1/2/3 
libdir=$ROOT/test3/a/b/c
      #NOTE test on next line fail as dlname is incorect
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/test3/a/b/c             
${DESTDIR}$ROOT/test3/1/2/3/foo.exe libfoo1
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/test3/1/2/3             
${DESTDIR}$ROOT/test3/1/2/3/foo.exe libfoo1
      LTDL_LIBRARY_PATH=${DESTDIR}$ROOT/test3/a/b/c             
${DESTDIR}$ROOT/test3/1/2/3/foo.exe libfoo2
      do_check ${DESTDIR}/tmp/test/pkg/$PKG-$DIRSUFFIX
      make uninstall prefix=$ROOT/test3/common bindir=$ROOT/test3/1/2/3 
libdir=$ROOT/test3/a/b/c
      do_check ${DESTDIR}/tmp/test/pkg/$PKG-$DIRSUFFIX
    ) ;;
  install-linux)
    ( DIRSUFFIX=linux
      cd .build-$DIRSUFFIX
      MAKE="make `echo $1 | sed -e 's|-linux$||'`"

      ROOT=/tmp/test/pkg/$PKG-$DIRSUFFIX
      #NOTE for la-files:
      #- libdir in la files is "/tmp/test/pkg/$PKG-$DIRSUFFIX/zero/2/3" (!)

      echo =====================================================================
      case $1 in install*) rm -rf $ROOT;; esac
      make install
      LTDL_LIBRARY_PATH=$ROOT/zero/2/3          $ROOT/zero/1/bin/foo libfoo1
      LTDL_LIBRARY_PATH=$ROOT/zero/2/3          $ROOT/zero/1/bin/foo libfoo2
      do_check $ROOT
      make uninstall
      do_check $ROOT

      echo =====================================================================
      case $1 in install*) rm -rf $ROOT;; esac
      make install prefix=$ROOT/test1/1/2/3 libdir=$ROOT/test1/a/b/c
      LTDL_LIBRARY_PATH=$ROOT/test1/a/b/c       $ROOT/test1/1/2/3/bin/foo 
libfoo1
      LTDL_LIBRARY_PATH=$ROOT/test1/a/b/c       $ROOT/test1/1/2/3/bin/foo 
libfoo2
      do_check $ROOT
      make uninstall prefix=$ROOT/test1/1/2/3 libdir=$ROOT/test1/a/b/c
      do_check $ROOT

      echo =====================================================================
      case $1 in install*) rm -rf $ROOT;; esac
      make install prefix=$ROOT/test2/common
      LTDL_LIBRARY_PATH=$ROOT/zero/2/3          $ROOT/test2/common/bin/foo 
libfoo1
      LTDL_LIBRARY_PATH=$ROOT/zero/2/3          $ROOT/test2/common/bin/foo 
libfoo2
      do_check $ROOT
      make uninstall prefix=$ROOT/test2/common
      do_check $ROOT

      echo =====================================================================
      case $1 in install*) rm -rf $ROOT;; esac
      make install prefix=$ROOT/test3/common bindir=$ROOT/test3/1/2/3 
libdir=$ROOT/test3/a/b/c
      LTDL_LIBRARY_PATH=$ROOT/test3/a/b/c       $ROOT/test3/1/2/3/foo libfoo1
      LTDL_LIBRARY_PATH=$ROOT/test3/a/b/c       $ROOT/test3/1/2/3/foo libfoo2
      do_check $ROOT
      make uninstall prefix=$ROOT/test3/common bindir=$ROOT/test3/1/2/3 
libdir=$ROOT/test3/a/b/c
      do_check $ROOT
    ) ;;
esac
--- libltdl/ltdl.c.ORIG 2009-08-19 00:18:55.000000000 +0300
+++ libltdl/ltdl.c      2009-08-19 01:40:03.000000000 +0300
@@ -1320,12 +1320,21 @@
        {
          const char *search_path = user_search_path;
 
+#ifdef LT_DEBUG_LOADERS
+         fprintf (stderr, "try_dlopen user_search_path=%s\n",
+                  search_path ? search_path : "(null)");
+#endif
          if (search_path)
            file = find_file (user_search_path, base_name, &dir);
 
          if (!file)
            {
              search_path = getenv (LTDL_SEARCHPATH_VAR);
+#ifdef LT_DEBUG_LOADERS
+             fprintf (stderr, "try_dlopen LTDL_SEARCHPATH_VAR[%s]=%s\n",
+                      LTDL_SEARCHPATH_VAR,
+                      search_path ? search_path : "(null)");
+#endif
              if (search_path)
                file = find_file (search_path, base_name, &dir);
            }
@@ -1334,6 +1343,11 @@
          if (!file)
            {
              search_path = getenv (LT_MODULE_PATH_VAR);
+#ifdef LT_DEBUG_LOADERS
+             fprintf (stderr, "try_dlopen LT_MODULE_PATH_VAR[%s]=%s\n",
+                      LT_MODULE_PATH_VAR,
+                      search_path ? search_path : "(null)");
+#endif
              if (search_path)
                file = find_file (search_path, base_name, &dir);
            }
@@ -1341,6 +1355,10 @@
 #if defined(LT_DLSEARCH_PATH)
          if (!file && *sys_dlsearch_path)
            {
+#ifdef LT_DEBUG_LOADERS
+             fprintf (stderr, "try_dlopen sys_dlsearch_path=%s\n",
+                      sys_dlsearch_path ? sys_dlsearch_path : "(null)");
+#endif
              file = find_file (sys_dlsearch_path, base_name, &dir);
            }
 #endif
--- dir1/Makefile.in.ORIG       2009-08-21 02:07:50.000000000 +0300
+++ dir1/Makefile.in    2009-08-21 02:46:27.000000000 +0300
@@ -265,8 +265,8 @@
          else :; fi; \
        done; \
        test -z "$$list2" || { \
-         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install 
$(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
-         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install 
$(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install 
$(INSTALL) $(INSTALL_STRIP_FLAG) -bindir $(bindir) $$list2 
'$(DESTDIR)$(libdir)'"; \
+         DESTDIR=$(DESTDIR) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) -bindir $(bindir) $$list2 
"$(DESTDIR)$(libdir)"; \
        }
 
 uninstall-libLTLIBRARIES:
@@ -274,8 +274,8 @@
        @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
        for p in $$list; do \
          $(am__strip_dir) \
-         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall 
rm -f '$(DESTDIR)$(libdir)/$$f'"; \
-         $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f 
"$(DESTDIR)$(libdir)/$$f"; \
+         echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall 
rm -f -bindir $(bindir) '$(DESTDIR)$(libdir)/$$f'"; \
+         DESTDIR=$(DESTDIR) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=uninstall rm -f -bindir $(bindir) "$(DESTDIR)$(libdir)/$$f"; \
        done
 
 clean-libLTLIBRARIES:
@@ -287,7 +287,7 @@
          rm -f "$${dir}/so_locations"; \
        done
 libfoo1.la: $(libfoo1_la_OBJECTS) $(libfoo1_la_DEPENDENCIES) 
-       $(libfoo1_la_LINK) -rpath $(libdir) $(libfoo1_la_OBJECTS) 
$(libfoo1_la_LIBADD) $(LIBS)
+       $(libfoo1_la_LINK) -bindir $(bindir) -rpath $(libdir) 
$(libfoo1_la_OBJECTS) $(libfoo1_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]