Remove ``-W -Wall'' from top-level Makefile/configure.
[deliverable/binutils-gdb.git] / binutils / configure.in
index f5ce9d6f73cc632281e2f78b1e7ed642978bd144..27a14866adcb4117aed82a509ca2266212556732 100644 (file)
@@ -1,8 +1,14 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl
-AC_PREREQ(2.5)
+AC_PREREQ(2.13)
 AC_INIT(ar.c)
 
+AC_CANONICAL_SYSTEM
+
+AM_INIT_AUTOMAKE(binutils, 2.9.5)
+
+AM_PROG_LIBTOOL
+
 AC_ARG_ENABLE(targets,
 [  --enable-targets        alternative target configurations],
 [case "${enableval}" in
@@ -11,17 +17,6 @@ AC_ARG_ENABLE(targets,
   no)       enable_targets= ;;
   *)        enable_targets=$enableval ;;
 esac])dnl
-AC_ARG_ENABLE(shared,
-[  --enable-shared         build shared BFD library],
-[case "${enableval}" in
-  yes) shared=true shared_bfd=true shared_opcodes=true ;;
-  no)  shared=false ;;
-  *bfd*opcodes*) shared=true shared_bfd=true shared_opcodes=true ;;
-  *opcodes*bfd*) shared=true shared_bfd=true shared_opcodes=true ;;
-  *bfd*) shared=true shared_bfd=true ;;
-  *opcodes*) shared=true shared_opcodes=true ;;
-  *) shared=false ;;
-esac])dnl
 AC_ARG_ENABLE(commonbfdlib,
 [  --enable-commonbfdlib   build shared BFD/opcodes/libiberty library],
 [case "${enableval}" in
@@ -30,94 +25,81 @@ AC_ARG_ENABLE(commonbfdlib,
   *)   AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
 esac])dnl
 
-AC_CONFIG_HEADER(config.h:config.in)
+build_warnings="-W -Wall"
+AC_ARG_ENABLE(build-warnings,
+[  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
+[case "${enableval}" in
+  yes) ;;
+  no)  build_warnings="-w";;
+  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${build_warnings} ${t}";;
+  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${t} ${build_warnings}";;
+  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+  echo "Setting warning flags = $build_warnings" 6>&1
+fi])dnl
+WARN_CFLAGS=""
+if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
+    WARN_CFLAGS="${build_warnings}"
+fi
+AC_SUBST(WARN_CFLAGS)
+
+AM_CONFIG_HEADER(config.h:config.in)
 
-AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
-AC_CANONICAL_SYSTEM
 if test -z "$target" ; then
     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
 fi
 if test -z "$host" ; then
     AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
 fi
-AC_ARG_PROGRAM
+
+AC_PROG_CC
+
+AC_PROG_YACC
+AM_PROG_LEX
+
+ALL_LINGUAS=
+CY_GNU_GETTEXT
+
+AM_MAINTAINER_MODE
+AC_EXEEXT
+if test -n "$EXEEXT"; then
+  AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
+           [Does the platform use an executable suffix?])
+fi
+AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
+                  [Suffix used for executables, if any.])
 
 # host-specific stuff:
 
 HDEFINES=
-HLDFLAGS=
-HLDENV=
-RPATH_ENVVAR=LD_LIBRARY_PATH
-
-AC_PROG_CC
 
 . ${srcdir}/../bfd/configure.host
 
 AC_SUBST(HDEFINES)
-AC_SUBST(HLDFLAGS)
-AC_SUBST(HLDENV)
-AC_SUBST(RPATH_ENVVAR)
 AR=${AR-ar}
 AC_SUBST(AR)
 AC_PROG_RANLIB
 AC_PROG_INSTALL
 
-# For most hosts we can use a simple definition to pick up the BFD and
-# opcodes libraries.  However, if we are building shared libraries, we
-# need to handle some hosts specially.
-BFDLIB='-L../bfd -lbfd'
-OPCODES='-L../opcodes -lopcodes'
+BFD_CC_FOR_BUILD
 
+DEMANGLER_NAME=c++filt
 case "${host}" in
-*-*-sunos*)
-  # On SunOS, we must link against the name we are going to install,
-  # not -lbfd, since SunOS does not support SONAME.
-  if test "${shared_bfd}" = "true"; then
-    BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
-  fi
-  if test "${shared_opcodes}" = "true"; then
-    OPCODES='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
-  fi
-  ;;
-alpha*-*-osf*)
-  # On Alpha OSF/1, the native linker searches all the -L
-  # directories for any LIB.so files, and only then searches for any
-  # LIB.a files.  That means that if there is an installed
-  # libbfd.so, but this build is not done with --enable-shared, the
-  # link will wind up being against the install libbfd.so rather
-  # than the newly built libbfd.  To avoid this, we must explicitly
-  # link against libbfd.a when --enable-shared is not used.
-  if test "${shared_bfd}" != "true"; then
-    BFDLIB='../bfd/libbfd.a'
-  fi
-  if test "${shared_opcodes}" != "true"; then
-    OPCODES='../opcodes/libopcodes.a'
-  fi
-  ;;
+  *-*-go32* | *-*-msdos*)
+    DEMANGLER_NAME=cxxfilt
 esac
