* configure.host: Set RPATH_ENVVAR.
[deliverable/binutils-gdb.git] / binutils / configure.in
CommitLineData
5ab6ca68
ILT
1dnl Process this file with autoconf to produce a configure script.
2dnl
3AC_PREREQ(2.0)
4AC_INIT(ar.c)
5
6AC_ARG_ENABLE(targets,
7[ --enable-targets alternative target configurations],
8[case "${enableval}" in
9 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
10 ;;
11 no) enable_targets= ;;
12 *) enable_targets=$enableval ;;
13esac])dnl
36fb98be
ILT
14AC_ARG_ENABLE(shared,
15[ --enable-shared build shared BFD library],
16[case "${enableval}" in
17 yes) shared=true ;;
18 no) shared=false ;;
19 *) AC_MSG_ERROR([bad value ${enableval} for BFD shared option]) ;;
20esac])dnl
5ab6ca68 21
320d4f29 22AC_CONFIG_HEADER(config.h:config.in)
5ab6ca68
ILT
23
24AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
25AC_CANONICAL_SYSTEM
26if test -z "$target" ; then
27 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
28fi
29if test -z "$host" ; then
30 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
31fi
32AC_ARG_PROGRAM
db19f828 33
5ab6ca68 34# host-specific stuff:
db19f828 35
5ab6ca68
ILT
36HDEFINES=
37LDFLAGS=
36fb98be 38HLDFLAGS=
db19f828 39
b5775df3
DHW
40. ${srcdir}/../bfd/configure.host
41
5ab6ca68
ILT
42AC_PROG_CC
43AC_SUBST(CFLAGS)
44AC_SUBST(HDEFINES)
45AC_SUBST(LDFLAGS)
36fb98be 46AC_SUBST(HLDFLAGS)
5ab6ca68
ILT
47AR=${AR-ar}
48AC_SUBST(AR)
49AC_PROG_RANLIB
50AC_PROG_INSTALL
51
36fb98be
ILT
52# For most hosts we can use a simple definition to pick up the BFD and
53# opcodes libraries. However, if we are building shared libraries, we
54# need to handle some hosts specially.
55BFDLIB='-L../bfd -lbfd'
56OPCODES='-L../opcodes -lopcodes'
57if test "${shared}" = "true"; then
58 case "${host}" in
59 *-*-sunos*)
60 # On SunOS, we must link against the name we are going to install,
61 # not -lbfd, since SunOS does not support SONAME.
62 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
63 OPCODES='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
64 ;;
65 esac
66fi
67AC_SUBST(BFDLIB)
68AC_SUBST(OPCODES)
69
320d4f29
ILT
70BFD_CC_FOR_BUILD
71
5ab6ca68 72AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
ae0daa11 73AC_HEADER_SYS_WAIT
5ab6ca68
ILT
74AC_CHECK_FUNCS(sbrk utimes)
75
76AC_MSG_CHECKING(for time_t in time.h)
77AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
78[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
79bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
80AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
81if test $bu_cv_decl_time_t_time_h = yes; then
82 AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
83fi
84
85AC_MSG_CHECKING(for time_t in sys/types.h)
86AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
87[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
88bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
89AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
90if test $bu_cv_decl_time_t_types_h = yes; then
91 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
92fi
93
94# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
95# by default.
96AC_MSG_CHECKING([for utime.h])
97AC_CACHE_VAL(bu_cv_header_utime_h,
98[AC_TRY_COMPILE([#include <sys/types.h>
99#ifdef HAVE_TIME_H
100#include <time.h>
101#endif
102#include <utime.h>],
103[struct utimbuf s;],
104bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
105AC_MSG_RESULT($bu_cv_header_utime_h)
106if test $bu_cv_header_utime_h = yes; then
107 AC_DEFINE(HAVE_GOOD_UTIME_H)
108fi
109
36fb98be 110BFD_NEED_DECLARATION(fprintf)
5ab6ca68 111
320d4f29 112BFD_BINARY_FOPEN
5ab6ca68
ILT
113
114# target-specific stuff:
b5775df3
DHW
115
116# Canonicalize the secondary target names.
5ab6ca68 117if test -n "$enable_targets"; then
99ac7754 118 for targ in `echo $enable_targets | sed 's/,/ /g'`
b5775df3 119 do
5ab6ca68
ILT
120 result=`$ac_config_sub $targ 2>/dev/null`
121 if test -n "$result"; then
b5775df3
DHW
122 canon_targets="$canon_targets $result"
123 else
124 # Allow targets that config.sub doesn't recognize, like "all".
125 canon_targets="$canon_targets $targ"
126 fi
127 done
b5775df3
DHW
128fi
129
130all_targets=false
5ab6ca68
ILT
131BUILD_NLMCONV=
132NLMCONV_DEFS=
133BUILD_SRCONV=
134BUILD_DLLTOOL=
135DLLTOOL_DEFS=
b5775df3
DHW
136
137for targ in $target $canon_targets
138do
5ab6ca68 139 if test "x$targ" = "xall"; then
b5775df3 140 all_targets=true
5ab6ca68
ILT
141 BUILD_NLMCONV='$(NLMCONV_PROG)'
142 BUILD_SRCONV='$(SRCONV_PROG)'
143 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
b5775df3
DHW
144 else
145 case $targ in
5ab6ca68 146changequote(,)dnl
99ac7754 147 i[345]86*-*-netware*)
5ab6ca68
ILT
148changequote([,])dnl
149 BUILD_NLMCONV='$(NLMCONV_PROG)'
150 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
99ac7754
JM
151 ;;
152 alpha*-*-netware*)
5ab6ca68
ILT
153 BUILD_NLMCONV='$(NLMCONV_PROG)'
154 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
99ac7754
JM
155 ;;
156 powerpc*-*-netware*)
5ab6ca68
ILT
157 BUILD_NLMCONV='$(NLMCONV_PROG)'
158 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
99ac7754
JM
159 ;;
160 sparc*-*-netware*)
5ab6ca68
ILT
161 BUILD_NLMCONV='$(NLMCONV_PROG)'
162 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
99ac7754 163 ;;
b5775df3 164 esac
b5775df3 165 case $targ in
5ab6ca68 166 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
b5775df3 167 esac
99ac7754
JM
168 case $targ in
169 arm-*pe*)
5ab6ca68
ILT
170 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
171 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
99ac7754 172 ;;
5ab6ca68 173changequote(,)dnl
36fb98be 174 i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
5ab6ca68
ILT
175changequote([,])dnl
176 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
177 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
99ac7754 178 ;;
36fb98be
ILT
179 powerpc*-*-*pe* | powerpc*-*-cygwin32)
180 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
181 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
182 ;;
99ac7754 183 esac
b5775df3
DHW
184 fi
185done
186
5ab6ca68
ILT
187AC_SUBST(NLMCONV_DEFS)
188AC_SUBST(BUILD_NLMCONV)
189AC_SUBST(BUILD_SRCONV)
190AC_SUBST(BUILD_DLLTOOL)
191AC_SUBST(DLLTOOL_DEFS)
99ac7754 192
fe48a154
ILT
193targ=$target
194. $srcdir/../bfd/config.bfd
195if test "x$targ_underscore" = "xyes"; then
5ab6ca68 196 UNDERSCORE=1
6f88f031 197else
5ab6ca68 198 UNDERSCORE=0
6f88f031 199fi
5ab6ca68
ILT
200AC_SUBST(UNDERSCORE)
201
202AC_OUTPUT(Makefile,
320d4f29 203[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.170801 seconds and 4 git commands to generate.