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