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
|
--- a/configure.ac
+++ b/configure.ac_new
@@ -87,16 +87,23 @@
if test "x${oldxul}" != xyes ; then
- AC_MSG_CHECKING(Mozilla XPCOM > 1.8)
- mozilla_xpcom_pcs="libxul-embedding-unstable"
- for pc in $mozilla_xpcom_pcs; do
- if $PKG_CONFIG --exists $pc; then
- AC_MSG_RESULT($pc)
- mozilla_xpcom=$pc
- XUL_VERSION=3
- break;
- fi
- done
+ if test -z $mozilla_xpcom; then
+ AC_MSG_CHECKING(Mozilla XPCOM > 1.8)
+ mozilla_xpcom_pcs="libxul-embedding libxul-embedding-unstable"
+ for pc in $mozilla_xpcom_pcs; do
+ if $PKG_CONFIG --exists $pc; then
+ mozilla_xpcom=$pc
+ XUL_VERSION=3
+ version="$(pkg-config --modversion $pc)"
+ minor=`echo "$version" | sed -e 's,\([[0-9]]*\)\..*,\1,'`
+ if test $minor -ge 2; then
+ XUL_VERSION=4
+ fi
+ AC_MSG_RESULT(Found $version)
+ break;
+ fi
+ done
+ fi
fi
if test -z $mozilla_xpcom; then
@@ -121,9 +128,12 @@
XPCOM_PKGS="$mozilla_xpcom"
fi
-AM_CONDITIONAL([OLDXUL], [test x$XUL_VERSION = x2])
-
AC_SUBST(XUL_VERSION)
+
+AM_CONDITIONAL([XUL_4], [test x$XUL_VERSION = x4])
+AM_CONDITIONAL([XUL_3], [test x$XUL_VERSION = x3])
+AM_CONDITIONAL([XUL_2], [test x$XUL_VERSION = x2])
+
AC_ARG_ENABLE([optimize],
AC_HELP_STRING([--enable-optimize], [Enable optimizations (-O2)]),
|