1 dnl Process this file with autoconf to produce a configure script.
7 [ --enable-targets alternative target configurations],
8 [case "${enableval}" in
9 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
11 no) enable_targets= ;;
12 *) enable_targets=$enableval ;;
15 [ --enable-shared build shared BFD library],
16 [case "${enableval}" in
19 *) AC_MSG_ERROR([bad value ${enableval} for BFD shared option]) ;;
22 AC_CONFIG_HEADER(config.h:config.in)
24 AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
26 if test -z "$target" ; then
27 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
29 if test -z "$host" ; then
30 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
34 # host-specific stuff:
40 . ${srcdir}/../bfd/configure.host
52 # For most hosts we can use a simple definition to pick up the BFD and
53 # opcodes libraries. However, if we are building shared libraries, we
54 # need to handle some hosts specially.
55 BFDLIB='-L../bfd -lbfd'
56 OPCODES='-L../opcodes -lopcodes'
57 if test "${shared}" = "true"; then
60 # On SunOS, we must link against the name we are going to install,
61 # not -lbfd, since SunOS does not support SONAME.
62 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
63 OPCODES='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
72 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
74 AC_CHECK_FUNCS(sbrk utimes)
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])
85 AC_MSG_CHECKING(for time_t in sys/types.h)
86 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
87 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
88 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
89 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
90 if test $bu_cv_decl_time_t_types_h = yes; then
91 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
94 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
96 AC_MSG_CHECKING([for utime.h])
97 AC_CACHE_VAL(bu_cv_header_utime_h,
98 [AC_TRY_COMPILE([#include <sys/types.h>
104 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
105 AC_MSG_RESULT($bu_cv_header_utime_h)
106 if test $bu_cv_header_utime_h = yes; then
107 AC_DEFINE(HAVE_GOOD_UTIME_H)
110 BFD_NEED_DECLARATION(fprintf)
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'`
120 result=`$ac_config_sub $targ 2>/dev/null`
121 if test -n "$result"; then
122 canon_targets="$canon_targets $result"
124 # Allow targets that config.sub doesn't recognize, like "all".
125 canon_targets="$canon_targets $targ"
137 for targ in $target $canon_targets
139 if test "x$targ" = "xall"; then
141 BUILD_NLMCONV='$(NLMCONV_PROG)'
142 BUILD_SRCONV='$(SRCONV_PROG)'
143 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
147 i[345]86*-*-netware*)
149 BUILD_NLMCONV='$(NLMCONV_PROG)'
150 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
153 BUILD_NLMCONV='$(NLMCONV_PROG)'
154 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
157 BUILD_NLMCONV='$(NLMCONV_PROG)'
158 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
161 BUILD_NLMCONV='$(NLMCONV_PROG)'
162 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
166 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
170 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
171 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
174 i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
176 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
177 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
179 powerpc*-*-*pe* | powerpc*-*-cygwin32)
180 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
181 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
187 AC_SUBST(NLMCONV_DEFS)
188 AC_SUBST(BUILD_NLMCONV)
189 AC_SUBST(BUILD_SRCONV)
190 AC_SUBST(BUILD_DLLTOOL)
191 AC_SUBST(DLLTOOL_DEFS)
194 . $srcdir/../bfd/config.bfd
195 if test "x$targ_underscore" = "xyes"; then
203 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])