Support multiple ksplice modules in ksplice-apply.
[ksplice.git] / configure.ac
blobf509c868a4d1f6e8ed6ac116437dcac5a2381fde
1 AC_INIT(Ksplice, 0.8.7, ksplice@mit.edu)
3 dnl The author of Ksplice learned how to configure libbfd by looking at
4 dnl elf2flt, which is available under the GNU General Public License.
6 AC_ARG_WITH(libbfd,
7   [ --with-libbfd=<file>  path to libbfd.a ],
8   [ ac_libbfd=$withval ],
9   [ ac_libbfd=NONE ]
12 AC_ARG_WITH(libiberty,
13   [ --with-libiberty=<file>  path to libiberty.a ],
14   [ ac_libiberty=$withval ],
15   [ ac_libiberty=NONE ]
18 AC_ARG_WITH(bfd-include-dir,
19   [ --with-bfd-include-dir=<dir>  path to bfd.h ],
20   [ ac_bfd_include_dir=$withval ],
21   [ ac_bfd_include_dir=NONE ]
24 AC_PROG_CC
25 AC_CHECK_HEADERS(bfd.h,, BFD_H="no")
27 if test "$ac_libiberty" = "NONE"; then
28   AC_CHECK_LIB(iberty, objalloc_create)
29   ac_libiberty=auto
30 else
31   LIBS="$ac_libiberty $LIBS"
33 if test "$ac_libbfd" = "NONE"; then
34   AC_CHECK_LIB(bfd, bfd_openr)
35   ac_libbfd=auto
36 else
37   LIBS="$ac_libbfd $LIBS"
40 if test "$ac_bfd_include_dir" != "NONE"; then
41   CPPFLAGS="$CPPFLAGS -I$ac_bfd_include_dir"
44 if ! test -e "objdiff-static" || ! test -e "objmanip-static"; then
45   if test "$ac_libbfd" = "NONE" || test "$ac_libiberty" = "NONE"; then
46     echo
47     echo "Ksplice could not locate libbfd.a and/or libiberty.a on your system."
48     echo "You can obtain these libraries from the GNU binutils collection."
49     echo "These libraries are available on many Linux distributions as a"
50     echo "package called 'binutils-dev' or 'binutils-devel'."
51     echo "If your distribution does not provide GNU binutils, you can install"
52     echo "GNU binutils from source -- see http://www.gnu.org/software/binutils/."
53     echo
54     echo "If these libraries are already installed on your system, then you need"
55     echo "to tell Ksplice where to find them by running configure again:"
56     echo
57     echo "  ./configure --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
58     echo
59     exit 1
60   fi
62   if test "$BFD_H" = "no"; then
63     echo
64     echo "Ksplice could not locate bfd.h on your system."
65     echo "If this header file is already installed on your system, then you need"
66     echo "to tell Ksplice where to find it by running configure again:"
67     echo
68     echo "  ./configure --with-bfd-include-dir=<directory-containing-bfd.h>"
69     echo
70     exit 1
71   fi
74 AC_PROG_SED
76 AC_PATH_PROG(RSYNC, rsync)
77 AC_PATH_PROG(PATCH, patch)
78 AC_PATH_PROG(POD2MAN, pod2man)
79 if test "$RSYNC" = ""; then
80   echo
81   echo "Ksplice could not locate rsync on your system."
82   echo
83   exit 1
85 if test "$PATCH" = ""; then
86   echo
87   echo "Ksplice could not locate patch on your system."
88   echo
89   exit 1
91 if test "$POD2MAN" = ""; then
92   echo
93   echo "Ksplice could not locate pod2man on your system."
94   echo
95   exit 1
98 AC_PROG_PERL_MODULES(Cwd,,AC_MSG_ERROR(Required perl module Cwd not found))
99 AC_PROG_PERL_MODULES(Pod::Usage,,AC_MSG_ERROR(Required perl module Pod::Usage not found))
100 AC_PROG_PERL_MODULES(File::Temp,,AC_MSG_ERROR(Required perl module File::Temp not found))
102 AC_CONFIG_FILES([Makefile])
103 AC_OUTPUT