1 dnl Process this file with autoconf to produce a configure script.
6 [ --enable-shared build shared BFD library],
7 [case "${enableval}" in
21 alpha-*-*) MY_TARGET=alpha ;;
23 i[345]86-*-*) MY_TARGET=i386 ;;
25 sparc-*-*) MY_TARGET=sparc ;;
26 tahoe-*-*) MY_TARGET=tahoe ;;
27 vax-*-*) MY_TARGET=vax ;;
28 ns32k-*-*) MY_TARGET=ns532;;
29 *-*-*) MY_TARGET=dummy ;;
34 BFDLIB='-L../bfd -lbfd'
36 # We need to handle some special cases if BFD was built shared.
39 # On SunOS, we must link against the name we are going to install,
40 # not -lbfd, since SunOS does not support SONAME.
41 if test "${shared}" = "true"; then
42 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
46 # On Alpha OSF/1, the native linker searches all the -L
47 # directories for any LIB.so files, and only then searches for any
48 # LIB.a files. That means that if there is an installed
49 # libbfd.so, but this build is not done with --enable-shared, the
50 # link will wind up being against the install libbfd.so rather
51 # than the newly built libbfd. To avoid this, we must explicitly
52 # link against libbfd.a when --enable-shared is not used.
53 if test "${shared}" != "true"; then
54 BFDLIB='../bfd/libbfd.a'
61 # If we have shared libraries, try to set rpath reasonably.
62 if test "${shared}" = "true"; then
65 HLDFLAGS='-Wl,+s,+b,$(libdir)'
68 HLDFLAGS='-Wl,-rpath,$(libdir)'
73 HLDFLAGS='-Wl,-rpath,$(libdir)'
75 *-*-sysv4* | *-*-solaris*)
76 HLDFLAGS='-R $(libdir)'
81 # On SunOS, if the linker supports the -rpath option, use it to
82 # prevent ../bfd and ../opcodes from being included in the run time
86 echo 'main () { }' > conftest.c
87 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
88 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
90 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
92 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
94 elif test "${shared}" = "true"; then
95 HLDFLAGS='-Wl,-rpath=$(libdir)'
97 HLDFLAGS='-Wl,-rpath='
99 rm -f conftest.t conftest.c conftest