* Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir):
[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.
8530ae8e 36case "${host}" in
ba8e3a2e
ILT
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.
8530ae8e
ILT
40 if test "${shared}" = "true"; then
41 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
42 fi
43 ;;
44alpha*-*-osf*)
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'
54 fi
ba8e3a2e 55 ;;
8530ae8e 56esac
ba8e3a2e
ILT
57AC_SUBST(BFDLIB)
58
59HLDFLAGS=
60# If we have shared libraries, try to set rpath reasonably.
61if test "${shared}" = "true"; then
62 case "${host}" in
56f9773f
ILT
63 *-*-hpux*)
64 HLDFLAGS='-Wl,+s,+b,$(libdir)'
65 ;;
ba8e3a2e
ILT
66 *-*-irix5*)
67 HLDFLAGS='-Wl,-rpath,$(libdir)'
68 ;;
69 *-*-linux*aout*)
70 ;;
71 *-*-linux*)
72 HLDFLAGS='-Wl,-rpath,$(libdir)'
73 ;;
74 *-*-sysv4* | *-*-solaris*)
75 HLDFLAGS='-R $(libdir)'
76 ;;
77 esac
78fi
79
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
82# search path.
83case "${host}" in
84 *-*-sunos*)
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
88 :
89 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
90 :
7925f4d4
ILT
91 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
92 :
ba8e3a2e
ILT
93 elif test "${shared}" = "true"; then
94 HLDFLAGS='-Wl,-rpath=$(libdir)'
95 else
96 HLDFLAGS='-Wl,-rpath='
97 fi
98 rm -f conftest.t conftest.c conftest
99 ;;
100esac
101AC_SUBST(HLDFLAGS)
102
7858d8dc 103AC_OUTPUT(Makefile)
This page took 0.16565 seconds and 4 git commands to generate.