]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/binutils/binutils/configure.in
This commit was generated by cvs2svn to compensate for changes in r55099,
[FreeBSD/FreeBSD.git] / contrib / binutils / binutils / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 AC_PREREQ(2.5)
4 AC_INIT(ar.c)
5
6 AC_CANONICAL_SYSTEM
7
8 AM_INIT_AUTOMAKE(binutils, 2.9.1)
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 AC_PROG_LEX
41 AC_DECL_YYTEXT
42
43 AM_MAINTAINER_MODE
44 AM_CYGWIN32
45 AM_EXEEXT
46
47 # host-specific stuff:
48
49 HDEFINES=
50
51 . ${srcdir}/../bfd/configure.host
52
53 AC_SUBST(HDEFINES)
54 AR=${AR-ar}
55 AC_SUBST(AR)
56 AC_PROG_RANLIB
57 AM_PROG_INSTALL
58
59 BFD_CC_FOR_BUILD
60
61 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
62 AC_HEADER_SYS_WAIT
63 AC_FUNC_ALLOCA
64 AC_CHECK_FUNCS(sbrk utimes)
65
66 AC_MSG_CHECKING(for time_t in time.h)
67 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
68 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
69 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
70 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
71 if test $bu_cv_decl_time_t_time_h = yes; then
72   AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
73 fi
74
75 AC_MSG_CHECKING(for time_t in sys/types.h)
76 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
77 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
78 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
79 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
80 if test $bu_cv_decl_time_t_types_h = yes; then
81   AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
82 fi
83
84 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
85 # by default.
86 AC_MSG_CHECKING([for utime.h])
87 AC_CACHE_VAL(bu_cv_header_utime_h,
88 [AC_TRY_COMPILE([#include <sys/types.h>
89 #ifdef HAVE_TIME_H
90 #include <time.h>
91 #endif
92 #include <utime.h>],
93 [struct utimbuf s;],
94 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
95 AC_MSG_RESULT($bu_cv_header_utime_h)
96 if test $bu_cv_header_utime_h = yes; then
97   AC_DEFINE(HAVE_GOOD_UTIME_H)
98 fi
99
100 BFD_NEED_DECLARATION(fprintf)
101 BFD_NEED_DECLARATION(strstr)
102 BFD_NEED_DECLARATION(sbrk)
103 BFD_NEED_DECLARATION(getenv)
104
105 BFD_BINARY_FOPEN
106
107 # target-specific stuff:
108
109 # Canonicalize the secondary target names.
110 if test -n "$enable_targets"; then
111     for targ in `echo $enable_targets | sed 's/,/ /g'`
112     do
113         result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
114         if test -n "$result"; then
115             canon_targets="$canon_targets $result"
116         else
117             # Allow targets that config.sub doesn't recognize, like "all".
118             canon_targets="$canon_targets $targ"
119         fi
120     done
121 fi
122
123 all_targets=false
124 BUILD_NLMCONV=
125 NLMCONV_DEFS=
126 BUILD_SRCONV=
127 BUILD_DLLTOOL=
128 DLLTOOL_DEFS=
129 BUILD_WINDRES=
130
131 for targ in $target $canon_targets
132 do
133     if test "x$targ" = "xall"; then
134         all_targets=true
135         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
136         BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)'
137         NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
138     else
139         case $targ in
140 changequote(,)dnl
141         i[3456]86*-*-netware*) 
142 changequote([,])dnl
143           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
144           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
145           ;;
146         alpha*-*-netware*)
147           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
148           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
149           ;;
150         powerpc*-*-netware*)
151           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
152           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
153           ;;
154         sparc*-*-netware*)
155           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
156           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
157           ;;
158         esac
159         case $targ in
160         *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)' ;;
161         esac
162         case $targ in
163         arm-*pe*)
164           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
165           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
166           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
167          ;;
168 changequote(,)dnl
169         i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
170 changequote([,])dnl
171           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
172           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
173           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
174          ;;
175         powerpc*-*-*pe* | powerpc*-*-cygwin32)
176           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
177           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
178           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
179          ;;
180         esac
181     fi
182 done
183
184 AC_SUBST(NLMCONV_DEFS)
185 AC_SUBST(BUILD_NLMCONV)
186 AC_SUBST(BUILD_SRCONV)
187 AC_SUBST(BUILD_DLLTOOL)
188 AC_SUBST(DLLTOOL_DEFS)
189 AC_SUBST(BUILD_WINDRES)
190
191 AC_DEFINE_UNQUOTED(TARGET, "${target}")
192
193 targ=$target
194 . $srcdir/../bfd/config.bfd
195 if test "x$targ_underscore" = "xyes"; then
196     UNDERSCORE=1
197 else
198     UNDERSCORE=0
199 fi
200 AC_SUBST(UNDERSCORE)
201
202 AC_OUTPUT(Makefile)