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.
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.
MAINTAINERCLEANFILES =
SUFFIXES =
+lib_LTLIBRARIES =
noinst_LTLIBRARIES =
# Extra files to be installed.
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 \
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)
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
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: