1 dnl Process this file with autoconf to produce a configure script.
7 AM_INIT_AUTOMAKE(gprof, 2.8.1)
10 [ --enable-shared build shared BFD library],
11 [case "${enableval}" in
24 alpha-*-*) MY_TARGET=alpha ;;
26 i[3456]86-*-*) MY_TARGET=i386 ;;
28 sparc-*-*) MY_TARGET=sparc ;;
29 tahoe-*-*) MY_TARGET=tahoe ;;
30 vax-*-*) MY_TARGET=vax ;;
31 ns32k-*-*) MY_TARGET=ns532;;
32 *-*-*) MY_TARGET=dummy ;;
37 dnl We need to set BSD44_FORMAT on a host which uses the additional
38 dnl header fields. This is an attempt to do that. I can't think of a
39 dnl good feature test for this.
41 *-*-bsd4.4* | *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
42 AC_DEFINE(BSD44_FORMAT)
46 BFDLIB='-L../bfd -lbfd'
48 # We need to handle some special cases if BFD was built shared.
51 # On SunOS, we must link against the name we are going to install,
52 # not -lbfd, since SunOS does not support SONAME.
53 if test "${shared}" = "true"; then
54 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
58 # On Alpha OSF/1, the native linker searches all the -L
59 # directories for any LIB.so files, and only then searches for any
60 # LIB.a files. That means that if there is an installed
61 # libbfd.so, but this build is not done with --enable-shared, the
62 # link will wind up being against the install libbfd.so rather
63 # than the newly built libbfd. To avoid this, we must explicitly
64 # link against libbfd.a when --enable-shared is not used.
65 if test "${shared}" != "true"; then
66 BFDLIB='../bfd/libbfd.a'
74 # If we have shared libraries, try to set rpath reasonably.
75 if test "${shared}" = "true"; then
78 HLDFLAGS='-Wl,+s,+b,$(libdir)'
81 HLDFLAGS='-Wl,-rpath,$(libdir)'
86 HLDFLAGS='-Wl,-rpath,$(libdir)'
89 HLDFLAGS='-R $(libdir)'
92 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;'
97 # On SunOS, if the linker supports the -rpath option, use it to
98 # prevent ../bfd and ../opcodes from being included in the run time
102 echo 'main () { }' > conftest.c
103 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
104 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
106 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
108 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
110 elif test "${shared}" = "true"; then
111 HLDFLAGS='-Wl,-rpath=$(libdir)'
113 HLDFLAGS='-Wl,-rpath='
115 rm -f conftest.t conftest.c conftest
121 # automake --cygnus requires these for some reason.