~compiz-team/compiz/build-fixes-part-1

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
AC_PREREQ(2.57)

AC_INIT([compiz], [0.0.1], [davidr@novell.com])

AC_CONFIG_AUX_DIR(config)

AM_INIT_AUTOMAKE([dist-bzip2])
AC_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE

AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LIBTOOL
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h sys/time.h unistd.h])

if test "x$GCC" = "xyes"; then
  case " $CFLAGS " in
  *[[\ \	]]-Wall[[\ \	]]*) ;;
  *) CFLAGS="$CFLAGS -Wall" ;;
  esac

  case " $CFLAGS " in
  *[[\ \	]]-Wpointer-arith[[\ \	]]*) ;;
  *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
  esac

  case " $CFLAGS " in
  *[[\ \	]]-Wstrict-prototypes[[\ \	]]*) ;;
  *) CFLAGS="$CFLAGS -Wstrict-prototypes" ;;
  esac

  case " $CFLAGS " in
  *[[\ \	]]-Wmissing-prototypes[[\ \	]]*) ;;
  *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
  esac

  case " $CFLAGS " in
  *[[\ \	]]-Wmissing-declarations[[\ \	]]*) ;;
  *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
  esac

  case " $CFLAGS " in
  *[[\ \	]]-Wnested-externs[[\ \	]]*) ;;
  *) CFLAGS="$CFLAGS -Wnested-externs" ;;
  esac

  case " $CFLAGS " in
  *[[\ \	]]-fno-strict-aliasing[[\ \	]]*) ;;
  *) CFLAGS="$CFLAGS -fno-strict-aliasing" ;;
  esac

  if test "x$enable_ansi" = "xyes"; then
    case " $CFLAGS " in
    *[[\ \	]]-ansi[[\ \	]]*) ;;
    *) CFLAGS="$CFLAGS -ansi" ;;
    esac

    case " $CFLAGS " in
    *[[\ \	]]-pedantic[[\ \	]]*) ;;
    *) CFLAGS="$CFLAGS -pedantic" ;;
    esac
  fi
fi

AC_C_BIGENDIAN

plugindir=$libdir/compiz
AC_SUBST(plugindir)

imagedir=$datadir/compiz
AC_SUBST(imagedir)

COMPIZ_REQUIRES="libpng	    \
		 xcomposite \
		 xfixes	    \
		 xdamage    \
		 xrandr	    \
		 ice	    \
		 sm	    \
		 libstartup-notification-1.0 >= 0.7"

PKG_CHECK_MODULES(COMPIZ, $COMPIZ_REQUIRES)
AC_SUBST(COMPIZ_REQUIRES)

AC_MSG_CHECKING(for GL_CFLAGS)
AC_ARG_WITH(gl-cflags, [  --with-gl-cflags=CFLAGS ],
		       [GL_CFLAGS="$withval"],
		       [GL_CFLAGS=""])

AC_MSG_RESULT($GL_CFLAGS)
AC_MSG_CHECKING(for GL_LIBS)
AC_ARG_WITH(gl-libs, [  --with-gl-libs=LIBS ],
		     [GL_LIBS="$withval"],
		     [GL_LIBS="-lGL"])
AC_MSG_RESULT($GL_LIBS)

AC_SUBST(GL_CFLAGS)
AC_SUBST(GL_LIBS)

AC_ARG_ENABLE(gconf,
  [  --disable-gconf         Disable gconf plugin],
  [use_gconf=$enableval], [use_gconf=yes])

if test "x$use_gconf" = "xyes"; then
  PKG_CHECK_MODULES(GCONF, gconf-2.0, [use_gconf=yes], [use_gconf=no])
fi

AM_CONDITIONAL(GCONF_PLUGIN, test "x$use_gconf" = "xyes")
if test "$use_gconf" = yes; then
  AC_DEFINE(USE_GCONF, 1, [Build gconf plugin])
fi

AC_ARG_ENABLE(place,
  [  --disable-place         Disable window placement plugin],
  [use_place=$enableval], [use_place=yes])

