dnl Process this file with autoconf to produce a configure script.
dnl
-AC_PREREQ(2.0)
+AC_PREREQ(2.5)
AC_INIT(ar.c)
AC_ARG_ENABLE(targets,
AC_ARG_ENABLE(shared,
[ --enable-shared build shared BFD library],
[case "${enableval}" in
- yes) shared=true ;;
+ yes) shared=true shared_bfd=true shared_opcodes=true ;;
no) shared=false ;;
- *) AC_MSG_ERROR([bad value ${enableval} for BFD shared option]) ;;
+ *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
+ yes) commonbfdlib=true ;;
+ no) commonbfdlib=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
esac])dnl
AC_CONFIG_HEADER(config.h:config.in)
# host-specific stuff:
HDEFINES=
-LDFLAGS=
HLDFLAGS=
+HLDENV=
+RPATH_ENVVAR=LD_LIBRARY_PATH
+
+AC_PROG_CC
. ${srcdir}/../bfd/configure.host
-AC_PROG_CC
-AC_SUBST(CFLAGS)
AC_SUBST(HDEFINES)
-AC_SUBST(LDFLAGS)
AC_SUBST(HLDFLAGS)
+AC_SUBST(HLDENV)
+AC_SUBST(RPATH_ENVVAR)
AR=${AR-ar}
AC_SUBST(AR)
AC_PROG_RANLIB
# need to handle some hosts specially.
BFDLIB='-L../bfd -lbfd'
OPCODES='-L../opcodes -lopcodes'
-if test "${shared}" = "true"; then
- 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.
+
+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)'"'"'`'
- ;;
- esac
+ 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
+ ;;
+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)
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
AC_MSG_CHECKING(for time_t in time.h)
AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
fi
BFD_NEED_DECLARATION(fprintf)
+BFD_NEED_DECLARATION(strstr)
+BFD_NEED_DECLARATION(sbrk)
+BFD_NEED_DECLARATION(getenv)
BFD_BINARY_FOPEN
else
case $targ in
changequote(,)dnl
- i[345]86*-*-netware*)
+ i[3456]86*-*-netware*)
changequote([,])dnl
BUILD_NLMCONV='$(NLMCONV_PROG)'
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"