bug-libtool
[Top][All Lists]
Advanced

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

incorrect "cannot install xxx to a directory not ending in yyy" error


From: Patrick Ohly
Subject: incorrect "cannot install xxx to a directory not ending in yyy" error
Date: Mon, 30 Nov 2009 18:41:03 +0100

Hello!

I got a pretty weird error message:

$ /bin/sh ../../../libtool   --mode=install /usr/bin/install -c   syncecal.la 
syncebook.la 
'/work/runtests/head-gcc-4.3-i386/install/usr/lib/syncevolution/backends/'
libtool: install: error: cannot install `syncecal.la' to a directory not ending 
in /usr/lib/syncevolution/backends/

Clearly my install directory *does* end in the expected path, so what
the heck?

The relevant code is this:
  # Determine the prefix the user has applied to our future dir.
  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`

set -x to the rescue:

++ echo X/work/runtests/head-gcc-4.3-i386/install/usr/lib/syncevolution/backends
++ /bin/sed -e '1s/^X//' -e 's%/usr/lib/syncevolution/backends/$%%'
+ 
inst_prefix_dir=/work/runtests/head-gcc-4.3-i386/install/usr/lib/syncevolution/backends
+ set +x

The problem is the trailing / in the path that was specified for
syncecal.la: it gets stripped from the destdir somewhere, but not from
libdir, so the sed expression above fails to determine inst_prefix_dir
correctly.

Here's a line that worked for me, with and without the trailing slash:

  # Determine the prefix the user has applied to our future dir.
  inst_prefix_dir=`$ECHO "X$destdir/" | $Xsed -e "s%$libdir/*\$%%"`

It works for up to one trailing slash in $libdir. A better solution
would be to sanitize $libdir before using it as regular expression, like
this:

  # Determine the prefix the user has applied to our future dir.
  libdir_reg_ex=`$ECHO "X$libdir" | $Xsed -e "s%/*\$%%"`
  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir_reg_ex$%%"`

Please include whatever you find more suitable. In the meantime I'll
make sure that our libdir paths don't end in a slash...

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.






reply via email to

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