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)
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
43 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
44 AC_CHECK_FUNCS(sbrk utimes)
46 AC_MSG_CHECKING(for time_t in time.h)
47 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
48 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
49 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
50 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
51 if test $bu_cv_decl_time_t_time_h = yes; then
52 AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
55 AC_MSG_CHECKING(for time_t in sys/types.h)
56 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
57 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
58 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
59 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
60 if test $bu_cv_decl_time_t_types_h = yes; then
61 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
64 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
66 AC_MSG_CHECKING([for utime.h])
67 AC_CACHE_VAL(bu_cv_header_utime_h,
68 [AC_TRY_COMPILE([#include <sys/types.h>
74 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
75 AC_MSG_RESULT($bu_cv_header_utime_h)
76 if test $bu_cv_header_utime_h = yes; then
77 AC_DEFINE(HAVE_GOOD_UTIME_H)
80 AC_MSG_CHECKING([whether fprintf must be declared])
81 AC_CACHE_VAL(bu_cv_decl_needed_fprintf,
82 [AC_TRY_COMPILE([#include <stdio.h>],
83 [int (*pfn) = (int (*)) fprintf],
84 bu_cv_decl_needed_fprintf=no, bu_cv_decl_needed_fprintf=yes)])
85 AC_MSG_RESULT($bu_cv_decl_needed_fprintf)
86 if test $bu_cv_decl_needed_fprintf = yes; then
87 AC_DEFINE(NEED_DECLARATION_FPRINTF)
90 dnl FIXME: We should check this in some central place somehow
92 i[345]86-*-msdos* | i[345]86-*-go32* | i[345]86-*-win32)
93 AC_DEFINE(USE_BINARY_FOPEN) ;;
96 # target-specific stuff:
98 # Canonicalize the secondary target names.
99 target_makefile_fragment=/dev/null
100 if test -n "$enable_targets"; then
101 for targ in `echo $enable_targets | sed 's/,/ /g'`
103 result=`$ac_config_sub $targ 2>/dev/null`
104 if test -n "$result"; then
105 canon_targets="$canon_targets $result"
107 # Allow targets that config.sub doesn't recognize, like "all".
108 canon_targets="$canon_targets $targ"
112 # If our target is rs6000 _and nothing else_ then we build only nm!
114 rs6000-*-lynx*) target_makefile_fragment=${srcdir}/config/rslynx ;;
117 AC_SUBST_FILE(target_makefile_fragment)
126 for targ in $target $canon_targets
128 if test "x$targ" = "xall"; then
130 BUILD_NLMCONV='$(NLMCONV_PROG)'
131 BUILD_SRCONV='$(SRCONV_PROG)'
132 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
136 i[345]86*-*-netware*)
138 BUILD_NLMCONV='$(NLMCONV_PROG)'
139 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
142 BUILD_NLMCONV='$(NLMCONV_PROG)'
143 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
146 BUILD_NLMCONV='$(NLMCONV_PROG)'
147 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
150 BUILD_NLMCONV='$(NLMCONV_PROG)'
151 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
155 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
159 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
160 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
163 i[3-6]86-*pe* | i[3-6]86-*-win32)
165 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
166 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
172 AC_SUBST(NLMCONV_DEFS)
173 AC_SUBST(BUILD_NLMCONV)
174 AC_SUBST(BUILD_SRCONV)
175 AC_SUBST(BUILD_DLLTOOL)
176 AC_SUBST(DLLTOOL_DEFS)
179 . $srcdir/../bfd/config.bfd
180 if test "x$targ_underscore" = "xyes"; then
188 [case x$CONFIG_HEADERS in xconfig.h) echo > stamp-h ;; esac])