From 29670fb929f146bafbeb2abb8759eede0a984691 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 16 Jan 2009 08:02:29 +0000 Subject: bfd/ * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute SHARED_LIBADD and SHARED_LDFLAGS rather than WIN32LIBADD, WIN32LDFLAGS. * configure.in (commonbfdlib): Delete. (SHARED_LDFLAGS): Rename from WIN32LDFLAGS/ (SHARED_LIBADD): Rename from WIN32LIBADD. Add pic libiberty if such is available, not just for linux. * po/SRC-POTFILES.in: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. opcodes/ * configure.in (commonbfdlib): Delete. (SHARED_LIBADD): Add pic libiberty if such is available. * configure: Regenerate. * po/POTFILES.in: Regenerate. binutils/ * configure.in (commonbfdlib): Delete. * configure: Regenerate. gas/ * configure.in (commonbfdlib): Delete. * configure: Regenerate. * po/POTFILES.in: Regenerate. --- bfd/configure.in | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) (limited to 'bfd/configure.in') diff --git a/bfd/configure.in b/bfd/configure.in index 663eba4..c3a8efa 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -60,14 +60,6 @@ AC_ARG_ENABLE(targets, *) enable_targets=$enableval ;; esac])dnl -AC_ARG_ENABLE(commonbfdlib, -[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], -[case "${enableval}" in - yes) commonbfdlib=true ;; - no) commonbfdlib=false ;; - *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; -esac])dnl - AC_ARG_WITH(mmap, [ --with-mmap try using mmap for BFD input files if available], [case "${withval}" in @@ -502,29 +494,31 @@ if test -n "$TRAD_HEADER"; then [Name of host specific header file to include in trad-core.c.]) fi -# Horrible hacks to build DLLs on Windows. -WIN32LDFLAGS= -WIN32LIBADD= -case "${host}" in -*-*-cygwin*) - if test "$enable_shared" = "yes"; then - WIN32LDFLAGS="-no-undefined" - WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" - fi - ;; -*-*-linux*) - # We borrow WIN32LIBADD so that the shared libbfd won't depend on - # libiberty.a. +# When building a shared libbfd, link against the pic version of libiberty +# so that apps that use libbfd won't need libiberty just to satisfy any +# libbfd references. +# We can't do that if a pic libiberty is unavailable since including non-pic +# code would insert text relocations into libbfd. +SHARED_LIBADD= +SHARED_LDFLAGS= +if test "$enable_shared" = "yes"; then changequote(,)dnl x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` changequote([,])dnl if test -n "$x"; then - WIN32LIBADD="-L../libiberty/pic -liberty" + SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" fi + +# More hacks to build DLLs on Windows. + case "${host}" in + *-*-cygwin*) + SHARED_LDFLAGS="-no-undefined" + SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32" ;; -esac -AC_SUBST(WIN32LDFLAGS) -AC_SUBST(WIN32LIBADD) + esac +fi +AC_SUBST(SHARED_LDFLAGS) +AC_SUBST(SHARED_LIBADD) # target stuff: -- cgit v1.1