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