From 95148614026da7353721411dd020d024667e3482 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Wed, 3 Feb 2021 18:42:06 +0000 Subject: bfd, opcodes, libctf: support --with-included-gettext Right now, these libraries hardwire -L../intl -lintl on a few fixed platforms, which works fine on those platforms but on other platforms leads to shared libraries that lack libintl_* symbols when configured --with-included-gettext, and/or static libraries that contain libintl as *another* static library. If we instead use the LIBINTL variable defined in ../intl/config.intl, this gives us the right thing on all three classes of platform (gettext in libc, gettext in system libintl, gettext in ../intl/libintl.a).. This also means we can rip out some Darwin-specific machinery from configure.ac and also simplify the Cygwin side. This also means that the libctf testsuite (and other places that include libbfd, libopcodes or libctf) don't need to grow libintl dependencies just on account of those libraries (though they still need such dependencies if they themselves use gettext machinery). bfd/ChangeLog 2021-02-03 Nick Alcock * configure.ac (SHARED_LIBADD): Remove explicit -lintl population in favour of LIBINTL. * configure: Regenerated. libctf/ChangeLog 2021-02-02 Nick Alcock * configure.ac (CTF_LIBADD): Remove explicit -lintl population in favour of LIBINTL. * Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly include $(LIBINTL). (check-DEJAGNU): Pass down to tests as well. * configure: Regenerated. * Makefile.in: Likewise. opcodes/ChangeLog 2021-02-04 Nick Alcock * configure.ac (SHARED_LIBADD): Remove explicit -lintl population in favour of LIBINTL. * configure: Regenerated. --- opcodes/ChangeLog | 6 ++++++ opcodes/configure | 8 +++++++- opcodes/configure.ac | 8 +++++++- 3 files changed, 20 insertions(+), 2 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 24d063a..fa1830e 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2021-02-04 Nick Alcock + + * configure.ac (SHARED_LIBADD): Remove explicit -lintl population in + favour of LIBINTL. + * configure: Regenerated. + 2021-02-08 Mike Frysinger * tic54x-dis.c (sprint_mmr): Change to tic54x_mmregs. diff --git a/opcodes/configure b/opcodes/configure index a0934e1..d17d254 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -12798,15 +12798,21 @@ if test "$enable_shared" = "yes"; then # Note that linking against libbfd as we do here, which is itself linked # against libiberty, may not satisfy all the libopcodes libiberty references # since libbfd may not pull in the entirety of libiberty. +# Also, jam libintl into the right place in all of this: after libiberty, +# which uses it, but before -lcygwin, which it uses. x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` if test -n "$x"; then SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" fi +fi + +SHARED_LIBADD="$SHARED_LIBADD $LIBINTL" +if test "$enable_shared" = "yes"; then case "${host}" in *-*-cygwin*) SHARED_LDFLAGS="-no-undefined" - SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin" + SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" ;; *-*-darwin*) SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}" diff --git a/opcodes/configure.ac b/opcodes/configure.ac index 2192979..c19d2f8 100644 --- a/opcodes/configure.ac +++ b/opcodes/configure.ac @@ -166,17 +166,23 @@ if test "$enable_shared" = "yes"; then # Note that linking against libbfd as we do here, which is itself linked # against libiberty, may not satisfy all the libopcodes libiberty references # since libbfd may not pull in the entirety of libiberty. +# Also, jam libintl into the right place in all of this: after libiberty, +# which uses it, but before -lcygwin, which it uses. changequote(,)dnl x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` changequote([,])dnl if test -n "$x"; then SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" fi +fi + +SHARED_LIBADD="$SHARED_LIBADD $LIBINTL" +if test "$enable_shared" = "yes"; then case "${host}" in *-*-cygwin*) SHARED_LDFLAGS="-no-undefined" - SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin" + SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD" ;; *-*-darwin*) SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}" -- cgit v1.1