]> icculus.org git repositories - mikachu/openbox.git/blob - configure.in
make Xft default to off, you have ot --enable-xft now
[mikachu/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.0.0,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_CHECK_PROGS(regex_cmd, sed)
19 if test x$regex_cmd = "x"; then
20   AC_MSG_ERROR([error. sed is required to build the default menu file.])
21 fi
22
23 dnl Check for system header files
24 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)
25 AC_HEADER_TIME
26
27 dnl Check for existance of basename(), setlocale() and strftime()
28 AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename,
29                           AC_DEFINE(HAVE_BASENAME) LIBS="$LIBS -lgen"))
30 AC_CHECK_FUNCS(getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose)
31 AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl")
32 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
33
34 dnl Check for X headers and libraries
35 AC_PATH_X
36 AC_PATH_XTRA
37
38 test x$no_x = "xyes" && AC_MSG_ERROR([Openbox requires the X Window System libraries and headers.])
39
40 test x$x_includes = "x" && x_includes="/usr/include"
41 test x$x_libraries = "x" && x_libraries="/usr/lib"
42
43 CFLAGS="$CFLAGS $X_CFLAGS"
44 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
45 LIBS="$LIBS $X_LIBS"
46 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
47
48 dnl Check for required functions in -lX11
49 AC_CHECK_LIB(X11, XOpenDisplay,
50   LIBS="$LIBS -lX11",
51   AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
52 )
53
54 LIBS="$LIBS $X_EXTRA_LIBS"
55
56 dnl Check for XShape extension support and proper library files.
57 SHAPE=""
58 AC_MSG_CHECKING([whether to build support for the XShape extension])
59 AC_ARG_ENABLE(
60   shape, [  --enable-shape          enable support of the XShape extension [default=yes]])
61
62 : ${enableval="yes"}
63 if test x$enableval = "xyes"; then
64   AC_MSG_RESULT([yes])
65   AC_CHECK_LIB(Xext, XShapeCombineShape,
66         AC_MSG_CHECKING([for X11/extensions/shape.h])
67         AC_TRY_LINK(
68 #include <X11/Xlib.h>
69 #include <X11/Xutil.h>
70 #include <X11/extensions/shape.h>
71 , long foo = ShapeSet,
72           AC_MSG_RESULT([yes])
73           SHAPE="yes",
74           AC_MSG_RESULT([no])
75         )
76   )
77 else
78   AC_MSG_RESULT([no])
79 fi
80 if test x$SHAPE = "xyes"; then
81   LIBS="$LIBS -lXext"
82   AC_DEFINE(SHAPE,1,Enable support of the XShape extension)
83 fi
84
85 dnl Check for Xft extension support and proper library files.
86 XFT=""
87 AC_MSG_CHECKING([whether to build support for the Xft extension])
88 AC_ARG_ENABLE(
89   xft, [  --enable-xft             enable support of the Xft extension [default=no]],
90   if test x$enableval = "xyes"; then
91     AC_MSG_RESULT([yes])
92     AC_CHECK_LIB(Xft, XftFontOpenXlfd,
93       AC_MSG_CHECKING([for X11/Xft/Xft.h])
94       AC_TRY_LINK(
95 #include <X11/Xlib.h>
96 #include <X11/Xft/Xft.h>
97       , XftFont foo,
98         AC_MSG_RESULT([yes])
99         XFT="yes",
100         AC_MSG_RESULT([no])
101       )
102     )
103   else
104     AC_MSG_RESULT([no])
105   fi,
106         AC_MSG_RESULT([no])
107 )
108 if test x$XFT = "xyes"; then
109   LIBS="$LIBS -lXft"
110   AC_DEFINE(XFT,1,Enable support of the Xft extension)
111 fi
112
113 dnl Check for the Slit
114 SLIT=""
115 AC_MSG_CHECKING([whether to include the Slit])
116 AC_ARG_ENABLE(
117   slit, [  --enable-slit           include code for the Slit [default=yes]],
118   if test x$enableval = "xyes"; then
119     AC_MSG_RESULT([yes])
120     SLIT="yes"
121   else
122     AC_MSG_RESULT([no])
123   fi,
124   AC_MSG_RESULT([yes])
125   SLIT="yes"
126 )
127 if test x$SLIT = "xyes"; then
128   AC_DEFINE(SLIT,1,Enable the Slit)
129 fi
130
131 dnl Check for ordered 8bpp dithering
132 ORDEREDPSEUDO=""
133 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
134 AC_ARG_ENABLE(ordered-pseudo,
135 [  --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
136                           dithering [default=no]],
137   if test x$enableval = "xyes"; then
138     AC_MSG_RESULT([yes])
139     ORDEREDPSEUDO="yes" 
140   else
141     AC_MSG_RESULT([no]) 
142   fi,
143   AC_MSG_RESULT([no])
144 )
145 if test x$ORDEREDPSEUDO = "xyes"; then
146   AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
147 fi
148
149 dnl Check for event clobbering
150 CLOBBER=""
151 AC_MSG_CHECKING([whether to intercept mouse events to clients])
152 AC_ARG_ENABLE(clobber,
153 [  --enable-clobber        intercept mouse events to clients when num lock 
154                           or scroll lock are on [default=yes]],
155   if test x$enableval = "xno"; then
156     AC_MSG_RESULT([no])
157     CLOBBER="no"
158   else
159     AC_MSG_RESULT([yes]) 
160   fi,
161   AC_MSG_RESULT([yes])
162 )
163 if test x$CLOBBER = "xno"; then
164   AC_DEFINE(NOCLOBBER,1,Disable grabbing of mouse events when num/scoll lock is pressed)
165 fi
166
167 dnl Check whether to include debugging code
168 DEBUG=""
169 AC_MSG_CHECKING([whether to include verbose debugging code])
170 AC_ARG_ENABLE(debug,
171   [  --enable-debug          include verbose debugging code [default=no]],
172   if test x$enableval = "xyes"; then
173     AC_MSG_RESULT([yes])
174     DEBUG="-DDEBUG -Wall -W"
175   else
176     AC_MSG_RESULT([no])
177     DEBUG="-DNDEBUG"
178   fi,
179   AC_MSG_RESULT([no])
180   DEBUG="-DNDEBUG"
181 )
182 AC_SUBST(DEBUG)
183
184 dnl Check whether to include natural language support (i18n)
185 NLS=""
186 AC_MSG_CHECKING([whether to include NLS support])
187 AC_ARG_ENABLE(nls,
188   [  --enable-nls            include natural language support [default=yes]],
189   if test x$enableval = "xyes"; then
190     AC_MSG_RESULT([yes])
191     NLS="yes"
192   else
193     AC_MSG_RESULT([no])
194   fi,
195   AC_MSG_RESULT([yes])
196   NLS="yes"
197 )
198
199 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
200
201 AC_CHECK_PROGS(gencat_cmd, gencat)
202 if test x$gencat_cmd = "x"; then
203   NLS=""
204 fi
205
206 if test x$NLS = "xyes"; then
207   AC_DEFINE(NLS,1,Include natural language support)
208   AC_SUBST(NLS)
209 fi
210
211 dnl Check for new timed pixmap cache
212 TIMEDCACHE=""
213 AC_MSG_CHECKING([whether to use the timed pixmap cache])
214 AC_ARG_ENABLE(
215   timed-cache,
216 [  --enable-timed-cache    use timed pixmap cache [default=yes]],
217   if test x$enableval = "xyes"; then
218     AC_MSG_RESULT([yes])
219     TIMEDCACHE="yes"
220   else
221     AC_MSG_RESULT([no])
222   fi,
223   AC_MSG_RESULT([yes])
224   TIMEDCACHE="yes"
225 )
226 if test x$TIMEDCACHE = "xyes"; then
227   AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
228 fi
229
230 dnl Determine the return type of signal handlers
231 AC_TYPE_SIGNAL
232
233 dnl Determine if maintainer portions of the Makefiles should be included.
234 AM_MAINTAINER_MODE
235
236 dnl Print results
237 AC_MSG_RESULT([])
238 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
239 AC_MSG_RESULT([])
240 AC_MSG_RESULT([Using '$prefix' for installation.])
241 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
242 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
243 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
244 AC_MSG_RESULT([])
245
246 dnl Output files
247 AM_CONFIG_HEADER(config.h)
248 AC_OUTPUT(Makefile
249 src/Makefile
250 util/Makefile
251 data/Makefile
252 data/styles/Makefile
253 doc/Makefile
254 nls/Makefile
255 nls/C/Makefile
256 nls/da_DK/Makefile
257 nls/de_DE/Makefile
258 nls/es_ES/Makefile
259 nls/et_EE/Makefile
260 nls/fr_FR/Makefile
261 nls/hu_HU/Makefile
262 nls/it_IT/Makefile
263 nls/ja_JP/Makefile
264 nls/ko_KR/Makefile
265 nls/nl_NL/Makefile
266 nls/pt_BR/Makefile
267 nls/ru_RU/Makefile
268 nls/sl_SI/Makefile
269 nls/sv_SE/Makefile
270 nls/tr_TR/Makefile
271 nls/uk_UA/Makefile
272 nls/zh_CN/Makefile
273 nls/zh_TW/Makefile
274 version.h)