document behaviour of dot inside sections.
[binutils.git] / binutils / configure.in
blob7da8ab6cc4410f40dc71be3f3b9158f290ee4f22
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 AC_PREREQ(2.13)
4 AC_INIT(ar.c)
6 AC_CANONICAL_SYSTEM
8 AM_INIT_AUTOMAKE(binutils, 2.9.4)
10 AM_PROG_LIBTOOL
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
28 AM_CONFIG_HEADER(config.h:config.in)
30 if test -z "$target" ; then
31     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
33 if test -z "$host" ; then
34     AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
37 AC_PROG_CC
39 AC_PROG_YACC
40 AM_PROG_LEX
42 ALL_LINGUAS=
43 CY_GNU_GETTEXT
45 AM_MAINTAINER_MODE
46 AC_EXEEXT
48 # host-specific stuff:
50 HDEFINES=
52 . ${srcdir}/../bfd/configure.host
54 AC_SUBST(HDEFINES)
55 AR=${AR-ar}
56 AC_SUBST(AR)
57 AC_PROG_RANLIB
58 AC_PROG_INSTALL
60 BFD_CC_FOR_BUILD
62 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
63 AC_HEADER_SYS_WAIT
64 AC_FUNC_ALLOCA
65 AC_CHECK_FUNCS(sbrk utimes)
67 # Some systems have frexp only in -lm, not in -lc.
68 AC_SEARCH_LIBS(frexp, -lm)
70 AC_MSG_CHECKING(for time_t in time.h)
71 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
72 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
73 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
74 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
75 if test $bu_cv_decl_time_t_time_h = yes; then
76   AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
77             [Is the type time_t defined in <time.h>?])
80 AC_MSG_CHECKING(for time_t in sys/types.h)
81 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
82 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
83 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
84 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
85 if test $bu_cv_decl_time_t_types_h = yes; then
86   AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
87             [Is the type time_t defined in <sys/types.h>?])
90 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
91 # by default.
92 AC_MSG_CHECKING([for utime.h])
93 AC_CACHE_VAL(bu_cv_header_utime_h,
94 [AC_TRY_COMPILE([#include <sys/types.h>
95 #ifdef HAVE_TIME_H
96 #include <time.h>
97 #endif
98 #include <utime.h>],
99 [struct utimbuf s;],
100 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
101 AC_MSG_RESULT($bu_cv_header_utime_h)
102 if test $bu_cv_header_utime_h = yes; then
103   AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
106 BFD_NEED_DECLARATION(fprintf)
107 BFD_NEED_DECLARATION(strstr)
108 BFD_NEED_DECLARATION(sbrk)
109 BFD_NEED_DECLARATION(getenv)
110 BFD_NEED_DECLARATION(environ)
112 BFD_BINARY_FOPEN
114 # target-specific stuff:
116 # Canonicalize the secondary target names.
117 if test -n "$enable_targets"; then
118     for targ in `echo $enable_targets | sed 's/,/ /g'`
119     do
120         result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
121         if test -n "$result"; then
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
130 all_targets=false
131 BUILD_NLMCONV=
132 NLMCONV_DEFS=
133 BUILD_SRCONV=
134 BUILD_DLLTOOL=
135 DLLTOOL_DEFS=
136 BUILD_WINDRES=
137 BUILD_DLLWRAP=
138 BUILD_MISC=
140 for targ in $target $canon_targets
142     if test "x$targ" = "xall"; then
143         all_targets=true
144         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
145         BUILD_SRCONV='$(SRCONV_PROG)'
146         NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
147     else
148         case $targ in
149 changequote(,)dnl
150         i[3456]86*-*-netware*) 
151 changequote([,])dnl
152           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
153           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
154           ;;
155         alpha*-*-netware*)
156           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
157           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
158           ;;
159         powerpc*-*-netware*)
160           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
161           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
162           ;;
163         sparc*-*-netware*)
164           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
165           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
166           ;;
167         esac
168         case $targ in
169         *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
170         esac
171         case $targ in
172         arm-*pe*)
173           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
174           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
175           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
176          ;;
177         thumb-*pe*)
178           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
179           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
180           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
181          ;;
182 changequote(,)dnl
183         i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
184 changequote([,])dnl
185           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
186           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
187           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
188           BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
189          ;;
190         powerpc*-*-*pe* | powerpc*-*-cygwin*)
191           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
192           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
193           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
194          ;;
195         mcore-*pe)
196           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
197           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
198           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
199          ;;
200         mcore-*elf)
201           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
202           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
203          ;;
204         esac
205     fi
206 done
208 AC_SUBST(NLMCONV_DEFS)
209 AC_SUBST(BUILD_NLMCONV)
210 AC_SUBST(BUILD_SRCONV)
211 AC_SUBST(BUILD_DLLTOOL)
212 AC_SUBST(DLLTOOL_DEFS)
213 AC_SUBST(BUILD_WINDRES)
214 AC_SUBST(BUILD_DLLWRAP)
215 AC_SUBST(BUILD_MISC)
217 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
219 targ=$target
220 . $srcdir/../bfd/config.bfd
221 if test "x$targ_underscore" = "xyes"; then
222     UNDERSCORE=1
223 else
224     UNDERSCORE=0
226 AC_SUBST(UNDERSCORE)
228 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
230 case "x$CONFIG_FILES" in
231 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
232 esac