1 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
3 AM_CONFIG_HEADER(config.h)
4 AC_PREREQ(2.13) dnl Minimum Autoconf version required.
7 AM_INIT_AUTOMAKE([prelink], [0.0])
14 AC_PROG_GCC_TRADITIONAL
18 [ --disable-64-bit only support 32-bit ELF],
19 [case "${enableval}" in
22 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit option) ;;
23 esac],[want64=true])dnl
25 AC_CHECK_HEADER(libelf.h,,[
26 if test -f /usr/include/elfutils/libelf.h; then
27 CPPFLAGS="$CPPFLAGS -I /usr/include/elfutils"
28 elif test -f /usr/local/include/elfutils/libelf.h; then
29 CPPFLAGS="$CPPFLAGS -I /usr/local/include/elfutils"
30 elif test -f /usr/include/libelf/libelf.h; then
31 CPPFLAGS="$CPPFLAGS -I /usr/include/libelf"
32 elif test -f /usr/local/include/libelf/libelf.h; then
33 CPPFLAGS="$CPPFLAGS -I /usr/local/include/libelf"
35 AC_MSG_ERROR(libelf.h not found)
38 if test "$want64"x = falsex; then
39 GELFINCLUDE='-I$(top_srcdir)/gelfx32'
41 GELFINCLUDE='-I$(top_srcdir)/gelfx'
42 AC_CHECK_HEADER(gelf.h,,[
43 GELFINCLUDE="$GELFINCLUDE "'-I$(top_srcdir)/gelf'
44 LIBGELF='../gelf/libgelf.la'
47 AC_CHECK_LIB(elf,elf_begin)
51 dnl Now check what kind of libelf we will link against
52 AC_CHECK_FUNC(gelf_getvernaux,[newbu=true],[newbu=false])
54 dnl Check if FTW_ACTIONRETVAL is supported
55 AC_CACHE_CHECK([whether FTW_ACTIONRETVAL is supported],
56 [ac_cv_ftw_actionretval], [dnl
57 AC_EGREP_CPP([FTW supports ACTIONRETVAL], [
62 #ifdef FTW_ACTIONRETVAL
63 FTW supports ACTIONRETVAL
65 ], ac_cv_ftw_actionretval=yes, ac_cv_ftw_actionretval=no)])
66 if test "x$ac_cv_ftw_actionretval" = xyes; then
67 AC_DEFINE(HAVE_FTW_ACTIONRETVAL, 1,
68 [Define if FTW_ACTIONRETVAL is supported.])
72 AC_CHECK_LIB(selinux,is_selinux_enabled)
73 AC_CHECK_HEADERS(selinux/selinux.h)
75 dnl This test must come as early as possible after the compiler configuration
76 dnl tests, because the choice of the file model can (in principle) affect
77 dnl whether functions and headers are available, whether they work, etc.
78 if test x"$newbu" = xtrue; then
79 # Don't use LFS for libelf-0.x