]> icculus.org git repositories - mikachu/openbox.git/blob - configure.in
changelog fixes
[mikachu/openbox.git] / configure.in
1 dnl configure.in for Openbox
2 dnl Initialize autoconf and automake
3 AC_INIT(src/openbox.cc)
4 AM_INIT_AUTOMAKE(openbox,1.1.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 Xext_lib=""
57
58 dnl Check for XShape extension support and proper library files.
59 SHAPE=""
60 AC_MSG_CHECKING([whether to build support for the XShape extension])
61 AC_ARG_ENABLE(
62   shape, [  --enable-shape          enable support of the XShape extension [default=yes]])
63
64 : ${enableval="yes"}
65 if test x$enableval = "xyes"; then
66   AC_MSG_RESULT([yes])
67   AC_CHECK_LIB(Xext, XShapeCombineShape,
68     AC_MSG_CHECKING([for X11/extensions/shape.h])
69     AC_TRY_LINK(
70 #include <X11/Xlib.h>
71 #include <X11/Xutil.h>
72 #include <X11/extensions/shape.h>
73 , long foo = ShapeSet,
74       AC_MSG_RESULT([yes])
75       SHAPE="-DSHAPE"; Xext_lib="-lXext",
76       AC_MSG_RESULT([no])
77     )
78   )
79 else
80   AC_MSG_RESULT([no])
81 fi
82 AC_SUBST(SHAPE)
83
84 LIBS="$LIBS $Xext_lib"
85
86 dnl Check for the Slit
87 SLIT=""
88 AC_MSG_CHECKING([whether to include the Slit])
89 AC_ARG_ENABLE(
90   slit, [  --enable-slit           include code for the Slit [default=yes]],
91   if test x$enableval = "xyes"; then
92     AC_MSG_RESULT([yes])
93     SLIT="-DSLIT"
94   else
95     AC_MSG_RESULT([no])
96   fi,
97   AC_MSG_RESULT([yes])
98   SLIT="-DSLIT"
99 )
100 AC_SUBST(SLIT)
101
102 dnl Check for the new WM Spec
103 NEWWMSPEC=""
104 AC_MSG_CHECKING([whether to include the new WM Spec (DOES NOTHING)])
105 AC_ARG_ENABLE(
106   newspec,
107 [  --enable-newspec        include code for the new WM Spec (DOES NOTHING)
108                           [default=no]],
109   if test x$enableval = "xyes"; then
110     AC_MSG_RESULT([yes])
111     NEWWMSPEC="-DNEWWMSPEC"   
112   else
113     AC_MSG_RESULT([no])
114   fi,
115   AC_MSG_RESULT([no])
116 )
117 AC_SUBST(NEWWMSPEC)
118
119
120 dnl Check for Interlacing
121 INTERLACE=""
122 AC_MSG_CHECKING([whether to include interlacing image code])
123 AC_ARG_ENABLE(
124   interlace, [  --enable-interlace      include code for image interlacing [default=yes]],
125   if test x$enableval = "xyes"; then
126     AC_MSG_RESULT([yes])
127     INTERLACE="-DINTERLACE"
128   else
129     AC_MSG_RESULT([no])
130   fi,
131   AC_MSG_RESULT([yes])
132   INTERLACE="-DINTERLACE"
133 )
134 AC_SUBST(INTERLACE)
135
136 dnl Check for ordered 8bpp dithering
137 ORDEREDPSEUDO=""
138 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
139 AC_ARG_ENABLE(ordered-pseudo,
140 [  --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
141                           dithering [default=no]],
142   if test x$enableval = "xyes"; then
143     AC_MSG_RESULT([yes])
144     ORDEREDPSEUDO="-DORDEREDPSEUDO" 
145   else
146     AC_MSG_RESULT([no]) 
147   fi,
148   AC_MSG_RESULT([no])
149 )
150 AC_SUBST(ORDEREDPSEUDO)
151
152 dnl Check for event clobbering
153 CLOBBER=""
154 AC_MSG_CHECKING([whether to intercept mouse events to clients])
155 AC_ARG_ENABLE(clobber,
156 [  --enable-clobber        intercept mouse events to clients when num lock 
157                           or scroll lock are on [default=yes]],
158   if test x$enableval = "xno"; then
159     AC_MSG_RESULT([no])
160     CLOBBER="-DNOCLOBBER" 
161   else
162     AC_MSG_RESULT([yes]) 
163   fi,
164   AC_MSG_RESULT([no])
165 )
166 AC_SUBST(CLOBBER)
167
168 dnl Check whether to include debugging code
169 DEBUG=""
170 AC_MSG_CHECKING([whether to include verbose debugging code])
171 AC_ARG_ENABLE(debug,
172   [  --enable-debug          include verbose debugging code [default=no]],
173   if test x$enableval = "xyes"; then
174     AC_MSG_RESULT([yes])
175     DEBUG="-DDEBUG"
176   else
177     AC_MSG_RESULT([no])
178   fi,
179   AC_MSG_RESULT([no])
180 )
181 AC_SUBST(DEBUG)
182
183 dnl Check whether to include natural language support (i18n)
184 NLS=""
185 AC_MSG_CHECKING([whether to include NLS support])
186 AC_ARG_ENABLE(nls,
187   [  --enable-nls            include natural language support [default=yes]],
188   if test x$enableval = "xyes"; then
189     AC_MSG_RESULT([yes])
190     NLS="-DNLS"
191   else
192     AC_MSG_RESULT([no])
193   fi,
194   AC_MSG_RESULT([yes])
195   NLS="-DNLS"
196 )
197 AC_SUBST(NLS)
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
207 dnl Check for new timed pixmap cache
208 TIMEDCACHE=""
209 AC_MSG_CHECKING([whether to use the new timed pixmap cache])
210 AC_ARG_ENABLE(
211   timed-cache,
212 [  --enable-timed-cache    use new timed pixmap cache [default=yes]],
213   if test x$enableval = "xyes"; then
214     AC_MSG_RESULT([yes])
215     TIMEDCACHE="-DTIMEDCACHE"
216   else
217     AC_MSG_RESULT([no])
218   fi,
219   AC_MSG_RESULT([yes])
220   TIMEDCACHE="-DTIMEDCACHE"
221 )
222 AC_SUBST(TIMEDCACHE)
223
224 dnl Determine the return type of signal handlers
225 AC_TYPE_SIGNAL
226
227 dnl Determine if maintainer portions of the Makefiles should be included.
228 AM_MAINTAINER_MODE
229
230 dnl Print results
231 AC_MSG_RESULT([])
232 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
233 AC_MSG_RESULT([])
234 AC_MSG_RESULT([Using '$prefix' for installation.])
235 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
236 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
237 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
238 AC_MSG_RESULT([])
239
240 dnl Output files
241 AM_CONFIG_HEADER(config.h)
242 AC_OUTPUT(Makefile
243 src/Makefile
244 util/Makefile
245 data/Makefile
246 data/styles/Makefile
247 doc/Makefile
248 dnl doc/ja_JP/Makefile
249 dnl doc/nl_NL/Makefile
250 dnl doc/sl_SI/Makefile
251 nls/Makefile
252 nls/C/Makefile
253 nls/da_DK/Makefile
254 nls/de_DE/Makefile
255 nls/es_ES/Makefile
256 nls/et_EE/Makefile
257 nls/fr_FR/Makefile
258 nls/it_IT/Makefile
259 nls/ja_JP/Makefile
260 nls/nl_NL/Makefile
261 nls/pt_BR/Makefile
262 nls/ru_RU/Makefile
263 nls/sl_SI/Makefile
264 nls/sv_SE/Makefile
265 nls/tr_TR/Makefile
266 nls/zh_CN/Makefile
267 version.h)