forked from jojolian753/cormander-ksplice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
108 lines (94 loc) · 3.1 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
AC_INIT([Ksplice], [0.9.9], [[email protected]])
AC_SUBST([KSPLICE_API_VERSION], [2])
AC_ARG_WITH([libbfd],
[ --with-libbfd=FILE path to libbfd.a],
[ac_libbfd=$withval],
[ac_libbfd=NONE])
AC_ARG_WITH([libiberty],
[ --with-libiberty=FILE path to libiberty.a],
[ac_libiberty=$withval],
[ac_libiberty=NONE])
AC_ARG_WITH([libz],
[ --with-libz=FILE path to libz.a],
[ac_libz=$withval],
[ac_libz=NONE])
AC_ARG_WITH([bfd-include-dir],
[ --with-bfd-include-dir=DIR
path to directory containing bfd.h],
[ac_bfd_include_dir=$withval],
[ac_bfd_include_dir=NONE])
AC_PROG_CC
if test "$ac_libz" = "NONE"; then
AC_CHECK_LIB([z], [zlibVersion])
else
LIBS="$ac_libz $LIBS"
fi
if test "$ac_libiberty" = "NONE"; then
AC_CHECK_LIB([iberty], [objalloc_create])
else
LIBS="$ac_libiberty $LIBS"
fi
if test "$ac_libbfd" = "NONE"; then
ac_libbfd=auto
AC_CHECK_LIB([bfd], [bfd_openr], , [ac_libbfd=NONE])
else
LIBS="$ac_libbfd $LIBS"
fi
if test "$ac_bfd_include_dir" != "NONE"; then
CPPFLAGS="$CPPFLAGS -I$ac_bfd_include_dir"
fi
AC_CHECK_HEADERS([bfd.h], , [BFD_H="no"])
AC_CHECK_MEMBER([struct bfd_hash_table.entsize],
[CPPFLAGS="$CPPFLAGS -DBFD_HASH_TABLE_HAS_ENTSIZE"],
[],
[[#include <bfd.h>]])
if ! test -e "objmanip-static"; then
if test "$ac_libbfd" = "NONE"; then
echo
echo "Ksplice could not locate libbfd.a and/or libiberty.a on your system."
echo "You can obtain these libraries from the GNU binutils collection."
echo "These libraries are available on many Linux distributions as a"
echo "package called 'binutils-dev' or 'binutils-devel'."
echo "If your distribution does not provide GNU binutils, you can install"
echo "GNU binutils from source -- see http://www.gnu.org/software/binutils/."
echo
echo "If these libraries are already installed on your system, then you need"
echo "to tell Ksplice where to find them by running configure again:"
echo
echo " ./configure --with-libbfd=<libbfd.a> --with-libiberty=<libiberty.a>"
echo
echo "Depending on the host system you may also need to provide zlib:"
echo
echo " ./configure ... --with-libz=<libz.a>"
echo
exit 1
fi
if test "$BFD_H" = "no"; then
echo
echo "Ksplice could not locate bfd.h on your system."
echo "If this header file is already installed on your system, then you need"
echo "to tell Ksplice where to find it by running configure again:"
echo
echo " ./configure --with-bfd-include-dir=<directory-containing-bfd.h>"
echo
exit 1
fi
fi
AC_PATH_PROG([PATCH], [patch])
AC_PATH_PROG([POD2MAN], [pod2man])
if test "$PATCH" = ""; then
echo
echo "Ksplice could not locate patch on your system."
echo
exit 1
fi
if test "$POD2MAN" = ""; then
echo
echo "Ksplice could not locate pod2man on your system."
echo
exit 1
fi
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], ,
[AC_MSG_ERROR([Missing some required perl modules])])
AC_CONFIG_FILES([Makefile kmodsrc/Makefile])
AC_OUTPUT