1 dnl Process this file with autoconf to produce a configure script.
5 [ --with-libbfd=<file> path to libbfd.a library to use ],
6 [ ac_libbfd=$withval ],
10 AC_ARG_WITH(libiberty,
11 [ --with-libiberty=<file> path to libiberty.a library to use ],
12 [ ac_libiberty=$withval ],
16 AC_ARG_WITH(bfd-include-dir,
17 [ --with-bfd-include-dir=<dir> include path for correct bfd.h ],
18 [ ac_bfd_include_dir=$withval ],
19 [ ac_bfd_include_dir=NONE ]
22 AC_ARG_WITH(binutils-include-dir,
23 [ --with-binutils-include-dir=<dir> include path for binutils headers ],
24 [ ac_binutils_include_dir=$withval ],
25 [ ac_binutils_include_dir=NONE ]
28 AC_ARG_WITH(binutils-ldscript-dir,
29 [ --with-binutils-ldscript-dir=<dir> path to install elf2flt.ld ],
30 [ ac_binutils_ldscript_dir=$withval ],
31 [ ac_binutils_ldscript_dir=NONE ]
34 AC_ARG_ENABLE(got-check,
35 [ --disable-got-check - disable check for GOT (needed on H8) ],
36 [ got_check=$enableval ],
43 dnl Checks for programs.
47 dnl Checks for libraries.
48 if test "$ac_libiberty" = "NONE"; then
49 AC_CHECK_LIB(iberty, objalloc_create)
52 LIBS="$ac_libiberty $LIBS"
54 if test "$ac_libbfd" = "NONE"; then
55 AC_CHECK_LIB(bfd, bfd_openr)
58 LIBS="$ac_libbfd $LIBS"
62 if test "$ac_bfd_include_dir" != "NONE"; then
63 bfd_include_dir="-I$ac_bfd_include_dir"
67 if test "$ac_binutils_include_dir" != "NONE"; then
68 binutils_include_dir="-I$ac_binutils_include_dir"
71 binutils_ldscript_dir=
72 if test "$ac_binutils_ldscript_dir" = "NONE"; then
73 ac_binutils_ldscript_dir="\${TOOLDIR}/../${target_alias}/lib"
75 binutils_ldscript_dir="$ac_binutils_ldscript_dir"
77 if test "$ac_libbfd" = "NONE" -o "$ac_libiberty" = "NONE" ; then
79 echo "You need to specify the location of the libfd.a and libiberty.a"
80 echo "host libraries from the binutils package."
82 echo "Run configure again specifying these options:"
84 echo " ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
89 if test "$ac_bfd_include_dir" = "NONE" ; then
91 echo "You need to specify the location of the bfd.h header from a"
92 echo "configured/compiled version of the binutils package for your target."
93 echo "Without this your elf2flt may crash as it will try to use the"
94 echo "systems bfd.h which may be from a different binutils package."
96 echo "Run configure again specifying these options:"
98 echo " ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
103 dnl Checks for header files.
105 AC_CHECK_HEADERS(fcntl.h unistd.h bfd.h)
107 dnl Checks for typedefs, structures, and compiler characteristics.
110 dnl Checks for library functions.
113 AC_CHECK_FUNCS(dcgettext)
117 AC_SUBST(target_alias)
120 AC_SUBST(target_vendor)
121 AC_SUBST(bfd_include_dir)
122 AC_SUBST(binutils_include_dir)
123 AC_SUBST(binutils_ldscript_dir)
126 AC_OUTPUT(Makefile ld-elf2flt)