* configure.in: On alpha*-*-osf*, link against libbfd.a if not
[deliverable/binutils-gdb.git] / gprof / configure.in
CommitLineData
7858d8dc
C
1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.3)dnl
3AC_INIT(gprof.c)
c98f0ae5 4
ba8e3a2e
ILT
5AC_ARG_ENABLE(shared,
6[ --enable-shared build shared BFD library],
7[case "${enableval}" in
8 yes) shared=true ;;
9 no) shared=false ;;
b4cb4ea2
ILT
10 *bfd*) shared=true ;;
11 *) shared=false ;;
ba8e3a2e
ILT
12esac])dnl
13
7858d8dc 14AC_PROG_CC
c98f0ae5 15
7858d8dc
C
16AC_CANONICAL_SYSTEM
17AC_ARG_PROGRAM
c98f0ae5 18
5d32c952 19case "${target}" in
7858d8dc 20alpha-*-*) MY_TARGET=alpha ;;
379062d1 21changequote(,)dnl
7858d8dc 22i[345]86-*-*) MY_TARGET=i386 ;;
379062d1 23changequote([,])dnl
7858d8dc
C
24sparc-*-*) MY_TARGET=sparc ;;
25tahoe-*-*) MY_TARGET=tahoe ;;
26vax-*-*) MY_TARGET=vax ;;
af0786b4 27ns32k-*-*) MY_TARGET=ns532;;
7858d8dc 28*-*-*) MY_TARGET=dummy ;;
a11d7ba3
SEF
29esac
30
7858d8dc 31AC_SUBST(MY_TARGET)
ba8e3a2e
ILT
32
33BFDLIB='-L../bfd -lbfd'
34
35# We need to handle some special cases if BFD was built shared.
36if test "${shared}" = "true"; then
37 case "${host}" in
38 *-*-sunos*)
39 # On SunOS, we must link against the name we are going to install,
40 # not -lbfd, since SunOS does not support SONAME.
41 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
42 ;;
43 esac
44fi
45AC_SUBST(BFDLIB)
46
47HLDFLAGS=
48# If we have shared libraries, try to set rpath reasonably.
49if test "${shared}" = "true"; then
50 case "${host}" in
56f9773f
ILT
51 *-*-hpux*)
52 HLDFLAGS='-Wl,+s,+b,$(libdir)'
53 ;;
ba8e3a2e
ILT
54 *-*-irix5*)
55 HLDFLAGS='-Wl,-rpath,$(libdir)'
56 ;;
57 *-*-linux*aout*)
58 ;;
59 *-*-linux*)
60 HLDFLAGS='-Wl,-rpath,$(libdir)'
61 ;;
62 *-*-sysv4* | *-*-solaris*)
63 HLDFLAGS='-R $(libdir)'
64 ;;
65 esac
66fi
67
68# On SunOS, if the linker supports the -rpath option, use it to
69# prevent ../bfd and ../opcodes from being included in the run time
70# search path.
71case "${host}" in
72 *-*-sunos*)
73 echo 'main () { }' > conftest.c
74 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
75 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
76 :
77 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
78 :
7925f4d4
ILT
79 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
80 :
ba8e3a2e
ILT
81 elif test "${shared}" = "true"; then
82 HLDFLAGS='-Wl,-rpath=$(libdir)'
83 else
84 HLDFLAGS='-Wl,-rpath='
85 fi
86 rm -f conftest.t conftest.c conftest
87 ;;
88esac
89AC_SUBST(HLDFLAGS)
90
7858d8dc 91AC_OUTPUT(Makefile)
This page took 0.152844 seconds and 4 git commands to generate.