aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure.in
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-09-14 00:09:24 +0000
committerFred Fish <fnf@specifix.com>1996-09-14 00:09:24 +0000
commit1d5eb137043999be02f59c465d7df6f35e0c9f04 (patch)
tree12506ebdbafdb8c4ff3d7e164a17f78860ec22d0 /gdb/configure.in
parent20ece5977c43da03f0ae99bab2847f4c8d474fbf (diff)
downloadgdb-1d5eb137043999be02f59c465d7df6f35e0c9f04.zip
gdb-1d5eb137043999be02f59c465d7df6f35e0c9f04.tar.gz
gdb-1d5eb137043999be02f59c465d7df6f35e0c9f04.tar.bz2
* Makefile.in (INTERNAL_LDFLAGS): Add @HLDFLAGS@ to list.
(HLDENV): Set to @HLDENV@. (gdb): Prefix link command line with $(HLDENV). * configure.in: Add support to test for --enable-shared and generate appropriate values for HLDFLAGS and HLDENV. * configure: Regenerated with autoconf. PR 10489
Diffstat (limited to 'gdb/configure.in')
-rw-r--r--gdb/configure.in59
1 files changed, 59 insertions, 0 deletions
diff --git a/gdb/configure.in b/gdb/configure.in
index f33178d..f00ac5a 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -265,6 +265,65 @@ AC_SUBST(ENABLE_CFLAGS)
AC_SUBST(ENABLE_CLIBS)
AC_SUBST(ENABLE_OBS)
+# Begin stuff to support --enable-shared
+AC_ARG_ENABLE(shared,
+[ --enable-shared use shared libraries],
+[case "${enableval}" in
+ yes) shared=true ;;
+ no) shared=false ;;
+ *) shared=true ;;
+esac])dnl
+
+HLDFLAGS=
+HLDENV=
+# If we have shared libraries, try to set rpath reasonably.
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-hpux*)
+ HLDFLAGS='-Wl,+s,+b,$(libdir)'
+ ;;
+ *-*-irix5* | *-*-irix6*)
+ HLDFLAGS='-Wl,-rpath,$(libdir)'
+ ;;
+ *-*-linux*aout*)
+ ;;
+ *-*-linux*)
+ HLDFLAGS='-Wl,-rpath,$(libdir)'
+ ;;
+ *-*-solaris*)
+ HLDFLAGS='-R $(libdir)'
+ ;;
+ *-*-sysv4*)
+ HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
+ ;;
+ esac
+fi
+
+# On SunOS, if the linker supports the -rpath option, use it to
+# prevent ../bfd and ../opcodes from being included in the run time
+# search path.
+case "${host}" in
+ *-*-sunos*)
+ echo 'main () { }' > conftest.c
+ ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
+ if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
+ :
+ elif grep 'No such file' conftest.t >/dev/null 2>&1; then
+ :
+ elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
+ :
+ elif test "${shared}" = "true"; then
+ HLDFLAGS='-Wl,-rpath=$(libdir)'
+ else
+ HLDFLAGS='-Wl,-rpath='
+ fi
+ rm -f conftest.t conftest.c conftest
+ ;;
+esac
+AC_SUBST(HLDFLAGS)
+AC_SUBST(HLDENV)
+# End stuff to support --enable-shared
+
# target_subdir is used by the testsuite to find the target libraries.
target_subdir=
if test "${host}" != "${target}"; then