]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - binutils/configure.in
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/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
5b10df4a 8AM_INIT_AUTOMAKE(binutils, 2.9.4)
d467c30d
ILT
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
db19f828 36
d467c30d
ILT
37AC_PROG_CC
38
39AC_PROG_YACC
9d04d618
TT
40AM_PROG_LEX
41
42ALL_LINGUAS=
43CY_GNU_GETTEXT
d467c30d
ILT
44
45AM_MAINTAINER_MODE
46AM_CYGWIN32
47AM_EXEEXT
48
5ab6ca68 49# host-specific stuff:
db19f828 50
5ab6ca68 51HDEFINES=
33106b60 52
b5775df3
DHW
53. ${srcdir}/../bfd/configure.host
54
5ab6ca68 55AC_SUBST(HDEFINES)
5ab6ca68
ILT
56AR=${AR-ar}
57AC_SUBST(AR)
58AC_PROG_RANLIB
d467c30d 59AM_PROG_INSTALL
36fb98be 60
320d4f29
ILT
61BFD_CC_FOR_BUILD
62
5ab6ca68 63AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
ae0daa11 64AC_HEADER_SYS_WAIT
33106b60 65AC_FUNC_ALLOCA
5ab6ca68
ILT
66AC_CHECK_FUNCS(sbrk utimes)
67
68AC_MSG_CHECKING(for time_t in time.h)
69AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
70[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
71bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
72AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
73if test $bu_cv_decl_time_t_time_h = yes; then
74 AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
75fi
76
77AC_MSG_CHECKING(for time_t in sys/types.h)
78AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
79[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
80bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
81AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
82if test $bu_cv_decl_time_t_types_h = yes; then
83 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
84fi
85
86# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
87# by default.
88AC_MSG_CHECKING([for utime.h])
89AC_CACHE_VAL(bu_cv_header_utime_h,
90[AC_TRY_COMPILE([#include <sys/types.h>
91#ifdef HAVE_TIME_H
92#include <time.h>
93#endif
94#include <utime.h>],
95[struct utimbuf s;],
96bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
97AC_MSG_RESULT($bu_cv_header_utime_h)
98if test $bu_cv_header_utime_h = yes; then
99 AC_DEFINE(HAVE_GOOD_UTIME_H)
100fi
101
36fb98be 102BFD_NEED_DECLARATION(fprintf)
33106b60
ILT
103BFD_NEED_DECLARATION(strstr)
104BFD_NEED_DECLARATION(sbrk)
105BFD_NEED_DECLARATION(getenv)
5ab6ca68 106
320d4f29 107BFD_BINARY_FOPEN
5ab6ca68
ILT
108
109# target-specific stuff:
b5775df3
DHW
110
111# Canonicalize the secondary target names.
5ab6ca68 112if test -n "$enable_targets"; then
99ac7754 113 for targ in `echo $enable_targets | sed 's/,/ /g'`
b5775df3 114 do
1d371d35 115 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
5ab6ca68 116 if test -n "$result"; then
b5775df3
DHW
117 canon_targets="$canon_targets $result"
118 else
119 # Allow targets that config.sub doesn't recognize, like "all".
120 canon_targets="$canon_targets $targ"
121 fi
122 done
b5775df3
DHW
123fi
124
125all_targets=false
5ab6ca68
ILT
126BUILD_NLMCONV=
127NLMCONV_DEFS=
128BUILD_SRCONV=
129BUILD_DLLTOOL=
130DLLTOOL_DEFS=
1d371d35 131BUILD_WINDRES=
b5775df3
DHW
132
133for targ in $target $canon_targets
134do
5ab6ca68 135 if test "x$targ" = "xall"; then
b5775df3 136 all_targets=true
bf2a3cb1 137 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
1bfa8616 138 BUILD_SRCONV='$(SRCONV_PROG)'
5ab6ca68 139 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
b5775df3
DHW
140 else
141 case $targ in
5ab6ca68 142changequote(,)dnl
33106b60 143 i[3456]86*-*-netware*)
5ab6ca68 144changequote([,])dnl
bf2a3cb1 145 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
5ab6ca68 146 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
99ac7754
JM
147 ;;
148 alpha*-*-netware*)
bf2a3cb1 149 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
5ab6ca68 150 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
99ac7754
JM
151 ;;
152 powerpc*-*-netware*)
bf2a3cb1 153 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
5ab6ca68 154 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
99ac7754
JM
155 ;;
156 sparc*-*-netware*)
bf2a3cb1 157 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
5ab6ca68 158 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
99ac7754 159 ;;
b5775df3 160 esac
b5775df3 161 case $targ in
1bfa8616 162 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
b5775df3 163 esac
99ac7754
JM
164 case $targ in
165 arm-*pe*)
4c2cea9d 166 thumb-*pe*)
bf2a3cb1 167 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
5ab6ca68 168 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
bf2a3cb1 169 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
99ac7754 170 ;;
5ab6ca68 171changequote(,)dnl
9d04d618 172 i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
5ab6ca68 173changequote([,])dnl
bf2a3cb1 174 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
5ab6ca68 175 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
bf2a3cb1 176 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
99ac7754 177 ;;
36fb98be 178 powerpc*-*-*pe* | powerpc*-*-cygwin32)
bf2a3cb1 179 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
36fb98be 180 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
bf2a3cb1 181 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
36fb98be 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)
1d371d35 192AC_SUBST(BUILD_WINDRES)
99ac7754 193
9d04d618
TT
194AC_DEFINE_UNQUOTED(TARGET, "${target}")
195
fe48a154
ILT
196targ=$target
197. $srcdir/../bfd/config.bfd
198if test "x$targ_underscore" = "xyes"; then
5ab6ca68 199 UNDERSCORE=1
6f88f031 200else
5ab6ca68 201 UNDERSCORE=0
6f88f031 202fi
5ab6ca68
ILT
203AC_SUBST(UNDERSCORE)
204
9d04d618
TT
205AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
206[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])