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 AC_CONFIG_HEADER(config.h:config.in)
17 AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
19 if test -z "$target" ; then
20 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
22 if test -z "$host" ; then
23 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
27 # host-specific stuff:
32 . ${srcdir}/../bfd/configure.host
45 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
47 AC_CHECK_FUNCS(sbrk utimes)
49 AC_MSG_CHECKING(for time_t in time.h)
50 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
51 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
52 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
53 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
54 if test $bu_cv_decl_time_t_time_h = yes; then
55 AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
58 AC_MSG_CHECKING(for time_t in sys/types.h)
59 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
60 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
61 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
62 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
63 if test $bu_cv_decl_time_t_types_h = yes; then
64 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
67 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
69 AC_MSG_CHECKING([for utime.h])
70 AC_CACHE_VAL(bu_cv_header_utime_h,
71 [AC_TRY_COMPILE([#include <sys/types.h>
77 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
78 AC_MSG_RESULT($bu_cv_header_utime_h)
79 if test $bu_cv_header_utime_h = yes; then
80 AC_DEFINE(HAVE_GOOD_UTIME_H)
83 AC_MSG_CHECKING([whether fprintf must be declared])
84 AC_CACHE_VAL(bu_cv_decl_needed_fprintf,
85 [AC_TRY_COMPILE([#include <stdio.h>],
86 [int (*pfn) = (int (*)) fprintf],
87 bu_cv_decl_needed_fprintf=no, bu_cv_decl_needed_fprintf=yes)])
88 AC_MSG_RESULT($bu_cv_decl_needed_fprintf)
89 if test $bu_cv_decl_needed_fprintf = yes; then
90 AC_DEFINE(NEED_DECLARATION_FPRINTF)
95 # target-specific stuff:
97 # Canonicalize the secondary target names.
98 if test -n "$enable_targets"; then
99 for targ in `echo $enable_targets | sed 's/,/ /g'`
101 result=`$ac_config_sub $targ 2>/dev/null`
102 if test -n "$result"; then
103 canon_targets="$canon_targets $result"
105 # Allow targets that config.sub doesn't recognize, like "all".
106 canon_targets="$canon_targets $targ"
118 for targ in $target $canon_targets
120 if test "x$targ" = "xall"; then
122 BUILD_NLMCONV='$(NLMCONV_PROG)'
123 BUILD_SRCONV='$(SRCONV_PROG)'
124 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
128 i[345]86*-*-netware*)
130 BUILD_NLMCONV='$(NLMCONV_PROG)'
131 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
134 BUILD_NLMCONV='$(NLMCONV_PROG)'
135 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
138 BUILD_NLMCONV='$(NLMCONV_PROG)'
139 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
142 BUILD_NLMCONV='$(NLMCONV_PROG)'
143 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
147 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
151 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
152 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
155 i[3-6]86-*pe* | i[3-6]86-*-win32)
157 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
158 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
164 AC_SUBST(NLMCONV_DEFS)
165 AC_SUBST(BUILD_NLMCONV)
166 AC_SUBST(BUILD_SRCONV)
167 AC_SUBST(BUILD_DLLTOOL)
168 AC_SUBST(DLLTOOL_DEFS)
171 . $srcdir/../bfd/config.bfd
172 if test "x$targ_underscore" = "xyes"; then
180 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])