dnl Process this file with autoconf to produce a configure script.
dnl
-AC_PREREQ(2.13)
+AC_PREREQ(2.57)
AC_INIT(ar.c)
AC_CANONICAL_SYSTEM
*) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
esac])dnl
-build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+dnl FIXME: The following is bfd/warning.m4 contents expanded
+dnl When converting to current autotools, please replace with
+dnl AM_BINUTILS_WARNINGS
+WARN_CFLAGS="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
+
+AC_ARG_ENABLE(werror,
+ [ --enable-werror treat compile warnings as errors],
+ [case "${enableval}" in
+ yes | y) ERROR_ON_WARNING="yes" ;;
+ no | n) ERROR_ON_WARNING="no" ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
+ esac])
+
+# Enable -Werror by default when using gcc
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ ERROR_ON_WARNING=yes
+fi
+
+NO_WERROR=
+if test "${ERROR_ON_WARNING}" = yes ; then
+ WARN_CFLAGS="$WARN_CFLAGS -Werror"
+ NO_WERROR="-Wno-error"
+fi
+
AC_ARG_ENABLE(build-warnings,
-[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
+[ --enable-build-warnings Enable build-time compiler warnings],
[case "${enableval}" in
yes) ;;
- no) build_warnings="-w";;
+ no) WARN_CFLAGS="-w";;
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
- build_warnings="${build_warnings} ${t}";;
+ WARN_CFLAGS="${WARN_CFLAGS} ${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}"
+ WARN_CFLAGS="${t} ${WARN_CFLAGS}";;
+ *) WARN_CFLAGS=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac])
+
+if test x"$silent" != x"yes" && test x"$WARN_CFLAGS" != x""; then
+ echo "Setting warning flags = $WARN_CFLAGS" 6>&1
fi
+
AC_SUBST(WARN_CFLAGS)
+AC_SUBST(NO_WERROR)
AM_CONFIG_HEADER(config.h:config.in)
AC_PROG_YACC
AM_PROG_LEX
-ALL_LINGUAS="fr tr ja es sv da zh_CN ru"
+ALL_LINGUAS="fr tr ja es sv da zh_CN ru ro rw zh_TW"
CY_GNU_GETTEXT
AM_MAINTAINER_MODE
if test "$bu_cv_have_fopen64" != no; then
AC_DEFINE([HAVE_FOPEN64], 1,
[Is fopen64 available?])
- if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE"; then
- AC_DEFINE([_LARGEFILE64_SOURCE], 1,
- [Enable LFS])
- fi
+fi
+AC_MSG_CHECKING([for stat64])
+AC_CACHE_VAL(bu_cv_have_stat64,
+[AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
+bu_cv_have_stat64=yes,
+[saved_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
+ AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
+bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
+bu_cv_have_stat64=no)
+ CPPFLAGS=$saved_CPPFLAGS])])
+AC_MSG_RESULT($bu_cv_have_stat64)
+if test "$bu_cv_have_stat64" != no; then
+ AC_DEFINE([HAVE_STAT64], 1,
+ [Is stat64 available?])
+fi
+if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
+ || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
+ AC_DEFINE([_LARGEFILE64_SOURCE], 1,
+ [Enable LFS])
+ CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
fi
# Some systems have frexp only in -lm, not in -lc.
[Is the type time_t defined in <sys/types.h>?])
fi
+AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
+AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
+[AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
+bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
+AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
+if test $bu_cv_decl_getopt_unistd_h = yes; then
+ AC_DEFINE([HAVE_DECL_GETOPT], 1,
+ [Is the prototype for getopt in <unistd.h> in the expected format?])
+fi
+
# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
# by default.
AC_MSG_CHECKING([for utime.h])
BFD_NEED_DECLARATION(sbrk)
BFD_NEED_DECLARATION(getenv)
BFD_NEED_DECLARATION(environ)
+AC_CHECK_DECLS(getc_unlocked)
BFD_BINARY_FOPEN
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
;;
- c4x-*-* | tic4x-*-*)
- OBJDUMP_DEFS="$OBJDUMP_DEFS -DSKIP_ZEROES=32"
- ;;
- ia64-*-*)
- OBJDUMP_DEFS="$OBJDUMP_DEFS -DSKIP_ZEROES=16"
- ;;
esac
fi
done