-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig-libs.m4
55 lines (53 loc) · 1.66 KB
/
config-libs.m4
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
AS_IF([test "x$enable_babel" != "xno"], [
PKG_CHECK_MODULES(
[libxml2],
[libxml-2.0],
[libfizmo_reqs="libxml-2.0"],
[for dir in $with_libxml2_includedir /usr/include/libxml2 /usr/local/include/libxml2 /opt/local/include/libxml2 ; do
AC_MSG_CHECKING(for libxml/tree.h in $dir)
if [ test -e $dir/libxml/tree.h ]; then
AC_MSG_RESULT(yes)
libxml2_h_dir=$dir
break
else
AC_MSG_RESULT(no)
fi
done
if [ test "x$libxml2_h_dir" == "x"] ; then
echo "Could not find libxml/tree.h."
echo "Try setting the location using --with-libxml2-includedir."
exit
fi
libxml2_nonpkg_cflags+="-I$libxml2_h_dir"
libxml2_CFLAGS="-I$libxml2_h_dir"
CFLAGS_SAVED=$CFLAGS
LIBS_SAVED=$LIBS
LDFLAGS_SAVED=$LDFLAGS
LIBS="-lxml2"
CFLAGS="-I$libxml2_h_dir"
for dir in $with_libxml2_libdir /usr/lib /usr/local/lib /opt/local/lib ; do
AC_MSG_CHECKING(for libxml2 in $dir)
LDFLAGS="-L$dir"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <libxml/tree.h>]],
[[xmlDocPtr doc;
xmlChar version[] = "1.0";
doc = xmlNewDoc(version);]])],
[AC_MSG_RESULT(yes)
libxml2_l_dir=$dir
break],
[AC_MSG_RESULT(no)])
done
if [ test "x$libxml2_l_dir" == "x"] ; then
echo "Could not find libxml2."
echo "Try setting the location using --with-libxml2-libdir."
exit
fi
LIBS=$LIBS_SAVED
LDFLAGS=$LDFLAGS_SAVED
CFLAGS=$CFLAGS_SAVED
libxml2_nonpkg_libs="-L$libxml2_l_dir -lxml2"
libxml2_LIBS="-L$libxml2_l_dir -lxml2"
])
])