Do not create $(bfdlibdir) and $(bfdincludedir) if !INSTALL_LIBBFD.
[deliverable/binutils-gdb.git] / bfd / acinclude.m4
CommitLineData
252b5132 1dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
f8b73030 2AC_DEFUN([BFD_BINARY_FOPEN],
5464f5a1 3[AC_REQUIRE([AC_CANONICAL_TARGET])
252b5132
RH
4case "${host}" in
5changequote(,)dnl
855b0be7 6*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
252b5132
RH
7changequote([,])dnl
8 AC_DEFINE(USE_BINARY_FOPEN, 1, [Use b modifier when opening binary files?]) ;;
9esac])dnl
10
11dnl Get a default for CC_FOR_BUILD to put into Makefile.
f8b73030 12AC_DEFUN([BFD_CC_FOR_BUILD],
252b5132
RH
13[# Put a plausible default for CC_FOR_BUILD in Makefile.
14if test -z "$CC_FOR_BUILD"; then
15 if test "x$cross_compiling" = "xno"; then
16 CC_FOR_BUILD='$(CC)'
17 else
18 CC_FOR_BUILD=gcc
19 fi
20fi
21AC_SUBST(CC_FOR_BUILD)
22# Also set EXEEXT_FOR_BUILD.
23if test "x$cross_compiling" = "xno"; then
24 EXEEXT_FOR_BUILD='$(EXEEXT)'
25else
26 AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
aab08431
ILT
27 [rm -f conftest*
28 echo 'int main () { return 0; }' > conftest.c
29 bfd_cv_build_exeext=
30 ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
31 for file in conftest.*; do
32 case $file in
33 *.c | *.o | *.obj | *.ilk | *.pdb) ;;
34 *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
35 esac
36 done
37 rm -f conftest*
38 test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
252b5132
RH
39 EXEEXT_FOR_BUILD=""
40 test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
41fi
42AC_SUBST(EXEEXT_FOR_BUILD)])dnl
43
a703a6ea
AM
44AC_DEFUN([AM_INSTALL_LIBBFD],
45[AC_MSG_CHECKING([whether to install libbfd])
46 AC_ARG_ENABLE(install-libbfd,
c5d1701e 47[ --enable-install-libbfd controls installation of libbfd and related headers],
a703a6ea 48 install_libbfd_p=$enableval,
66e25bab 49 if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then
a703a6ea
AM
50 install_libbfd_p=yes
51 else
52 install_libbfd_p=no
53 fi)
54 AC_MSG_RESULT($install_libbfd_p)
55 AM_CONDITIONAL(INSTALL_LIBBFD, test $install_libbfd_p = yes)
5464f5a1 56 # Need _noncanonical variables for this.
24443139
AS
57 ACX_NONCANONICAL_HOST
58 ACX_NONCANONICAL_TARGET
a703a6ea
AM
59 # libbfd.a is a host library containing target dependent code
60 bfdlibdir='$(libdir)'
61 bfdincludedir='$(includedir)'
62 if test "${host}" != "${target}"; then
5464f5a1
NN
63 bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'
64 bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
a703a6ea
AM
65 fi
66 AC_SUBST(bfdlibdir)
573e8a1c 67 AM_SUBST_NOTMAKE(bfdlibdir)
a703a6ea 68 AC_SUBST(bfdincludedir)
573e8a1c 69 AM_SUBST_NOTMAKE(bfdincludedir)
a703a6ea
AM
70]
71)
This page took 0.476917 seconds and 4 git commands to generate.