The generated library Makefiles list the build-tree library outputs in
LIBRARIES, but there is no matching aggregate for the installed shared
libraries. Instead, install and install.libs get their installed-file
prerequisites only from the per-library rules emitted later.

That can miss a library in split installs. For example, after installing a
narrow build first, $(LIBDIR)/libtinfo.so.$(REL_VERSION) already exists.  A
subsequent wide install.libs with --with-termlib=tinfo --with-ticlib can
install libticw, libpanelw, libmenuw and libformw, while not relinking
$(LIBDIR)/libncursesw.so.$(REL_VERSION).

Track the installed shared-library targets separately and make install and
install.libs depend on that aggregate.  This keeps the generated install target
consistent with LIBRARIES and forces all installed shared libraries in the
directory to be considered.

Signed-off-by: Luca Fancellu <[email protected]>
---
 aclocal.m4          | 13 +++++++++++++
 c++/Makefile.in     |  4 ++++
 configure           | 13 +++++++++++++
 form/Makefile.in    |  4 ++++
 menu/Makefile.in    |  4 ++++
 ncurses/Makefile.in |  4 ++++
 panel/Makefile.in   |  4 ++++
 7 files changed, 46 insertions(+)

diff --git a/aclocal.m4 b/aclocal.m4
index 76dd793d1c74..f502b83122cb 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -4842,6 +4842,7 @@ do
 
                SHARED_LIB=
                Libs_To_Make=
+               Libs_To_Install=
                cf_awk_program=
                if test -n "${cf_cv_abi_default}" && test 
"x${cf_cv_abi_default}" != "x5"
                then
@@ -4955,12 +4956,18 @@ CF_EOF
                        fi
                        
cf_add_lib="../lib/${cf_prefix}${cf_libname}${cf_suffix}"
                        Libs_To_Make="$Libs_To_Make $cf_add_lib"
+                       if test "$cf_item" = shared && test "$cf_dir" != c++
+                       then
+                               
cf_add_inst='$(LIBDIR)'"/${cf_prefix}${cf_libname}${cf_suffix}"
+                               Libs_To_Install="$Libs_To_Install $cf_add_inst"
+                       fi
                done
 
                if test "$cf_dir" = ncurses ; then
                        cf_subsets="$LIB_SUBSETS"
                        cf_r_parts="$cf_subsets"
                        cf_liblist="$Libs_To_Make"
+                       cf_instlist="$Libs_To_Install"
 
                        while test -n "$cf_r_parts"
                        do
