diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 74e92ca56..a135ae6d0 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -130,6 +130,13 @@ case "$host_os" in esac AM_CONDITIONAL([WINDOWS_NATIVE], [test $is_windows_native = yes]) +dnl Package-private libraries do not need to be installed when we build only +dnl static libraries. Don't install them in this case. This avoids a build +dnl error on AIX with --enable-shared, when some other version of GNU gettext, +dnl built with --disable-shared, is already installed in the same $prefix and +dnl the CFLAGS or LDFLAGS happen to contain "-L$prefix/lib". +AM_CONDITIONAL([INSTALL_PRIVATE_LIBRARIES], [test "$enable_shared" = yes]) + dnl Checks for libraries. dnl These are the only lines required to internationalize the package. diff --git a/gettext-tools/gnulib-lib/Makefile.am b/gettext-tools/gnulib-lib/Makefile.am index 6b9d43f9b..83eca02aa 100644 --- a/gettext-tools/gnulib-lib/Makefile.am +++ b/gettext-tools/gnulib-lib/Makefile.am @@ -26,6 +26,7 @@ DISTCLEANFILES = MAINTAINERCLEANFILES = SUFFIXES = +lib_LTLIBRARIES = noinst_LTLIBRARIES = # Extra files to be installed. diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index ba7f045af..a71d5e26f 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -33,7 +33,13 @@ recode-sr-latin noinst_PROGRAMS = hostname urlget cldr-plurals +if INSTALL_PRIVATE_LIBRARIES +# Specify that libgettextsrc should be installed in $(libdir). lib_LTLIBRARIES = libgettextsrc.la +else +# Specify that libgettextsrc should not be installed. +noinst_LTLIBRARIES = libgettextsrc.la +endif noinst_HEADERS = \ pos.h message.h po-error.h po-xerror.h po-gram.h po-charset.h \ @@ -356,14 +362,6 @@ if RELOCATABLE_VIA_LD libgettextsrc_la_LDFLAGS += `$(RELOCATABLE_LDFLAGS) $(libdir)` endif -# No need to install libgettextsrc.a, except on AIX. -install-exec-hook: install-exec-clean -install-exec-clean: - case "@host_os@" in \ - aix*) ;; \ - *) $(RM) $(DESTDIR)$(libdir)/libgettextsrc.a ;; \ - esac - # Compile-time flags for particular source files. msgmerge_CFLAGS = $(AM_CFLAGS) $(OPENMP_CFLAGS) msgmerge_CXXFLAGS = $(AM_CXXFLAGS) $(OPENMP_CFLAGS) diff --git a/gnulib-local/modules/gettext-tools-misc b/gnulib-local/modules/gettext-tools-misc index 6e9b3412c..3975ac676 100644 --- a/gnulib-local/modules/gettext-tools-misc +++ b/gnulib-local/modules/gettext-tools-misc @@ -10,8 +10,13 @@ configure.ac: Makefile.am: -# Specify that libgettextlib should installed in $(libdir). -lib_LTLIBRARIES = libgettextlib.la +if INSTALL_PRIVATE_LIBRARIES +# Specify that libgettextlib should be installed in $(libdir). +lib_LTLIBRARIES += libgettextlib.la +else +# Specify that libgettextlib should not be installed. +noinst_LTLIBRARIES += libgettextlib.la +endif # Need $(LTLIBUNISTRING) because ulc_width_linebreaks, uc_width, etc. may be # taken from libunistring, when the configure option --with-libunistring-prefix @@ -31,14 +36,6 @@ lib_LDFLAGS += -Wl,--export-all-symbols AM_CPPFLAGS += @GETTEXTLIB_EXPORTS_FLAGS@ endif -# No need to install libgettextlib.a, except on AIX. -install-exec-local: install-libLTLIBRARIES install-exec-clean -install-exec-clean: - case "@host_os@" in \ - aix*) ;; \ - *) rm -f $(DESTDIR)$(libdir)/libgettextlib.a ;; \ - esac - Include: License: