Commit | Line | Data |
---|---|---|
5ab6ca68 ILT |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | dnl | |
33106b60 | 3 | AC_PREREQ(2.5) |
5ab6ca68 ILT |
4 | AC_INIT(ar.c) |
5 | ||
d467c30d ILT |
6 | AC_CANONICAL_SYSTEM |
7 | ||
5b10df4a | 8 | AM_INIT_AUTOMAKE(binutils, 2.9.4) |
d467c30d ILT |
9 | |
10 | AM_PROG_LIBTOOL | |
11 | ||
5ab6ca68 ILT |
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 | |
33106b60 ILT |
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]) ;; | |
36fb98be | 26 | esac])dnl |
5ab6ca68 | 27 | |
d467c30d | 28 | AM_CONFIG_HEADER(config.h:config.in) |
5ab6ca68 | 29 | |
5ab6ca68 ILT |
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 | |
db19f828 | 36 | |
d467c30d ILT |
37 | AC_PROG_CC |
38 | ||
39 | AC_PROG_YACC | |
9d04d618 TT |
40 | AM_PROG_LEX |
41 | ||
42 | ALL_LINGUAS= | |
43 | CY_GNU_GETTEXT | |
d467c30d ILT |
44 | |
45 | AM_MAINTAINER_MODE | |
46 | AM_CYGWIN32 | |
47 | AM_EXEEXT | |
48 | ||
5ab6ca68 | 49 | # host-specific stuff: |
db19f828 | 50 | |
5ab6ca68 | 51 | HDEFINES= |
33106b60 | 52 | |
b5775df3 DHW |
53 | . ${srcdir}/../bfd/configure.host |
54 | ||
5ab6ca68 | 55 | AC_SUBST(HDEFINES) |
5ab6ca68 ILT |
56 | AR=${AR-ar} |
57 | AC_SUBST(AR) | |
58 | AC_PROG_RANLIB | |
d467c30d | 59 | AM_PROG_INSTALL |
36fb98be | 60 | |
320d4f29 ILT |
61 | BFD_CC_FOR_BUILD |
62 | ||
5ab6ca68 | 63 | AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h) |
ae0daa11 | 64 | AC_HEADER_SYS_WAIT |
33106b60 | 65 | AC_FUNC_ALLOCA |
5ab6ca68 ILT |
66 | AC_CHECK_FUNCS(sbrk utimes) |
67 | ||
68 | AC_MSG_CHECKING(for time_t in time.h) | |
69 | AC_CACHE_VAL(bu_cv_decl_time_t_time_h, | |
70 | [AC_TRY_COMPILE([#include <time.h>], [time_t i;], | |
71 | bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)]) | |
72 | AC_MSG_RESULT($bu_cv_decl_time_t_time_h) | |
73 | if test $bu_cv_decl_time_t_time_h = yes; then | |
74 | AC_DEFINE([HAVE_TIME_T_IN_TIME_H]) | |
75 | fi | |
76 | ||
77 | AC_MSG_CHECKING(for time_t in sys/types.h) | |
78 | AC_CACHE_VAL(bu_cv_decl_time_t_types_h, | |
79 | [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;], | |
80 | bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)]) | |
81 | AC_MSG_RESULT($bu_cv_decl_time_t_types_h) | |
82 | if test $bu_cv_decl_time_t_types_h = yes; then | |
83 | AC_DEFINE([HAVE_TIME_T_IN_TYPES_H]) | |
84 | fi | |
85 | ||
86 | # Under Next 3.2 <utime.h> apparently does not define struct utimbuf | |
87 | # by default. | |
88 | AC_MSG_CHECKING([for utime.h]) | |
89 | AC_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;], | |
96 | bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)]) | |
97 | AC_MSG_RESULT($bu_cv_header_utime_h) | |
98 | if test $bu_cv_header_utime_h = yes; then | |
99 | AC_DEFINE(HAVE_GOOD_UTIME_H) | |
100 | fi | |
101 | ||
36fb98be | 102 | BFD_NEED_DECLARATION(fprintf) |
33106b60 ILT |
103 | BFD_NEED_DECLARATION(strstr) |
104 | BFD_NEED_DECLARATION(sbrk) | |
105 | BFD_NEED_DECLARATION(getenv) | |
5ab6ca68 | 106 | |
320d4f29 | 107 | BFD_BINARY_FOPEN |
5ab6ca68 ILT |
108 | |
109 | # target-specific stuff: | |
b5775df3 DHW |
110 | |
111 | # Canonicalize the secondary target names. | |
5ab6ca68 | 112 | if 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 |
123 | fi |
124 | ||
125 | all_targets=false | |
5ab6ca68 ILT |
126 | BUILD_NLMCONV= |
127 | NLMCONV_DEFS= | |
128 | BUILD_SRCONV= | |
129 | BUILD_DLLTOOL= | |
130 | DLLTOOL_DEFS= | |
1d371d35 | 131 | BUILD_WINDRES= |
b5775df3 DHW |
132 | |
133 | for targ in $target $canon_targets | |
134 | do | |
5ab6ca68 | 135 | if test "x$targ" = "xall"; then |
b5775df3 | 136 | all_targets=true |
bf2a3cb1 ILT |
137 | BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' |
138 | BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)' | |
5ab6ca68 | 139 | NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" |
b5775df3 DHW |
140 | else |
141 | case $targ in | |
5ab6ca68 | 142 | changequote(,)dnl |
33106b60 | 143 | i[3456]86*-*-netware*) |
5ab6ca68 | 144 | changequote([,])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 |
bf2a3cb1 | 162 | *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)' ;; |
b5775df3 | 163 | esac |
99ac7754 JM |
164 | case $targ in |
165 | arm-*pe*) | |
bf2a3cb1 | 166 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' |
5ab6ca68 | 167 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" |
bf2a3cb1 | 168 | BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' |
99ac7754 | 169 | ;; |
5ab6ca68 | 170 | changequote(,)dnl |
9d04d618 | 171 | i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*) |
5ab6ca68 | 172 | changequote([,])dnl |
bf2a3cb1 | 173 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' |
5ab6ca68 | 174 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" |
bf2a3cb1 | 175 | BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' |
99ac7754 | 176 | ;; |
36fb98be | 177 | powerpc*-*-*pe* | powerpc*-*-cygwin32) |
bf2a3cb1 | 178 | BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' |
36fb98be | 179 | DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" |
bf2a3cb1 | 180 | BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' |
36fb98be | 181 | ;; |
99ac7754 | 182 | esac |
b5775df3 DHW |
183 | fi |
184 | done | |
185 | ||
5ab6ca68 ILT |
186 | AC_SUBST(NLMCONV_DEFS) |
187 | AC_SUBST(BUILD_NLMCONV) | |
188 | AC_SUBST(BUILD_SRCONV) | |
189 | AC_SUBST(BUILD_DLLTOOL) | |
190 | AC_SUBST(DLLTOOL_DEFS) | |
1d371d35 | 191 | AC_SUBST(BUILD_WINDRES) |
99ac7754 | 192 | |
9d04d618 TT |
193 | AC_DEFINE_UNQUOTED(TARGET, "${target}") |
194 | ||
fe48a154 ILT |
195 | targ=$target |
196 | . $srcdir/../bfd/config.bfd | |
197 | if test "x$targ_underscore" = "xyes"; then | |
5ab6ca68 | 198 | UNDERSCORE=1 |
6f88f031 | 199 | else |
5ab6ca68 | 200 | UNDERSCORE=0 |
6f88f031 | 201 | fi |
5ab6ca68 ILT |
202 | AC_SUBST(UNDERSCORE) |
203 | ||
9d04d618 TT |
204 | AC_OUTPUT(Makefile po/Makefile.in:po/Make-in, |
205 | [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile]) |