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_ENABLE(got-check,
29 [ --disable-got-check - disable check for GOT (needed on H8) ],
30 [ got_check=$enableval ],
37 dnl Checks for programs.
41 dnl Checks for libraries.
42 if test "$ac_libiberty" = "NONE"; then
43 AC_CHECK_LIB(iberty, objalloc_create)
46 LIBS="$ac_libiberty $LIBS"
48 if test "$ac_libbfd" = "NONE"; then
49 AC_CHECK_LIB(bfd, bfd_openr)
52 LIBS="$ac_libbfd $LIBS"
56 if test "$ac_bfd_include_dir" != "NONE"; then
57 bfd_include_dir="-I$ac_bfd_include_dir"
61 if test "$ac_binutils_include_dir" != "NONE"; then
62 binutils_include_dir="-I$ac_binutils_include_dir"
65 if test "$ac_libbfd" = "NONE" -o "$ac_libiberty" = "NONE" ; then
67 echo "You need to specify the location of the libfd.a and libiberty.a"
68 echo "host libraries from the binutils package."
70 echo "Run configure again specifying these options:"
72 echo " ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
77 if test "$ac_bfd_include_dir" = "NONE" ; then
79 echo "You need to specify the location of the bfd.h header from a"
80 echo "configured/compiled version of the binutils package for your target."
81 echo "Without this your elf2flt may crash as it will try to use the"
82 echo "systems bfd.h which may be from a different binutils package."
84 echo "Run configure again specifying these options:"
86 echo " ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
91 dnl Checks for header files.
93 AC_CHECK_HEADERS(fcntl.h unistd.h bfd.h)
95 dnl Checks for typedefs, structures, and compiler characteristics.
98 dnl Checks for library functions.
101 AC_CHECK_FUNCS(dcgettext)
105 AC_SUBST(target_alias)
108 AC_SUBST(target_vendor)
109 AC_SUBST(bfd_include_dir)
110 AC_SUBST(binutils_include_dir)
113 AC_OUTPUT(Makefile ld-elf2flt)