aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: be7f23e0c79b4dabcd8a941837d69430e0a859cb (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
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
AC_PREREQ(2.53)
AC_INIT(web, 0.0, http://www.chrislord.net/)
AM_INIT_AUTOMAKE()
AC_CONFIG_SRCDIR(src/web_main.c)
AM_CONFIG_HEADER(src/config.h)
AM_MAINTAINER_MODE

AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_LIBTOOL

m4_include(libcurl.m4)

PKG_CHECK_MODULES(WEB, libxml-2.0 glib-2.0 gthread-2.0 gtk+-2.0 libglade-2.0 gconf-2.0 gobject-2.0)

# -- Hildon stuff for Maemo 
hildon=false
AC_ARG_ENABLE(hildon,AS_HELP_STRING([--enable-hildon],[Turn on hildon support]),[
	if test "x$enableval" = "xyes"; then
	   hildon=true
	   PKG_CHECK_MODULES(HILDON,[
				hildon-libs,
				dbus-1, 
				libosso, 
				libosso-gsf-1
				], 
				AC_DEFINE(WITH_HILDON, 1, [Define if you want hildon-libs to be used]))

	   WEB_CFLAGS="$WEB_CFLAGS $HILDON_CFLAGS"
	   WEB_LIBS="$WEB_LIBS $HILDON_LIBS"
	fi
])
AM_CONDITIONAL(WITH_HILDON, test "x$hildon" = "xtrue")
# -- End of Hildon Stuff --

LIBCURL_CHECK_CONFIG([yes], [7.14.0],
	[WEB_CFLAGS="$WEB_CFLAGS $LIBCURL_CPPFLAGS"
	WEB_LIBS="$WEB_LIBS $LIBCURL"
	],
	AC_MSG_ERROR([libcurl >= 7.14.0 not found]))

# Find how and where to put the GConf schemas
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
if test x"$GCONFTOOL" = xno; then
	AC_MSG_WARN([gconftool-2 executable not found in your path - should be installed with GConf])
fi
AM_GCONF_SOURCE_2

# gtkhtml2 back-end
AC_ARG_ENABLE(gtkhtml2,AS_HELP_STRING([--disable-gtkhtml2],[don't compile the gtkhtml2 backend]),,enable_gtkhtml2=yes)
AC_ARG_ENABLE(libtidy,AS_HELP_STRING([--enable-libtidy],[Use libtidy with the gtkhtml2 backend [[default=no]]]),want_libtidy=yes,want_libtidy=no)

AC_ARG_WITH(libspidermonkey,AS_HELP_STRING([--with-libspidermonkey],[Prefix where libspidermonkey is installed]),[
	CPPFLAGS="$CPPFLAGS -I$withval/include"
	LIBS="$LIBS -L$withval/lib"],)

if test x"$enable_gtkhtml2" = "xyes"; then
	dnl AC_MSG_CHECKING([for GtkHTML2 support])
	PKG_CHECK_MODULES(GTKHTML2, libgtkhtml-2.0 libxml-2.0)

	# libtidy check
	if test x"$want_libtidy" = "xyes"; then
		AC_CHECK_HEADER([tidy/tidy.h],
			[GTKHTML2_LIBS="$GTKHTML2_LIBS -ltidy"
			AC_DEFINE(HAVE_LIBTIDY, 1, [Define if you want libtidy to be used])
			],
			[AC_MSG_ERROR([libtidy not found])])
	fi

	# spidermonkey check, copied from gxine
	dnl Check for Spidermonkey in two locations.
	dnl This is necessary because in Debian, libjs.so is already taken by the
	dnl NGS Javascript interpreter (ngs-js); consequently, the Spidermonkey
	dnl library is named libsmjs.so and has its include files in
	dnl /usr/include/smjs rather than /usr/include/js.
	AC_CHECK_HEADER([smjs/jsapi.h],
		[GTKHTML2_LIBS="$GTKHTML2_LIBS -lsmjs"],
		[AC_CHECK_HEADER([js/jsapi.h],
			[GTKHTML2_LIBS="$GTKHTML2_LIBS -ljs"
			AC_DEFINE(LIBJS_IS_SMJS, 1,
			[Define if you have <js/jsapi.h> rather than <smjs/jsapi.h>])],
			[PKG_CHECK_MODULES(JS, xulrunner-js,
				[GTKHTML2_LIBS="$GTKHTML2_LIBS $JS_LIBS"
				AC_DEFINE(LIBJS_IS_MOZJS, 1,
				[Define if you have <mozjs/jsapi.h>])],
				[AC_MSG_ERROR([libsmjs not found])])],
			[#define XP_UNIX])],
		[#define XP_UNIX])

fi

if test x"$enable_gtkhtml2" != "xyes" ; then
	AC_MSG_ERROR([
*** You must enable at least one HTML back-end
])
fi

AM_CONDITIONAL(WITH_GTKHTML2, test x"$enable_gtkhtml2" = "xyes")

AC_OUTPUT([
Makefile
data/Makefile
src/Makefile
src/gtkhtml2/Makefile
])