-
-if test "${commonbfdlib}" = "true"; then
-  # when a shared libbfd is built with --enable-commonbfdlib,
-  # all of libopcodes is available in libbfd.so
-  OPCODES=
-fi
-
-AC_SUBST(BFDLIB)
-AC_SUBST(OPCODES)
-
-BFD_CC_FOR_BUILD
+AC_SUBST(DEMANGLER_NAME)
 
 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
 AC_HEADER_SYS_WAIT
 AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(sbrk utimes)
-dnl Temporary workaround for bug in autoconf 2.12.  When the bug is
-dnl fixed, we can just call AC_FUNC_VFORK in all cases.
-if test "x$cross_compiling" = "xno"; then
-  AC_FUNC_VFORK
-else
-  AC_CHECK_FUNC(vfork, , AC_DEFINE(vfork, fork))
-fi
+
+# Some systems have frexp only in -lm, not in -lc.
+AC_SEARCH_LIBS(frexp, m)
 
 AC_MSG_CHECKING(for time_t in time.h)
 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
@@ -125,7 +107,8 @@ AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
 if test $bu_cv_decl_time_t_time_h = yes; then
-  AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
+  AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
+           [Is the type time_t defined in <time.h>?])
 fi
 
 AC_MSG_CHECKING(for time_t in sys/types.h)
@@ -134,7 +117,8 @@ AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
 if test $bu_cv_decl_time_t_types_h = yes; then
-  AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
+  AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
+           [Is the type time_t defined in <sys/types.h>?])
 fi
 
 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
@@ -150,13 +134,14 @@ AC_CACHE_VAL(bu_cv_header_utime_h,
 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
 AC_MSG_RESULT($bu_cv_header_utime_h)
 if test $bu_cv_header_utime_h = yes; then
-  AC_DEFINE(HAVE_GOOD_UTIME_H)
+  AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
 fi
 
 BFD_NEED_DECLARATION(fprintf)
 BFD_NEED_DECLARATION(strstr)
 BFD_NEED_DECLARATION(sbrk)
 BFD_NEED_DECLARATION(getenv)
+BFD_NEED_DECLARATION(environ)
 
 BFD_BINARY_FOPEN
 
@@ -182,12 +167,15 @@ NLMCONV_DEFS=
 BUILD_SRCONV=
 BUILD_DLLTOOL=
 DLLTOOL_DEFS=
+BUILD_WINDRES=
+BUILD_DLLWRAP=
+BUILD_MISC=
 
 for targ in $target $canon_targets
 do
     if test "x$targ" = "xall"; then
         all_targets=true
-       BUILD_NLMCONV='$(NLMCONV_PROG)'
+       BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
        BUILD_SRCONV='$(SRCONV_PROG)'
        NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
     else
@@ -195,19 +183,19 @@ do
 changequote(,)dnl
        i[3456]86*-*-netware*) 
 changequote([,])dnl
-         BUILD_NLMCONV='$(NLMCONV_PROG)'
+         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
          NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
          ;;
        alpha*-*-netware*)
-         BUILD_NLMCONV='$(NLMCONV_PROG)'
+         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
          NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
          ;;
        powerpc*-*-netware*)
-         BUILD_NLMCONV='$(NLMCONV_PROG)'
+         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
          NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
          ;;
        sparc*-*-netware*)
-         BUILD_NLMCONV='$(NLMCONV_PROG)'
+         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
          NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
          ;;
        esac
@@ -215,20 +203,52 @@ changequote([,])dnl
        *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
        esac
        case $targ in
-       arm-*pe*)
-         BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+       arm-*pe* | arm-*-wince)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
-        ;;
+         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+         ;;
+       thumb-*pe*)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
+         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+         ;;
 changequote(,)dnl
-       i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
+       i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
 changequote([,])dnl
-         BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
-        ;;
-       powerpc*-*-*pe* | powerpc*-*-cygwin32)
-         BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+         BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
+         ;;
+       i[3-6]86-*-interix)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)'
+         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
+         ;;
+       powerpc*-*-*pe* | powerpc*-*-cygwin*)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
          DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
-        ;;
+         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+         ;;
+       sh*-*-*pe)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
+         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+         ;;
+       mips*-*-*pe)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
+         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+         ;;
+       mcore-*pe)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
+         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
+         ;;
+       mcore-*elf)
+         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
+         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
+         ;;
        esac
     fi
 done
@@ -238,6 +258,11 @@ AC_SUBST(BUILD_NLMCONV)
 AC_SUBST(BUILD_SRCONV)
 AC_SUBST(BUILD_DLLTOOL)
 AC_SUBST(DLLTOOL_DEFS)
+AC_SUBST(BUILD_WINDRES)
+AC_SUBST(BUILD_DLLWRAP)
+AC_SUBST(BUILD_MISC)
+
+AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
 
 targ=$target
 . $srcdir/../bfd/config.bfd
@@ -248,5 +273,9 @@ else
 fi
 AC_SUBST(UNDERSCORE)
 
-AC_OUTPUT(Makefile,
-[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
+AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
+[
+case "x$CONFIG_FILES" in
+*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
+esac
+])
This page took 0.027141 seconds and 4 git commands to generate.