Thu Jul 18 01:22:01 1996 Geoffrey Noer <noer@cygnus.com>
[deliverable/binutils-gdb.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
36fb98be
ILT
14AC_ARG_ENABLE(shared,
15[ --enable-shared build shared BFD library],
16[case "${enableval}" in
17 yes) shared=true ;;
18 no) shared=false ;;
19 *) AC_MSG_ERROR([bad value ${enableval} for BFD shared option]) ;;
20esac])dnl
5ab6ca68 21
320d4f29 22AC_CONFIG_HEADER(config.h:config.in)
5ab6ca68
ILT
23
24AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
25AC_CANONICAL_SYSTEM
26if test -z "$target" ; then
27 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
28fi
29if test -z "$host" ; then
30 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
31fi
32AC_ARG_PROGRAM
db19f828 33
5ab6ca68 34# host-specific stuff:
db19f828 35
5ab6ca68
ILT
36HDEFINES=
37LDFLAGS=
36fb98be 38HLDFLAGS=
efa86453 39RPATH_ENVVAR=LD_LIBRARY_PATH
db19f828 40
b5775df3
DHW
41. ${srcdir}/../bfd/configure.host
42
5ab6ca68
ILT
43AC_PROG_CC
44AC_SUBST(CFLAGS)
45AC_SUBST(HDEFINES)
46AC_SUBST(LDFLAGS)
36fb98be 47AC_SUBST(HLDFLAGS)
efa86453 48AC_SUBST(RPATH_ENVVAR)
5ab6ca68
ILT
49AR=${AR-ar}
50AC_SUBST(AR)
51AC_PROG_RANLIB
52AC_PROG_INSTALL
53
36fb98be
ILT
54# For most hosts we can use a simple definition to pick up the BFD and
55# opcodes libraries. However, if we are building shared libraries, we
56# need to handle some hosts specially.
57BFDLIB='-L../bfd -lbfd'
58OPCODES='-L../opcodes -lopcodes'
59if test "${shared}" = "true"; then
60 case "${host}" in
61 *-*-sunos*)
62 # On SunOS, we must link against the name we are going to install,
63 # not -lbfd, since SunOS does not support SONAME.
64 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
65 OPCODES='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
66 ;;
67 esac
68fi
69AC_SUBST(BFDLIB)
70AC_SUBST(OPCODES)
71
320d4f29
ILT
72BFD_CC_FOR_BUILD
73
5ab6ca68 74AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
ae0daa11 75AC_HEADER_SYS_WAIT
5ab6ca68
ILT
76AC_CHECK_FUNCS(sbrk utimes)
77
78AC_MSG_CHECKING(for time_t in time.h)
79AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
80[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
81bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
82AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
83if test $bu_cv_decl_time_t_time_h = yes; then
84 AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
85fi
86
87AC_MSG_CHECKING(for time_t in sys/types.h)
88AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
89[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
90bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
91AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
92if test $bu_cv_decl_time_t_types_h = yes; then
93 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
94fi
95
96# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
97# by default.
98AC_MSG_CHECKING([for utime.h])
99AC_CACHE_VAL(bu_cv_header_utime_h,
100[AC_TRY_COMPILE([#include <sys/types.h>
101#ifdef HAVE_TIME_H
102#include <time.h>
103#endif
104#include <utime.h>],
105[struct utimbuf s;],
106bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
107AC_MSG_RESULT($bu_cv_header_utime_h)
108if test $bu_cv_header_utime_h = yes; then
109 AC_DEFINE(HAVE_GOOD_UTIME_H)
110fi
111
36fb98be 112BFD_NEED_DECLARATION(fprintf)
5ab6ca68 113
320d4f29 114BFD_BINARY_FOPEN
5ab6ca68
ILT
115
116# target-specific stuff:
b5775df3
DHW
117
118# Canonicalize the secondary target names.
5ab6ca68 119if test -n "$enable_targets"; then
99ac7754 120 for targ in `echo $enable_targets | sed 's/,/ /g'`
b5775df3 121 do
5ab6ca68
ILT
122 result=`$ac_config_sub $targ 2>/dev/null`
123 if test -n "$result"; then
b5775df3
DHW
124 canon_targets="$canon_targets $result"
125 else
126 # Allow targets that config.sub doesn't recognize, like "all".
127 canon_targets="$canon_targets $targ"
128 fi
129 done
b5775df3
DHW
130fi
131
132all_targets=false
5ab6ca68
ILT
133BUILD_NLMCONV=
134NLMCONV_DEFS=
135BUILD_SRCONV=
136BUILD_DLLTOOL=
137DLLTOOL_DEFS=
b5775df3
DHW
138
139for targ in $target $canon_targets
140do
5ab6ca68 141 if test "x$targ" = "xall"; then
b5775df3 142 all_targets=true
5ab6ca68
ILT
143 BUILD_NLMCONV='$(NLMCONV_PROG)'
144 BUILD_SRCONV='$(SRCONV_PROG)'
145 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
b5775df3
DHW
146 else
147 case $targ in
5ab6ca68 148changequote(,)dnl
99ac7754 149 i[345]86*-*-netware*)
5ab6ca68
ILT
150changequote([,])dnl
151 BUILD_NLMCONV='$(NLMCONV_PROG)'
152 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
99ac7754
JM
153 ;;
154 alpha*-*-netware*)
5ab6ca68
ILT
155 BUILD_NLMCONV='$(NLMCONV_PROG)'
156 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
99ac7754
JM
157 ;;
158 powerpc*-*-netware*)
5ab6ca68
ILT
159 BUILD_NLMCONV='$(NLMCONV_PROG)'
160 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
99ac7754
JM
161 ;;
162 sparc*-*-netware*)
5ab6ca68
ILT
163 BUILD_NLMCONV='$(NLMCONV_PROG)'
164 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
99ac7754 165 ;;
b5775df3 166 esac
b5775df3 167 case $targ in
5ab6ca68 168 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
b5775df3 169 esac
99ac7754
JM
170 case $targ in
171 arm-*pe*)
5ab6ca68
ILT
172 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
173 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
99ac7754 174 ;;
5ab6ca68 175changequote(,)dnl
36fb98be 176 i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
5ab6ca68
ILT
177changequote([,])dnl
178 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
179 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
99ac7754 180 ;;
36fb98be
ILT
181 powerpc*-*-*pe* | powerpc*-*-cygwin32)
182 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
183 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
184 ;;
99ac7754 185 esac
b5775df3
DHW
186 fi
187done
188
5ab6ca68
ILT
189AC_SUBST(NLMCONV_DEFS)
190AC_SUBST(BUILD_NLMCONV)
191AC_SUBST(BUILD_SRCONV)
192AC_SUBST(BUILD_DLLTOOL)
193AC_SUBST(DLLTOOL_DEFS)
99ac7754 194
fe48a154
ILT
195targ=$target
196. $srcdir/../bfd/config.bfd
197if test "x$targ_underscore" = "xyes"; then
5ab6ca68 198 UNDERSCORE=1
6f88f031 199else
5ab6ca68 200 UNDERSCORE=0
6f88f031 201fi
5ab6ca68
ILT
202AC_SUBST(UNDERSCORE)
203
204AC_OUTPUT(Makefile,
320d4f29 205[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
This page took 0.16409 seconds and 4 git commands to generate.