configure.ac 6.4 KB
Newer Older
1
AC_PREREQ([2.63])
Shaun McCance's avatar
Shaun McCance committed
2
AC_INIT([Yelp],[2.31.2],[http://bugzilla.gnome.org/enter_bug.cgi?product=yelp],[yelp])
Christian Persch's avatar
Christian Persch committed
3

Shaun McCance's avatar
Shaun McCance committed
4
AC_CONFIG_SRCDIR([src/yelp.c])
5
AC_CONFIG_HEADERS([config.h])
Saleem Abdulrasool's avatar
Saleem Abdulrasool committed
6
AC_CONFIG_MACRO_DIR([m4])
Shaun McCance's avatar
Shaun McCance committed
7

8 9
AM_INIT_AUTOMAKE([1.11 dist-bzip2 no-dist-gzip])
AM_MAINTAINER_MODE([enable])
Mikael Hallendal's avatar
Mikael Hallendal committed
10

11 12 13
AM_SILENT_RULES([yes])

# Check for programs
Mikael Hallendal's avatar
Mikael Hallendal committed
14
AC_PROG_CC
15 16 17 18 19 20 21 22 23
AC_PROG_CC_C_O
AC_PROG_LN_S

# Initialize libtool
LT_PREREQ([2.2.6])
LT_INIT

AC_PATH_PROGS(SED, gsed sed)

Alexander Larsson's avatar
Alexander Larsson committed
24
AM_PATH_GLIB_2_0
25
GLIB_GSETTINGS
26

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
# Library dependecies
PKG_CHECK_MODULES(YELP,
[
	gio-2.0 >= 2.25.3
	gio-unix-2.0
	gtk+-unix-print-2.0
	gtk+-2.0 >= 2.16.0
	libxml-2.0 >= 2.6.5
	libxslt >= 1.1.4
	libexslt >= 0.8.1
	dbus-glib-1
	webkit-1.0 >= 1.1.15
	yelp-xsl
])
AC_SUBST([YELP_CFLAGS])
AC_SUBST([YELP_LIBS])
43 44


Christian Persch's avatar
Christian Persch committed
45 46
GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
47
GNOME_MAINTAINER_MODE_DEFINES
Christian Persch's avatar
Christian Persch committed
48

49 50
MORE_WARN_FLAGS=

Christian Persch's avatar
Christian Persch committed
51 52 53 54 55
if test "x$enable_debug" = "xyes"; then
	AC_DEFINE([YELP_DEBUG],[1],[Enable Yelp debugging])
	AM_CFLAGS="$AM_CFLAGS -pedantic -ansi"
fi

56 57
dnl NOTE : it appears that some systems do not like it when you use line
dnl        continuation charactes to split CFLAGS into readable chunks
58
if test "x$GCC" = "xyes"; then
Christian Persch's avatar
Christian Persch committed
59
   AM_CFLAGS="$AM_CFLAGS -Wall -Wno-uninitialized -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare"
60
fi
Mikael Hallendal's avatar
Mikael Hallendal committed
61

62 63 64
# i18n stuff
IT_PROG_INTLTOOL([0.41.0])

Richard Hult's avatar
Richard Hult committed
65 66
GETTEXT_PACKAGE=yelp
AC_SUBST(GETTEXT_PACKAGE)
67 68
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
                   [The gettext translation domain])
Richard Hult's avatar
Richard Hult committed
69 70

AM_GLIB_GNU_GETTEXT
71
AM_GLIB_DEFINE_LOCALEDIR([GNOMELOCALEDIR])
Richard Hult's avatar
Richard Hult committed
72

73

74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
AC_ARG_ENABLE(lzma,
	AS_HELP_STRING([--enable-lzma],[Enable lzma decoder support [[default=yes]]]),
	[enable_lzma=$enableval],
	[enable_lzma="auto"])
if test x"$enable_lzma" = "xauto"; then
	PKG_CHECK_MODULES(YELP_LZMA,
			  liblzma,
			  enable_lzma=yes,
			  enable_lzma=no)
elif test x"$enable_lzma" = "xyes"; then
	PKG_CHECK_MODULES(YELP_LZMA, liblzma)
fi
if test x"$enable_lzma" = "xyes"; then
	YELP_CFLAGS="$YELP_LZMA_CFLAGS $YELP_CFLAGS";
	YELP_LIBS="$YELP_LZMA_LIBS $YELP_LIBS";
	AC_DEFINE(ENABLE_LZMA, 1, [Enable lzma decoder support])
fi
AM_CONDITIONAL([ENABLE_LZMA],[test x"$enable_lzma" != "xno"])

Shaun McCance's avatar
Shaun McCance committed
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
AC_ARG_ENABLE(bz2,
	AS_HELP_STRING([--enable-bz2],[Enable bz2 decoder support [[default=yes]]]),
	[enable_bz2=$enableval],
	[enable_bz2="auto"])
if test x"$enable_bz2" = "xauto"; then
	AC_CHECK_LIB(bz2,
		     BZ2_bzread,
		     enable_bz2=yes,
		     enable_bz2=no)
elif test x"$enable_bz2" = "xyes"; then
	AC_CHECK_LIB(bz2, BZ2_bzread)
fi
if test x"$enable_bz2" = "xyes"; then
	YELP_LIBS="-lbz2 $YELP_LIBS";
	AC_DEFINE(ENABLE_BZ2, 1, [Enable bz2 decoder support])
fi
AM_CONDITIONAL([ENABLE_BZ2],[test x"$enable_bz2" != "xno"])

111 112 113
AC_SUBST([YELP_CFLAGS])
AC_SUBST([YELP_LIBS])

114 115 116 117 118 119 120 121 122
DATADIR=`(
	case $prefix in
		NONE) prefix=$ac_default_prefix ;;
		*) ;;
	esac
	eval echo $(eval echo $datadir)/yelp
)`
AC_SUBST([DATADIR])

123

124 125 126
XSL_PATH="`$PKG_CONFIG --variable=xsltdir yelp-xsl`"
XSL_DB_TITLE="$XSLT_PATH""/docbook/common/db-title.xsl"
AC_SUBST(XSL_DB_TITLE)
127

128 129
XSL_DB2XHTML="`$PKG_CONFIG --variable=db2xhtml yelp-xsl`"
AC_SUBST(XSL_DB2XHTML)
130

131 132
XSL_MAL2XHTML="`$PKG_CONFIG --variable=mal2xhtml yelp-xsl`"
AC_SUBST(XSL_MAL2XHTML)
Shaun McCance's avatar
Shaun McCance committed
133

134 135 136 137 138 139 140
XSL_THEME_COLORS="`$PKG_CONFIG --variable=xsltdir yelp-xsl`/theme/theme-colors.xsl"
AC_SUBST(XSL_THEME_COLORS)
XSL_THEME_ICONS="`$PKG_CONFIG --variable=xsltdir yelp-xsl`/theme/theme-icons.xsl"
AC_SUBST(XSL_THEME_ICONS)
XSL_THEME_HTML="`$PKG_CONFIG --variable=xsltdir yelp-xsl`/theme/theme-html.xsl"
AC_SUBST(XSL_THEME_HTML)

141 142
XSL_GETTEXT="`$PKG_CONFIG --variable=gettext yelp-xsl`"
AC_SUBST(XSL_GETTEXT)
Shaun McCance's avatar
Shaun McCance committed
143

144 145
YELP_ICON_PATH="`$PKG_CONFIG --variable=icondir yelp-xsl`"
AC_SUBST(YELP_ICON_PATH)
Don Scorgie's avatar
Don Scorgie committed
146 147 148 149

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

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
#
# 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)

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
# *****
# SMClient
# *****

GDK_TARGET="$($PKG_CONFIG --variable target gdk-2.0)"

SMCLIENT_PKGS=
AC_MSG_CHECKING([which smclient backend to use])
AC_ARG_WITH([smclient],
  [AS_HELP_STRING([--with-smclient],[which smclient backend to use (xsmp/win32/quartz)])],
  [],
  [case "$GDK_TARGET" in
    x11) with_smclient=xsmp SMCLIENT_PKGS="sm" ;;
    win32|quartz) with_smclient=$GDK_TARGET ;;
    *) with_smclient=no ;;
   esac])
