blob: e153737fc787240bf789de8346f8785d6cce8c16 [file] [log] [blame]
The Android Open Source Project441f72d2009-03-03 19:29:28 -08001dnl Process this file with autoconf to produce a configure script. -*-m4-*-
2dnl Configure input file for elfutils.
3dnl
4dnl Copyright (C) 1996-2002, 2003, 2004 Red Hat, Inc.
5dnl
6dnl This program is free software; you can redistribute it and/or modify
7dnl it under the terms of the GNU General Public License as published by
8dnl the Free Software Foundation, version 2.
9dnl
10dnl This program is distributed in the hope that it will be useful,
11dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13dnl GNU General Public License for more details.
14dnl
15dnl You should have received a copy of the GNU General Public License
16dnl along with this program; if not, write to the Free Software Foundation,
17dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18dnl
19AC_INIT([Red Hat elfutils],[0.97],[http://bugzilla.redhat.com/bugzilla/],
20 [elfutils])
21
22AC_CONFIG_AUX_DIR([config])
23AC_CONFIG_FILES([config/Makefile])
24
25AC_COPYRIGHT([Copyright (C) 1996-2003, 2004 Red Hat, Inc.])
26AC_REVISION($Revision: 1.30 $)
27AC_PREREQ(2.59) dnl Minimum Autoconf version required.
28
29AM_INIT_AUTOMAKE([gnits 1.7 dist-bzip2])
30
31AC_CONFIG_SRCDIR([libelf/libelf.h])
32AC_CONFIG_FILES([Makefile])
33AC_CONFIG_HEADERS([config.h])
34
35AC_CONFIG_MACRO_DIR([m4])
36AC_CONFIG_FILES([m4/Makefile])
37
38dnl The RPM spec file. We substitute a few values in the file.
39AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in])
40
41
42AC_CANONICAL_HOST
43
44AC_ARG_ENABLE([tls],
45AS_HELP_STRING([--enable-tls], [enable use of thread local storage]),
46AC_DEFINE(USE_TLS))
47AH_TEMPLATE([USE_TLS], [Defined if thread local storage should be used.])
48
49dnl Add all the languages for which translations are available.
50ALL_LINGUAS=
51
52AC_PROG_CC
53AC_PROG_CPP
54AC_PROG_GCC_TRADITIONAL
55AM_GNU_GETTEXT([external])
56AC_PROG_RANLIB
57AC_PROG_YACC
58AM_PROG_LEX
59
60AC_CACHE_CHECK([for gcc with C99 support], ac_cv_c99, [dnl
61old_CFLAGS="$CFLAGS"
62CFLAGS="$CFLAGS -std=gnu99"
63AC_COMPILE_IFELSE([dnl
64int foo (int a) { for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; }],
65 ac_cv_c99=yes, ac_cv_c99=no)
66CFLAGS="$old_CFLAGS"])
67AS_IF([test "x$ac_cv_c99" != xyes],
68 AC_MSG_ERROR([gcc with C99 support required]))
69
70LOCALEDIR=$datadir
71AC_SUBST(LOCALEDIR)
72AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
73AH_TEMPLATE([LOCALEDIR], [Directory to place translation files in.])
74
75DATADIRNAME=$datadir
76AC_SUBST(DATADIRNAME)
77
78dnl This test must come as early as possible after the compiler configuration
79dnl tests, because the choice of the file model can (in principle) affect
80dnl whether functions and headers are available, whether they work, etc.
81AC_SYS_LARGEFILE
82
83dnl Enable the linker to be build as a native-only linker. By default it
84dnl can handle all architectures but this comes at a cost. A native
85dnl will be slightly faster, small, and has fewer dependencies.
86native_ld=no
87AC_ARG_ENABLE([generic],
88AS_HELP_STRING([--disable-generic], [do not build generic linker]), [dnl
89if test "$enable_generic" = no; then
90 case "$host_cpu" in
91 i?86)
92 AC_DEFINE(NATIVE_ELF, 32)
93 native_ld=yes
94 base_cpu=i386
95 ;;
96 *)
97 AC_MSG_ERROR([no machine-specific linker for this configuration available])
98 ;;
99 esac
100fi])
101AH_TEMPLATE([NATIVE_ELF],
102[Define to 32 or 64 if a specific implementation is wanted.])
103AM_CONDITIONAL(NATIVE_LD, test "$native_ld" = yes)
104dnl The automake generated Makefile cannot deal with macros in the name
105dnl of files if at any time there is no such file, even if the filename
106dnl would not be used.
107AS_IF([test -z "$base_cpu"], [base_cpu=none])
108AC_SUBST(base_cpu)
109
110dnl Enable debugging via mudflap. This option will cause most libraries
111dnl to be built as archives which are statically linked into the applications.
112dnl All code, as far as possible, is compiled instrumented to catch all
113dnl the bugs valgrind is able to catch.
114use_mudflap=no
115AC_ARG_ENABLE([mudflap],
116AS_HELP_STRING([--enable-mudflap],
117[build binaries with mudflap instrumentation]), [dnl
118if test "x$enable_mudflap" = xyes; then
119 # Check whether the compiler support -fmudflap.
120 old_CFLAGS="$CFLAGS"
121 CFLAGS="$CFLAGS -fmudflap"
122 AC_TRY_COMPILE([], [], use_mudflap=yes, use_mudflap=fail)
123 CFLAGS="$old_CFLAGS"
124fi])
125if test "$use_mudflap" = fail; then
126 AC_MSG_FAILURE([--enable-mudflap requires a compiler which understands this option])
127fi
128AM_CONDITIONAL(MUDFLAP, test "$use_mudflap" = yes)
129
130
131dnl The directories with content.
132
133dnl Documentation.
134AC_CONFIG_FILES([doc/Makefile])
135
136dnl Support library.
137AC_CONFIG_FILES([lib/Makefile])
138
139dnl ELF library.
140AC_CONFIG_FILES([libelf/Makefile libelf-po/Makefile.in])
141
142dnl Higher-level ELF support library.
143AC_CONFIG_FILES([libebl/Makefile])
144
145dnl DWARF library.
146AC_CONFIG_FILES([libdw/Makefile])
147
148dnl CPU handling library.
149AC_CONFIG_FILES([libcpu/Makefile])
150
151dnl Assembler library.
152AC_CONFIG_FILES([libasm/Makefile])
153
154dnl Tools.
155AC_CONFIG_FILES([src/Makefile po/Makefile.in])
156
157dnl Test suite.
158AC_CONFIG_FILES([tests/Makefile])
159
160
161dnl Test of the config.h file. We hide all kinds of configuration magic
162dnl in there.
163AH_BOTTOM([
164/* Eventually we will allow multi-threaded applications to use the
165 libraries. Therefore we will add the necessary locking although
166 the macros used expand to nothing for now. */
167#define lock_lock(lock) ((void) (lock))
168#define rwlock_define(class,name) class int name
169#define rwlock_init(lock) ((void) (lock))
170#define rwlock_fini(lock) ((void) (lock))
171#define rwlock_rdlock(lock) ((void) (lock))
172#define rwlock_wrlock(lock) ((void) (lock))
173#define rwlock_unlock(lock) ((void) (lock))
174#define tls_key_t void *
175#define key_create(keyp, freefct) (1)
176#define getspecific(key) key
177#define setspecific(key,val) key = val
178#define once_define(class,name) class int name
179#define once_execute(name,fct) \
180 do { \
181 if (name == 0) \
182 fct (); \
183 name = 1; \
184 } while (0)
185
186/* gettext helper macro. */
187#define N_(Str) Str
188
189/* Compiler-specific definitions. */
190#define strong_alias(name, aliasname) \
191 extern __typeof (name) aliasname __attribute__ ((alias (#name)));
192
193#ifdef __i386__
194# define internal_function_def __attribute__ ((regparm (3), stdcall))
195#else
196# define internal_function_def /* nothing */
197#endif
198
199# define internal_function \
200 internal_function_def __attribute__ ((visibility ("internal")))
201# define internal_strong_alias(name, aliasname) \
202 extern __typeof (name) aliasname __attribute__ ((alias (#name), visibility ("internal"))) internal_function_def;
203
204#define attribute_hidden \
205 __attribute__ ((visibility ("hidden")))
206
207/* Define ALLOW_UNALIGNED if the architecture allows operations on
208 unaligned memory locations. */
209#if defined __i386__ || defined __alpha__ || defined __x86_64__ || defined __ia64__
210# define ALLOW_UNALIGNED 1
211#else
212# define ALLOW_UNALIGNED 0
213#endif
214
215#define unlikely(expr) __builtin_expect (expr, 0)
216#define likely(expr) __builtin_expect (expr, 1)
217
218#define obstack_calloc(ob, size) \
219 ({ size_t _s = (size); memset (obstack_alloc (ob, _s), '\0', _s); })
220#define obstack_strdup(ob, str) \
221 ({ const char *_s = (str); obstack_copy0 (ob, _s, strlen (_s)); })
222#define obstack_strndup(ob, str, n) \
223 ({ const char *_s = (str); obstack_copy0 (ob, _s, strnlen (_s, n)); })
224
225#if __STDC_VERSION__ >= 199901L
226# define flexarr_size /* empty */
227#else
228# define flexarr_size 0
229#endif
230
231/* Calling conventions. */
232#ifdef __i386__
233# define CALLING_CONVENTION regparm (3), stdcall
234# define AND_CALLING_CONVENTION , regparm (3), stdcall
235#else
236# define CALLING_CONVENTION
237# define AND_CALLING_CONVENTION
238#endif
239
240/* Avoid PLT entries. */
241#ifdef PIC
242# define INTUSE(name) _INTUSE(name)
243# define _INTUSE(name) __##name##_internal
244# define INTDEF(name) _INTDEF(name)
245# define _INTDEF(name) \
246 extern __typeof__ (name) __##name##_internal __attribute__ ((alias (#name)));
247#else
248# define INTUSE(name) name
249# define INTDEF(name) /* empty */
250#endif
251])
252
253AC_OUTPUT