OSDN Git Service

gcc 3.1 and 3.1.1 create a .jcr ELF section, which apparently is intended to
[uclinux-h8/elf2flt.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(elf2flt.c)
3
4 AC_ARG_WITH(libbfd,
5         [ --with-libbfd=<file>  path to libbfd.a library to use ],
6         [ ac_libbfd=$withval ],
7         [ ac_libbfd=NONE ]
8 )
9
10 AC_ARG_WITH(libiberty,
11         [ --with-libiberty=<file>  path to libiberty.a library to use ],
12         [ ac_libiberty=$withval ],
13         [ ac_libiberty=NONE ]
14 )
15
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 ]
20 )
21
22 AC_CANONICAL_HOST
23 AC_CANONICAL_TARGET
24
25 dnl Checks for programs.
26 AC_PROG_CC
27 AC_PROG_INSTALL
28
29 dnl Checks for libraries.
30 if test "$ac_libiberty" = "NONE"; then
31   AC_CHECK_LIB(iberty, objalloc_create)
32   ac_libiberty=auto
33 else
34   LIBS="$ac_libiberty $LIBS"
35 fi
36 if test "$ac_libbfd" = "NONE"; then
37   AC_CHECK_LIB(bfd, bfd_openr)
38   ac_libbfd=auto
39 else
40   LIBS="$ac_libbfd $LIBS"
41 fi
42
43 bfd_include_dir=
44 if test "$ac_bfd_include_dir" != "NONE"; then
45   bfd_include_dir="-I$ac_bfd_include_dir"
46 fi
47
48 if test "$ac_libbfd" = "NONE" -o "$ac_libiberty" = "NONE" ; then
49         echo
50         echo "You need to specify the location of the libfd.a and libiberty.a"
51         echo "host libraries from the binutils package."
52         echo
53         echo "Run configure again specifying these options:"
54         echo
55         echo "  ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
56         echo
57         exit 1
58 fi
59
60 if test "$ac_bfd_include_dir" = "NONE" ; then
61         echo
62         echo "You need to specify the location of the bfd.h header from a"
63         echo "configured/compiled version of the binutils package for your target."
64         echo "Without this your elf2flt may crash as it will try to use the"
65         echo "systems bfd.h which may be from a different binutils package."
66         echo
67         echo "Run configure again specifying these options:"
68         echo
69         echo "  ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
70         echo
71         exit 1
72 fi
73
74 dnl Checks for header files.
75 AC_HEADER_STDC
76 AC_CHECK_HEADERS(fcntl.h unistd.h bfd.h)
77
78 dnl Checks for typedefs, structures, and compiler characteristics.
79 AC_C_CONST
80
81 dnl Checks for library functions.
82 AC_FUNC_VPRINTF
83
84 dnl Subsitute values
85 AC_SUBST(target)
86 AC_SUBST(target_alias)
87 AC_SUBST(target_cpu)
88 AC_SUBST(target_os)
89 AC_SUBST(target_vendor)
90 AC_SUBST(bfd_include_dir)
91
92 AC_OUTPUT(Makefile ld-elf2flt)
93