if test "x$use_place" = "xyes"; then
  PKG_CHECK_MODULES(PLACE, glib-2.0, [use_place=yes], [use_place=no])
fi

AM_CONDITIONAL(PLACE_PLUGIN, test "x$use_place" = "xyes")
if test "$use_place" = yes; then
  AC_DEFINE(USE_PLACE, 1, [Build placement plugin])
fi

AC_ARG_ENABLE(menu,
  [  --disable-menu          Disable window menu plugin],
  [use_menu=$enableval], [use_menu=yes])

if test "x$use_menu" = "xyes"; then
  PKG_CHECK_MODULES(MENU, gtk+-2.0, [use_menu=yes], [use_menu=no])
fi

AM_CONDITIONAL(MENU_PLUGIN, test "x$use_menu" = "xyes")
if test "$use_menu" = yes; then
  AC_DEFINE(USE_MENU, 1, [Build menu plugin])
fi

AC_ARG_ENABLE(libsvg-cairo,
  [  --enable-libsvg-cairo   Enable svg support],
  [use_libsvg_cairo=$enableval], [use_libsvg_cairo=no])

if test "x$use_libsvg_cairo" = "xyes"; then
  PKG_CHECK_MODULES(LIBSVG_CAIRO, libsvg-cairo,
		    [use_libsvg_cairo=yes],
		    [use_libsvg_cairo=no])
fi

AM_CONDITIONAL(USE_LIBSVG_CAIRO, [test x$use_libsvg_cairo = xyes])
if test "$use_libsvg_cairo" = yes; then
  AC_DEFINE(USE_LIBSVG_CAIRO, 1, [libsvg-cairo for SVG support])
fi

AC_ARG_ENABLE(gnome,
  [  --disable-gnome         Disable gnome window decorator and settings module],
  [use_gnome=$enableval], [use_gnome=yes])

if test "x$use_gnome" = "xyes"; then
  PKG_CHECK_MODULES(GNOME_WINDOW_DECORATOR,
		    gtk+-2.0 libwnck-1.0 pangocairo,
		    [use_gnome=yes], [use_gnome=no])
  if test "x$use_gnome" = "xyes"; then
    PKG_CHECK_MODULES(GNOME_WINDOW_SETTINGS,
		      gnome-window-settings-2.0 gnome-desktop-2.0,
		      [use_gnome=yes], [use_gnome=no])
  fi
  windowsettingsdatadir=`pkg-config --variable=prefix gnome-window-settings-2.0`/share
  windowsettingslibdir=`pkg-config --variable=libdir gnome-window-settings-2.0`
fi

AC_SUBST(windowsettingsdatadir)
AC_SUBST(windowsettingslibdir)

AM_CONDITIONAL(USE_GNOME, test "x$use_gnome" = "xyes")
if test "$use_gnome" = yes; then
  AC_DEFINE(USE_GNOME, 1, [Build gnome window decorator and settings module])
fi

AC_ARG_ENABLE(kde,
  [  --disable-kde           Disable kde window decorator],
  [use_kde=$enableval], [use_kde=yes])

if test "x$use_kde" = "xyes"; then
  PKG_CHECK_MODULES(KDE_WINDOW_DECORATOR, QtCore,
		    [use_kde=yes], [use_kde=no])
fi

AM_CONDITIONAL(USE_KDE, test "x$use_kde" = "xyes")
if test "$use_kde" = yes; then
  AC_DEFINE(USE_KDE, 1, [Build kde window decorator])
fi

AC_OUTPUT([
compiz.pc
Makefile
src/Makefile
include/Makefile
plugins/Makefile
images/Makefile
gnome/Makefile
gnome/window-decorator/Makefile
gnome/compiz.desktop
kde/Makefile
kde/window-decorator/Makefile
])

echo ""
echo "the following optional plugins will be compiled:"
echo "  gconf: $use_gconf"
echo "  place: $use_place"
echo "  menu:  $use_menu"
echo "  svg:   $use_libsvg_cairo"
echo ""
echo "and the following optional features will be compiled:"
echo "  gnome: $use_gnome"
echo "  kde:   $use_kde"
echo ""