-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
137 lines (116 loc) · 4.85 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
AC_INIT([libvirt-php], [0.4.5], [http://libvirt.org])
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_CONFIG_FILES([Makefile tools/Makefile src/Makefile tests/Makefile docs/Makefile])
AM_INIT_AUTOMAKE([-Wno-portability])
AM_MAINTAINER_MODE([enable])
dnl Checks for programs.
AC_PROG_CC
AC_LANG([C])
AC_PROG_INSTALL
AC_PROG_SED
AC_PROG_AWK
AC_CHECK_TOOL([ECHO], [echo])
AC_CHECK_TOOL([RM], [rm])
dnl Need to test if pkg-config exists
PKG_PROG_PKG_CONFIG
LIBVIRT_REQUIRED=0.6.2
PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
dnl ==========================================================================
dnl required minimum version of libxml2
dnl replace "2.0.0" with an appropriate one
dnl ==========================================================================
LIBXML_REQUIRED="2.0.0"
dnl ==========================================================================
dnl find libxml2 library, borrowed from xmlsec
dnl ==========================================================================
LIBXML_CONFIG="xml2-config"
LIBXML_CFLAGS=""
LIBXML_LIBS=""
LIBXML_FOUND="no"
AC_ARG_WITH([libxml], AC_HELP_STRING([--with-libxml=@<:@PFX@:>@], [libxml2 location]))
if test "x$with_libxml" = "xno" ; then
AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED)
AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt])
elif test "x$with_libxml" = "x" && test "x$PKG_CONFIG" != "x" ; then
PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no])
fi
if test "$LIBXML_FOUND" = "no" ; then
if test "x$with_libxml" != "x" ; then
LIBXML_CONFIG=$with_libxml/bin/$LIBXML_CONFIG
fi
AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED )
if ! $LIBXML_CONFIG --version > /dev/null 2>&1 ; then
AC_MSG_ERROR([Could not find libxml2 anywhere (see config.log for details).])
fi
vers=`$LIBXML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
minvers=`echo $LIBXML_REQUIRED | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test "$vers" -ge "$minvers" ; then
LIBXML_LIBS="`$LIBXML_CONFIG --libs`"
LIBXML_CFLAGS="`$LIBXML_CONFIG --cflags`"
LIBXML_FOUND="yes"
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR(
[You need at least libxml2 $LIBXML_REQUIRED for this version of libvirt])
fi
fi
AC_SUBST([LIBXML_CFLAGS])
AC_SUBST([LIBXML_LIBS])
dnl Get the version information at compile-time
VERSION_MAJOR=`echo $VERSION | awk -F. '{print $1}'`
VERSION_MINOR=`echo $VERSION | awk -F. '{print $2}'`
VERSION_MICRO=`echo $VERSION | awk -F. '{print $3}'`
AC_DEFINE_UNQUOTED(VERSION_MAJOR, $VERSION_MAJOR, [Major version number of package])
AC_DEFINE_UNQUOTED(VERSION_MINOR, $VERSION_MINOR, [Minor version number of package])
AC_DEFINE_UNQUOTED(VERSION_MICRO, $VERSION_MICRO, [Micro version number of package])
dnl Specific XML catalog file for validation of generated html
AC_ARG_WITH([xml-catalog-file],
[AC_HELP_STRING([--with-xml-catalog-file=path],
[path to XML catalog file for validating
generated html, default /etc/xml/catalog])],
[XML_CATALOG_FILE=$withval],
[XML_CATALOG_FILE='/etc/xml/catalog'])
AC_SUBST([XML_CATALOG_FILE])
# External programs to generate documentation
AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
if test "x$XSLTPROC" = "xno"; then
AC_MSG_ERROR([xsltproc not found])
fi
AC_PATH_PROG([XMLLINT], [xmllint], [no])
if test "x$XMLLINT" = "xno"; then
AC_MSG_ERROR([xmllint not found])
fi
AC_PATH_PROG([XMLCATALOG], [xmlcatalog], [no])
if test "x$XMLCATALOG" = "xno"; then
AC_MSG_ERROR([xmlcatalog not found])
fi
dnl Specific dir for HTML output ?
AC_ARG_WITH([html-dir], [AC_HELP_STRING([--with-html-dir=path],
[path to base html directory, default $datadir/doc/html])],
[HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])
AC_ARG_WITH([html-subdir], [AC_HELP_STRING([--with-html-subdir=path],
[directory used under html-dir, default $PACKAGE-$VERSION/html])],
[test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
[HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
AC_SUBST([HTML_DIR])
AC_ARG_WITH([php-config], [AC_HELP_STRING([--with-php-config=path],
[path to php-config, default search all paths])])
if test "x$with_php_config" != "x" ; then
AC_MSG_CHECKING(for php-config)
PHPCONFIG=$with_php_config
AC_MSG_RESULT($with_php_config)
else
AC_PATH_PROG([PHPCONFIG], [php-config], [no])
fi
if test "x$PHPCONFIG" = "xno"; then
AC_MSG_ERROR([php-config not found; please install the PHP SDK])
fi
AC_PATH_PROG([PHPIZE], [phpize], [no], [`php-config --prefix`/bin$PATH_SEPARATOR$PATH])
if test "x$PHPIZE" = "xno"; then
AC_MSG_ERROR([phpize not found; please install the PHP SDK])
fi
AC_SUBST([PHPIZE])
AC_SUBST([PHPCONFIG])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([$PACKAGE.spec])
AC_OUTPUT