12159047fSniklasdnl Process this file with autoconf to produce a configure script. 22159047fSniklasdnl 3b305b0f1SespieAC_PREREQ(2.13) 42159047fSniklasAC_INIT(ar.c) 52159047fSniklas 6b305b0f1SespieAC_CANONICAL_SYSTEM 76978ef19SespieAC_ISC_POSIX 8b305b0f1Sespie 9b55d4692Sfgschchangequote(,)dnl 10b55d4692SfgschBFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` 11b55d4692Sfgschchangequote([,])dnl 12b55d4692SfgschAM_INIT_AUTOMAKE(binutils, ${BFD_VERSION}) 13b305b0f1Sespie 14b305b0f1SespieAM_PROG_LIBTOOL 15b305b0f1Sespie 162159047fSniklasAC_ARG_ENABLE(targets, 172159047fSniklas[ --enable-targets alternative target configurations], 182159047fSniklas[case "${enableval}" in 192159047fSniklas yes | "") AC_ERROR(enable-targets option must specify target names or 'all') 202159047fSniklas ;; 212159047fSniklas no) enable_targets= ;; 222159047fSniklas *) enable_targets=$enableval ;; 232159047fSniklasesac])dnl 24b305b0f1SespieAC_ARG_ENABLE(commonbfdlib, 25b305b0f1Sespie[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], 26c88b1d6cSniklas[case "${enableval}" in 27b305b0f1Sespie yes) commonbfdlib=true ;; 28b305b0f1Sespie no) commonbfdlib=false ;; 29b305b0f1Sespie *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; 30c88b1d6cSniklasesac])dnl 312159047fSniklas 32c074d1c9Sdrahnbuild_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" 33b55d4692SfgschAC_ARG_ENABLE(build-warnings, 34b55d4692Sfgsch[ --enable-build-warnings Enable build-time compiler warnings if gcc is used], 35b55d4692Sfgsch[case "${enableval}" in 36b55d4692Sfgsch yes) ;; 37b55d4692Sfgsch no) build_warnings="-w";; 38b55d4692Sfgsch ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` 39b55d4692Sfgsch build_warnings="${build_warnings} ${t}";; 40b55d4692Sfgsch *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` 41b55d4692Sfgsch build_warnings="${t} ${build_warnings}";; 42b55d4692Sfgsch *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; 43b55d4692Sfgschesac 44b55d4692Sfgschif test x"$silent" != x"yes" && test x"$build_warnings" != x""; then 45b55d4692Sfgsch echo "Setting warning flags = $build_warnings" 6>&1 46b55d4692Sfgschfi])dnl 47b55d4692SfgschWARN_CFLAGS="" 48b55d4692Sfgschif test "x${build_warnings}" != x -a "x$GCC" = xyes ; then 49b55d4692Sfgsch WARN_CFLAGS="${build_warnings}" 50b55d4692Sfgschfi 51b55d4692SfgschAC_SUBST(WARN_CFLAGS) 52b55d4692Sfgsch 53b305b0f1SespieAM_CONFIG_HEADER(config.h:config.in) 542159047fSniklas 552159047fSniklasif test -z "$target" ; then 562159047fSniklas AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) 572159047fSniklasfi 582159047fSniklasif test -z "$host" ; then 592159047fSniklas AC_MSG_ERROR(Unrecognized host system type; please check config.sub.) 602159047fSniklasfi 61b305b0f1Sespie 62b305b0f1SespieAC_PROG_CC 63b305b0f1Sespie 64b305b0f1SespieAC_PROG_YACC 65b305b0f1SespieAM_PROG_LEX 66b305b0f1Sespie 67*007c2a45SmiodALL_LINGUAS="fr tr ja es sv da zh_CN ru" 68b305b0f1SespieCY_GNU_GETTEXT 69b305b0f1Sespie 70b305b0f1SespieAM_MAINTAINER_MODE 71b305b0f1SespieAC_EXEEXT 72b305b0f1Sespieif test -n "$EXEEXT"; then 73b305b0f1Sespie AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1, 74b305b0f1Sespie [Does the platform use an executable suffix?]) 75b305b0f1Sespiefi 76b305b0f1SespieAC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}", 77b305b0f1Sespie [Suffix used for executables, if any.]) 782159047fSniklas 792159047fSniklas# host-specific stuff: 802159047fSniklas 812159047fSniklasHDEFINES= 822159047fSniklas 832159047fSniklas. ${srcdir}/../bfd/configure.host 842159047fSniklas 852159047fSniklasAC_SUBST(HDEFINES) 862159047fSniklasAR=${AR-ar} 872159047fSniklasAC_SUBST(AR) 882159047fSniklasAC_PROG_RANLIB 892159047fSniklasAC_PROG_INSTALL 902159047fSniklas 912159047fSniklasBFD_CC_FOR_BUILD 922159047fSniklas 93b305b0f1SespieDEMANGLER_NAME=c++filt 94b305b0f1Sespiecase "${host}" in 95b305b0f1Sespie *-*-go32* | *-*-msdos*) 96b305b0f1Sespie DEMANGLER_NAME=cxxfilt 97b305b0f1Sespieesac 98b305b0f1SespieAC_SUBST(DEMANGLER_NAME) 99b305b0f1Sespie 1002159047fSniklasAC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h) 1012159047fSniklasAC_HEADER_SYS_WAIT 102b305b0f1SespieAC_FUNC_ALLOCA 103c074d1c9SdrahnAC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll) 104c074d1c9Sdrahn 105c074d1c9Sdrahn# Check whether fopen64 is available and whether _LARGEFILE64_SOURCE 106c074d1c9Sdrahn# needs to be defined for it 107c074d1c9SdrahnAC_MSG_CHECKING([for fopen64]) 108c074d1c9SdrahnAC_CACHE_VAL(bu_cv_have_fopen64, 109c074d1c9Sdrahn[AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");], 110c074d1c9Sdrahnbu_cv_have_fopen64=yes, 111c074d1c9Sdrahn[saved_CPPFLAGS=$CPPFLAGS 112c074d1c9Sdrahn CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" 113c074d1c9Sdrahn AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");], 114c074d1c9Sdrahnbu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE", 115c074d1c9Sdrahnbu_cv_have_fopen64=no) 116c074d1c9Sdrahn CPPFLAGS=$saved_CPPFLAGS])]) 117c074d1c9SdrahnAC_MSG_RESULT($bu_cv_have_fopen64) 118c074d1c9Sdrahnif test "$bu_cv_have_fopen64" != no; then 119c074d1c9Sdrahn AC_DEFINE([HAVE_FOPEN64], 1, 120c074d1c9Sdrahn [Is fopen64 available?]) 121c074d1c9Sdrahn if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE"; then 122c074d1c9Sdrahn AC_DEFINE([_LARGEFILE64_SOURCE], 1, 123c074d1c9Sdrahn [Enable LFS]) 124c074d1c9Sdrahn fi 125c074d1c9Sdrahnfi 126b305b0f1Sespie 127b305b0f1Sespie# Some systems have frexp only in -lm, not in -lc. 128b305b0f1SespieAC_SEARCH_LIBS(frexp, m) 1292159047fSniklas 1302159047fSniklasAC_MSG_CHECKING(for time_t in time.h) 1312159047fSniklasAC_CACHE_VAL(bu_cv_decl_time_t_time_h, 1322159047fSniklas[AC_TRY_COMPILE([#include <time.h>], [time_t i;], 1332159047fSniklasbu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)]) 1342159047fSniklasAC_MSG_RESULT($bu_cv_decl_time_t_time_h) 1352159047fSniklasif test $bu_cv_decl_time_t_time_h = yes; then 136b305b0f1Sespie AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1, 137b305b0f1Sespie [Is the type time_t defined in <time.h>?]) 1382159047fSniklasfi 1392159047fSniklas 1402159047fSniklasAC_MSG_CHECKING(for time_t in sys/types.h) 1412159047fSniklasAC_CACHE_VAL(bu_cv_decl_time_t_types_h, 1422159047fSniklas[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;], 1432159047fSniklasbu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)]) 1442159047fSniklasAC_MSG_RESULT($bu_cv_decl_time_t_types_h) 1452159047fSniklasif test $bu_cv_decl_time_t_types_h = yes; then 146b305b0f1Sespie AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1, 147b305b0f1Sespie [Is the type time_t defined in <sys/types.h>?]) 1482159047fSniklasfi 1492159047fSniklas 1502159047fSniklas# Under Next 3.2 <utime.h> apparently does not define struct utimbuf 1512159047fSniklas# by default. 1522159047fSniklasAC_MSG_CHECKING([for utime.h]) 1532159047fSniklasAC_CACHE_VAL(bu_cv_header_utime_h, 1542159047fSniklas[AC_TRY_COMPILE([#include <sys/types.h> 1552159047fSniklas#ifdef HAVE_TIME_H 1562159047fSniklas#include <time.h> 1572159047fSniklas#endif 1582159047fSniklas#include <utime.h>], 1592159047fSniklas[struct utimbuf s;], 1602159047fSniklasbu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)]) 1612159047fSniklasAC_MSG_RESULT($bu_cv_header_utime_h) 1622159047fSniklasif test $bu_cv_header_utime_h = yes; then 163b305b0f1Sespie AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?]) 1642159047fSniklasfi 1652159047fSniklas 166c88b1d6cSniklasBFD_NEED_DECLARATION(fprintf) 1670c6d0228SniklasBFD_NEED_DECLARATION(strstr) 1680c6d0228SniklasBFD_NEED_DECLARATION(sbrk) 169b305b0f1SespieBFD_NEED_DECLARATION(getenv) 170b305b0f1SespieBFD_NEED_DECLARATION(environ) 1712159047fSniklas 1722159047fSniklasBFD_BINARY_FOPEN 1732159047fSniklas 1742159047fSniklas# target-specific stuff: 1752159047fSniklas 1762159047fSniklas# Canonicalize the secondary target names. 1772159047fSniklasif test -n "$enable_targets"; then 1782159047fSniklas for targ in `echo $enable_targets | sed 's/,/ /g'` 1792159047fSniklas do 1802159047fSniklas result=`$ac_config_sub $targ 2>/dev/null` 1812159047fSniklas if test -n "$result"; then 1822159047fSniklas canon_targets="$canon_targets $result" 1832159047fSniklas else 1842159047fSniklas # Allow targets that config.sub doesn't recognize, like "all". 1852159047fSniklas canon_targets="$canon_targets $targ" 1862159047fSniklas fi 1872159047fSniklas done 1882159047fSniklasfi 1892159047fSniklas 1902159047fSniklasall_targets=false 1912159047fSniklasBUILD_NLMCONV= 1922159047fSniklasNLMCONV_DEFS= 1932159047fSniklasBUILD_SRCONV= 1942159047fSniklasBUILD_DLLTOOL= 1952159047fSniklasDLLTOOL_DEFS= 196b305b0f1SespieBUILD_WINDRES= 197b305b0f1SespieBUILD_DLLWRAP= 198b305b0f1SespieBUILD_MISC= 199b55d4692SfgschOBJDUMP_DEFS= 2002159047fSniklas 2012159047fSniklasfor targ in $target $canon_targets 2022159047fSniklasdo 2032159047fSniklas if test "x$targ" = "xall"; then 2042159047fSniklas all_targets=true 205b305b0f1Sespie BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' 2062159047fSniklas BUILD_SRCONV='$(SRCONV_PROG)' 2072159047fSniklas NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" 2082159047fSniklas else 2092159047fSniklas case $targ in 2102159047fSniklaschangequote(,)dnl 211*007c2a45Smiod i[3-7]86*-*-netware*) 2122159047fSniklaschangequote([,])dnl 213b305b0f1Sespie BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' 2142159047fSniklas NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386" 2152159047fSniklas ;; 2162159047fSniklas alpha*-*-netware*) 217b305b0f1Sespie BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' 2182159047fSniklas NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA" 2192159047fSniklas ;; 2202159047fSniklas powerpc*-*-netware*) 221b305b0f1Sespie BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' 2222159047fSniklas NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC" 2232159047fSniklas ;; 2242159047fSniklas sparc*-*-netware*) 225b305b0f1Sespie BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' 2262159047fSniklas NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC" 2272159047fSniklas ;; 2282159047fSniklas esac 2292159047fSniklas case $targ in 2302159047fSniklas *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;; 2312159047fSniklas esac 2322159047fSniklas case $targ in 233b55d4692Sfgsch arm-epoc-pe*) 234b55d4692Sfgsch BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 235b55d4692Sfgsch DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" 236b55d4692Sfgsch BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 237b55d4692Sfgsch ;; 238c074d1c9Sdrahn arm-*-pe* | arm-*-wince) 239b305b0f1Sespie BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 2402159047fSniklas DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" 241b305b0f1Sespie BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 242b305b0f1Sespie ;; 243c074d1c9Sdrahn thumb-*-pe*) 244b305b0f1Sespie BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 245b305b0f1Sespie DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" 246b305b0f1Sespie BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 2472159047fSniklas ;; 248b55d4692Sfgsch arm*-* | xscale-* | strongarm-* | d10v-*) 249b55d4692Sfgsch OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS" 250b55d4692Sfgsch ;; 2512159047fSniklaschangequote(,)dnl 252*007c2a45Smiod i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) 2532159047fSniklaschangequote([,])dnl 254b305b0f1Sespie BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 255b305b0f1Sespie DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" 256b305b0f1Sespie BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 257b305b0f1Sespie BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' 258b305b0f1Sespie ;; 259*007c2a45Smiodchangequote(,)dnl 260*007c2a45Smiod i[3-7]86-*-interix) 261*007c2a45Smiodchangequote([,])dnl 2622159047fSniklas BUILD_DLLTOOL='$(DLLTOOL_PROG)' 2632159047fSniklas DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" 2642159047fSniklas ;; 265*007c2a45Smiodchangequote(,)dnl 266*007c2a45Smiod powerpc*-aix5.[01]) 267*007c2a45Smiodchangequote([,])dnl 268*007c2a45Smiod ;; 269*007c2a45Smiod powerpc*-aix5.*) 270*007c2a45Smiod OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT" 271*007c2a45Smiod ;; 272d419eb06Sfgsch powerpc*-*-pe* | powerpc*-*-cygwin*) 273b305b0f1Sespie BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 2742159047fSniklas DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" 275b305b0f1Sespie BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 276b305b0f1Sespie ;; 277d419eb06Sfgsch sh*-*-pe) 278b305b0f1Sespie BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 279b305b0f1Sespie DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH" 280b305b0f1Sespie BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 281b305b0f1Sespie ;; 282d419eb06Sfgsch mips*-*-pe) 283b305b0f1Sespie BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 284b305b0f1Sespie DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS" 285b305b0f1Sespie BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 286b305b0f1Sespie ;; 287c074d1c9Sdrahn mcore-*-pe) 288b305b0f1Sespie BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 289b305b0f1Sespie DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE" 290b305b0f1Sespie BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 291b305b0f1Sespie ;; 292c074d1c9Sdrahn mcore-*-elf) 293b305b0f1Sespie BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' 294b305b0f1Sespie DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF" 2952159047fSniklas ;; 296c074d1c9Sdrahn c4x-*-* | tic4x-*-*) 297c074d1c9Sdrahn OBJDUMP_DEFS="$OBJDUMP_DEFS -DSKIP_ZEROES=32" 298c074d1c9Sdrahn ;; 299c074d1c9Sdrahn ia64-*-*) 300c074d1c9Sdrahn OBJDUMP_DEFS="$OBJDUMP_DEFS -DSKIP_ZEROES=16" 301c074d1c9Sdrahn ;; 3022159047fSniklas esac 3032159047fSniklas fi 3042159047fSniklasdone 3052159047fSniklas 306c074d1c9Sdrahnif test "${with_windres+set}" = set; then 307c074d1c9Sdrahn BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' 308c074d1c9Sdrahnfi 309c074d1c9Sdrahn 3102159047fSniklasAC_SUBST(NLMCONV_DEFS) 3112159047fSniklasAC_SUBST(BUILD_NLMCONV) 3122159047fSniklasAC_SUBST(BUILD_SRCONV) 3132159047fSniklasAC_SUBST(BUILD_DLLTOOL) 3142159047fSniklasAC_SUBST(DLLTOOL_DEFS) 315b305b0f1SespieAC_SUBST(BUILD_WINDRES) 316b305b0f1SespieAC_SUBST(BUILD_DLLWRAP) 317b305b0f1SespieAC_SUBST(BUILD_MISC) 318b55d4692SfgschAC_SUBST(OBJDUMP_DEFS) 319b305b0f1Sespie 320b305b0f1SespieAC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.]) 3212159047fSniklas 3222159047fSniklastarg=$target 3232159047fSniklas. $srcdir/../bfd/config.bfd 3242159047fSniklasif test "x$targ_underscore" = "xyes"; then 3252159047fSniklas UNDERSCORE=1 3262159047fSniklaselse 3272159047fSniklas UNDERSCORE=0 3282159047fSniklasfi 329c074d1c9SdrahnAC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE, 330c074d1c9Sdrahn [Define to 1 if user symbol names have a leading underscore, 0 if not.]) 3312159047fSniklas 332c074d1c9Sdrahn# Emulation 333c074d1c9Sdrahnfor targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'` 334c074d1c9Sdrahndo 335c074d1c9Sdrahn # Canonicalize the secondary target names. 336c074d1c9Sdrahn result=`$ac_config_sub $targ_alias 2>/dev/null` 337c074d1c9Sdrahn if test -n "$result"; then 338c074d1c9Sdrahn targ=$result 339c074d1c9Sdrahn else 340c074d1c9Sdrahn targ=$targ_alias 341c074d1c9Sdrahn fi 342c074d1c9Sdrahn 343c074d1c9Sdrahn . ${srcdir}/configure.tgt 344c074d1c9Sdrahn 345c074d1c9Sdrahn EMULATION=$targ_emul 346c074d1c9Sdrahn EMULATION_VECTOR=$targ_emul_vector 347c074d1c9Sdrahndone 348c074d1c9Sdrahn 349c074d1c9SdrahnAC_SUBST(EMULATION) 350c074d1c9SdrahnAC_SUBST(EMULATION_VECTOR) 351c074d1c9Sdrahn 352c074d1c9SdrahnAC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in, 353b305b0f1Sespie[ 354b305b0f1Sespiecase "x$CONFIG_FILES" in 355b305b0f1Sespie*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; 356b305b0f1Sespieesac 357b305b0f1Sespie]) 358