aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 31dd0a0ce82b066cc02491215090afabfb7667a4 (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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# mbwm2 package version number, (as distinct from shared library version)
# An odd minor number indicates in-progress development, (eg. from svn)
# An even minor number indicates a released version.
m4_define([mbwm2_major_version], [0])
m4_define([mbwm2_minor_version], [1])
m4_define([mbwm2_micro_version], [0])

m4_define([mbwm2_version],
          [mbwm2_major_version.mbwm2_minor_version.mbwm2_micro_version])

m4_define([mbwm2_api_version],
          [mbwm2_major_version.mbwm2_minor_version])

AC_PREREQ(2.59)
AC_INIT([matchbox-window-manager-2], mbwm2_version, [mallum@handhelds.org])
AC_CONFIG_SRCDIR([matchbox2/core/mb-window-manager.c])

AM_INIT_AUTOMAKE()
AM_SILENT_RULES([yes])

MBWM2_VERSION=mbwm2_version
AC_SUBST(MBWM2_VERSION)

MBWM2_API_VERSION=mbwm2_api_version
AC_SUBST(MBWM2_API_VERSION)

MBWM2_INCDIR=matchbox-wm-2/$MBWM2_API_VERSION/matchbox
AC_SUBST(MBWM2_INCDIR)

MBWM2_PKGINCDIR=matchbox-wm-2/$MBWM2_API_VERSION/
AC_SUBST(MBWM2_PKGINCDIR)

clutter_package="clutter-1.0 >= 1.5.6"

AC_PROG_CC
AM_PROG_LIBTOOL

AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h expat.h])
AC_C_CONST
AC_CHECK_FUNCS([memset strdup strncasecmp])

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

# we don't want to build the documentation from a Git clone unless we
# explicitly tell configure to do so; this allows avoiding to recurse into
# the documentation directory when building Matchbox2 inside Poky for a
# target device that doesn't have gtk-doc installed. for reference
# see: http://bugzilla.openedhand.com/show_bug.cgi?id=1047
#
# we use autogen.sh as it exists only inside the Git clones, and it
# is not packaged into tarballs.
AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])

needed_pkgs="x11 "

AC_ARG_ENABLE(debug,
  [  --enable-debug          Enable verbose debugging output],
  [want_debug=$enableval], [want_debug=no])

AC_ARG_ENABLE(png-theme,
  [  --enable-png-theme      Enable PNG-based theme],
  [png_theme=$enableval], [png_theme=no])

AC_ARG_WITH(pango,
  [  --with-pango            Use of pango for text layout],
  [use_pango=$withval], [use_pango=no])

AC_ARG_WITH(gtk,
  [  --with-gtk              With GTK integration support],
  [use_gtk=$withval], [use_gtk=no])

dnl due to an autoconf bug, commas in the first arg to
dnl AC_HELP_STRING cause problems.
dnl AC_HELP_STRING([--with-composite-managers=MANAGER1 MANAGER2 ...],
dnl                [build the specified composite managers])
AC_ARG_ENABLE(composite_managers,
[  --enable-composite-managers=MANAGER1,MANAGER2,...
                          Build the specified composite managers. Available managers are:
                             * framework-only
                             * xrender
                             * clutter],
    [composite_managers=$enableval], [composite_managers=no])

AC_ARG_ENABLE(glib-main-loop,
  [  --enable-glib-main-loop    Enable use of glib main loop],
  [gmloop=$enableval], [gmloop=no])

AC_ARG_ENABLE(libmatchbox2,
  [  --enable-libmatchbox2      Enable building as a library],
  [libmatchbox2=$enableval], [libmatchbox2=no])

AC_ARG_ENABLE(matchbox-remote,
  [  --enable-matchbox-remote   Enable matchbox remote control utility],
  [matchbox_remote=$enableval], [matchbox_remote=no])


if test "x$use_pango" = "xyes"; then
  needed_pkgs="$needed_pkgs pangoxft "
fi

if ! test "x$use_pango" = "xyes" -o "x$use_pango" = "xyes"; then
  needed_pkgs="$needed_pkgs xft "
fi

if test "x$use_gtk" = "xyes"; then
  needed_pkgs="$needed_pkgs gtk+-2.0 "
fi

if test "x$png_theme" = "xyes"; then
  needed_pkgs="$needed_pkgs libpng12 "
fi

if test "x$composite_managers" != xno -a \
        "x$composite_managers" != "xframework-only"; then
  needed_pkgs="$needed_pkgs xcomposite xdamage "
fi

all_composite_managers="xrender,clutter"

included_composite_managers=""
# If no composite managers specified, include all
if test "x$composite_managers" = xyes ; then
  included_composite_managers="$all_composite_managers"
else
  if test "x$composite_managers" != xno ; then
    included_composite_managers="$composite_managers"
  fi
fi

comp_mgr="no"
if test "x$composite_managers" != xno ; then
  comp_mgr="yes ($included_composite_managers)"
fi

AC_MSG_RESULT($included_composite_managers)

COMPOSITE_MANAGER_DEFINE=

IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=","
for composite_manager in $included_composite_managers; do
 if echo "framework-only,$all_composite_managers" | egrep "(^|,)$composite_manager(\$|,)" > /dev/null; then
   :
 else
   AC_MSG_ERROR([the specified composite_manager $composite_manager does not exist])
 fi
 case $composite_manager in
      xrender )
        needed_pkgs="$needed_pkgs xcomposite xdamage "
	MBWM_EXTRA_LIBS="$MBWM_EXTRA_LIBS -lm"
        ;;
      clutter )
        needed_pkgs="$needed_pkgs $clutter_package xcomposite xdamage "
        gmloop="yes"
        ;;
 esac

 COMPOSITE_MANAGER_DEFINE="$COMPOSITE_MANAGER_DEFINE \
                           -DCOMPOSITE_MANAGER_`echo $composite_manager|tr 'a-z' 'A-Z'`"
 eval COMPOSITE_MANAGER_$composite_manager=yes
done
IFS="$save_ifs"

AC_SUBST(COMPOSITE_MANAGER_DEFINE)


MBWM_WANT_DEBUG=0
if test "x$want_debug" = "xyes"; then
  MBWM_WANT_DEBUG=1
  MBWM_DEBUG_CFLAGS="-O0 $MBWM_DEBUG_CFLAGS"
  MBWM_DEBUG_LDFLAGS="$MBWM_DEBUG_LDFLAGS -rdynamic"
fi
AC_SUBST(MBWM_WANT_DEBUG)

USE_GLIB_MAINLOOP=0
if test "x$gmloop" = "xyes"; then
  needed_pkgs="$needed_pkgs glib-2.0 "
  USE_GLIB_MAINLOOP=1
fi
AC_SUBST(USE_GLIB_MAINLOOP)

USE_PANGO=0
if test "$use_pango" = yes; then
  USE_PANGO=1
fi
AC_SUBST(USE_PANGO)

THEME_PNG=0
AM_CONDITIONAL(THEME_PNG, [test "x$png_theme" = "xyes"])
if test "$png_theme" = yes; then
  THEME_PNG=1
fi
AC_SUBST(THEME_PNG)

# only build simple theme if png theme disabled
THEME_SIMPLE=0
AM_CONDITIONAL(THEME_SIMPLE, [test "x$use_png" != "xyes"])
if test "$use_png" != yes; then
  THEME_SIMPLE=1
fi
AC_SUBST(THEME_SIMPLE)

USE_GTK=0
AM_CONDITIONAL(USE_GTK, test "x$use_gtk" = "xyes")
if test "$use_gtk" = yes; then
  USE_GTK=1
fi
AC_SUBST(USE_GTK)

PKG_CHECK_MODULES(MBWM, $needed_pkgs)
MBWM2_PKGREQUIRES="$MBWM2_PKGREQUIRES $needed_pkgs"
AC_SUBST(MBWM2_PKGREQUIRES)

COMP_MGR_BACKEND=0
ENABLE_COMPOSITE=0
AM_CONDITIONAL(ENABLE_COMPOSITE, [test "x$comp_mgr" != "xno"])
if test x"$comp_mgr" != xno; then
   ENABLE_COMPOSITE=1
fi
AC_SUBST(ENABLE_COMPOSITE)

ENABLE_CLUTTER_COMPOSITE_MANAGER=0
AM_CONDITIONAL(ENABLE_CLUTTER_COMPOSITE_MANAGER, [test x"$COMPOSITE_MANAGER_clutter" = xyes])
if test x"$COMPOSITE_MANAGER_clutter" = xyes; then
  ENABLE_CLUTTER_COMPOSITE_MANAGER=1
  COMP_MGR_BACKEND=1

  clutter_backend=$($PKG_CONFIG $clutter_package --variable=backend)
  if test x"$clutter_backend" = xglx; then
    AC_DEFINE(HAVE_CLUTTER_GLX, [1], [Using clutter glx backend])
  elif test x"$clutter_backend" = xeglx; then
    AC_DEFINE(HAVE_CLUTTER_EGLX, [1], [Using clutter eglx backend])
  fi
fi
AC_SUBST(ENABLE_CLUTTER_COMPOSITE_MANAGER)

ENABLE_XRENDER_COMPOSITE_MANAGER=0
AM_CONDITIONAL(ENABLE_XRENDER_COMPOSITE_MANAGER, [test x"$COMPOSITE_MANAGER_xrender" = xyes])
if test x"$COMPOSITE_MANAGER_xrender" = xyes; then
  ENABLE_XRENDER_COMPOSITE_MANAGER=1
  COMP_MGR_BACKEND=1
fi
AC_SUBST(ENABLE_XRENDER_COMPOSITE_MANAGER)

AM_CONDITIONAL(COMP_MGR_BACKEND, [test "x$COMP_MGR_BACKEND" = "x1"])
AC_SUBST(COMP_MGR_BACKEND)

AM_CONDITIONAL(ENABLE_LIBMATCHBOX2, [test "x$libmatchbox2" = "xyes"])

