* Makefile.am: New file, based on old Makefile.in.
[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
2f1fec47
ILT
5AC_CANONICAL_SYSTEM
6
7AM_INIT_AUTOMAKE(gprof, 2.8.1)
8
ba8e3a2e
ILT
9AC_ARG_ENABLE(shared,
10[ --enable-shared build shared BFD library],
11[case "${enableval}" in
12 yes) shared=true ;;
13 no) shared=false ;;
b4cb4ea2
ILT
14 *bfd*) shared=true ;;
15 *) shared=false ;;
ba8e3a2e
ILT
16esac])dnl
17
7858d8dc 18AC_PROG_CC
39c3964f 19AC_PROG_INSTALL
c98f0ae5 20
e3c0e00b
ILT
21AC_ISC_POSIX
22
5d32c952 23case "${target}" in
7858d8dc 24alpha-*-*) MY_TARGET=alpha ;;
379062d1 25changequote(,)dnl
3d5aa992 26i[3456]86-*-*) MY_TARGET=i386 ;;
379062d1 27changequote([,])dnl
7858d8dc
C
28sparc-*-*) MY_TARGET=sparc ;;
29tahoe-*-*) MY_TARGET=tahoe ;;
30vax-*-*) MY_TARGET=vax ;;
af0786b4 31ns32k-*-*) MY_TARGET=ns532;;
7858d8dc 32*-*-*) MY_TARGET=dummy ;;
a11d7ba3
SEF
33esac
34
7858d8dc 35AC_SUBST(MY_TARGET)
ba8e3a2e 36
22395d7e
ILT
37dnl We need to set BSD44_FORMAT on a host which uses the additional
38dnl header fields. This is an attempt to do that. I can't think of a
39dnl good feature test for this.
40case "${target}" in
41*-*-bsd4.4* | *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
42 AC_DEFINE(BSD44_FORMAT)
43 ;;
44esac
45
ba8e3a2e
ILT
46BFDLIB='-L../bfd -lbfd'
47
48# We need to handle some special cases if BFD was built shared.
8530ae8e 49case "${host}" in
ba8e3a2e
ILT
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.
8530ae8e
ILT
53 if test "${shared}" = "true"; then
54 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
55 fi
56 ;;
57alpha*-*-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
ba8e3a2e 68 ;;
8530ae8e 69esac
ba8e3a2e
ILT
70AC_SUBST(BFDLIB)
71
72HLDFLAGS=
cb26c22d 73HLDENV=
ba8e3a2e
ILT
74# If we have shared libraries, try to set rpath reasonably.
75if test "${shared}" = "true"; then
76 case "${host}" in
56f9773f
ILT
77 *-*-hpux*)
78 HLDFLAGS='-Wl,+s,+b,$(libdir)'
79 ;;
ba8e3a2e
ILT
80 *-*-irix5*)
81 HLDFLAGS='-Wl,-rpath,$(libdir)'
82 ;;
83 *-*-linux*aout*)
84 ;;
85 *-*-linux*)
86 HLDFLAGS='-Wl,-rpath,$(libdir)'
87 ;;
cb26c22d 88 *-*-solaris*)
ba8e3a2e
ILT
89 HLDFLAGS='-R $(libdir)'
90 ;;
cb26c22d
ILT
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 ;;
ba8e3a2e
ILT
94 esac
95fi
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.
100case "${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 :
7925f4d4
ILT
108 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
109 :
ba8e3a2e
ILT
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 ;;
117esac
118AC_SUBST(HLDFLAGS)
cb26c22d 119AC_SUBST(HLDENV)
ba8e3a2e 120
2f1fec47
ILT
121# automake --cygnus requires these for some reason.
122AM_MAINTAINER_MODE
123AM_CYGWIN32
124
7858d8dc 125AC_OUTPUT(Makefile)
This page took 0.19861 seconds and 4 git commands to generate.