Update catalan translation
[mikachu/openbox.git] / configure.ac
1 AC_PREREQ([2.54])
2 AC_INIT([openbox], [3.7], [http://bugzilla.icculus.org])
3 AC_CONFIG_SRCDIR([openbox/openbox.c])
4
5 AM_INIT_AUTOMAKE([foreign])
6 AM_SILENT_RULES([yes])
7
8 OB_VERSION=$PACKAGE_VERSION
9 AC_SUBST(OB_VERSION)
10
11 dnl Making releases:
12 dnl RR_ is for obrender, OBT_ is for obt, keep major/minor in sync,
13 dnl treat the rest separately.
14 dnl
15 dnl if MAJOR or MINOR version changes, be sure to change AC_INIT above to match.
16 dnl the other variables aren't related to the user visible versions, but are used
17 dnl to version the .so files.
18 dnl if no backward compat is broken, it's just a preference if you want to bump
19 dnl the AC_INIT micro version or minor version. if the AC_INIT micro version is
20 dnl 0, don't write it out.
21 dnl
22 dnl How to process .so versioning,
23 dnl   RR_MICRO_VERSION += 1;
24 dnl   RR_INTERFACE_AGE += 1;
25 dnl   RR_BINARY_AGE += 1;
26 dnl if any functions have been added, set RR_INTERFACE_AGE to 0.
27 dnl if backwards compatibility has been broken,
28 dnl set RR_BINARY_AGE and RR_INTERFACE_AGE to 0.
29 dnl if you set anything to 0, you should also bump the MINOR version.
30 dnl
31 RR_MAJOR_VERSION=3
32 RR_MINOR_VERSION=6
33 RR_MICRO_VERSION=33
34 RR_INTERFACE_AGE=1
35 RR_BINARY_AGE=1
36 RR_VERSION=$RR_MAJOR_VERSION.$RR_MINOR_VERSION
37
38 OBT_MAJOR_VERSION=3
39 OBT_MINOR_VERSION=6
40 OBT_MICRO_VERSION=5
41 OBT_INTERFACE_AGE=3
42 OBT_BINARY_AGE=3
43 OBT_VERSION=$OBT_MAJOR_VERSION.$OBT_MINOR_VERSION
44
45 AC_SUBST(RR_MAJOR_VERSION)
46 AC_SUBST(RR_MINOR_VERSION)
47 AC_SUBST(RR_MICRO_VERSION)
48 AC_SUBST(RR_INTERFACE_AGE)
49 AC_SUBST(RR_BINARY_AGE)
50 AC_SUBST(RR_VERSION)
51 AC_SUBST(OBT_MAJOR_VERSION)
52 AC_SUBST(OBT_MINOR_VERSION)
53 AC_SUBST(OBT_MICRO_VERSION)
54 AC_SUBST(OBT_INTERFACE_AGE)
55 AC_SUBST(OBT_BINARY_AGE)
56 AC_SUBST(OBT_VERSION)
57
58 dnl Libtool versioning
59 RR_RELEASE=$RR_MAJOR_VERSION.$RR_MINOR_VERSION
60 RR_CURRENT=`expr $RR_MICRO_VERSION - $RR_INTERFACE_AGE`
61 RR_REVISION=$RR_INTERFACE_AGE
62 RR_AGE=`expr $RR_BINARY_AGE - $RR_INTERFACE_AGE`
63 RR_CURRENT_MINUS_AGE=`expr $RR_CURRENT - $RR_AGE`
64
65 OBT_RELEASE=$OBT_MAJOR_VERSION.$OBT_MINOR_VERSION
66 OBT_CURRENT=`expr $OBT_MICRO_VERSION - $OBT_INTERFACE_AGE`
67 OBT_REVISION=$OBT_INTERFACE_AGE
68 OBT_AGE=`expr $OBT_BINARY_AGE - $OBT_INTERFACE_AGE`
69 OBT_CURRENT_MINUS_AGE=`expr $OBT_CURRENT - $OBT_AGE`
70
71 AC_SUBST(RR_RELEASE)
72 AC_SUBST(RR_CURRENT)
73 AC_SUBST(RR_REVISION)
74 AC_SUBST(RR_AGE)
75 AC_SUBST(RR_CURRENT_MINUS_AGE)
76 AC_SUBST(OBT_RELEASE)
77 AC_SUBST(OBT_CURRENT)
78 AC_SUBST(OBT_REVISION)
79 AC_SUBST(OBT_AGE)
80 AC_SUBST(OBT_CURRENT_MINUS_AGE)
81
82 AC_PREFIX_DEFAULT([/usr/local])
83 test "$prefix" = "NONE" && prefix=$ac_default_prefix
84
85 dnl Determine build target
86 OB_DEBUG
87 dnl Pick compiler specific/build target flags, and set $CVS
88 AM_PROG_CC_C_O
89 OB_COMPILER_FLAGS
90 AC_C_CONST
91 AC_C_INLINE
92
93 AC_PROG_LIBTOOL
94 AC_SUBST(LIBTOOL_DEPS)
95 LIBTOOL="$LIBTOOL --silent"
96
97 AC_PROG_INSTALL
98
99 AM_GNU_GETTEXT_VERSION(0.15)
100 AM_GNU_GETTEXT([external])
101
102 AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h grp.h locale.h pwd.h)
103 AC_CHECK_HEADERS(signal.h string.h stdio.h stdlib.h unistd.h sys/stat.h)
104 AC_CHECK_HEADERS(sys/select.h sys/socket.h sys/time.h sys/types.h sys/wait.h)
105
106 AC_PATH_PROG([SED], [sed], [no])
107 if test "$SED" = "no"; then
108   AC_MSG_ERROR([The program "sed" is not available. This program is required to build Openbox.])
109 fi
110
111 AC_PATH_PROG([DIRNAME], [dirname], [no])
112 if test "$DIRNAME" = "no"; then
113   AC_MSG_ERROR([The program "dirname" is not available. This program is required to build Openbox.])
114 fi
115
116 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.14.0])
117 AC_SUBST(GLIB_CFLAGS)
118 AC_SUBST(GLIB_LIBS)
119
120 PKG_CHECK_MODULES(PANGO, [pango >= 1.8.0 pangoxft >= 1.8.0])
121 AC_SUBST(PANGO_CFLAGS)
122 AC_SUBST(PANGO_LIBS)
123
124 PKG_CHECK_MODULES(XML, [libxml-2.0 >= 2.6.0])
125 AC_SUBST(XML_CFLAGS)
126 AC_SUBST(XML_LIBS)
127
128 AC_ARG_ENABLE(startup-notification,
129   AC_HELP_STRING(
130     [--disable-startup-notification],
131     [disable the startup notification library. [default=enabled]]
132   ),
133   [enable_sn=$enableval],
134   [enable_sn=yes]
135 )
136
137 if test "$enable_sn" = yes; then
138 PKG_CHECK_MODULES(LIBSN, [libstartup-notification-1.0 >= 0.8],
139   [
140     AC_DEFINE(USE_LIBSN, [1], [Use startup-notification])
141     AC_SUBST(LIBSN_CFLAGS)
142     AC_SUBST(LIBSN_LIBS)
143     sn_found=yes
144   ],
145   [
146     sn_found=no
147   ]
148 )
149 else
150   sn_found=no
151 fi
152
153 AC_ARG_ENABLE(xcursor,
154   AC_HELP_STRING(
155     [--disable-xcursor],
156     [disable use of the X Cursor library. [default=enabled]]
157   ),
158   [enable_xcursor=$enableval],
159   [enable_xcursor=yes]
160 )
161
162 if test "$enable_xcursor" = yes; then
163 PKG_CHECK_MODULES(XCURSOR, [xcursor],
164   [
165     AC_DEFINE(USE_XCURSOR, [1], [Use X Cursor library])
166     AC_SUBST(XCURSOR_CFLAGS)
167     AC_SUBST(XCURSOR_LIBS)
168     xcursor_found=yes
169   ],
170   [
171     xcursor_found=no
172   ]
173 )
174 else
175   xcursor_found=no
176 fi
177
178 AC_ARG_ENABLE(imlib2,
179   AC_HELP_STRING(
180     [--disable-imlib2],
181     [disable use of Imlib2 image library for loading icons. [default=enabled]]
182   ),
183   [enable_imlib2=$enableval],
184   [enable_imlib2=yes]
185 )
186
187 if test "$enable_imlib2" = yes; then
188 PKG_CHECK_MODULES(IMLIB2, [imlib2],
189   [
190     AC_DEFINE(USE_IMLIB2, [1], [Use Imlib2 image library])
191     AC_SUBST(IMLIB2_CFLAGS)
192     AC_SUBST(IMLIB2_LIBS)
193     # export it for the pkg-config file
194     PKG_CONFIG_IMLIB=imlib2
195     AC_SUBST(PKG_CONFIG_IMLIB)
196     imlib2_found=yes
197   ],
198   [
199     imlib2_found=no
200   ]
201 )
202 else
203   imlib2_found=no
204 fi
205
206 AM_CONDITIONAL(USE_IMLIB2, [test $imlib2_found = yes])
207
208 AC_ARG_ENABLE(librsvg,
209   AC_HELP_STRING(
210     [--disable-librsvg],
211     [disable use of SVG image files for loading icons. [default=enabled]]
212   ),
213   [enable_librsvg=$enableval],
214   [enable_librsvg=yes]
215 )
216
217 if test "$enable_librsvg" = yes; then
218 PKG_CHECK_MODULES(LIBRSVG, [librsvg-2.0],
219   [
220     AC_DEFINE(USE_LIBRSVG, [1], [Use SVG image files])
221     AC_SUBST(LIBRSVG_CFLAGS)
222     AC_SUBST(LIBRSVG_LIBS)
223     # export it for the pkg-config file
224     PKG_CONFIG_LIBRSVG=librsvg-2.0
225     AC_SUBST(PKG_CONFIG_LIBRSVG)
226     librsvg_found=yes
227   ],
228   [
229     librsvg_found=no
230   ]
231 )
232 else
233   librsvg_found=no
234 fi
235
236 AM_CONDITIONAL(USE_LIBRSVG, [test $librsvg_found = yes])
237
238 dnl Check for session management
239 X11_SM
240
241 #EFENCE_LIBS=-lefence
242 EFENCE_LIBS=""
243 AC_SUBST(EFENCE_LIBS)
244
245 dnl Check for X11 extensions
246 X11_EXT_XKB
247 X11_EXT_XRANDR
248 X11_EXT_SHAPE
249 X11_EXT_XINERAMA
250 X11_EXT_SYNC
251 X11_EXT_AUTH
252
253 AC_CONFIG_FILES([
254   Makefile
255   m4/Makefile
256   po/Makefile.in
257   obrender/obrender-3.5.pc
258   obt/obt-3.5.pc
259   obrender/version.h
260   obt/version.h
261   version.h
262 ])
263 AC_CONFIG_COMMANDS([doc],
264                    [test -d doc || mkdir doc])
265 AC_CONFIG_COMMANDS([data],
266                    [test -d data || mkdir data])
267 AC_CONFIG_COMMANDS([data/xsession],
268                    [test -d data/xsession || mkdir data/xsession])
269 AC_OUTPUT
270
271 AC_MSG_RESULT
272 AC_MSG_RESULT([Compiling with these options:
273                Startup Notification... $sn_found
274                X Cursor Library... $xcursor_found
275                Session Management... $SM
276                Imlib2 Library... $imlib2_found
277                SVG Support (librsvg)... $librsvg_found
278                ])
279 AC_MSG_RESULT([configure complete, now type "make"])