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.
This commit is contained in:
Bruno Haible 2023-11-17 12:40:54 +01:00
parent c3ea4fe91e
commit f20aed4cb1
4 changed files with 21 additions and 18 deletions

View File

@ -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.

View File

@ -26,6 +26,7 @@ DISTCLEANFILES =
MAINTAINERCLEANFILES =
SUFFIXES =
lib_LTLIBRARIES =
noinst_LTLIBRARIES =
# Extra files to be installed.

View File

@ -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)

View File

@ -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: