* gas/m32r/allinsn.{exp,s.d}: New testcases.
[deliverable/binutils-gdb.git] / gprof / configure.in
CommitLineData
7858d8dc 1dnl Process this file with autoconf to produce a configure script.
39c3964f 2AC_PREREQ(2.5)dnl
7858d8dc 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
39c3964f 15AC_PROG_INSTALL
c98f0ae5 16
e3c0e00b
ILT
17AC_ISC_POSIX
18
7858d8dc
C
19AC_CANONICAL_SYSTEM
20AC_ARG_PROGRAM
c98f0ae5 21
5d32c952 22case "${target}" in
7858d8dc 23alpha-*-*) MY_TARGET=alpha ;;
379062d1 24changequote(,)dnl
3d5aa992 25i[3456]86-*-*) MY_TARGET=i386 ;;
379062d1 26changequote([,])dnl
7858d8dc
C
27sparc-*-*) MY_TARGET=sparc ;;
28tahoe-*-*) MY_TARGET=tahoe ;;
29vax-*-*) MY_TARGET=vax ;;
af0786b4 30ns32k-*-*) MY_TARGET=ns532;;
7858d8dc 31*-*-*) MY_TARGET=dummy ;;
a11d7ba3
SEF
32esac
33
7858d8dc 34AC_SUBST(MY_TARGET)
ba8e3a2e 35
22395d7e
ILT
36dnl We need to set BSD44_FORMAT on a host which uses the additional
37dnl header fields. This is an attempt to do that. I can't think of a
38dnl good feature test for this.
39case "${target}" in
40*-*-bsd4.4* | *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
41 AC_DEFINE(BSD44_FORMAT)
42 ;;
43esac
44
ba8e3a2e
ILT
45BFDLIB='-L../bfd -lbfd'
46
47# We need to handle some special cases if BFD was built shared.
8530ae8e 48case "${host}" in
ba8e3a2e
ILT
49 *-*-sunos*)
50 # On SunOS, we must link against the name we are going to install,
51 # not -lbfd, since SunOS does not support SONAME.
8530ae8e
ILT
52 if test "${shared}" = "true"; then
53 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
54 fi
55 ;;
56alpha*-*-osf*)
57 # On Alpha OSF/1, the native linker searches all the -L
58 # directories for any LIB.so files, and only then searches for any
59 # LIB.a files. That means that if there is an installed
60 # libbfd.so, but this build is not done with --enable-shared, the
61 # link will wind up being against the install libbfd.so rather
62 # than the newly built libbfd. To avoid this, we must explicitly
63 # link against libbfd.a when --enable-shared is not used.
64 if test "${shared}" != "true"; then
65 BFDLIB='../bfd/libbfd.a'
66 fi
ba8e3a2e 67 ;;
8530ae8e 68esac
ba8e3a2e
ILT
69AC_SUBST(BFDLIB)
70
71HLDFLAGS=
cb26c22d 72HLDENV=
ba8e3a2e
ILT
73# If we have shared libraries, try to set rpath reasonably.
74if test "${shared}" = "true"; then
75 case "${host}" in
56f9773f
ILT
76 *-*-hpux*)
77 HLDFLAGS='-Wl,+s,+b,$(libdir)'
78 ;;
ba8e3a2e
ILT
79 *-*-irix5*)
80 HLDFLAGS='-Wl,-rpath,$(libdir)'
81 ;;
82 *-*-linux*aout*)
83 ;;
84 *-*-linux*)
85 HLDFLAGS='-Wl,-rpath,$(libdir)'
86 ;;
cb26c22d 87 *-*-solaris*)
ba8e3a2e
ILT
88 HLDFLAGS='-R $(libdir)'
89 ;;
cb26c22d
ILT
90 *-*-sysv4*)
91 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;'
92 ;;
ba8e3a2e
ILT
93 esac
94fi
95
96# On SunOS, if the linker supports the -rpath option, use it to
97# prevent ../bfd and ../opcodes from being included in the run time
98# search path.
99case "${host}" in
100 *-*-sunos*)
101 echo 'main () { }' > conftest.c
102 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
103 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
104 :
105 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
106 :
7925f4d4
ILT
107 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
108 :
ba8e3a2e
ILT
109 elif test "${shared}" = "true"; then
110 HLDFLAGS='-Wl,-rpath=$(libdir)'
111 else
112 HLDFLAGS='-Wl,-rpath='
113 fi
114 rm -f conftest.t conftest.c conftest
115 ;;
116esac
117AC_SUBST(HLDFLAGS)
cb26c22d 118AC_SUBST(HLDENV)
ba8e3a2e 119
7858d8dc 120AC_OUTPUT(Makefile)
This page took 0.178473 seconds and 4 git commands to generate.