summaryrefslogtreecommitdiff
path: root/configure.in
blob: 94b15a3c67c24e6434503640e6157e620569194f (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
AC_INIT([Yelp],[2.27.3],[http://bugzilla.gnome.org/enter_bug.cgi?product=yelp],[yelp])

GNOME_COMMON_INIT

AC_CONFIG_SRCDIR([src/yelp-main.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip])
AM_MAINTAINER_MODE

AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")

IT_PROG_INTLTOOL([0.35.0])
AC_PATH_PROG(GCONFTOOL, gconftool-2)

AM_GCONF_SOURCE_2

AC_PROG_LN_S
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_STDC
AC_ISC_POSIX
AC_HEADER_STDC
AM_PROG_LIBTOOL
AM_PATH_GLIB_2_0

AM_PROG_CC_C_O

GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
GNOME_CXX_WARNINGS

MORE_WARN_FLAGS=
DEPRECATION_FLAGS=
if test "x$GCC" = "xyes"; then
  MOZILLA_WARN_CXXFLAGS="-Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
fi

if test "x$enable_maintainer_mode" = "xyes"; then
	AC_DEFINE([MAINTAINER_MODE],[1],[Define to enable 'maintainer-only' behaviour])
#	DEPRECATION_FLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED -DGNOME_VFS_DISABLE_DEPRECATED -DBONOBO_UI_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED -DLIBGLADE_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED"
  if test "x$GCC" = "xyes"; then
	MOZILLA_WARN_CXXFLAGS="-Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth $MOZILLA_WARN_CXXFLAGS"
  fi
fi

if test "x$enable_debug" = "xyes"; then
	AC_DEFINE([YELP_DEBUG],[1],[Enable Yelp debugging])
	AM_CFLAGS="$AM_CFLAGS -pedantic -ansi"
fi

dnl NOTE : it appears that some systems do not like it when you use line
dnl        continuation charactes to split CFLAGS into readable chunks
if test "x$GCC" = "xyes"; then
   AM_CFLAGS="$AM_CFLAGS -Wall -Wno-uninitialized -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare"
fi

GETTEXT_PACKAGE=yelp
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
                   [The gettext translation domain])

AM_GLIB_GNU_GETTEXT

AM_GLIB_DEFINE_LOCALEDIR([GNOMELOCALEDIR])

PKG_CHECK_MODULES(YELP,
[
	gio-2.0
	gconf-2.0
	gnome-doc-utils >= 0.17.2
	gtk+-unix-print-2.0
	gtk+-2.0 >= 2.10.0
	libgnome-2.0 >= 2.14.0
	libgnomeui-2.0 >= 2.14.0
	libxml-2.0 >= 2.6.5
	libxslt >= 1.1.4
	libexslt >= 0.8.1
	libstartup-notification-1.0 >= 0.8
	dbus-glib-1
	rarian >= 0.7.0
])
AC_SUBST([YELP_CFLAGS])
AC_SUBST([YELP_LIBS])

AC_PATH_PROGS(SED, gsed sed)

XSLT_PATH="`$PKG_CONFIG --variable=xsltdir gnome-doc-utils`"
DB_TITLE="$XSLT_PATH""/docbook/common/db-title.xsl"
AC_SUBST(DB_TITLE)

DB2HTML="`$PKG_CONFIG --variable=db2xhtml gnome-doc-utils`"
AC_SUBST(DB2HTML)

MAL2HTML="`$PKG_CONFIG --variable=mal2xhtml gnome-doc-utils`"
AC_SUBST(MAL2HTML)

GDU_GETTEXT="`$PKG_CONFIG --variable=gettext gnome-doc-utils`"
AC_SUBST(GDU_GETTEXT)

GDU_ICON_PATH="`$PKG_CONFIG --variable=icondir gnome-doc-utils`"
AC_SUBST(GDU_ICON_PATH)

GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
AC_SUBST(GLIB_GENMARSHAL)

#
# If Pango included the shared library dependencies from X11 in
# the pkg-config output, then we use that (to avoid duplicates).
# but if they were omitted to avoid binary compatibility problems
# then we need to repeat the checks.
#
if $PKG_CONFIG --exists pangoxft ; then
  PANGO_PACKAGES="pangox pangoxft"
else
  PANGO_PACKAGES="pangox"
fi

x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
case x_libs in
  *-lX11*) pango_omitted_x_deps=no ;;
  *)       pango_omitted_x_deps=yes ;;
esac

if test $pango_omitted_x_deps = yes ; then
  AC_PATH_XTRA

  if test x$no_x = xyes ; then
    AC_MSG_ERROR([X development libraries not found])
  else
    X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
  fi
fi

AC_SUBST(X_LIBS)


dnl ******
dnl beagle
dnl ******

BEAGLE_MODULES=
if $PKG_CONFIG --exists libbeagle-1.0; then
	BEAGLE_MODULES="libbeagle-1.0 >= 0.3.0"
else
	BEAGLE_MODULES="libbeagle-0.0 >= 0.2.4"
fi

AC_ARG_WITH([search],
	[AC_HELP_STRING([--with-search=basic|beagle|auto],
			[turn on search support [default=auto]])], ,
	with_search=auto)

if test "x$with_search" = "xauto"; then
    PKG_CHECK_MODULES(YELP_SEARCH, $BEAGLE_MODULES, have_beagle=yes, have_beagle=no)
fi

AM_CONDITIONAL(ENABLE_BEAGLE, test x"$with_search" = xbeagle)

if test "x$with_search" = "xbeagle"; then
    PKG_CHECK_MODULES(YELP_SEARCH, $BEAGLE_MODULES)
fi


