blob: 25804a8baaa02446b05e3fa52a8dd6a4b44b721e [file] [log] [blame]
Ben Chengcc6695e2012-03-07 23:04:02 -08001dnl Process this file with autoconf to produce a configure script.
2dnl Configure input file for elfutils. -*-autoconf-*-
The Android Open Source Project441f72d2009-03-03 19:29:28 -08003dnl
Ben Chengcc6695e2012-03-07 23:04:02 -08004dnl Copyright (C) 1996-2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc.
The Android Open Source Project441f72d2009-03-03 19:29:28 -08005dnl
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,
Ben Chengcc6695e2012-03-07 23:04:02 -080017dnl Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
The Android Open Source Project441f72d2009-03-03 19:29:28 -080018dnl
Ben Chengcc6695e2012-03-07 23:04:02 -080019AC_INIT([Red Hat elfutils],[0.138],[http://bugzilla.redhat.com/bugzilla/],
The Android Open Source Project441f72d2009-03-03 19:29:28 -080020 [elfutils])
21
22AC_CONFIG_AUX_DIR([config])
23AC_CONFIG_FILES([config/Makefile])
24
Ben Chengcc6695e2012-03-07 23:04:02 -080025AC_COPYRIGHT([Copyright (C) 1996-2007, 2008 Red Hat, Inc.])
The Android Open Source Project441f72d2009-03-03 19:29:28 -080026AC_PREREQ(2.59) dnl Minimum Autoconf version required.
27
Ben Chengcc6695e2012-03-07 23:04:02 -080028dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
29AM_INIT_AUTOMAKE([gnits 1.8 -Wno-portability dist-bzip2 no-dist-gzip])
30AM_MAINTAINER_MODE
31
32dnl Unique ID for this build.
33MODVERSION="Build on $(hostname) $(date +%FT%R:%S%z)"
34AC_SUBST([MODVERSION])
35AC_DEFINE_UNQUOTED(MODVERSION, "$MODVERSION")
36AH_TEMPLATE([MODVERSION], [Identifier for modules in the build.])
The Android Open Source Project441f72d2009-03-03 19:29:28 -080037
38AC_CONFIG_SRCDIR([libelf/libelf.h])
39AC_CONFIG_FILES([Makefile])
40AC_CONFIG_HEADERS([config.h])
41
42AC_CONFIG_MACRO_DIR([m4])
43AC_CONFIG_FILES([m4/Makefile])
44
45dnl The RPM spec file. We substitute a few values in the file.
46AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in])
47
48
49AC_CANONICAL_HOST
50
51AC_ARG_ENABLE([tls],
52AS_HELP_STRING([--enable-tls], [enable use of thread local storage]),
Ben Chengcc6695e2012-03-07 23:04:02 -080053use_tls=yes, use_tls=no)
54AM_CONDITIONAL(USE_TLS, test "$use_tls" = yes)
55AS_IF([test "$use_tls" = yes], [AC_DEFINE(USE_TLS)])
56
The Android Open Source Project441f72d2009-03-03 19:29:28 -080057AH_TEMPLATE([USE_TLS], [Defined if thread local storage should be used.])
58
59dnl Add all the languages for which translations are available.
60ALL_LINGUAS=
61
62AC_PROG_CC
The Android Open Source Project441f72d2009-03-03 19:29:28 -080063AC_PROG_RANLIB
64AC_PROG_YACC
65AM_PROG_LEX
66
67AC_CACHE_CHECK([for gcc with C99 support], ac_cv_c99, [dnl
68old_CFLAGS="$CFLAGS"
69CFLAGS="$CFLAGS -std=gnu99"
70AC_COMPILE_IFELSE([dnl
71int foo (int a) { for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; }],
72 ac_cv_c99=yes, ac_cv_c99=no)
73CFLAGS="$old_CFLAGS"])
74AS_IF([test "x$ac_cv_c99" != xyes],
75 AC_MSG_ERROR([gcc with C99 support required]))
76
77LOCALEDIR=$datadir
78AC_SUBST(LOCALEDIR)
79AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
80AH_TEMPLATE([LOCALEDIR], [Directory to place translation files in.])
81
82DATADIRNAME=$datadir
83AC_SUBST(DATADIRNAME)
84
85dnl This test must come as early as possible after the compiler configuration
86dnl tests, because the choice of the file model can (in principle) affect
87dnl whether functions and headers are available, whether they work, etc.
88AC_SYS_LARGEFILE
89
90dnl Enable the linker to be build as a native-only linker. By default it
91dnl can handle all architectures but this comes at a cost. A native
92dnl will be slightly faster, small, and has fewer dependencies.
93native_ld=no
94AC_ARG_ENABLE([generic],
95AS_HELP_STRING([--disable-generic], [do not build generic linker]), [dnl
96if test "$enable_generic" = no; then
97 case "$host_cpu" in
98 i?86)
99 AC_DEFINE(NATIVE_ELF, 32)
100 native_ld=yes
101 base_cpu=i386
102 ;;
103 *)
104 AC_MSG_ERROR([no machine-specific linker for this configuration available])
105 ;;
106 esac
107fi])
108AH_TEMPLATE([NATIVE_ELF],
109[Define to 32 or 64 if a specific implementation is wanted.])
110AM_CONDITIONAL(NATIVE_LD, test "$native_ld" = yes)
111dnl The automake generated Makefile cannot deal with macros in the name
112dnl of files if at any time there is no such file, even if the filename
113dnl would not be used.
114AS_IF([test -z "$base_cpu"], [base_cpu=none])
115AC_SUBST(base_cpu)
Ben Chengcc6695e2012-03-07 23:04:02 -0800116dnl Support to work around automake's inflexible dependency generation.
117dnl See src/Makefile.am for more information.
118AM_CONDITIONAL(NEVER, false)
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800119
120dnl Enable debugging via mudflap. This option will cause most libraries
121dnl to be built as archives which are statically linked into the applications.
122dnl All code, as far as possible, is compiled instrumented to catch all
123dnl the bugs valgrind is able to catch.
124use_mudflap=no
125AC_ARG_ENABLE([mudflap],
126AS_HELP_STRING([--enable-mudflap],
127[build binaries with mudflap instrumentation]), [dnl
128if test "x$enable_mudflap" = xyes; then
129 # Check whether the compiler support -fmudflap.
130 old_CFLAGS="$CFLAGS"
131 CFLAGS="$CFLAGS -fmudflap"
132 AC_TRY_COMPILE([], [], use_mudflap=yes, use_mudflap=fail)
133 CFLAGS="$old_CFLAGS"
134fi])
135if test "$use_mudflap" = fail; then
136 AC_MSG_FAILURE([--enable-mudflap requires a compiler which understands this option])
137fi
138AM_CONDITIONAL(MUDFLAP, test "$use_mudflap" = yes)
139
Ben Chengcc6695e2012-03-07 23:04:02 -0800140dnl enable debugging of branch prediction.
141use_debugpred=0
142AC_ARG_ENABLE([debugpred],
143AC_HELP_STRING([--enable-debugpred],
144[build binaries with support to debug branch prediction]),
145[use_debugpred=1], [use_debugpred=0])
146AC_SUBST([DEBUGPRED], $use_debugpred)
147
148dnl Enable gprof suport.
149AC_ARG_ENABLE([gprof],
150AC_HELP_STRING([--enable-gprof],
151[build binaries with gprof support]), [use_gprof=yes], [use_gprof=no])
152if test "$use_gprof" = yes; then
153 CFLAGS="$CFLAGS -pg"
154 LDFLAGS="$LDFLAGS -pg"
155fi
156AM_CONDITIONAL(GPROF, test "$use_gprof" = yes)
157
158# Enable gcov suport.
159AC_ARG_ENABLE([gcov],
160AC_HELP_STRING([--enable-gcov],
161[build binaries with gcov support]), [use_gcov=yes], [use_gcov=no])
162if test "$use_gcov" = yes; then
163 CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
164 LDFLAGS="$LDFLAGS -fprofile-arcs"
165fi
166AM_CONDITIONAL(GCOV, test "$use_gcov" = yes)
167
168AM_CONDITIONAL(BUILD_STATIC, [dnl
169test "$use_mudflap" = yes -o "$use_gprof" = yes -o "$use_gcov" = yes])
170
171AC_ARG_ENABLE([tests-rpath],
172AC_HELP_STRING([--enable-tests-rpath], [build $ORIGIN-using rpath into tests]),
173 [tests_use_rpath=yes], [tests_use_rpath=no])
174AM_CONDITIONAL(TESTS_RPATH, test "$tests_use_rpath" = yes)
175
176LIBEBL_SUBDIR="$PACKAGE"
177AC_ARG_ENABLE([libebl-subdir],
178AS_HELP_STRING([--enable-libebl-subdir=DIR],
179[install libebl_CPU modules in $(libdir)/DIR]), [dnl
180LIBEBL_SUBDIR="$enable_libebl_subdir"])
181AC_SUBST([LIBEBL_SUBDIR])
182AC_DEFINE_UNQUOTED(LIBEBL_SUBDIR, "$LIBEBL_SUBDIR")
183AH_TEMPLATE([LIBEBL_SUBDIR], [$libdir subdirectory containing libebl modules.])
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800184
185dnl The directories with content.
186
187dnl Documentation.
Ben Chengcc6695e2012-03-07 23:04:02 -0800188dnl Commented out for now.
189dnl AC_CONFIG_FILES([doc/Makefile])
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800190
191dnl Support library.
192AC_CONFIG_FILES([lib/Makefile])
193
194dnl ELF library.
Ben Chengcc6695e2012-03-07 23:04:02 -0800195AC_CONFIG_FILES([libelf/Makefile])
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800196
197dnl Higher-level ELF support library.
198AC_CONFIG_FILES([libebl/Makefile])
199
200dnl DWARF library.
201AC_CONFIG_FILES([libdw/Makefile])
202
Ben Chengcc6695e2012-03-07 23:04:02 -0800203dnl Higher-level DWARF support library.
204AC_CONFIG_FILES([libdwfl/Makefile])
205
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800206dnl CPU handling library.
207AC_CONFIG_FILES([libcpu/Makefile])
208
209dnl Assembler library.
Ben Chengcc6695e2012-03-07 23:04:02 -0800210AM_CONDITIONAL(HAVE_LIBASM, true)dnl Used in tests/Makefile.am, which see.
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800211AC_CONFIG_FILES([libasm/Makefile])
212
Ben Chengcc6695e2012-03-07 23:04:02 -0800213dnl CPU-specific backend libraries.
214AC_CONFIG_FILES([backends/Makefile])
215
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800216dnl Tools.
217AC_CONFIG_FILES([src/Makefile po/Makefile.in])
218
219dnl Test suite.
Ben Chengcc6695e2012-03-07 23:04:02 -0800220AM_CONDITIONAL(STANDALONE, false)dnl Used in tests/Makefile.am, which see.
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800221AC_CONFIG_FILES([tests/Makefile])
222
Ben Chengcc6695e2012-03-07 23:04:02 -0800223# Get the definitions necessary to create the Makefiles in the po
224# subdirectories. This is a small subset of the gettext rules.
225AC_SUBST(USE_NLS, yes)
226AM_PO_SUBDIRS
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800227
Ben Chengcc6695e2012-03-07 23:04:02 -0800228dnl Appended to the config.h file.
229dnl We hide all kinds of configuration magic in lib/eu-config.h.
230AH_BOTTOM([#include <eu-config.h>])
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800231
Ben Chengcc6695e2012-03-07 23:04:02 -0800232dnl Version compatibility header.
233AC_CONFIG_FILES([version.h:config/version.h.in])
234AC_SUBST([eu_version])
235case $PACKAGE_VERSION in
2360.???) eu_version=${PACKAGE_VERSION#0.} ;;
237?.???) eu_version=${PACKAGE_VERSION/./} ;;
238?.??) eu_version=${PACKAGE_VERSION/./}0 ;;
239?.?) eu_version=${PACKAGE_VERSION/./}00 ;;
240*) AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
241esac
The Android Open Source Project441f72d2009-03-03 19:29:28 -0800242
243AC_OUTPUT