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 ],
40 AC_ARG_ENABLE(emit_relocs,
41 [ --disable-emit-relocs - don't use the --emit-relocs (-q) linker option ],
42 [ emit_relocs=$enableval ],
49 dnl Checks for programs.
53 dnl Checks for libraries.
54 if test "$ac_libiberty" = "NONE"; then
55 AC_CHECK_LIB(iberty, objalloc_create)
58 LIBS="$ac_libiberty $LIBS"
60 if test "$ac_libbfd" = "NONE"; then
61 AC_CHECK_LIB(bfd, bfd_openr)
64 LIBS="$ac_libbfd $LIBS"
68 if test "$ac_bfd_include_dir" != "NONE"; then
69 bfd_include_dir="-I$ac_bfd_include_dir"
73 if test "$ac_binutils_include_dir" != "NONE"; then
74 binutils_include_dir="-I$ac_binutils_include_dir"
77 binutils_ldscript_dir=
78 if test "$ac_binutils_ldscript_dir" = "NONE"; then
79 ac_binutils_ldscript_dir="\${TOOLDIR}/../${target_alias}/lib"
81 binutils_ldscript_dir="$ac_binutils_ldscript_dir"
83 if test "$ac_libbfd" = "NONE" -o "$ac_libiberty" = "NONE" ; then
85 echo "You need to specify the location of the libfd.a and libiberty.a"
86 echo "host libraries from the binutils package."
88 echo "Run configure again specifying these options:"
90 echo " ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
95 if test "$ac_bfd_include_dir" = "NONE" ; then
97 echo "You need to specify the location of the bfd.h header from a"
98 echo "configured/compiled version of the binutils package for your target."
99 echo "Without this your elf2flt may crash as it will try to use the"
100 echo "systems bfd.h which may be from a different binutils package."
102 echo "Run configure again specifying these options:"
104 echo " ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
109 dnl Checks for header files.
111 AC_CHECK_HEADERS(fcntl.h unistd.h bfd.h)
113 dnl Checks for typedefs, structures, and compiler characteristics.
116 dnl Checks for library functions.
119 AC_CHECK_FUNCS(dcgettext)
123 AC_SUBST(target_alias)
126 AC_SUBST(target_vendor)
127 AC_SUBST(bfd_include_dir)
128 AC_SUBST(binutils_include_dir)
129 AC_SUBST(binutils_ldscript_dir)
131 AC_SUBST(emit_relocs)
133 AC_OUTPUT(Makefile ld-elf2flt)