]> icculus.org git repositories - dana/openbox.git/blob - configure.in
add bitmap buttons, and put support for them in all the default styles
[dana/openbox.git] / configure.in
1 dnl configure.in for Openbox
2 dnl Initialize autoconf and automake
3 AC_INIT(src/blackbox.cc)
4 AM_INIT_AUTOMAKE(openbox,2.2.1,no-define)
5
6 dnl Determine default prefix
7 test x$prefix = "xNONE" && prefix="$ac_default_prefix"
8
9 dnl Check for various flavors of UNIX(r)
10 dnl AC_AIX
11 dnl AC_ISC_POSIX
12
13 dnl Locate required external software
14 AC_PROG_CC
15 AC_PROG_CXX
16 AC_PROG_INSTALL
17
18 dnl Determine if maintainer portions of the Makefiles should be included.
19 AM_MAINTAINER_MODE
20
21 AC_LANG(C++)
22
23 AC_CHECK_PROGS(regex_cmd, sed)
24 if test x$regex_cmd = "x"; then
25   AC_MSG_ERROR([error. sed is required to build the default menu file.])
26 fi
27
28 dnl Check for system header files
29 AC_CHECK_HEADERS(ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdio.h string.h stdlib.h time.h unistd.h sys/param.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h)
30 AC_HEADER_TIME
31
32 dnl Check for existance of basename(), setlocale() and strftime()
33 AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename,
34                           AC_DEFINE(HAVE_BASENAME) LIBS="$LIBS -lgen"))
35 AC_CHECK_FUNCS(getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose)
36 AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl")
37 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
38
39 dnl Check for X headers and libraries
40 AC_PATH_X
41 AC_PATH_XTRA
42
43 test "$no_x" = "yes" && AC_MSG_ERROR([Openbox requires the X Window System libraries and headers.])
44
45 test x$x_includes = "x" && x_includes="/usr/include"
46 test x$x_libraries = "x" && x_libraries="/usr/lib"
47
48 CFLAGS="$CFLAGS $X_CFLAGS"
49 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
50 LIBS="$LIBS $X_LIBS"
51 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
52
53 AC_MSG_CHECKING(for GCC)
54 if test "$GCC" = "yes"; then
55   AC_MSG_RESULT([yes])
56   CXXFLAGS="${CXXFLAGS} -Wall -W"
57 else
58   AC_MSG_RESULT([no, trying other compilers])
59   AC_MSG_CHECKING(for MIPSpro)
60   mips_pro_ver=`$CC -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
61   if test "x$mips_pro_ver" = "x"; then
62     AC_MSG_RESULT([no])
63   else
64     AC_MSG_RESULT([yes, version $mips_pro_ver.])
65     AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
66     lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
67     if test "x$lang_std_not_set" = "x"; then
68       AC_MSG_RESULT([not set, setting.])
69       CXXFLAGS="${CXXFLAGS} -LANG:std"
70     else
71       AC_MSG_RESULT([already set.])
72     fi
73   fi
74 fi
75
76 dnl Check for required functions in -lX11
77 AC_CHECK_LIB(X11, XOpenDisplay,
78   LIBS="$LIBS -lX11",
79   AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
80 )
81
82 LIBS="$LIBS $X_EXTRA_LIBS"
83
84 dnl Check for XShape extension support and proper library files.
85 SHAPE=""
86 AC_MSG_CHECKING([whether to build support for the XShape extension])
87 AC_ARG_ENABLE(
88   shape, [  --enable-shape          enable support of the XShape extension @<:@default=yes@:>@])
89
90 : ${enableval="yes"}
91 if test "$enableval" = "yes"; then
92   AC_MSG_RESULT([yes])
93   AC_CHECK_LIB(Xext, XShapeCombineShape,
94         AC_MSG_CHECKING([for X11/extensions/shape.h])
95         AC_TRY_LINK(
96 #include <X11/Xlib.h>
97 #include <X11/Xutil.h>
98 #include <X11/extensions/shape.h>
99 , long foo = ShapeSet,
100           AC_MSG_RESULT([yes])
101           SHAPE="yes",
102           AC_MSG_RESULT([no])
103         )
104   )
105 else
106   AC_MSG_RESULT([no])
107 fi
108 if test "$SHAPE" = "yes"; then
109   LIBS="$LIBS -lXext"
110   AC_DEFINE(SHAPE,1,Enable support of the XShape extension)
111 fi
112
113 dnl Check for Xinerama extension support and proper library files.
114 XINERAMA=""
115 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
116 AC_ARG_ENABLE(
117   xinerama, [  --enable-xinerama       enable support of the Xinerama extension @<:@default=no@:>@],
118   if test "$enableval" = "yes"; then
119         AC_MSG_RESULT([yes])
120
121         AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
122           AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
123           AC_TRY_LINK(
124 #include <X11/Xlib.h>
125 #include <X11/extensions/Xinerama.h>
126 , XineramaScreenInfo foo,
127                 AC_MSG_RESULT([yes])
128                 XINERAMA="yes"
129                 LIBS="$LIBS -lXinerama",
130                 AC_MSG_RESULT([no])
131           )
132         )
133
134   else
135         AC_MSG_RESULT([no])
136   fi,
137   AC_MSG_RESULT([no])
138 )
139 if test "$XINERAMA" = "yes"; then
140   AC_DEFINE(XINERAMA,1,Enable support of the Xinerama extension)
141 fi
142
143 dnl Check for Xft extension support and proper library files.
144 XFT=""
145 XFT2=""
146 dnl XFT_UTF8=""
147 AC_MSG_CHECKING([whether to build support for the Xft extension])
148 AC_ARG_ENABLE(
149   xft, [  --enable-xft            enable support of the Xft extension @<:@default=yes@:>@])
150 : ${enableval="yes"}
151 if test "$enableval" = "yes"; then
152
153   if pkg-config xft; then
154     XFT2="yes"
155     AC_MSG_RESULT([version 2])
156     CXXFLAGS="`pkg-config --cflags xft` ${CXXFLAGS}"
157     LIBS="${LIBS} `pkg-config --libs xft`"
158   else 
159     AC_MSG_RESULT([version 1])
160   fi
161   
162   AC_CHECK_LIB(Xft, XftFontOpenXlfd,
163     AC_MSG_CHECKING([for X11/Xft/Xft.h])
164     AC_TRY_LINK(
165 #include <X11/Xlib.h>
166 #include <X11/Xft/Xft.h>
167 , XftFont foo,
168       AC_MSG_RESULT([yes])
169       XFT="yes"
170       test "$XFT2" = "yes" || LIBS="$LIBS -lXft"
171
172       dnl Check for utf8 support in the Xft library
173       dnl AC_CHECK_LIB(Xft, XftDrawStringUtf8,
174       dnl  XFT_UTF8="yes",
175       dnl),
176       ,
177
178       AC_MSG_RESULT([no])
179     )
180   )
181
182 else
183   AC_MSG_RESULT([no])
184 fi
185 if test "$XFT" = "yes"; then
186   AC_DEFINE(XFT,1,[Enable support of the Xft extension])
187   dnl if test "$XFT_UTF8" = "yes"; then
188     dnl AC_DEFINE(XFT_UTF8,1,[Support for Utf8 text in the Xft extension])
189   dnl fi
190 fi
191 AM_CONDITIONAL(XFT, test "$XFT" = "yes")
192 AM_CONDITIONAL(XFT2, test "$XFT2" = "yes");
193         
194 dnl Check for ordered 8bpp dithering
195 ORDEREDPSEUDO=""
196 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
197 AC_ARG_ENABLE(ordered-pseudo,
198 [  --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
199                           dithering @<:@default=no@:>@],
200   if test "$enableval" = "yes"; then
201     AC_MSG_RESULT([yes])
202     ORDEREDPSEUDO="yes" 
203   else
204     AC_MSG_RESULT([no]) 
205   fi,
206   AC_MSG_RESULT([no])
207 )
208 if test "$ORDEREDPSEUDO" = "yes"; then
209   AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
210 fi
211
212 dnl Check whether to include debugging code
213 DEBUG=""
214 AC_MSG_CHECKING([whether to include verbose debugging code])
215 AC_ARG_ENABLE(debug,
216   [  --enable-debug          include verbose debugging code @<:@default=no@:>@],
217   if test "$enableval" = "yes"; then
218     AC_MSG_RESULT([yes])
219     if test "$GCC" = "yes"; then
220        DEBUG="-DDEBUG -fno-inline -g"
221     else
222        DEBUG="-DDEBUG"
223     fi
224   else
225     AC_MSG_RESULT([no])
226     DEBUG="-DNDEBUG"
227   fi,
228   AC_MSG_RESULT([no])
229   DEBUG="-DNDEBUG"
230 )
231 AC_SUBST(DEBUG)
232
233 dnl Check whether to include natural language support (i18n)
234 NLS=""
235 AC_MSG_CHECKING([whether to include NLS support])
236 AC_ARG_ENABLE(nls,
237   [  --enable-nls            include natural language support @<:@default=yes@:>@],
238   if test "$enableval" = "yes"; then
239     AC_MSG_RESULT([yes])
240     NLS="yes"
241   else
242     AC_MSG_RESULT([no])
243   fi,
244   AC_MSG_RESULT([yes])
245   NLS="yes"
246 )
247
248 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
249
250 AC_CHECK_PROGS(gencat_cmd, gencat)
251 if test x$gencat_cmd = "x"; then
252   NLS=""
253 fi
254
255 if test "$NLS" = "yes"; then
256   AC_DEFINE(NLS,1,Include natural language support)
257   AC_SUBST(NLS)
258 fi
259
260 dnl Check for new timed pixmap cache
261 TIMEDCACHE=""
262 AC_MSG_CHECKING([whether to use the timed pixmap cache])
263 AC_ARG_ENABLE(
264   timed-cache,
265 [  --enable-timed-cache    use timed pixmap cache @<:@default=yes@:>@],
266   if test "$enableval" = "yes"; then
267     AC_MSG_RESULT([yes])
268     TIMEDCACHE="yes"
269   else
270     AC_MSG_RESULT([no])
271   fi,
272   AC_MSG_RESULT([yes])
273   TIMEDCACHE="yes"
274 )
275 if test "$TIMEDCACHE" = "yes"; then
276   AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
277 fi
278
279 dnl Check for bitmapped buttons
280 BITMAPBUTTONS=""
281 AC_MSG_CHECKING([whether to include bitmappable buttons])
282 AC_ARG_ENABLE(
283   bitmap-buttons,
284 [  --enable-bitmap-buttons include bitmappable buttons @<:@default=yes@:>@],
285   if test x$enableval = "xyes"; then
286     AC_MSG_RESULT([yes])
287     BITMAPBUTTONS="yes"
288   else
289     AC_MSG_RESULT([no])
290   fi,
291   AC_MSG_RESULT([yes])
292   BITMAPBUTTONS="yes"
293 )
294 if test x$BITMAPBUTTONS = "xyes"; then
295   AC_DEFINE(BITMAPBUTTONS,1,Include bitmappable buttons)
296 fi
297
298 dnl Determine the return type of signal handlers
299 AC_TYPE_SIGNAL
300
301 dnl Print results
302 AC_MSG_RESULT([])
303 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
304 AC_MSG_RESULT([])
305 AC_MSG_RESULT([Using '$prefix' for installation.])
306 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
307 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
308 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
309 AC_MSG_RESULT([])
310
311 dnl Output files
312 AM_CONFIG_HEADER(config.h)
313 AC_OUTPUT(Makefile
314 src/Makefile
315 util/Makefile
316 util/epist/Makefile
317 data/Makefile
318 data/styles/Makefile
319 data/buttons/Makefile
320 doc/Makefile
321 nls/Makefile
322 nls/C/Makefile
323 nls/da_DK/Makefile
324 nls/de_DE/Makefile
325 nls/es_AR/Makefile
326 nls/es_ES/Makefile
327 nls/et_EE/Makefile
328 nls/fr_FR/Makefile
329 nls/hu_HU/Makefile
330 nls/it_IT/Makefile
331 nls/ja_JP/Makefile
332 nls/ko_KR/Makefile
333 nls/lv_LV/Makefile
334 nls/no_NO/Makefile
335 nls/pl_PL/Makefile
336 nls/nl_NL/Makefile
337 nls/pt_BR/Makefile
338 nls/ro_RO/Makefile
339 nls/ru_RU/Makefile
340 nls/sk_SK/Makefile
341 nls/sl_SI/Makefile
342 nls/sv_SE/Makefile
343 nls/tr_TR/Makefile
344 nls/uk_UA/Makefile
345 nls/zh_CN/Makefile
346 nls/zh_TW/Makefile
347 version.h)