AM_CONDITIONAL(ENABLE_MATCHBOX_REMOTE, [test "x$matchbox_remote" = "xyes"])

AC_ARG_ENABLE(simple-manager,
  [  --disable-simple-manager   Do not build simple window manager],
  [simple_manager=$enableval],
  [
    if test "x$libmatchbox2" = "xyes"; then
        simple_manager=no
    else
        simple_manager=yes
    fi])

AC_ARG_ENABLE(maemo-manager,
  [  --enable-maemo-manager     Build maemo window manager],
  [maemo_manager=$enableval], [maemo_manager=no])

if test $simple_manager = yes; then
   MANAGERS="$MANAGERS simple"
fi

if test $maemo_manager = yes; then
   MANAGERS="$MANAGERS maemo"
fi

AC_SUBST(MANAGERS)

PKG_CHECK_MODULES(XFIXES, xfixes >= 4.0, have_xfixes=yes, have_xfixes=no)

if test x$have_xfixes = xyes; then
  AC_DEFINE(HAVE_XFIXES, [1], [Use XFixes ext to really hide cursor])
  MBWM2_PKGREQUIRES="$MBWM2_PKGREQUIRES xfixes >= 0.4"
fi

PKG_CHECK_MODULES(XEXT, xext, have_xext=yes, have_xext=no)

if test x$have_xext = xyes; then
  AC_DEFINE(HAVE_XEXT, [1], [Use Xext ext])
  MBWM2_PKGREQUIRES="$MBWM2_PKGREQUIRES xext"
fi

PKG_CHECK_MODULES(XCURSOR, xcursor, have_xcursor=yes, have_xcursor=no)

if test x$have_xcursor = xyes; then
  AC_DEFINE(HAVE_XCURSOR, [1], [Use XCursor to sync pointer themes])
fi

MBWM_INCS='-I$(top_srcdir) -I$(top_srcdir)/matchbox2/core -I$(top_srcdir)/matchbox2/client-types -I$(top_srcdir)/matchbox2/theme-engines -I$(top_srcdir)/matchbox2/comp-mgr -I$(top_builddir)'
MBWM_CORE_LIB='$(top_builddir)/matchbox2/core/libmatchbox-window-manager-2-core.la'
MBWM_CLIENT_BUILDDIR='$(top_builddir)/matchbox2/client-types'
MBWM_THEME_BUILDDIR='$(top_builddir)/matchbox2/theme-engines'
MBWM_COMPMGR_BUILDDIR='$(top_builddir)/matchbox2/comp-mgr'
MBWM_CFLAGS="$MBWM_CFLAGS $MBWM_DEBUG_CFLAGS $XFIXES_CFLAGS $XEXT_CFLAGS $XCURSOR_CFLAGS"
MBWM_LIBS="$MBWM_LIBS $XFIXES_LIBS $XEXT_LIBS $XCURSOR_LIBS $MBWM_EXTRA_LIBS"

AC_SUBST([MBWM_CFLAGS])
AC_SUBST([MBWM_LIBS])
AC_SUBST([MBWM_CORE_LIB])
AC_SUBST([MBWM_INCS])
AC_SUBST([MBWM_CLIENT_BUILDDIR])
AC_SUBST([MBWM_THEME_BUILDDIR])
AC_SUBST([MBWM_COMPMGR_BUILDDIR])
AC_SUBST([MBWM_DEBUG_CFLAGS])
AC_SUBST([MBWM_DEBUG_LDFLAGS])

AC_OUTPUT([
Makefile
matchbox2/Makefile
matchbox2/mb-wm-config.h
matchbox2/core/Makefile
matchbox2/client-types/Makefile
matchbox2/comp-mgr/Makefile
matchbox2/theme-engines/Makefile
managers/Makefile
managers/simple/Makefile
managers/maemo/Makefile
managers/maemo/theme/Makefile
data/Makefile
data/themes/Makefile
data/themes/Default/Makefile
data/themes/PngSample/Makefile
data/libmatchbox2.pc
doc/Makefile
doc/reference/Makefile
doc/reference/matchbox2/Makefile
doc/reference/matchbox2/version.xml
util/Makefile
])

echo "
           Matchbox Window Manager II
           ==========================

    Directories:
        source code location:   ${srcdir}
        install prefix        :   ${prefix}

    Documentation:
        Build API Reference   :   ${enable_gtk_doc}

    Extension:
	Xfixes                :   ${have_xfixes}
	Xext                  :   ${have_xext}
	Xcursor               :   ${have_xcursor}

    Themes:
	PNG theme             :   ${png_theme}
	GTK integration       :   ${use_gtk}
	Pango integration     :   ${use_pango}

    Managers:
	Simple manager        :	  ${simple_manager}
	Maemo manager         :	  ${maemo_manager}

	Compositing managers  :   ${comp_mgr}

    Miscel:
        Glib main loop        :   ${gmloop}
	Build libmatchbox2    :   ${libmatchbox2}
	Build matchbox-remote :   ${matchbox_remote}
	Debugging output      :   ${want_debug}
"