Commit | Line | Data |
---|---|---|
252b5132 RH |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | dnl | |
3 | AC_PREREQ(2.13) | |
4 | AC_INIT(ar.c) | |
5 | ||
6 | AC_CANONICAL_SYSTEM | |
7 | ||
2844ed43 | 8 | AM_INIT_AUTOMAKE(binutils, 2.9.5) |
252b5132 RH |
9 | |
10 | AM_PROG_LIBTOOL | |
11 | ||
12 | AC_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 ;; | |
19 | esac])dnl | |
20 | AC_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]) ;; | |
26 | esac])dnl | |
27 | ||
28 | AM_CONFIG_HEADER(config.h:config.in) | |
29 | ||
30 | if test -z "$target" ; then | |
31 | AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) | |
32 | fi | |
33 | if test -z "$host" ; then | |
34 | AC_MSG_ERROR(Unrecognized host system type; please check config.sub.) | |
35 | fi | |
36 | ||
37 | AC_PROG_CC | |
38 | ||
39 | AC_PROG_YACC | |
40 | AM_PROG_LEX | |
41 | ||
42 | ALL_LINGUAS= | |
43 | CY_GNU_GETTEXT | |
44 | ||
45 | AM_MAINTAINER_MODE | |
46 | AC_EXEEXT | |
2481e6a2 ILT |
47 | if test -n "$EXEEXT"; then |
48 | AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1, | |
49 | [Does the platform use an executable suffix?]) | |
50 | fi | |
bb0cb4db ILT |
51 | AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}", |
52 | [Suffix used for executables, if any.]) | |
252b5132 RH |
53 | |
54 | # host-specific stuff: | |
55 | ||
56 | HDEFINES= | |
57 | ||
58 | . ${srcdir}/../bfd/configure.host | |
59 | ||
60 | AC_SUBST(HDEFINES) | |
61 | AR=${AR-ar} | |
62 | AC_SUBST(AR) | |
63 | AC_PROG_RANLIB | |
64 | AC_PROG_INSTALL | |
65 | ||
66 | BFD_CC_FOR_BUILD | |
67 | ||
68 | AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h) | |
69 | AC_HEADER_SYS_WAIT | |
70 | AC_FUNC_ALLOCA | |
71 | AC_CHECK_FUNCS(sbrk utimes) | |
72 | ||
f353eb8a ILT |
73 | # Some systems have frexp only in -lm, not in -lc. |
74 | AC_SEARCH_LIBS(frexp, -lm) | |
75 | ||
252b5132 RH |
76 | AC_MSG_CHECKING(for time_t in time.h) |
77 | AC_CACHE_VAL(bu_cv_decl_time_t_time_h, | |
78 | [AC_TRY_COMPILE([#include <time.h>], [time_t i;], | |
79 | bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)]) | |
80 | AC_MSG_RESULT($bu_cv_decl_time_t_time_h) | |
81 | if test $bu_cv_decl_time_t_time_h = yes; then | |
82 | AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1, | |
83 | [Is the type time_t defined in <time.h>?]) | |
84 | fi | |
85 | ||
86 | AC_MSG_CHECKING(for time_t in sys/types.h) | |
87 | AC_CACHE_VAL(bu_cv_decl_time_t_types_h, | |
88 | [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;], | |
89 | bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)]) | |
90 | AC_MSG_RESULT($bu_cv_decl_time_t_types_h) | |
91 | if test $bu_cv_decl_time_t_types_h = yes; then | |
92 | AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1, | |
93 | [Is the type time_t defined in <sys/types.h>?]) | |
94 | fi | |
95 | ||
96 | # Under Next 3.2 <utime.h> apparently does not define struct utimbuf | |
97 | # by default. | |
98 | AC_MSG_CHECKING([for utime.h]) | |
99 | AC_CACHE_VAL(bu_cv_header_utime_h, | |
100 | [AC_TRY_COMPILE([#include <sys/types.h> | |
101 | #ifdef HAVE_TIME_H | |
102 | #include <time.h> | |
103 | #endif | |
104 | #include <utime.h>], | |
105 | [struct utimbuf s;], | |
106 | bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)]) | |
107 | AC_MSG_RESULT($bu_cv_header_utime_h) | |
108 | if test $bu_cv_header_utime_h = yes; then | |
109 | AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?]) | |
110 | fi | |
111 | ||
112 | BFD_NEED_DECLARATION(fprintf) | |
113 | BFD_NEED_DECLARATION(strstr) | |
114 | BFD_NEED_DECLARATION(sbrk) | |
115 | BFD_NEED_DECLARATION(getenv) | |
116 | BFD_NEED_DECLARATION(environ) | |
117 | ||
118 | BFD_BINARY_FOPEN | |
119 | ||
120 | # target-specific stuff: | |
121 | ||
122 | # Canonicalize the secondary target names. | |
123 | if test -n "$enable_targets"; then | |
124 | for targ in `echo $enable_targets | sed 's/,/ /g'` | |
125 | do | |
126 | result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null` | |
127 | if test -n "$result"; then | |
128 | canon_targets="$canon_targets $result" | |
129 | else | |
130 | # Allow targets that config.sub doesn't recognize, like "all". | |
131 | canon_targets="$canon_targets $targ" | |
132 | fi | |
133 | done | |
134 | fi | |
135 | ||
136 | all_targets=false | |
137 | BUILD_NLMCONV= | |
138 | NLMCONV_DEFS= | |
139 | BUILD_SRCONV= | |
140 | BUILD_DLLTOOL= | |
141 | DLLTOOL_DEFS= | |
142 | BUILD_WINDRES= | |
143 | BUILD_DLLWRAP= | |
144 | BUILD_MISC= | |
145 | ||
146 | for targ in $target $canon_targets | |
147 | do | |
148 | if test "x$targ" = "xall"; then | |
149 | all_targets=true | |
150 | BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' | |
151 | BUILD_SRCONV='$(SRCONV_PROG)' | |
152 | NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" | |
153 | else | |
154 | case $targ in | |
155 | changequote(,)dnl | |
156 | i[3456]86*-*-netware*) | |
157 | changequote([,])dnl | |
158 | BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' | |
159 | NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386" | |
160 | ;; | |
161 | alpha*-*-netware*) | |
162 | BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' | |
163 | NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA" | |
164 | ;; | |
165 | powerpc*-*-netware*) | |
166 | BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' | |
167 | NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC" | |
168 | ;; | |
169 | sparc*-*-netware*) | |
170 | BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' | |
171 | NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC" | |
172 | ;; | |
173 | esac | |
174 | case $targ in | |
175 | *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;; | |
176 | esac | |
177 | case $targ in | |
178 | arm-*pe*) | |
179 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' | |
180 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" | |
181 | BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' | |
7a7b06ef | 182 | ;; |
252b5132 RH |
183 | thumb-*pe*) |
184 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' | |
185 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" | |
186 | BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' | |
7a7b06ef | 187 | ;; |
252b5132 RH |
188 | changequote(,)dnl |
189 | i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*) | |
190 | changequote([,])dnl | |
191 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' | |
192 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" | |
193 | BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' | |
194 | BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' | |
7a7b06ef ILT |
195 | ;; |
196 | i[3-6]86-*-interix) | |
197 | BUILD_DLLTOOL='$(DLLTOOL_PROG)' | |
198 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" | |
199 | ;; | |
252b5132 RH |
200 | powerpc*-*-*pe* | powerpc*-*-cygwin*) |
201 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' | |
202 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" | |
203 | BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' | |
7a7b06ef | 204 | ;; |
661016bb NC |
205 | mcore-*pe) |
206 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' | |
207 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE" | |
208 | BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' | |
7a7b06ef | 209 | ;; |
661016bb NC |
210 | mcore-*elf) |
211 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' | |
212 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF" | |
7a7b06ef | 213 | ;; |
252b5132 RH |
214 | esac |
215 | fi | |
216 | done | |
217 | ||
218 | AC_SUBST(NLMCONV_DEFS) | |
219 | AC_SUBST(BUILD_NLMCONV) | |
220 | AC_SUBST(BUILD_SRCONV) | |
221 | AC_SUBST(BUILD_DLLTOOL) | |
222 | AC_SUBST(DLLTOOL_DEFS) | |
223 | AC_SUBST(BUILD_WINDRES) | |
224 | AC_SUBST(BUILD_DLLWRAP) | |
225 | AC_SUBST(BUILD_MISC) | |
226 | ||
227 | AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.]) | |
228 | ||
229 | targ=$target | |
230 | . $srcdir/../bfd/config.bfd | |
231 | if test "x$targ_underscore" = "xyes"; then | |
232 | UNDERSCORE=1 | |
233 | else | |
234 | UNDERSCORE=0 | |
235 | fi | |
236 | AC_SUBST(UNDERSCORE) | |
237 | ||
238 | AC_OUTPUT(Makefile po/Makefile.in:po/Make-in, | |
239 | [ | |
240 | case "x$CONFIG_FILES" in | |
241 | *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; | |
242 | esac | |
243 | ]) |