AC_MSG_RESULT([$with_smclient])

if test "$with_smclient" != "no"; then
  PKG_CHECK_MODULES([SMCLIENT],[$SMCLIENT_PKGS])
  AC_DEFINE([WITH_SMCLIENT],[1],[Define if smclient is enabled])
fi

AM_CONDITIONAL([WITH_SMCLIENT],[test "$with_smclient" != "no"])
AM_CONDITIONAL([WITH_SMCLIENT_XSMP],[test "$with_smclient" = "xsmp"])
AM_CONDITIONAL([WITH_SMCLIENT_WIN32],[test "$with_smclient" = "win32"])
AM_CONDITIONAL([WITH_SMCLIENT_QUARTZ],[test "$with_smclient" = "quartz"])

209 210 211
# Set flags
AM_CPPFLAGS="$AM_CPPFLAGS $DEPRECATION_FLAGS"
AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $MORE_WARN_FLAGS"
212 213


Christian Persch's avatar
Christian Persch committed
214 215
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
216
AC_SUBST([AM_LDFLAGS])
Christian Persch's avatar
Christian Persch committed
217

218 219
GTK_DOC_CHECK([1.13],[--flavour no-tmpl])

220
AC_CONFIG_FILES([
Mikael Hallendal's avatar
Mikael Hallendal committed
221
Makefile
222 223 224
docs/Makefile
docs/libyelp/Makefile
docs/libyelp/version.xml
Shaun McCance's avatar
Shaun McCance committed
225
libyelp/Makefile
Mikael Hallendal's avatar
Mikael Hallendal committed
226
src/Makefile
227
stylesheets/Makefile
228
stylesheets/db2html.xsl
229
stylesheets/db-title.xsl
230
stylesheets/info2html.xsl
Shaun McCance's avatar
Shaun McCance committed
231
stylesheets/mal2html.xsl
Shaun McCance's avatar
Shaun McCance committed
232
stylesheets/toc2html.xsl
233
stylesheets/yelp-common.xsl
234
data/Makefile
235
data/icons/Makefile
Shaun McCance's avatar
Shaun McCance committed
236 237 238
data/icons/hicolor/Makefile
data/icons/hicolor/16x16/Makefile
data/icons/hicolor/16x16/status/Makefile
Richard Hult's avatar
Richard Hult committed
239
po/Makefile.in
240
tests/Makefile
241 242
yelp.desktop.in
])
243 244

AC_OUTPUT
245 246 247 248 249 250 251 252 253

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

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

254
	Documentation:            ${enable_gtk_doc}
255
	Debug enabled:            ${enable_debug}
256
	Search backend:           ${search_backend}
257
	Using SMClient:           ${with_smclient}
Shaun McCance's avatar
Shaun McCance committed
258
	Enable BZ2:               ${enable_bz2}
259
	Enable LZMA:              ${enable_lzma}
260

261
"