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