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