|
1 dnl Process this file with autoconf to produce a configure script. |
|
2 AC_INIT(libdwarf.h) |
|
3 AC_CONFIG_HEADER(config.h) |
|
4 |
|
5 AC_PROG_CC |
|
6 AC_C_BIGENDIAN |
|
7 AC_GCC_TRADITIONAL |
|
8 AC_PROG_INSTALL |
|
9 AC_CHECK_TOOL(RANLIB, ranlib, :) |
|
10 AC_CHECK_TOOL(AR, ar) |
|
11 |
|
12 dnl AC_ARFLAGS |
|
13 |
|
14 AC_CHECK_HEADERS(alloca.h elf.h elfaccess.h libelf.h libelf/libelf.h sys/types.h sys/ia64/elf.h) |
|
15 |
|
16 AC_CHECK_LIB(elf,elf64_getehdr, |
|
17 AC_DEFINE(HAVE_ELF64_GETEHDR,1, |
|
18 [Define to 1 if the elf64_getehdr function is in libelf.a.])) |
|
19 AC_CHECK_LIB(elf,elf64_getshdr, |
|
20 AC_DEFINE(HAVE_ELF64_GETSHDR,1, |
|
21 [Define to 1 if the elf64_getshdr function is in libelf.a.])) |
|
22 AC_TRY_COMPILE( , __uint32_t p; p = 3; ,AC_DEFINE(HAVE___UINT32_T,1, |
|
23 [See if __uint32_t is predefined in the compiler.])) |
|
24 AC_TRY_COMPILE( , __uint64_t p; p = 3; ,AC_DEFINE(HAVE___UINT64_T,1, |
|
25 [See if __uint64_t is predefined in the compiler.])) |
|
26 AC_TRY_COMPILE([#include <sys/types.h>],[ __uint32_t p; p = 3;] , |
|
27 AC_DEFINE(HAVE___UINT32_T_IN_SYS_TYPES_H,1, |
|
28 [Define 1 if sys/types.h defines __uint32_t.])) |
|
29 AC_TRY_COMPILE([#include <sys/types.h>],[ __uint64_t p; p = 3;] , |
|
30 AC_DEFINE(HAVE___UINT64_T_IN_SYS_TYPES_H,1, |
|
31 [Define 1 if sys/types.h defines __uint64_t.])) |
|
32 dnl checking for ia 64 types, which might be enums, using HAVE_R_IA_64_DIR32LSB |
|
33 dnl to stand in for a small set. |
|
34 AC_TRY_COMPILE([#include <elf.h>],[ int p; p = R_IA_64_DIR32LSB;] , |
|
35 AC_DEFINE(HAVE_R_IA_64_DIR32LSB,1, |
|
36 [Define 1 if R_IA_64_DIR32LSB is defined (might be enum value).])) |
|
37 |
|
38 AC_TRY_COMPILE([ |
|
39 #include <libelf.h> |
|
40 ],[ int p; p = 0; ] , |
|
41 AC_DEFINE(HAVE_RAW_LIBELF_OK,1, |
|
42 [Define 1 if plain libelf builds.])) |
|
43 AC_TRY_COMPILE([ |
|
44 #define _GNU_SOURCE |
|
45 #include <libelf.h> |
|
46 ],[ off64_t p; p = 0;] , |
|
47 AC_DEFINE(HAVE_LIBELF_OFF64_OK,1, |
|
48 [Define 1 if off64 is defined via libelf with GNU_SOURCE.])) |
|
49 |
|
50 dnl the existence of sgidefs.h does not prove it's truly SGI, nor |
|
51 dnl prove that __uint32_t or __uint64_t is defined therein. |
|
52 AC_TRY_COMPILE([#include <sgidefs.h>],[ __uint32_t p; p = 27;] , |
|
53 AC_DEFINE(HAVE___UINT32_T_IN_SGIDEFS_H,1, |
|
54 [Define 1 if __uint32_t is in sgidefs.h.])) |
|
55 AC_TRY_COMPILE([#include <sgidefs.h>],[ __uint64_t p; p = 27;] , |
|
56 AC_DEFINE(HAVE___UINT64_T_IN_SGIDEFS_H,1, |
|
57 [Define 1 if __uint64_t is in sgidefs.h.])) |
|
58 AC_TRY_COMPILE([#include <sgidefs.h>],[ __uint64_t p; p = 27;] , |
|
59 AC_DEFINE(HAVE___UINT64_T_IN_SGIDEFS_H,1, |
|
60 [Define 1 if is in sgidefs.h.])) |
|
61 |
|
62 AC_SUBST(build_shared,[]) |
|
63 AC_SUBST(build_nonshared,[libdwarf.a]) |
|
64 AC_ARG_ENABLE(shared,AC_HELP_STRING([--enable-shared], |
|
65 [build shared library libdwarf.so (default is NO)]), |
|
66 [ AC_SUBST(build_shared,[libdwarf.so]) ], |
|
67 [ AC_SUBST(build_shared,[none]) ]) |
|
68 AC_ARG_ENABLE(nonshared,AC_HELP_STRING([--enable-nonshared], |
|
69 [build archive library libdwarf.a (default is YES)]), |
|
70 [ AC_SUBST(build_nonshared,[libdwarf.a]) ] |
|
71 [ AC_SUBST(build_nonshared,[none]) ]) |
|
72 |
|
73 |
|
74 dnl Just assume, if old ia64 R_IA_64_DIR32LSB name present, |
|
75 dnl compatibility with cygnus before |
|
76 dnl HAVE_DWARF2_99_EXTENSION defined. |
|
77 dnl Only applies to producer code, as consumer adapts itself. |
|
78 dnl This is not the right test, really. |
|
79 AC_TRY_COMPILE([#include <elf.h>],[ int p; p = R_IA_64_DIR32LSB;] , |
|
80 AC_DEFINE(HAVE_OLD_DWARF2_32BIT_OFFSET,1, |
|
81 [Define 1 if want producer to build with only 32bit section offsets per strict dwarf2] ), |
|
82 AC_DEFINE(HAVE_DWARF2_99_EXTENSION,1, |
|
83 [Define 1 if want producer to build with 32/64bit section offsets per dwarf3] )) |
|
84 |
|
85 AC_OUTPUT(Makefile) |