OSDN Git Service

nios/nios2 support by Wentao Xu <wentao@microtronix.com>
[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_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 ]
26 )
27
28 AC_ARG_ENABLE(got-check,
29         [ --disable-got-check - disable check for GOT (needed on H8) ],
30         [ got_check=$enableval ],
31         [ got_check=yes ]
32 )
33
34 AC_CANONICAL_HOST
35 AC_CANONICAL_TARGET
36
37 dnl Checks for programs.
38 AC_PROG_CC
39 AC_PROG_INSTALL
40
41 dnl Checks for libraries.
42 if test "$ac_libiberty" = "NONE"; then
43   AC_CHECK_LIB(iberty, objalloc_create)
44   ac_libiberty=auto
45 else
46   LIBS="$ac_libiberty $LIBS"
47 fi
48 if test "$ac_libbfd" = "NONE"; then
49   AC_CHECK_LIB(bfd, bfd_openr)
50   ac_libbfd=auto
51 else
52   LIBS="$ac_libbfd $LIBS"
53 fi
54
55 bfd_include_dir=
56 if test "$ac_bfd_include_dir" != "NONE"; then
57   bfd_include_dir="-I$ac_bfd_include_dir"
58 fi
59
60 binutils_include_dir=
61 if test "$ac_binutils_include_dir" != "NONE"; then
62   binutils_include_dir="-I$ac_binutils_include_dir"
63 fi
64
65 if test "$ac_libbfd" = "NONE" -o "$ac_libiberty" = "NONE" ; then
66         echo
67         echo "You need to specify the location of the libfd.a and libiberty.a"
68         echo "host libraries from the binutils package."
69         echo
70         echo "Run configure again specifying these options:"
71         echo
72         echo "  ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
73         echo
74         exit 1
75 fi
76
77 if test "$ac_bfd_include_dir" = "NONE" ; then
78         echo
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."
83         echo
84         echo "Run configure again specifying these options:"
85         echo
86         echo "  ./configure --target=<ARCH> --with-bfd-include-dir=<dir> --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
87         echo
88         exit 1
89 fi
90
91 dnl Checks for header files.
92 AC_HEADER_STDC
93 AC_CHECK_HEADERS(fcntl.h unistd.h bfd.h)
94
95 dnl Checks for typedefs, structures, and compiler characteristics.
96 AC_C_CONST
97
98 dnl Checks for library functions.
99 AC_FUNC_VPRINTF
100
101 AC_CHECK_FUNCS(dcgettext)
102
103 dnl Subsitute values
104 AC_SUBST(target)
105 AC_SUBST(target_alias)
106 AC_SUBST(target_cpu)
107 AC_SUBST(target_os)
108 AC_SUBST(target_vendor)
109 AC_SUBST(bfd_include_dir)
110 AC_SUBST(binutils_include_dir)
111 AC_SUBST(got_check)
112
113 AC_OUTPUT(Makefile ld-elf2flt)
114