Replace __DATE__ and __TIME__ in the final code with the right date.
[ksplice.git] / configure.ac
blobfb907326bee65cc2f04a3aaaf363d8ce2d9c095b
1 AC_INIT([Ksplice], [0.9.2], [devel@ksplice.com])
3 AC_ARG_WITH([libbfd],
4   [  --with-libbfd=FILE      path to libbfd.a],
5   [ac_libbfd=$withval],
6   [ac_libbfd=NONE])
8 AC_ARG_WITH([libiberty],
9   [  --with-libiberty=FILE   path to libiberty.a],
10   [ac_libiberty=$withval],
11   [ac_libiberty=NONE])
13 AC_ARG_WITH([libz],
14   [  --with-libz=FILE        path to libz.a],
15   [ac_libz=$withval],
16   [ac_libz=NONE])
18 AC_ARG_WITH([bfd-include-dir],
19   [  --with-bfd-include-dir=DIR
20                           path to directory containing bfd.h],
21   [ac_bfd_include_dir=$withval],
22   [ac_bfd_include_dir=NONE])
24 AC_PROG_CC
26 if test "$ac_libz" = "NONE"; then
27   AC_CHECK_LIB([z], [zlibVersion])
28 else
29   LIBS="$ac_libz $LIBS"
31 if test "$ac_libiberty" = "NONE"; then
32   AC_CHECK_LIB([iberty], [objalloc_create])
33 else
34   LIBS="$ac_libiberty $LIBS"
36 if test "$ac_libbfd" = "NONE"; then
37   ac_libbfd=auto
38   AC_CHECK_LIB([bfd], [bfd_openr], , [ac_libbfd=NONE])
39 else
40   LIBS="$ac_libbfd $LIBS"
43 if test "$ac_bfd_include_dir" != "NONE"; then
44   CPPFLAGS="$CPPFLAGS -I$ac_bfd_include_dir"
47 AC_CHECK_HEADERS([bfd.h], , [BFD_H="no"])
49 AC_CHECK_MEMBER([struct bfd_hash_table.entsize],
50   [CPPFLAGS="$CPPFLAGS -DBFD_HASH_TABLE_HAS_ENTSIZE"],
51   [],
52   [[#include <bfd.h>]])
54 if ! test -e "objmanip-static"; then
55   if test "$ac_libbfd" = "NONE"; then
56     echo
57     echo "Ksplice could not locate libbfd.a and/or libiberty.a on your system."
58     echo "You can obtain these libraries from the GNU binutils collection."
59     echo "These libraries are available on many Linux distributions as a"
60     echo "package called 'binutils-dev' or 'binutils-devel'."
61     echo "If your distribution does not provide GNU binutils, you can install"
62     echo "GNU binutils from source -- see http://www.gnu.org/software/binutils/."
63     echo
64     echo "If these libraries are already installed on your system, then you need"
65     echo "to tell Ksplice where to find them by running configure again:"
66     echo
67     echo "  ./configure --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
68     echo
69     echo "Depending on the host system you may also need to provide zlib:"
70     echo
71     echo "  ./configure ... --with-libz=<libz.a>"
72     echo
73     exit 1
74   fi
76   if test "$BFD_H" = "no"; then
77     echo
78     echo "Ksplice could not locate bfd.h on your system."
79     echo "If this header file is already installed on your system, then you need"
80     echo "to tell Ksplice where to find it by running configure again:"
81     echo
82     echo "  ./configure --with-bfd-include-dir=<directory-containing-bfd.h>"
83     echo
84     exit 1
85   fi
88 AC_PATH_PROG([PATCH], [patch])
89 AC_PATH_PROG([POD2MAN], [pod2man])
90 if test "$PATCH" = ""; then
91   echo
92   echo "Ksplice could not locate patch on your system."
93   echo
94   exit 1
96 if test "$POD2MAN" = ""; then
97   echo
98   echo "Ksplice could not locate pod2man on your system."
99   echo
100   exit 1
103 AC_PROG_PERL_MODULES([Cwd Getopt::Long File::Basename File::Copy File::Path File::Spec::Functions File::Temp Fatal IPC::Open2 IPC::Open3 Pod::Usage Text::ParseWords], ,
104   [AC_MSG_ERROR([Missing some required perl modules])])
106 AC_CONFIG_FILES([Makefile kmodsrc/Makefile])
107 AC_OUTPUT