aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 69e020d465adad5223d9a95e421d995cf0a473e3 (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
AC_PREREQ(2.59)
AC_INIT([matchbox-window-manager-2], 0.0.0, [mallum@handhelds.org])
AC_CONFIG_SRCDIR([src/core/mb-window-manager.c])

AM_INIT_AUTOMAKE()
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AM_PROG_LIBTOOL

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

needed_pkgs="x11 "

AC_ARG_ENABLE(cairo-theme,
  [  --disable-cairo-theme   Disable Cairo graphics rendering support],
  [use_cairo=$enableval], [use_cairo=yes])

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

AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Disable GTK integration support],
  [use_gtk=$enableval], [use_gtk=yes])

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

if test "x$use_cairo" = "xyes"; then
  needed_pkgs="$needed_pkgs pangocairo "
else
  needed_pkgs="$needed_pkgs xft "
fi

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

if test "x$want_debug" = "xyes"; then
  MBWM_DEBUG_CFLAGS="-O0 $MBWM_DEBUG_CFLAGS -DMBWM_WANT_DEBUG"
  MBWM_DEBUG_LDFLAGS="$MBWM_DEBUG_LDFLAGS -rdynamic"
fi

PKG_CHECK_MODULES(MBWM, $needed_pkgs)

AM_CONDITIONAL(THEME_CAIRO, [test "x$use_cairo" = "xyes"])
if test "$use_cairo" = yes; then
  AC_DEFINE(USE_CAIRO, 1, [Use cairo for theme rendering])
fi

AM_CONDITIONAL(THEME_PNG, [test "x$png_theme" = "xyes"])
if test "$png_theme" = yes; then
  AC_DEFINE(THEME_PNG, 1, [Build PNG-image based theme engine])
  PKG_CHECK_MODULES(THEME_PNG, xft libpng12)
fi

# only build simple theme if cairo theme disabled
AM_CONDITIONAL(THEME_SIMPLE, [test "x$use_cairo" != "xyes"])

AM_CONDITIONAL(USE_GTK, test "x$use_gtk" = "xyes")
if test "$use_gtk" = yes; then
  AC_DEFINE(USE_GTK, 1, [GTK Integration])
fi

MBWM_INCS='-I$(top_srcdir)/src/core -I$(top_srcdir)/src/client-types -I$(top_srcdir)/src/theme-engines'
MBWM_CORE_LIB='$(top_builddir)/src/core/libmatchbox-window-manager-2-core.a'
MBWM_CLIENT_LIBS='$(top_builddir)/src/client-types'
MBWM_THEME_LIBS='$(top_builddir)/src/theme-engines'
MBWM_CFLAGS="$MBWM_CFLAGS $MBWM_DEBUG_CFLAGS $THEME_PNG_CFLAGS"
MBWM_LIBS="$MBWM_LIBS $THEME_PNG_LIBS"

AC_SUBST([MBWM_CFLAGS])
AC_SUBST([MBWM_LIBS])
AC_SUBST([MBWM_CORE_LIB])
AC_SUBST([MBWM_INCS])
AC_SUBST([MBWM_CLIENT_LIBS])
AC_SUBST([MBWM_THEME_LIBS])
AC_SUBST([MBWM_DEBUG_CFLAGS])
AC_SUBST([MBWM_DEBUG_LDFLAGS])

AC_OUTPUT([
Makefile
src/Makefile  
src/core/Makefile
src/client-types/Makefile
src/managers/Makefile
src/managers/simple/Makefile
src/theme-engines/Makefile
data/Makefile
data/themes/Makefile
data/themes/Default/Makefile
])

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

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

	Cairo theme:            ${use_cairo}
	PNG theme:              ${png_theme}
	GTK integration:	${use_gtk}
	Debugging output:       ${want_debug}
"