@@ -4971,9 +4978,11 @@ CF_EOF
                                        case "$cf_l_parts" in
                                        (*termlib*)
                                                cf_add_lib=`echo "$cf_liblist" 
|sed -e s%${LIB_NAME}${ABI_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
+                                               cf_add_inst=`echo 
"$cf_instlist" |sed -e s%${LIB_NAME}${ABI_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
                                                ;;
                                        (*ticlib*)
                                                cf_add_lib=`echo "$cf_liblist" 
|sed -e s%${LIB_NAME}${ABI_SUFFIX}%${TICS_LIB_SUFFIX}%g`
+                                               cf_add_inst=`echo 
"$cf_instlist" |sed -e s%${LIB_NAME}${ABI_SUFFIX}%${TICS_LIB_SUFFIX}%g`
                                                ;;
                                        (*)
                                                break
@@ -4982,6 +4991,9 @@ CF_EOF
                                        if test -n "$cf_add_lib"; then
                                                Libs_To_Make="$cf_add_lib 
$Libs_To_Make"
                                        fi
+                                       if test -n "$cf_add_inst"; then
+                                               Libs_To_Install="$cf_add_inst 
$Libs_To_Install"
+                                       fi
                                else
                                        break
                                fi
@@ -5018,6 +5030,7 @@ CF_EOF
                fi
 
                sed -e "s%@Libs_To_Make@%$Libs_To_Make%" \
+                   -e "s%@Libs_To_Install@%$Libs_To_Install%" \
                    -e "s%@SHARED_LIB@%$SHARED_LIB%" \
                        "$cf_dir/Makefile" >$cf_dir/Makefile.out
                mv "$cf_dir/Makefile.out" "$cf_dir/Makefile"
diff --git a/c++/Makefile.in b/c++/Makefile.in
index f03468bb519b..15746e20ca42 100644
--- a/c++/Makefile.in
+++ b/c++/Makefile.in
@@ -129,6 +129,7 @@ LIBNAME_NORMAL      = @LIB_PREFIX@$(LIBROOT)@[email protected]
 LIBNAME                = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@
 
 LIBRARIES      = @Libs_To_Make@
+INSTALL_LIBRARIES = @Libs_To_Install@
 
 LINT           = @LINT@
 LINT_OPTS      = @LINT_OPTS@
@@ -184,6 +185,9 @@ AUTO_SRC    = \
 all \
 libs ::                $(AUTO_SRC) $(LIBRARIES)
 
+install \
+install.libs :: $(INSTALL_LIBRARIES)
+
 @MAKE_TESTS@all ::             demo$x
 
 depend :
diff --git a/configure b/configure
index 69617e875f69..a843b006a15a 100755
--- a/configure
+++ b/configure
@@ -31413,6 +31413,7 @@ do
 
                SHARED_LIB=
                Libs_To_Make=
+               Libs_To_Install=
                cf_awk_program=
                if test -n "${cf_cv_abi_default}" && test 
"x${cf_cv_abi_default}" != "x5"
                then
@@ -31615,12 +31616,18 @@ eval cf_libname="\$${cf_map_lib_basename}_NAME"
                        fi
                        
cf_add_lib="../lib/${cf_prefix}${cf_libname}${cf_suffix}"
                        Libs_To_Make="$Libs_To_Make $cf_add_lib"
+                       if test "$cf_item" = shared && test "$cf_dir" != c++
+                       then
+                               
cf_add_inst='$(LIBDIR)'"/${cf_prefix}${cf_libname}${cf_suffix}"
+                               Libs_To_Install="$Libs_To_Install $cf_add_inst"
+                       fi
                done
 
                if test "$cf_dir" = ncurses ; then
                        cf_subsets="$LIB_SUBSETS"
                        cf_r_parts="$cf_subsets"
                        cf_liblist="$Libs_To_Make"
+                       cf_instlist="$Libs_To_Install"
 
                        while test -n "$cf_r_parts"
                        do
@@ -31631,9 +31638,11 @@ eval cf_libname="\$${cf_map_lib_basename}_NAME"
                                        case "$cf_l_parts" in
                                        (*termlib*)
                                                cf_add_lib=`echo "$cf_liblist" 
|sed -e s%${LIB_NAME}${ABI_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
+                                               cf_add_inst=`echo 
"$cf_instlist" |sed -e s%${LIB_NAME}${ABI_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
                                                ;;
                                        (*ticlib*)
                                                cf_add_lib=`echo "$cf_liblist" 
|sed -e s%${LIB_NAME}${ABI_SUFFIX}%${TICS_LIB_SUFFIX}%g`
+                                               cf_add_inst=`echo 
"$cf_instlist" |sed -e s%${LIB_NAME}${ABI_SUFFIX}%${TICS_LIB_SUFFIX}%g`
                                                ;;
                                        (*)
                                                break
@@ -31642,6 +31651,9 @@ eval cf_libname="\$${cf_map_lib_basename}_NAME"
                                        if test -n "$cf_add_lib"; then
                                                Libs_To_Make="$cf_add_lib 
$Libs_To_Make"
                                        fi
+                                       if test -n "$cf_add_inst"; then
+                                               Libs_To_Install="$cf_add_inst 
$Libs_To_Install"
+                                       fi
                                else
                                        break
                                fi
@@ -31678,6 +31690,7 @@ eval cf_libname="\$${cf_map_lib_basename}_NAME"
                fi
 
                sed -e "s%@Libs_To_Make@%$Libs_To_Make%" \
+                   -e "s%@Libs_To_Install@%$Libs_To_Install%" \
                    -e "s%@SHARED_LIB@%$SHARED_LIB%" \
                        "$cf_dir/Makefile" >$cf_dir/Makefile.out
                mv "$cf_dir/Makefile.out" "$cf_dir/Makefile"
diff --git a/form/Makefile.in b/form/Makefile.in
index 753e42faad72..f75ad26678fd 100644
--- a/form/Makefile.in
+++ b/form/Makefile.in
@@ -130,6 +130,7 @@ ABI_VERSION = @cf_cv_abi_version@
 RANLIB         = @LIB_PREP@
 
 LIBRARIES      = @Libs_To_Make@
+INSTALL_LIBRARIES = @Libs_To_Install@
 
 LINT           = @LINT@
 LINT_OPTS      = @LINT_OPTS@
@@ -156,6 +157,9 @@ all \
 libs \
 install ::     $(AUTO_SRC) $(LIBRARIES)
 
+install \
+install.libs :: $(INSTALL_LIBRARIES)
+
 check ::
        @echo "no unit-test implemented"
 
diff --git a/menu/Makefile.in b/menu/Makefile.in
index 5f96e76f944c..34cec6f51268 100644
--- a/menu/Makefile.in
+++ b/menu/Makefile.in
@@ -130,6 +130,7 @@ ABI_VERSION = @cf_cv_abi_version@
 RANLIB         = @LIB_PREP@
 
 LIBRARIES      = @Libs_To_Make@
+INSTALL_LIBRARIES = @Libs_To_Install@
 
 LINT           = @LINT@
 LINT_OPTS      = @LINT_OPTS@
@@ -158,6 +159,9 @@ all \
 libs \
 install ::     $(AUTO_SRC) $(LIBRARIES)
 
+install \
+install.libs :: $(INSTALL_LIBRARIES)
+
 check ::
        @echo "no unit-test implemented"
 
diff --git a/ncurses/Makefile.in b/ncurses/Makefile.in
index f3834cfdff4b..a3a08cc4975c 100644
--- a/ncurses/Makefile.in
+++ b/ncurses/Makefile.in
@@ -150,6 +150,7 @@ ABI_VERSION = @cf_cv_abi_version@
 RANLIB         = @LIB_PREP@
 
 LIBRARIES      = @Libs_To_Make@
+INSTALL_LIBRARIES = @Libs_To_Install@
 
 LINT           = @LINT@
 LINT_OPTS      = @LINT_OPTS@
@@ -239,6 +240,9 @@ all libs :: $(AUTO_SRC) ../lib $(LIBRARIES)
 
 @CHECK_BUILD@all libs ::       report_offsets$(BUILD_EXEEXT)
 
+install \
+install.libs :: $(INSTALL_LIBRARIES)
+
 sources:       $(AUTO_SRC)
 
 $(BINDIR) \
diff --git a/panel/Makefile.in b/panel/Makefile.in
index 53abc3625f57..e16a5dd43525 100644
--- a/panel/Makefile.in
+++ b/panel/Makefile.in
@@ -132,6 +132,7 @@ ABI_VERSION = @cf_cv_abi_version@
 RANLIB         = @LIB_PREP@
 
 LIBRARIES      = @Libs_To_Make@
+INSTALL_LIBRARIES = @Libs_To_Install@
 
 LINT           = @LINT@
 LINT_OPTS      = @LINT_OPTS@
@@ -158,6 +159,9 @@ all \
 libs \
 install ::     $(AUTO_SRC) $(LIBRARIES)
 
+install \
+install.libs :: $(INSTALL_LIBRARIES)
+
 check ::
        @echo "no unit-test implemented"
 
-- 
2.34.1


Reply via email to