1 dnl Process this file with autoconf to produce a configure script.
6 [ --enable-shared build shared BFD library],
7 [case "${enableval}" in
23 alpha-*-*) MY_TARGET=alpha ;;
25 i[3456]86-*-*) MY_TARGET=i386 ;;
27 sparc-*-*) MY_TARGET=sparc ;;
28 tahoe-*-*) MY_TARGET=tahoe ;;
29 vax-*-*) MY_TARGET=vax ;;
30 ns32k-*-*) MY_TARGET=ns532;;
31 *-*-*) MY_TARGET=dummy ;;
36 dnl We need to set BSD44_FORMAT on a host which uses the additional
37 dnl header fields. This is an attempt to do that. I can't think of a
38 dnl good feature test for this.
40 *-*-bsd4.4* | *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
41 AC_DEFINE(BSD44_FORMAT)
45 BFDLIB='-L../bfd -lbfd'
47 # We need to handle some special cases if BFD was built shared.
50 # On SunOS, we must link against the name we are going to install,
51 # not -lbfd, since SunOS does not support SONAME.
52 if test "${shared}" = "true"; then
53 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
57 # On Alpha OSF/1, the native linker searches all the -L
58 # directories for any LIB.so files, and only then searches for any
59 # LIB.a files. That means that if there is an installed
60 # libbfd.so, but this build is not done with --enable-shared, the
61 # link will wind up being against the install libbfd.so rather
62 # than the newly built libbfd. To avoid this, we must explicitly
63 # link against libbfd.a when --enable-shared is not used.
64 if test "${shared}" != "true"; then
65 BFDLIB='../bfd/libbfd.a'
73 # If we have shared libraries, try to set rpath reasonably.
74 if test "${shared}" = "true"; then
77 HLDFLAGS='-Wl,+s,+b,$(libdir)'
80 HLDFLAGS='-Wl,-rpath,$(libdir)'
85 HLDFLAGS='-Wl,-rpath,$(libdir)'
88 HLDFLAGS='-R $(libdir)'
91 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;'
96 # On SunOS, if the linker supports the -rpath option, use it to
97 # prevent ../bfd and ../opcodes from being included in the run time
101 echo 'main () { }' > conftest.c
102 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
103 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
105 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
107 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
109 elif test "${shared}" = "true"; then
110 HLDFLAGS='-Wl,-rpath=$(libdir)'
112 HLDFLAGS='-Wl,-rpath='
114 rm -f conftest.t conftest.c conftest