From: Bruno Haible Date: Fri, 17 Nov 2023 11:40:54 +0000 (+0100) Subject: build: Fix a build issue on AIX. X-Git-Tag: v0.22.4~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e705d78bc85746da667fb01d5e1526491f1b1892;p=thirdparty%2Fgettext.git build: Fix a build issue on AIX. How to reproduce: $ cd gettext-20231111 $ ~/build-64-gcc --disable-shared $ (cd build-64-gcc && gmake install) $ cd .. $ cd gettext-0.22.3 $ ~/build-64-gcc => Fails with "ERROR: Undefined symbol: .syntax_check_message_list" because the link uses $PREFIX/lib/libgettextsrc.a, which is a non-shared library that does not export 'syntax_check_message_list'. * gettext-tools/configure.ac (INSTALL_PRIVATE_LIBRARIES): New conditional. * gettext-tools/src/Makefile.am (noinst_LTLIBRARIES): Define as alternative to lib_LTLIBRARIES. (install-exec-clean): Remove rule. * gettext-tools/gnulib-lib/Makefile.am (lib_LTLIBRARIES): Initialize. * gnulib-local/modules/gettext-tools-misc (Makefile.am): Define noinst_LTLIBRARIES as alternative to lib_LTLIBRARIES. Remove 'install-exec-clean' rule. --- diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index e3aa58abd..4a4203c76 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -129,6 +129,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 e9c517fe9..ab729cdde 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 3850e2509..f77129d6f 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 \ @@ -351,14 +357,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: