1dnl $MirOS: src/gnu/usr.bin/binutils/bfd/acinclude.m4,v 1.6 2006/07/01 13:51:21 tg Exp $ 2 3sinclude(../config/acx.m4) 4sinclude(../bfd/bfd.m4) 5sinclude(../bfd/warning.m4) 6 7dnl See whether we need to use fopen-bin.h rather than fopen-same.h. 8AC_DEFUN([BFD_BINARY_FOPEN], 9[AC_REQUIRE([AC_CANONICAL_TARGET]) 10case "${host}" in 11changequote(,)dnl 12*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) 13changequote([,])dnl 14 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;; 15esac])dnl 16 17dnl Get a default for CC_FOR_BUILD to put into Makefile. 18AC_DEFUN([BFD_CC_FOR_BUILD], 19[# Put a plausible default for CC_FOR_BUILD in Makefile. 20if test -z "$CC_FOR_BUILD"; then 21 if test "x$cross_compiling" = "xno"; then 22 CC_FOR_BUILD='$(CC)' 23 else 24 CC_FOR_BUILD='$(HOSTCC)' 25 fi 26fi 27AC_SUBST(CC_FOR_BUILD) 28# Also set EXEEXT_FOR_BUILD. 29if test "x$cross_compiling" = "xno"; then 30 EXEEXT_FOR_BUILD='$(EXEEXT)' 31else 32 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext, 33 [rm -f conftest* 34 echo 'int main () { return 0; }' > conftest.c 35 bfd_cv_build_exeext= 36 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5 37 for file in conftest.*; do 38 case $file in 39 *.c | *.o | *.obj | *.ilk | *.pdb) ;; 40 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;; 41 esac 42 done 43 rm -f conftest* 44 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no]) 45 EXEEXT_FOR_BUILD="" 46 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext} 47fi 48AC_SUBST(EXEEXT_FOR_BUILD)])dnl 49 50sinclude(../libtool.m4) 51dnl The lines below arrange for aclocal not to bring libtool.m4 52dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake 53dnl to add a definition of LIBTOOL to Makefile.in. 54ifelse(yes,no,[ 55AC_DEFUN([AM_PROG_LIBTOOL],) 56AC_DEFUN([AM_DISABLE_SHARED],) 57AC_SUBST(LIBTOOL) 58]) 59 60AC_DEFUN([AM_INSTALL_LIBBFD], 61[AC_MSG_CHECKING([whether to install libbfd]) 62 AC_ARG_ENABLE(install-libbfd, 63[ --enable-install-libbfd controls installation of libbfd and related headers], 64 install_libbfd_p=$enableval, 65 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then 66 install_libbfd_p=yes 67 else 68 install_libbfd_p=no 69 fi) 70 AC_MSG_RESULT($install_libbfd_p) 71 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes) 72 # Need _noncanonical variables for this. 73 ACX_NONCANONICAL_HOST 74 ACX_NONCANONICAL_TARGET 75 # libbfd.a is a host library containing target dependent code 76 bfdlibdir='$(libdir)' 77 bfdincludedir='$(includedir)' 78 if test "${host}" != "${target}"; then 79 bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib' 80 bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include' 81 fi 82 AC_SUBST(bfdlibdir) 83 AC_SUBST(bfdincludedir) 84] 85) 86