* gas/m32r/allinsn.{exp,s.d}: New testcases.
[deliverable/binutils-gdb.git] / gprof / configure.in
... / ...
CommitLineData
1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.5)dnl
3AC_INIT(gprof.c)
4
5AC_ARG_ENABLE(shared,
6[ --enable-shared build shared BFD library],
7[case "${enableval}" in
8 yes) shared=true ;;
9 no) shared=false ;;
10 *bfd*) shared=true ;;
11 *) shared=false ;;
12esac])dnl
13
14AC_PROG_CC
15AC_PROG_INSTALL
16
17AC_ISC_POSIX
18
19AC_CANONICAL_SYSTEM
20AC_ARG_PROGRAM
21
22case "${target}" in
23alpha-*-*) MY_TARGET=alpha ;;
24changequote(,)dnl
25i[3456]86-*-*) MY_TARGET=i386 ;;
26changequote([,])dnl
27sparc-*-*) MY_TARGET=sparc ;;
28tahoe-*-*) MY_TARGET=tahoe ;;
29vax-*-*) MY_TARGET=vax ;;
30ns32k-*-*) MY_TARGET=ns532;;
31*-*-*) MY_TARGET=dummy ;;
32esac
33
34AC_SUBST(MY_TARGET)
35
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
45BFDLIB='-L../bfd -lbfd'
46
47# We need to handle some special cases if BFD was built shared.
48case "${host}" in
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.
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
67 ;;
68esac
69AC_SUBST(BFDLIB)
70
71HLDFLAGS=
72HLDENV=
73# If we have shared libraries, try to set rpath reasonably.
74if test "${shared}" = "true"; then
75 case "${host}" in
76 *-*-hpux*)
77 HLDFLAGS='-Wl,+s,+b,$(libdir)'
78 ;;
79 *-*-irix5*)
80 HLDFLAGS='-Wl,-rpath,$(libdir)'
81 ;;
82 *-*-linux*aout*)
83 ;;
84 *-*-linux*)
85 HLDFLAGS='-Wl,-rpath,$(libdir)'
86 ;;
87 *-*-solaris*)
88 HLDFLAGS='-R $(libdir)'
89 ;;
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 ;;
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 :
107 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
108 :
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)
118AC_SUBST(HLDENV)
119
120AC_OUTPUT(Makefile)
This page took 0.023849 seconds and 4 git commands to generate.