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