case "x$with_search" in
  "xbasic")
    search_backend="basic"
    ;;
  "xbeagle")
    search_backend="beagle"
    AC_DEFINE(ENABLE_BEAGLE, 1, [Define if you want the power of Beagle])
    ;;
  "xauto")
    search_backend="auto - basic"
    if test x$have_beagle = xyes; then
      AC_DEFINE(ENABLE_BEAGLE, 1)
      search_backend="auto - beagle"
    fi
    ;;
  *)
    AC_MSG_ERROR([Unknown search type selected - Please use --with-search=auto|basic|beagle])
    ;;
esac

AC_SUBST([YELP_SEARCH_CFLAGS])
AC_SUBST([YELP_SEARCH_LIBS])


dnl ====================================
dnl = zlib for help converters
dnl ====================================
AC_CHECK_LIB(z, gzopen, [Z_LIBS=-lz
AC_SUBST(Z_LIBS)], AC_MSG_ERROR([*** zlib is required]))

dnl ====================================
dnl = lzmadec for help converters
dnl ====================================
LZMADEC_LIBS=
AC_CHECK_LIB(lzmadec, lzmadec_open, [LZMADEC_LIBS=-llzmadec 
				     AC_DEFINE(HAVE_LIBLZMADEC, 1, [Compile with liblzmadec support])])
AC_SUBST(LZMADEC_LIBS)

dnl ====================================
dnl = Bzip2, for the help converters
dnl ====================================
BZ_LIBS=
AC_CHECK_LIB(bz2, bzread, [AC_DEFINE(HAVE_LIBBZ2, 1, [Compile with libbz2 suppot])
			  BZ_LIBS="-lbz2"])
dnl <= Check for bzip2 > 1.0.0
    AC_CHECK_LIB(bz2, BZ2_bzread, [AC_DEFINE(HAVE_LIBBZ2, 1, [Compile with libbz2 support])
		      	  BZ_LIBS="-lbz2"
    dnl <= define the wrapper-functions to get the Bzip2 stuff working .. =>	
	   AC_DEFINE(bzread,BZ2_bzread, [Needed to get Bzip2 working])
	   AC_DEFINE(bzopen,BZ2_bzopen, [Needed to get Bzip2 working])
	   AC_DEFINE(bzdopen,BZ2_bzdopen, [Needed to get Bzip2 working])
	   AC_DEFINE(bzwrite,BZ2_bzwrite, [Needed to get Bzip2 working])
	   AC_DEFINE(bzerror,BZ2_bzerror, [Needed to get Bzip2 working])
	   AC_DEFINE(bzclose,BZ2_bzclose, [Needed to get Bzip2 working])
	   AC_DEFINE(bzflush,BZ2_bzflush, [Needed to get Bzip2 working])
	   AC_DEFINE(bzCompress,BZ2_bzCompress, [Needed to get Bzip2 working])
	   AC_DEFINE(bzCompressInit,BZ2_bzCompressInit, [Needed to get Bzip2 working])
	   AC_DEFINE(bzDecompress,BZ2_bzDecompress, [Needed to get Bzip2 working])
	   AC_DEFINE(bzDecompressInit,BZ2_bzDecompressInit, [Needed to get Bzip2 working])	
	   ])
    dnl =>
AC_SUBST(BZ_LIBS)


# *****
# Gecko
# *****

GECKO_INIT([MOZILLA])
GECKO_DEFINES

AC_SUBST([MOZILLA])
AC_SUBST([MOZILLA_FLAVOUR])
AC_SUBST([MOZILLA_INCLUDE_ROOT])
AC_SUBST([MOZILLA_HOME])
AC_SUBST([MOZILLA_PREFIX])
AC_SUBST([MOZILLA_EXTRA_LIBS])
AC_SUBST([MOZILLA_GLUE_LIBS])

case "$MOZILLA" in
xulrunner) gecko_min_version=1.8 ;;
libxul*) gecko_min_version=1.9 ;;
*firefox) gecko_min_version=1.5 ;;
*) AC_MSG_ERROR([$gecko_cv_gecko is not supported])
esac

if test "$MOZILLA" = "libxul-embedding" -o "$MOZILLA" = "libxul"; then
	PKG_CHECK_MODULES([MOZILLA_COMPONENT],[$MOZILLA $gecko_cv_extra_pkg_dependencies])
	MOZILLA_COMPONENT_CFLAGS="$MOZILLA_COMPONENT_CFLAGS `$PKG_CONFIG --cflags ${gecko_cv_gecko}` `$PKG_CONFIG --define-variable=includetype=unstable --cflags ${gecko_cv_gecko}`"
else
	PKG_CHECK_MODULES([MOZILLA_COMPONENT],[${gecko_cv_gecko}-xpcom >= $gecko_min_version $gecko_cv_extra_pkg_dependencies])
fi

# Set flags

AM_CPPFLAGS="$AM_CPPFLAGS $DEPRECATION_FLAGS"
AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $MORE_WARN_FLAGS"
AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS $MOZILLA_WARN_CXXFLAGS"
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])

AC_CONFIG_FILES([
Makefile
src/Makefile
stylesheets/Makefile
stylesheets/db2html.xsl
stylesheets/db-title.xsl
stylesheets/mal2html.xsl
stylesheets/toc2html.xsl
data/Makefile
data/icons/Makefile
data/ui/Makefile
po/Makefile.in
yelp.desktop.in
])

AC_OUTPUT

dnl ==========================================================================
echo "
yelp-$VERSION:

	prefix:                   ${prefix}
	source code location:	  ${srcdir}
	compiler:		  ${CC}

	Debug enabled:            ${enable_debug}
	Search backend:           ${search_backend}
	Mozilla version:          ${MOZILLA}
"