configure.in revision 60484
133965Sjdpdnl Process this file with autoconf to produce a configure script.
233965Sjdpdnl
360484SobrienAC_PREREQ(2.13)
433965SjdpAC_INIT(ar.c)
533965Sjdp
638889SjdpAC_CANONICAL_SYSTEM
738889Sjdp
860484SobrienAM_INIT_AUTOMAKE(binutils, 2.9.5)
938889Sjdp
1038889SjdpAM_PROG_LIBTOOL
1138889Sjdp
1233965SjdpAC_ARG_ENABLE(targets,
1333965Sjdp[  --enable-targets        alternative target configurations],
1433965Sjdp[case "${enableval}" in
1533965Sjdp  yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
1633965Sjdp            ;;
1733965Sjdp  no)       enable_targets= ;;
1833965Sjdp  *)        enable_targets=$enableval ;;
1933965Sjdpesac])dnl
2033965SjdpAC_ARG_ENABLE(commonbfdlib,
2133965Sjdp[  --enable-commonbfdlib   build shared BFD/opcodes/libiberty library],
2233965Sjdp[case "${enableval}" in
2333965Sjdp  yes) commonbfdlib=true ;;
2433965Sjdp  no)  commonbfdlib=false ;;
2533965Sjdp  *)   AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
2633965Sjdpesac])dnl
2733965Sjdp
2838889SjdpAM_CONFIG_HEADER(config.h:config.in)
2933965Sjdp
3033965Sjdpif test -z "$target" ; then
3133965Sjdp    AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
3233965Sjdpfi
3333965Sjdpif test -z "$host" ; then
3433965Sjdp    AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
3533965Sjdpfi
3633965Sjdp
3738889SjdpAC_PROG_CC
3838889Sjdp
3938889SjdpAC_PROG_YACC
4060484SobrienAM_PROG_LEX
4138889Sjdp
4260484SobrienALL_LINGUAS=
4360484SobrienCY_GNU_GETTEXT
4460484Sobrien
4538889SjdpAM_MAINTAINER_MODE
4660484SobrienAC_EXEEXT
4760484Sobrienif test -n "$EXEEXT"; then
4860484Sobrien  AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
4960484Sobrien	    [Does the platform use an executable suffix?])
5060484Sobrienfi
5160484SobrienAC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
5260484Sobrien		   [Suffix used for executables, if any.])
5338889Sjdp
5433965Sjdp# host-specific stuff:
5533965Sjdp
5633965SjdpHDEFINES=
5733965Sjdp
5833965Sjdp. ${srcdir}/../bfd/configure.host
5933965Sjdp
6033965SjdpAC_SUBST(HDEFINES)
6133965SjdpAR=${AR-ar}
6233965SjdpAC_SUBST(AR)
6333965SjdpAC_PROG_RANLIB
6460484SobrienAC_PROG_INSTALL
6533965Sjdp
6633965SjdpBFD_CC_FOR_BUILD
6733965Sjdp
6860484SobrienDEMANGLER_NAME=c++filt
6960484Sobriencase "${host}" in
7060484Sobrien  *-*-go32* | *-*-msdos*)
7160484Sobrien    DEMANGLER_NAME=cxxfilt
7260484Sobrienesac
7360484SobrienAC_SUBST(DEMANGLER_NAME)
7460484Sobrien
7533965SjdpAC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
7633965SjdpAC_HEADER_SYS_WAIT
7733965SjdpAC_FUNC_ALLOCA
7833965SjdpAC_CHECK_FUNCS(sbrk utimes)
7933965Sjdp
8060484Sobrien# Some systems have frexp only in -lm, not in -lc.
8160484SobrienAC_SEARCH_LIBS(frexp, m)
8260484Sobrien
8333965SjdpAC_MSG_CHECKING(for time_t in time.h)
8433965SjdpAC_CACHE_VAL(bu_cv_decl_time_t_time_h,
8533965Sjdp[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
8633965Sjdpbu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
8733965SjdpAC_MSG_RESULT($bu_cv_decl_time_t_time_h)
8833965Sjdpif test $bu_cv_decl_time_t_time_h = yes; then
8960484Sobrien  AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
9060484Sobrien	    [Is the type time_t defined in <time.h>?])
9133965Sjdpfi
9233965Sjdp
9333965SjdpAC_MSG_CHECKING(for time_t in sys/types.h)
9433965SjdpAC_CACHE_VAL(bu_cv_decl_time_t_types_h,
9533965Sjdp[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
9633965Sjdpbu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
9733965SjdpAC_MSG_RESULT($bu_cv_decl_time_t_types_h)
9833965Sjdpif test $bu_cv_decl_time_t_types_h = yes; then
9960484Sobrien  AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
10060484Sobrien	    [Is the type time_t defined in <sys/types.h>?])
10133965Sjdpfi
10233965Sjdp
10333965Sjdp# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
10433965Sjdp# by default.
10533965SjdpAC_MSG_CHECKING([for utime.h])
10633965SjdpAC_CACHE_VAL(bu_cv_header_utime_h,
10733965Sjdp[AC_TRY_COMPILE([#include <sys/types.h>
10833965Sjdp#ifdef HAVE_TIME_H
10933965Sjdp#include <time.h>
11033965Sjdp#endif
11133965Sjdp#include <utime.h>],
11233965Sjdp[struct utimbuf s;],
11333965Sjdpbu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
11433965SjdpAC_MSG_RESULT($bu_cv_header_utime_h)
11533965Sjdpif test $bu_cv_header_utime_h = yes; then
11660484Sobrien  AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
11733965Sjdpfi
11833965Sjdp
11933965SjdpBFD_NEED_DECLARATION(fprintf)
12033965SjdpBFD_NEED_DECLARATION(strstr)
12133965SjdpBFD_NEED_DECLARATION(sbrk)
12233965SjdpBFD_NEED_DECLARATION(getenv)
12360484SobrienBFD_NEED_DECLARATION(environ)
12433965Sjdp
12533965SjdpBFD_BINARY_FOPEN
12633965Sjdp
12733965Sjdp# target-specific stuff:
12833965Sjdp
12933965Sjdp# Canonicalize the secondary target names.
13033965Sjdpif test -n "$enable_targets"; then
13133965Sjdp    for targ in `echo $enable_targets | sed 's/,/ /g'`
13233965Sjdp    do
13360484Sobrien	result=`$ac_config_sub $targ 2>/dev/null`
13433965Sjdp	if test -n "$result"; then
13533965Sjdp	    canon_targets="$canon_targets $result"
13633965Sjdp	else
13733965Sjdp	    # Allow targets that config.sub doesn't recognize, like "all".
13833965Sjdp	    canon_targets="$canon_targets $targ"
13933965Sjdp	fi
14033965Sjdp    done
14133965Sjdpfi
14233965Sjdp
14333965Sjdpall_targets=false
14433965SjdpBUILD_NLMCONV=
14533965SjdpNLMCONV_DEFS=
14633965SjdpBUILD_SRCONV=
14733965SjdpBUILD_DLLTOOL=
14833965SjdpDLLTOOL_DEFS=
14938889SjdpBUILD_WINDRES=
15060484SobrienBUILD_DLLWRAP=
15160484SobrienBUILD_MISC=
15233965Sjdp
15333965Sjdpfor targ in $target $canon_targets
15433965Sjdpdo
15533965Sjdp    if test "x$targ" = "xall"; then
15633965Sjdp        all_targets=true
15738889Sjdp	BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
15860484Sobrien	BUILD_SRCONV='$(SRCONV_PROG)'
15933965Sjdp	NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
16033965Sjdp    else
16133965Sjdp	case $targ in
16233965Sjdpchangequote(,)dnl
16333965Sjdp	i[3456]86*-*-netware*) 
16433965Sjdpchangequote([,])dnl
16538889Sjdp	  BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
16633965Sjdp	  NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
16733965Sjdp	  ;;
16833965Sjdp	alpha*-*-netware*)
16938889Sjdp	  BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
17033965Sjdp	  NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
17133965Sjdp	  ;;
17233965Sjdp	powerpc*-*-netware*)
17338889Sjdp	  BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
17433965Sjdp	  NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
17533965Sjdp	  ;;
17633965Sjdp	sparc*-*-netware*)
17738889Sjdp	  BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
17833965Sjdp	  NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
17933965Sjdp	  ;;
18033965Sjdp	esac
18133965Sjdp	case $targ in
18260484Sobrien	*-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
18333965Sjdp	esac
18433965Sjdp	case $targ in
18560484Sobrien	arm-*pe* | arm-*-wince)
18638889Sjdp  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
18733965Sjdp	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
18838889Sjdp	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
18960484Sobrien	  ;;
19060484Sobrien	thumb-*pe*)
19160484Sobrien  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
19260484Sobrien	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
19360484Sobrien	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
19460484Sobrien	  ;;
19533965Sjdpchangequote(,)dnl
19660484Sobrien	i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
19733965Sjdpchangequote([,])dnl
19838889Sjdp  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
19933965Sjdp	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
20038889Sjdp	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
20160484Sobrien	  BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
20260484Sobrien	  ;;
20360484Sobrien	i[3-6]86-*-interix)
20460484Sobrien	  BUILD_DLLTOOL='$(DLLTOOL_PROG)'
20560484Sobrien	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
20660484Sobrien	  ;;
20760484Sobrien	powerpc*-*-*pe* | powerpc*-*-cygwin*)
20838889Sjdp  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
20933965Sjdp	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
21038889Sjdp	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
21160484Sobrien	  ;;
21260484Sobrien	sh*-*-*pe)
21360484Sobrien  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
21460484Sobrien	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
21560484Sobrien	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
21660484Sobrien	  ;;
21760484Sobrien	mips*-*-*pe)
21860484Sobrien  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
21960484Sobrien	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
22060484Sobrien	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
22160484Sobrien	  ;;
22260484Sobrien	mcore-*pe)
22360484Sobrien  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
22460484Sobrien	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
22560484Sobrien	  BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
22660484Sobrien	  ;;
22760484Sobrien	mcore-*elf)
22860484Sobrien  	  BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
22960484Sobrien	  DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
23060484Sobrien	  ;;
23133965Sjdp	esac
23233965Sjdp    fi
23333965Sjdpdone
23433965Sjdp
23533965SjdpAC_SUBST(NLMCONV_DEFS)
23633965SjdpAC_SUBST(BUILD_NLMCONV)
23733965SjdpAC_SUBST(BUILD_SRCONV)
23833965SjdpAC_SUBST(BUILD_DLLTOOL)
23933965SjdpAC_SUBST(DLLTOOL_DEFS)
24038889SjdpAC_SUBST(BUILD_WINDRES)
24160484SobrienAC_SUBST(BUILD_DLLWRAP)
24260484SobrienAC_SUBST(BUILD_MISC)
24333965Sjdp
24460484SobrienAC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
24538889Sjdp
24633965Sjdptarg=$target
24733965Sjdp. $srcdir/../bfd/config.bfd
24833965Sjdpif test "x$targ_underscore" = "xyes"; then
24933965Sjdp    UNDERSCORE=1
25033965Sjdpelse
25133965Sjdp    UNDERSCORE=0
25233965Sjdpfi
25333965SjdpAC_SUBST(UNDERSCORE)
25433965Sjdp
25560484SobrienAC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
25660484Sobrien[
25760484Sobriencase "x$CONFIG_FILES" in
25860484Sobrien*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
25960484Sobrienesac
26060484Sobrien])
261