summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 7325baf17e4abd2bb3b892400c35870752ba841a (plain)
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
AC_INIT(firefox-apoc-adapter, 1.0)

AM_INIT_AUTOMAKE

AC_PROG_CXX
AC_PROG_LIBTOOL

#Checking and including XPCOM
PKG_CHECK_MODULES(XPCOM, firefox-xpcom,
[
        FIREFOX="yes"
	CXXFLAGS="$CXXFLAGS $XPCOM_CFLAGS -DMOZILLA_INTERNAL_API"
	LIBS="$LIBS $XPCOM_LIBS"
])

XPCOM_LIBDIR=`pkg-config --variable=libdir firefox-xpcom`
COMPONENT_DIR=$XPCOM_LIBDIR/components

#Checking NSPR headers
NSPR_INCLUDEDIR=""
AC_ARG_WITH(nspr-includes,
AC_HELP_STRING( [--with-nspr-includes=DIR],
		[specify the Netscape Portable Runtime include path]),
[
	if test "$withval" != "no"
	then
		CFLAGS="$CFLAGS -I$withval"
		CXXFLAGS="$CXXFLAGS -I$withval"
	fi
])

AC_CHECK_HEADERS([nspr.h], [],
AC_MSG_ERROR(Netscape Portable Runtime headers not found.
If you have it already installed please use --with-nspr-includes option to specify the correct include path.)
)
AC_CHECK_HEADERS([prtypes.h], [],
AC_MSG_ERROR(Netscape Portable Runtime headers not found.
If you have it already installed please use --with-nspr-includes option to specify the correct include path.)
)

AC_SUBST(XPCOM_LIBDIR)
AC_SUBST(COMPONENT_DIR)

AC_OUTPUT([
Makefile
src/Makefile
])