|
1 dnl Process this file with autoconf to produce a configure script. |
|
2 AC_INIT(dwarfdump.c) |
|
3 AC_CONFIG_HEADER(config.h) |
|
4 |
|
5 AC_PROG_CC |
|
6 AC_GCC_TRADITIONAL |
|
7 AC_PROG_INSTALL |
|
8 AC_CHECK_TOOL(RANLIB, ranlib, :) |
|
9 AC_CHECK_TOOL(AR, ar) |
|
10 dnl AC_ARFLAGS |
|
11 |
|
12 |
|
13 /* Define to 1 if the elf64_getehdr function is in libelf.a */ |
|
14 #undef HAVE_ELF64_GETEHDR |
|
15 |
|
16 |
|
17 |
|
18 AC_CHECK_HEADERS(elf.h getopt.h libelf.h libelf/libelf.h sgidefs.h sys/types.h) |
|
19 AC_CHECK_LIB(elf,elf64_getehdr, |
|
20 AC_DEFINE(HAVE_ELF64_GETEHDR,1, |
|
21 [Define to 1 if the elf64_getehdr function is in libelf.a.])) |
|
22 |
|
23 dnl Find out where the elf header is. |
|
24 if test "$ac_cv_header_elf_h" = yes; then |
|
25 AC_DEFINE(LOCATION_OF_LIBELFHEADER,[<elf.h>], [Define to header that first defines elf]) |
|
26 elif test "$ac_cv_header_libelf_h" = yes; then |
|
27 AC_DEFINE(LOCATION_OF_LIBELFHEADER, [<libelf.h>], |
|
28 [Define to header that first defines elf.]) |
|
29 elif test "$ac_cv_header_libelf_libelf_h" = yes; then |
|
30 AC_DEFINE(LOCATION_OF_LIBELFHEADER,[<libelf/libelf.h>], |
|
31 [Define to header that first defines elf.]) |
|
32 fi |
|
33 |
|
34 AC_TRY_COMPILE([#include LOCATION_OF_LIBELFHEADER], Elf64_Rel *p; int i; i = p->r_info; ,AC_DEFINE(HAVE_ELF64_R_INFO,1, |
|
35 [Define to 1 if the Elf64_Rel structure has r_info field.])) |
|
36 AC_TRY_COMPILE([], __uint32_t p; p = 3; ,AC_DEFINE(HAVE___UINT32_T, |
|
37 1,[See if __uint32_t is predefined in the compiler. ])) |
|
38 AC_TRY_COMPILE([], __uint64_t p; p = 3; ,AC_DEFINE(HAVE___UINT64_T, |
|
39 1,[See if __uint64_t is predefined in the compiler. ])) |
|
40 AC_TRY_COMPILE([#include <sys/types.h>],[ __uint32_t p; p = 3]; , |
|
41 AC_DEFINE(HAVE___UINT32_T_IN_SYS_TYPES_H,1, |
|
42 [Define 1 if sys/types.h defines __uint32_t.])) |
|
43 |
|
44 AC_TRY_COMPILE([ |
|
45 #include <libelf.h> |
|
46 ],[ int p; p = 0; ] , |
|
47 AC_DEFINE(HAVE_RAW_LIBELF_OK,1, |
|
48 [Define 1 if plain libelf builds.])) |
|
49 AC_TRY_COMPILE([ |
|
50 #define _GNU_SOURCE |
|
51 #include <libelf.h> |
|
52 ],[ off64_t p; p = 0;] , |
|
53 AC_DEFINE(HAVE_LIBELF_OFF64_OK,1, |
|
54 [Define 1 if off64 is defined via libelf with GNU_SOURCE.])) |
|
55 |
|
56 |
|
57 |
|
58 AC_OUTPUT(Makefile) |