libnsl: Do not install libnsl.so, libnsl.a if NIS is disabled [BZ #22701]

Message ID 20180111182159.2E32B4070C60A@oldenburg.str.redhat.com
State New
Headers show
Series
  • libnsl: Do not install libnsl.so, libnsl.a if NIS is disabled [BZ #22701]
Related show

Commit Message

Florian Weimer Jan. 11, 2018, 6:21 p.m.
This also skips building the .o files for libnsl.a.

2018-01-11  Florian Weimer  <fweimer@redhat.com>

	* nis/Makefile (install-lib-ldscripts, $(inst_libdir)/libnsl.so):
	Prevent installation of libnsl.so.
	(libnsl-inhibit-o): Do not build (or install) static libraries.

Comments

Carlos O'Donell Jan. 12, 2018, 3:32 a.m. | #1
On 01/11/2018 10:21 AM, Florian Weimer wrote:
> This also skips building the .o files for libnsl.a.
> 
> 2018-01-11  Florian Weimer  <fweimer@redhat.com>
> 
> 	* nis/Makefile (install-lib-ldscripts, $(inst_libdir)/libnsl.so):
> 	Prevent installation of libnsl.so.
> 	(libnsl-inhibit-o): Do not build (or install) static libraries.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> diff --git a/nis/Makefile b/nis/Makefile
> index b828c5ec4d..702c31eb63 100644
> --- a/nis/Makefile
> +++ b/nis/Makefile
> @@ -69,7 +69,15 @@ libnss_nis-inhibit-o	= $(filter-out .os,$(object-suffixes))
>  libnss_nisplus-routines	:= $(addprefix nisplus-,$(databases)) nisplus-parser \
>  			   nss-nisplus nisplus-initgroups
>  libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes))
> -endif
> +
> +else # not $(build-obsolete-nsl)
> +# Pretend that libnsl.so is a linker script, so that the symbolic link
> +# is not installed.
> +install-lib-ldscripts = libnsl.so
> +$(inst_libdir)/libnsl.so:
> +libnsl-inhibit-o = .o # Build no static libnsl.a.
> +
> +endif # not $(build-obsolete-nsl)
>  
>  include ../Rules
>  
>
Andreas Schwab Jan. 12, 2018, 11:31 a.m. | #2
Why not just remove libnsl from extra-libs, making the makefile a true
nop?

Andreas.
Florian Weimer Jan. 12, 2018, 11:53 a.m. | #3
On 01/12/2018 12:31 PM, Andreas Schwab wrote:
> Why not just remove libnsl from extra-libs, making the makefile a true
> nop?

Wouldn't hat drop the library completely?

We need to install libnsl.so.1.  Thorsten's replacement is not 
ABI-compatible, so we still need the glibc version.

Thanks,
Florian
Andreas Schwab Jan. 12, 2018, 4:58 p.m. | #4
On Jan 12 2018, Florian Weimer <fweimer@redhat.com> wrote:

> We need to install libnsl.so.1.

Right, I missed that.

Andreas.

Patch

diff --git a/nis/Makefile b/nis/Makefile
index b828c5ec4d..702c31eb63 100644
--- a/nis/Makefile
+++ b/nis/Makefile
@@ -69,7 +69,15 @@  libnss_nis-inhibit-o	= $(filter-out .os,$(object-suffixes))
 libnss_nisplus-routines	:= $(addprefix nisplus-,$(databases)) nisplus-parser \
 			   nss-nisplus nisplus-initgroups
 libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes))
-endif
+
+else # not $(build-obsolete-nsl)
+# Pretend that libnsl.so is a linker script, so that the symbolic link
+# is not installed.
+install-lib-ldscripts = libnsl.so
+$(inst_libdir)/libnsl.so:
+libnsl-inhibit-o = .o # Build no static libnsl.a.
+
+endif # not $(build-obsolete-nsl)
 
 include ../Rules