create the loco library for composting. it links against libGL. openbox.c calls...
[dana/openbox.git] / configure.ac
1 AC_PREREQ([2.54])
2 AC_INIT([openbox], [3.999.0], [http://bugzilla.icculus.org])
3 AM_INIT_AUTOMAKE
4 AC_CONFIG_SRCDIR([openbox/openbox.c])
5
6 dnl Making releases:
7 dnl   RR_MICRO_VERSION += 1;
8 dnl   RR_INTERFACE_AGE += 1;
9 dnl   R_BINARY_AGE += 1;
10 dnl if any functions have been added, set RR_INTERFACE_AGE to 0.
11 dnl if backwards compatibility has been broken,
12 dnl set RR_BINARY_AGE and RR_INTERFACE_AGE to 0.
13 dnl
14 dnl if MAJOR or MINOR version changes, be sure to change AC_INIT above to match
15 dnl
16 RR_MAJOR_VERSION=4
17 RR_MINOR_VERSION=0
18 RR_MICRO_VERSION=17
19 RR_INTERFACE_AGE=0
20 RR_BINARY_AGE=0
21 RR_VERSION=$RR_MAJOR_VERSION.$RR_MINOR_VERSION
22
23 OBT_MAJOR_VERSION=4
24 OBT_MINOR_VERSION=0
25 OBT_MICRO_VERSION=0
26 OBT_INTERFACE_AGE=0
27 OBT_BINARY_AGE=0
28 OBT_VERSION=$OBT_MAJOR_VERSION.$OBT_MINOR_VERSION
29
30 LOCO_MAJOR_VERSION=4
31 LOCO_MINOR_VERSION=0
32 LOCO_MICRO_VERSION=0
33 LOCO_INTERFACE_AGE=0
34 LOCO_BINARY_AGE=0
35 LOCO_VERSION=$OB_MAJOR_VERSION.$OB_MINOR_VERSION
36
37 AC_SUBST(RR_MAJOR_VERSION)
38 AC_SUBST(RR_MINOR_VERSION)
39 AC_SUBST(RR_MICRO_VERSION)
40 AC_SUBST(RR_INTERFACE_AGE)
41 AC_SUBST(RR_BINARY_AGE)
42 AC_SUBST(RR_VERSION)
43 AC_SUBST(OBT_MAJOR_VERSION)
44 AC_SUBST(OBT_MINOR_VERSION)
45 AC_SUBST(OBT_MICRO_VERSION)
46 AC_SUBST(OBT_INTERFACE_AGE)
47 AC_SUBST(OBT_BINARY_AGE)
48 AC_SUBST(OBT_VERSION)
49 AC_SUBST(LOCO_MAJOR_VERSION)
50 AC_SUBST(LOCO_MINOR_VERSION)
51 AC_SUBST(LOCO_MICRO_VERSION)
52 AC_SUBST(LOCO_INTERFACE_AGE)
53 AC_SUBST(LOCO_BINARY_AGE)
54 AC_SUBST(LOCO_VERSION)
55
56 dnl Libtool versioning
57 RR_RELEASE=$RR_MAJOR_VERSION.$RR_MINOR_VERSION
58 RR_CURRENT=`expr $RR_MICRO_VERSION - $RR_INTERFACE_AGE`
59 RR_REVISION=$RR_INTERFACE_AGE
60 RR_AGE=`expr $RR_BINARY_AGE - $RR_INTERFACE_AGE`
61 RR_CURRENT_MINUS_AGE=`expr $RR_CURRENT - $RR_AGE`
62
63 OBT_RELEASE=$OBT_MAJOR_VERSION.$OBT_MINOR_VERSION
64 OBT_CURRENT=`expr $OBT_MICRO_VERSION - $OBT_INTERFACE_AGE`
65 OBT_REVISION=$OBT_INTERFACE_AGE
66 OBT_AGE=`expr $OBT_BINARY_AGE - $OBT_INTERFACE_AGE`
67 OBT_CURRENT_MINUS_AGE=`expr $OBT_CURRENT - $OBT_AGE`
68
69 LOCO_RELEASE=$LOCO_MAJOR_VERSION.$LOCO_MINOR_VERSION
70 LOCO_CURRENT=`expr $LOCO_MICRO_VERSION - $LOCO_INTERFACE_AGE`
71 LOCO_REVISION=$LOCO_INTERFACE_AGE
72 LOCO_AGE=`expr $LOCO_BINARY_AGE - $LOCO_INTERFACE_AGE`
73 LOCO_CURRENT_MINUS_AGE=`expr $LOCO_CURRENT - $LOCO_AGE`
74
75 AC_SUBST(RR_RELEASE)
76 AC_SUBST(RR_CURRENT)
77 AC_SUBST(RR_REVISION)
78 AC_SUBST(RR_AGE)
79 AC_SUBST(RR_CURRENT_MINUS_AGE)
80 AC_SUBST(OBT_RELEASE)
81 AC_SUBST(OBT_CURRENT)
82 AC_SUBST(OBT_REVISION)
83 AC_SUBST(OBT_AGE)
84 AC_SUBST(OBT_CURRENT_MINUS_AGE)
85 AC_SUBST(LOCO_RELEASE)
86 AC_SUBST(LOCO_CURRENT)
87 AC_SUBST(LOCO_REVISION)
88 AC_SUBST(LOCO_AGE)
89 AC_SUBST(LOCO_CURRENT_MINUS_AGE)
90
91 AC_PREFIX_DEFAULT([/usr/local])
92 test "$prefix" = "NONE" && prefix=$ac_default_prefix
93
94 dnl Determine build target
95 OB_DEBUG
96 dnl Pick compiler specific/build target flags, and set $CVS
97 AM_PROG_CC_C_O
98 OB_COMPILER_FLAGS
99 AC_C_CONST
100 AC_C_INLINE
101
102 AC_PROG_LIBTOOL
103 AC_SUBST(LIBTOOL_DEPS)
104 LIBTOOL="$LIBTOOL --silent"
105
106 AC_PROG_INSTALL
107
108 AM_GNU_GETTEXT_VERSION(0.15)
109 AM_GNU_GETTEXT([external])
110
111 AC_CHECK_HEADERS(ctype.h fcntl.h locale.h signal.h string.h stdio.h stdlib.h)
112 AC_CHECK_HEADERS(unistd.h sys/stat.h sys/select.h sys/time.h sys/wait.h)
113 # AC_HEADER_TIME
114 # AC_TYPE_SIGNAL
115
116 AC_PATH_PROG([SED], [sed], [no])
117 if test "$SED" = "no"; then
118   AC_MSG_ERROR([The program "sed" is not available. This program is required to build Openbox.])
119 fi
120
121 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.6.0])
122 AC_SUBST(GLIB_CFLAGS)
123 AC_SUBST(GLIB_LIBS)
124
125 PKG_CHECK_MODULES(PANGO, [pango >= 1.8.0 pangoxft >= 1.8.0])
126 AC_SUBST(PANGO_CFLAGS)
127 AC_SUBST(PANGO_LIBS)
128
129 PKG_CHECK_MODULES(XFT, [xft])
130 AC_SUBST(XFT_CFLAGS)
131 AC_SUBST(XFT_LIBS)
132
133 PKG_CHECK_MODULES(XML, [libxml-2.0 >= 2.6.0])
134 AC_SUBST(XML_CFLAGS)
135 AC_SUBST(XML_LIBS)
136
137 AC_ARG_ENABLE(startup-notification,
138   AC_HELP_STRING(
139     [--disable-startup-notification],
140     [disable the startup notification library. [[default=enabled]]]
141   ),
142   [enable_sn=$enableval],
143   [enable_sn=yes]
144 )
145
146 if test "$enable_sn" = yes; then
147 PKG_CHECK_MODULES(LIBSN, [libstartup-notification-1.0 >= 0.8],
148   [
149     AC_DEFINE(USE_LIBSN, [1], [Use startup-notification])
150     AC_SUBST(LIBSN_CFLAGS)
151     AC_SUBST(LIBSN_LIBS)
152     sn_found=yes
153   ],
154   [
155     sn_found=no
156   ]
157 )
158 else
159   sn_found=no
160 fi
161
162 AC_ARG_ENABLE(xcursor,
163   AC_HELP_STRING(
164     [--disable-xcursor],
165     [disable use of the X Cursor library. [[default=enabled]]]
166   ),
167   [enable_xcursor=$enableval],
168   [enable_xcursor=yes]
169 )
170
171 if test "$enable_xcursor" = yes; then
172 PKG_CHECK_MODULES(XCURSOR, [xcursor],
173   [
174     AC_DEFINE(USE_XCURSOR, [1], [Use X Cursor library])
175     AC_SUBST(XCURSOR_CFLAGS)
176     AC_SUBST(XCURSOR_LIBS)
177     xcursor_found=yes
178   ],
179   [
180     xcursor_found=no
181   ]
182 )
183 else
184   xcursor_found=no
185 fi
186
187 AC_ARG_ENABLE(xcomposite,
188   AC_HELP_STRING(
189     [--disable-xcomposite],
190     [disable use of the X Composite library. [[default=enabled]]]
191   ),
192   [enable_xcomposite=$enableval],
193   [enable_xcomposite=yes]
194 )
195
196 if test "$enable_xcomposite" = yes; then
197 PKG_CHECK_MODULES(XRENDER, [xrender],
198   [
199     AC_DEFINE(USE_XRENDER, [1], [Use X Render library])
200     AC_SUBST(XRENDER_CFLAGS)
201     AC_SUBST(XRENDER_LIBS)
202     PKG_CHECK_MODULES(XDAMAGE, [xdamage],
203       [
204         AC_DEFINE(USE_XDAMAGE, [1], [Use X Damage library])
205         AC_SUBST(XDAMAGE_CFLAGS)
206         AC_SUBST(XDAMAGE_LIBS)
207         PKG_CHECK_MODULES(XCOMPOSITE, [xcomposite],
208           [
209             AC_DEFINE(USE_XCOMPOSITE, [1], [Use X Composite library])
210             AC_SUBST(XCOMPOSITE_CFLAGS)
211             AC_SUBST(XCOMPOSITE_LIBS)
212             xcomposite_found=yes
213           ],
214           [
215             xcomposite_found=no
216           ]
217         )
218       ],
219       [
220         xcomposite_found=no
221       ]
222     )
223   ],
224   [
225     xcomposite_found=no
226   ]
227 )
228 else
229   xcomposite_found=no
230 fi
231
232 AC_MSG_CHECKING(for GL_CFLAGS)
233 AC_ARG_WITH(gl-cflags, [  --with-gl-cflags=CFLAGS ],
234                        [GL_CFLAGS="$withval"],
235                        [GL_CFLAGS=""])
236
237 AC_MSG_RESULT($GL_CFLAGS)
238 AC_MSG_CHECKING(for GL_LIBS)
239 AC_ARG_WITH(gl-libs, [  --with-gl-libs=LIBS ],
240                      [GL_LIBS="$withval"],
241                      [GL_LIBS="-lGL"])
242 AC_MSG_RESULT($GL_LIBS)
243
244 AC_SUBST(GL_CFLAGS)
245 AC_SUBST(GL_LIBS)
246
247 dnl Check for session management
248 X11_SM
249
250 #EFENCE_LIBS=-lefence
251 EFENCE_LIBS=""
252 AC_SUBST(EFENCE_LIBS)
253
254 dnl Check for X11 extensions
255 X11_EXT_XKB
256 X11_EXT_XRANDR
257 X11_EXT_SHAPE
258 X11_EXT_XINERAMA
259 X11_EXT_SYNC
260
261 AC_CONFIG_FILES([
262   Makefile
263   m4/Makefile
264   po/Makefile.in
265   render/obrender-4.0.pc
266   obt/obt-4.0.pc
267   loco/loco-4.0.pc
268   render/version.h
269   obt/version.h
270 ])
271 AC_CONFIG_COMMANDS([doc],
272                    [test -d doc || mkdir doc])
273 AC_CONFIG_COMMANDS([data],
274                    [test -d data || mkdir data])
275 AC_CONFIG_COMMANDS([data/xsession],
276                    [test -d data/xsession || mkdir data/xsession])
277 AC_OUTPUT
278
279 AC_MSG_RESULT
280 AC_MSG_RESULT([Compiling with these options:
281                Startup Notification... $sn_found
282                X Cursor Library... $xcursor_found
283                X Composite Library... $xcomposite_found
284                Session Management... $SM
285                ])
286 AC_MSG_RESULT([configure complete, now type "make"])