]> Git Repo - binutils.git/blame - binutils/configure.in
* binutils-all/ar.exp: New file.
[binutils.git] / binutils / configure.in
CommitLineData
5ab6ca68
ILT
1dnl Process this file with autoconf to produce a configure script.
2dnl
3AC_PREREQ(2.0)
4AC_INIT(ar.c)
5
6AC_ARG_ENABLE(targets,
7[ --enable-targets alternative target configurations],
8[case "${enableval}" in
9 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
10 ;;
11 no) enable_targets= ;;
12 *) enable_targets=$enableval ;;
13esac])dnl
14
320d4f29 15AC_CONFIG_HEADER(config.h:config.in)
5ab6ca68
ILT
16
17AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
18AC_CANONICAL_SYSTEM
19if test -z "$target" ; then
20 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
21fi
22if test -z "$host" ; then
23 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
24fi
25AC_ARG_PROGRAM
db19f828 26
5ab6ca68 27# host-specific stuff:
db19f828 28
5ab6ca68
ILT
29HDEFINES=
30LDFLAGS=
db19f828 31
b5775df3
DHW
32. ${srcdir}/../bfd/configure.host
33
5ab6ca68
ILT
34AC_PROG_CC
35AC_SUBST(CFLAGS)
36AC_SUBST(HDEFINES)
37AC_SUBST(LDFLAGS)
38AR=${AR-ar}
39AC_SUBST(AR)
40AC_PROG_RANLIB
41AC_PROG_INSTALL
42
320d4f29
ILT
43BFD_CC_FOR_BUILD
44
5ab6ca68
ILT
45AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
46AC_CHECK_FUNCS(sbrk utimes)
47
48AC_MSG_CHECKING(for time_t in time.h)
49AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
50[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
51bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
52AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
53if test $bu_cv_decl_time_t_time_h = yes; then
54 AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
55fi
56
57AC_MSG_CHECKING(for time_t in sys/types.h)
58AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
59[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
60bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
61AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
62if test $bu_cv_decl_time_t_types_h = yes; then
63 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
64fi
65
66# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
67# by default.
68AC_MSG_CHECKING([for utime.h])
69AC_CACHE_VAL(bu_cv_header_utime_h,
70[AC_TRY_COMPILE([#include <sys/types.h>
71#ifdef HAVE_TIME_H
72#include <time.h>
73#endif
74#include <utime.h>],
75[struct utimbuf s;],
76bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
77AC_MSG_RESULT($bu_cv_header_utime_h)
78if test $bu_cv_header_utime_h = yes; then
79 AC_DEFINE(HAVE_GOOD_UTIME_H)
80fi
81
82AC_MSG_CHECKING([whether fprintf must be declared])
83AC_CACHE_VAL(bu_cv_decl_needed_fprintf,
84[AC_TRY_COMPILE([#include <stdio.h>],
85[int (*pfn) = (int (*)) fprintf],
86bu_cv_decl_needed_fprintf=no, bu_cv_decl_needed_fprintf=yes)])
87AC_MSG_RESULT($bu_cv_decl_needed_fprintf)
88if test $bu_cv_decl_needed_fprintf = yes; then
89 AC_DEFINE(NEED_DECLARATION_FPRINTF)
90fi
91
320d4f29 92BFD_BINARY_FOPEN
5ab6ca68
ILT
93
94# target-specific stuff:
b5775df3
DHW
95
96# Canonicalize the secondary target names.
5ab6ca68
ILT
97target_makefile_fragment=/dev/null
98if test -n "$enable_targets"; then
99ac7754 99 for targ in `echo $enable_targets | sed 's/,/ /g'`
b5775df3 100 do
5ab6ca68
ILT
101 result=`$ac_config_sub $targ 2>/dev/null`
102 if test -n "$result"; then
b5775df3
DHW
103 canon_targets="$canon_targets $result"
104 else
105 # Allow targets that config.sub doesn't recognize, like "all".
106 canon_targets="$canon_targets $targ"
107 fi
108 done
109else
5ab6ca68 110 # If our target is rs6000 _and nothing else_ then we build only nm!
b5775df3 111 case $target in
5ab6ca68 112 rs6000-*-lynx*) target_makefile_fragment=${srcdir}/config/rslynx ;;
b5775df3
DHW
113 esac
114fi
5ab6ca68 115AC_SUBST_FILE(target_makefile_fragment)
b5775df3
DHW
116
117all_targets=false
5ab6ca68
ILT
118BUILD_NLMCONV=
119NLMCONV_DEFS=
120BUILD_SRCONV=
121BUILD_DLLTOOL=
122DLLTOOL_DEFS=
b5775df3
DHW
123
124for targ in $target $canon_targets
125do
5ab6ca68 126 if test "x$targ" = "xall"; then
b5775df3 127 all_targets=true
5ab6ca68
ILT
128 BUILD_NLMCONV='$(NLMCONV_PROG)'
129 BUILD_SRCONV='$(SRCONV_PROG)'
130 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
b5775df3
DHW
131 else
132 case $targ in
5ab6ca68 133changequote(,)dnl
99ac7754 134 i[345]86*-*-netware*)
5ab6ca68
ILT
135changequote([,])dnl
136 BUILD_NLMCONV='$(NLMCONV_PROG)'
137 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
99ac7754
JM
138 ;;
139 alpha*-*-netware*)
5ab6ca68
ILT
140 BUILD_NLMCONV='$(NLMCONV_PROG)'
141 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
99ac7754
JM
142 ;;
143 powerpc*-*-netware*)
5ab6ca68
ILT
144 BUILD_NLMCONV='$(NLMCONV_PROG)'
145 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
99ac7754
JM
146 ;;
147 sparc*-*-netware*)
5ab6ca68
ILT
148 BUILD_NLMCONV='$(NLMCONV_PROG)'
149 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
99ac7754 150 ;;
b5775df3 151 esac
b5775df3 152 case $targ in
5ab6ca68 153 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
b5775df3 154 esac
99ac7754
JM
155 case $targ in
156 arm-*pe*)
5ab6ca68
ILT
157 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
158 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
99ac7754 159 ;;
5ab6ca68 160changequote(,)dnl
99ac7754 161 i[3-6]86-*pe* | i[3-6]86-*-win32)
5ab6ca68
ILT
162changequote([,])dnl
163 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
164 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
99ac7754
JM
165 ;;
166 esac
b5775df3
DHW
167 fi
168done
169
5ab6ca68
ILT
170AC_SUBST(NLMCONV_DEFS)
171AC_SUBST(BUILD_NLMCONV)
172AC_SUBST(BUILD_SRCONV)
173AC_SUBST(BUILD_DLLTOOL)
174AC_SUBST(DLLTOOL_DEFS)
99ac7754 175
fe48a154
ILT
176targ=$target
177. $srcdir/../bfd/config.bfd
178if test "x$targ_underscore" = "xyes"; then
5ab6ca68 179 UNDERSCORE=1
6f88f031 180else
5ab6ca68 181 UNDERSCORE=0
6f88f031 182fi
5ab6ca68
ILT
183AC_SUBST(UNDERSCORE)
184
185AC_OUTPUT(Makefile,
320d4f29 186[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.289366 seconds and 4 git commands to generate.