+2008-10-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Atomic shared library install permissions on HP-UX.
+ The HP-UX 11 runtime linker fails to mmap shared libraries
+ without execute permissions. Fixing them with postinstall_cmds
+ may be too late, as ln, sed, and chmod may link against the
+ library being installed.
+
+ * libltdl/m4/libtool.m4 (install_override_mode): New LT_DECL.
+ (_LT_SYS_DYNAMIC_LINKER) [hpux9*, hpux10*, hpux11*]: Set it.
+ * libltdl/config/ltmain.m4sh (func_mode_install): Build a second
+ command line, $install_shared_prog, for the installation of the
+ shared library. Override resp. set the permission mode if
+ install_override_mode is nonempty.
+ * doc/libtool.texi (libtool script contents): Document it.
+ * tests/install.at (Install tests): New test.
+ * Makefile.am (TESTSUITE_AT): Adjust.
+ (TESTS_ENVIRONMENT): Pass INSTALL.
+ Report by Bruno Haible.
+
2008-09-26 Eric Blake <ebb9@byu.net>
Avoid gcc warning.
tests/archive-in-archive.at \
tests/execute-mode.at \
tests/localization.at \
+ tests/install.at \
tests/destdir.at \
tests/old-m4-iface.at \
tests/am-subdir.at \
TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
- STRIP="$(STRIP)" \
+ STRIP="$(STRIP)" INSTALL="$(INSTALL)" \
OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
Set to @samp{yes} or @samp{no}. Default is @samp{no}.
@end defvar
+@defvar install_override_mode
+Permission mode override for installation of shared libraries. If the
+runtime linker fails to load libraries with wrong permissions, then it
+may fail to execute programs that are needed during installation,
+because these need the library that has just been installed. In this
+case, it is necessary to pass the mode to @command{install} with
+@option{-m @var{install_override_mode}}.
+@end defvar
+
@defvar libext
The standard old archive suffix (normally @samp{a}).
@end defvar
# Aesthetically quote it.
func_quote_for_eval "$arg"
install_prog="$install_prog$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
# We need to accept at least all the BSD install flags.
dest=
install_type=
isdir=no
stripme=
+ no_mode=:
for arg
do
+ arg2=
if test -n "$dest"; then
files="$files $dest"
dest=$arg
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
prev=
else
dest=$arg
# Aesthetically quote the argument.
func_quote_for_eval "$arg"
install_prog="$install_prog $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
done
test -z "$install_prog" && \
test -n "$prev" && \
func_fatal_help "the \`$prev' option requires an argument"
+ if test -n "$install_override_mode" && $no_mode; then
+ func_quote_for_eval "$install_override_mode"
+ install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
+ fi
+
if test -z "$files"; then
if test -z "$dest"; then
func_fatal_help "no file or destination specified"
test -n "$relink_command" && srcname="$realname"T
# Install the shared library and build the symlinks.
- func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
'exit $?'
tstripme="$stripme"
case $host_os in
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
;;
interix[[3-9]]*)
The last name is the one that the linker finds with -lNAME]])
_LT_DECL([], [soname_spec], [1],
[[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
_LT_DECL([], [postinstall_cmds], [2],
[Command to use after installation of a shared archive])
_LT_DECL([], [postuninstall_cmds], [2],
--- /dev/null
+# install.at -- install mode tests -*- Autotest -*-
+#
+# Copyright (C) 2008 Free Software Foundation, Inc.
+# Written by Ralf Wildenhues, 2008
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+####
+
+AT_SETUP([Install tests])
+AT_KEYWORDS([libtool])
+
+# Ensure that install_override_mode overrides the mode of the shared
+# library (and only the shared library).
+
+AT_CHECK([$LIBTOOL --features | grep 'enable shared libraries' || exit 77],
+ [], [ignore])
+sed 's,^\(install_override_mode=\).*,&755,' < $LIBTOOL > ./libtool
+LIBTOOL=./libtool
+chmod a+rx $LIBTOOL
+
+inst=`pwd`/inst
+mkdir inst
+
+echo 'int a () { return 0; }' > a.c
+$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c a.c
+$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo -rpath $inst
+AT_CHECK([$LIBTOOL --mode=install $INSTALL liba.la $inst],
+ [], [stdout], [ignore])
+AT_CHECK([grep ' -m 755' stdout], [], [ignore])
+AT_CHECK([$LIBTOOL --mode=install $INSTALL -m 644 liba.la $inst],
+ [], [stdout], [ignore])
+AT_CHECK([grep ' -m 755' stdout], [], [ignore])
+AT_CHECK([grep ' -m 644.*liba.la' stdout], [], [ignore])
+
+AT_CLEANUP