+2021-01-05 Nick Alcock <nick.alcock@oracle.com>
+
+ * configure.ac (BFD_LIBADD): Remove.
+ (BFD_DEPENDENCIES): Likewise. Remove associated cases.
+ (SHARED_LIBADD): Rename to...
+ (CTF_LIBADD): ... this. Stick in a suitable libiberty even when
+ linking statically.
+ * Makefile.am (libctf_nobfd_la_LIBADD): Adjust accordingly.
+ libctf uses libintl.
+ (libctf_la_LIBADD): Reference libbfd.la directly, not via
+ BFD_LIBADD.
+ (libctf_la_DEPENDENCIES): Remove.
+ * Makefile.in: Regenerate.
+ * configure: Likewise.
+
2021-01-05 Nick Alcock <nick.alcock@oracle.com>
* ctf-decl.c (ctf_decl_push): Exclude slices from the decl stack.
noinst_LTLIBRARIES = libctf.la libctf-nobfd.la
endif
-libctf_nobfd_la_LIBADD = @SHARED_LIBADD@ $(ZLIB)
+libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(LIBINTL) $(ZLIB)
libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@
libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c \
libctf_nobfd_la_SOURCES += ctf-qsort_r.c
endif
-libctf_la_LIBADD = @BFD_LIBADD@ $(libctf_nobfd_la_LIBADD)
+libctf_la_LIBADD = ../bfd/libbfd.la $(libctf_nobfd_la_LIBADD)
libctf_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=0
-libctf_la_DEPENDENCIES = @BFD_DEPENDENCIES@
libctf_la_LDFLAGS = $(libctf_nobfd_la_LDFLAGS)
libctf_la_SOURCES = $(libctf_nobfd_la_SOURCES) ctf-open-bfd.c
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
am__DEPENDENCIES_1 =
-libctf_nobfd_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+libctf_nobfd_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
am__libctf_nobfd_la_SOURCES_DIST = ctf-archive.c ctf-dump.c \
ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c \
ctf-dedup.c ctf-link.c ctf-lookup.c ctf-open.c ctf-sha1.c \
-o $@
@INSTALL_LIBBFD_FALSE@am_libctf_nobfd_la_rpath =
@INSTALL_LIBBFD_TRUE@am_libctf_nobfd_la_rpath = -rpath $(libdir)
-am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+libctf_la_DEPENDENCIES = ../bfd/libbfd.la $(am__DEPENDENCIES_2)
am__libctf_la_SOURCES_DIST = ctf-archive.c ctf-dump.c ctf-create.c \
ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-dedup.c \
ctf-link.c ctf-lookup.c ctf-open.c ctf-sha1.c ctf-string.c \
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
-BFD_DEPENDENCIES = @BFD_DEPENDENCIES@
-BFD_LIBADD = @BFD_LIBADD@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CTF_LIBADD = @CTF_LIBADD@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEFS = @DEFS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHARED_LDFLAGS = @SHARED_LDFLAGS@
-SHARED_LIBADD = @SHARED_LIBADD@
SHELL = @SHELL@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
@INSTALL_LIBBFD_FALSE@include_HEADERS =
@INSTALL_LIBBFD_TRUE@include_HEADERS = $(INCDIR)/ctf.h $(INCDIR)/ctf-api.h
@INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libctf.la libctf-nobfd.la
-libctf_nobfd_la_LIBADD = @SHARED_LIBADD@ $(ZLIB)
+libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(LIBINTL) $(ZLIB)
libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@
libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c \
ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-dedup.c \
ctf-link.c ctf-lookup.c ctf-open.c ctf-sha1.c ctf-string.c \
ctf-subr.c ctf-types.c ctf-util.c $(am__append_1)
-libctf_la_LIBADD = @BFD_LIBADD@ $(libctf_nobfd_la_LIBADD)
+libctf_la_LIBADD = ../bfd/libbfd.la $(libctf_nobfd_la_LIBADD)
libctf_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=0
-libctf_la_DEPENDENCIES = @BFD_DEPENDENCIES@
libctf_la_LDFLAGS = $(libctf_nobfd_la_LDFLAGS)
libctf_la_SOURCES = $(libctf_nobfd_la_SOURCES) ctf-open-bfd.c
all: config.h
LTLIBOBJS
LIBOBJS
VERSION_FLAGS
-BFD_DEPENDENCIES
-BFD_LIBADD
-SHARED_LIBADD
+CTF_LIBADD
SHARED_LDFLAGS
NEED_CTF_QSORT_R_FALSE
NEED_CTF_QSORT_R_TRUE
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11523 "configure"
+#line 11521 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11629 "configure"
+#line 11627 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
fi
# Horrible hacks to build DLLs on Windows and a shared library elsewhere.
-SHARED_LIBADD=
+
+CTF_LIBADD="-L`pwd`/../libiberty -liberty"
SHARED_LDFLAGS=
-BFD_LIBADD=
-BFD_DEPENDENCIES=
if test "$enable_shared" = "yes"; then
# When building a shared libctf, link against the pic version of libiberty
# so that apps that use libctf won't need libiberty just to satisfy any
# since libbfd may not pull in the entirety of libiberty.
x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'`
if test -n "$x"; then
- SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
+ CTF_LIBADD="-L`pwd`/../libiberty/pic -liberty"
fi
case "${host}" in
# More hacks to build DLLs on Windows.
*-*-cygwin*)
SHARED_LDFLAGS="-no-undefined"
- SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
- BFD_LIBADD="-L`pwd`/../bfd -lbfd"
- ;;
-
- *-*-darwin*)
- BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib"
- BFD_DEPENDENCIES="../bfd/libbfd.la"
- ;;
- *)
- case "$host_vendor" in
- hp)
- BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl"
- ;;
- *)
- BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so"
- ;;
- esac
- BFD_DEPENDENCIES="../bfd/libbfd.la"
+ CTF_LIBADD="$CTF_LIBADD -L`pwd`/../intl -lintl -lcygwin"
;;
esac
fi
-
-
# Use a version script, if possible, or an -export-symbols-regex otherwise.
VERSION_FLAGS='-export-symbols-regex ctf_.*'
if $LD --help 2>&1 | grep -- --version-script >/dev/null; then
fi
# Horrible hacks to build DLLs on Windows and a shared library elsewhere.
-SHARED_LIBADD=
+
+CTF_LIBADD="-L`pwd`/../libiberty -liberty"
SHARED_LDFLAGS=
-BFD_LIBADD=
-BFD_DEPENDENCIES=
if test "$enable_shared" = "yes"; then
# When building a shared libctf, link against the pic version of libiberty
# so that apps that use libctf won't need libiberty just to satisfy any
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"
+ CTF_LIBADD="-L`pwd`/../libiberty/pic -liberty"
fi
case "${host}" in
# More hacks to build DLLs on Windows.
*-*-cygwin*)
SHARED_LDFLAGS="-no-undefined"
- SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
- BFD_LIBADD="-L`pwd`/../bfd -lbfd"
- ;;
-
- *-*-darwin*)
- BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib"
- BFD_DEPENDENCIES="../bfd/libbfd.la"
- ;;
- *)
- case "$host_vendor" in
- hp)
- BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl"
- ;;
- *)
- BFD_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so"
- ;;
- esac
- BFD_DEPENDENCIES="../bfd/libbfd.la"
+ CTF_LIBADD="$CTF_LIBADD -L`pwd`/../intl -lintl -lcygwin"
;;
esac
fi
AC_SUBST(SHARED_LDFLAGS)
-AC_SUBST(SHARED_LIBADD)
-AC_SUBST(BFD_LIBADD)
-AC_SUBST(BFD_DEPENDENCIES)
+AC_SUBST(CTF_LIBADD)
# Use a version script, if possible, or an -export-symbols-regex otherwise.
VERSION_FLAGS='-export-symbols-regex ctf_.*'