-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
128 lines (108 loc) · 2.98 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
AC_PREREQ([2.57])
AC_INIT(spice-xpi, [2.7], [], spice-xpi)
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_CANONICAL_HOST
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
# Check for the CPU we are using
#
AC_MSG_CHECKING(for x86 or x86-64 platform)
case $host_cpu in
i386|i486|i586|i686|i786|k6|k7)
variant=32
;;
x86_64)
variant=64
;;
*)
AC_MSG_RESULT(no)
echo Only x86 and x86-64 are supported
exit 1
esac
AC_MSG_RESULT($variant bit)
AM_CONDITIONAL([X86_64], [test "$variant" = 64])
dnl =========================================================================
dnl Check deps
PKG_CHECK_MODULES(LOG4CPP, log4cpp)
AC_SUBST(LOG4CPP_CFLAGS)
AC_SUBST(LOG4CPP_LIBS)
# The explicit nspr dep is needed because libxul-embedding
# in RHEL5 is missing the Requires
PKG_CHECK_MODULES(XUL, mozilla-plugin)
AC_SUBST(XUL_CFLAGS)
AC_SUBST(XUL_LIBS)
# test for const return value of NPP_GetMIMEDescription, based on gecko-mediaplayer
AC_MSG_CHECKING([for const return value of NPP_GetMIMEDescription])
oCFLAGS=$CFLAGS
CFLAGS="$XUL_CFLAGS"
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#ifndef XP_UNIX
#define XP_UNIX 1
#endif
#include <npapi.h>
#if NP_VERSION_MAJOR == 0 && NP_VERSION_MINOR < 27
#error
#else
const char*NPP_GetMIMEDescription(void) {
return "test";
}
#endif
],[
const char *f=NPP_GetMIMEDescription();
])],[
AC_MSG_RESULT([yes])
AC_DEFINE([NPAPI_USE_CONSTCHARS],[1],[Define if NPAPI declares NPP_GetMIMEDescription as a const char*])
],[
AC_MSG_RESULT([no])
])
AC_LANG_POP([C])
CFLAGS=$oCFLAGS
# Find xpidl
XPIDL=/usr/lib/firefox-devel/sdk/bin/xpidl
AM_CONDITIONAL([HAVE_XPIDL], [test -x "$XPIDL"])
AC_SUBST(XPIDL)
if ! test -x "$XPIDL"; then
AM_PATH_PYTHON
AC_CHECK_FILE([`pkg-config --variable=sdkdir mozilla-plugin`/sdk/bin/header.py])
AC_CHECK_FILE([`pkg-config --variable=sdkdir mozilla-plugin`/sdk/bin/typelib.py])
fi
XUL_INCLUDEDIR=`pkg-config --variable=includedir mozilla-plugin`
XUL_IDLDIR=/usr/share/idl/firefox
AC_SUBST(XUL_INCLUDEDIR)
AC_SUBST(XUL_IDLDIR)
dnl libxul 1.9.1 changed header file names
PKG_CHECK_MODULES(XUL191,
mozilla-plugin >= 1.9.1,
have_xul191=yes,
have_xul191=no)
if test "x$have_xul191" = "xyes" ; then
AC_DEFINE([HAVE_XUL191], [1], [Define if we have mozilla-plugin >= 1.9.1])
fi
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_OUTPUT([
Makefile
data/Makefile
SpiceXPI/Makefile
SpiceXPI/src/Makefile
SpiceXPI/src/plugin/Makefile
])
dnl ==========================================================================
AC_MSG_NOTICE([
Spice-XPI $VERSION
==============
prefix: ${prefix}
compiler: ${CC}
xpidl: ${XPIDL}
XUL includes: ${XUL_INCLUDEDIR}
XUL IDL files: ${XUL_IDLDIR}
Red target: ${red_target}
Now type 'make' to build $PACKAGE
])