]> icculus.org git repositories - mikachu/openbox.git/blob - configure.in
adding .cvsignore files to the repository to clean up the output whenever you commit...
[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 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="yes",
76       AC_MSG_RESULT([no])
77     )
78   )
79 else
80   AC_MSG_RESULT([no])
81 fi
82 if test x$SHAPE = "xyes"; then
83   LIBS="$LIBS -lXext"
84   AC_DEFINE(SHAPE,1,Enable support of the XShape extension)
85 fi
86
87 dnl Check for the Slit
88 SLIT=""
89 AC_MSG_CHECKING([whether to include the Slit])
90 AC_ARG_ENABLE(
91   slit, [  --enable-slit           include code for the Slit [default=yes]],
92   if test x$enableval = "xyes"; then
93     AC_MSG_RESULT([yes])
94     SLIT="yes"
95   else
96     AC_MSG_RESULT([no])
97   fi,
98   AC_MSG_RESULT([yes])
99   SLIT="yes"
100 )
101 if test x$SLIT = "xyes"; then
102   AC_DEFINE(SLIT,1,Enable the Slit)
103 fi
104
105 dnl Check for ordered 8bpp dithering
106 ORDEREDPSEUDO=""
107 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
108 AC_ARG_ENABLE(ordered-pseudo,
109 [  --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
110                           dithering [default=no]],
111   if test x$enableval = "xyes"; then
112     AC_MSG_RESULT([yes])
113     ORDEREDPSEUDO="yes" 
114   else
115     AC_MSG_RESULT([no]) 
116   fi,
117   AC_MSG_RESULT([no])
118 )
119 if test x$ORDEREDPSEUDO = "xyes"; then
120   AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
121 fi
122
123 dnl Check for event clobbering
124 CLOBBER=""
125 AC_MSG_CHECKING([whether to intercept mouse events to clients])
126 AC_ARG_ENABLE(clobber,
127 [  --enable-clobber        intercept mouse events to clients when num lock 
128                           or scroll lock are on [default=yes]],
129   if test x$enableval = "xno"; then
130     AC_MSG_RESULT([no])
131     CLOBBER="no"
132   else
133     AC_MSG_RESULT([yes]) 
134   fi,
135   AC_MSG_RESULT([yes])
136 )
137 if test x$CLOBBER = "xno"; then
138   AC_DEFINE(NOCLOBBER,1,Disable grabbing of mouse events when num/scoll lock is pressed)
139 fi
140
141 dnl Check whether to include debugging code
142 DEBUG=""
143 AC_MSG_CHECKING([whether to include verbose debugging code])
144 AC_ARG_ENABLE(debug,
145   [  --enable-debug          include verbose debugging code [default=no]],
146   if test x$enableval = "xyes"; then
147     AC_MSG_RESULT([yes])
148     DEBUG="-DDEBUG -Wall -W"
149   else
150     AC_MSG_RESULT([no])
151     DEBUG="-DNDEBUG"
152   fi,
153   AC_MSG_RESULT([no])
154   DEBUG="-DNDEBUG"
155 )
156 AC_SUBST(DEBUG)
157
158 dnl Check whether to include natural language support (i18n)
159 NLS=""
160 AC_MSG_CHECKING([whether to include NLS support])
161 AC_ARG_ENABLE(nls,
162   [  --enable-nls            include natural language support [default=yes]],
163   if test x$enableval = "xyes"; then
164     AC_MSG_RESULT([yes])
165     NLS="yes"
166   else
167     AC_MSG_RESULT([no])
168   fi,
169   AC_MSG_RESULT([yes])
170   NLS="yes"
171 )
172
173 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
174
175 AC_CHECK_PROGS(gencat_cmd, gencat)
176 if test x$gencat_cmd = "x"; then
177   NLS=""
178 fi
179
180 if test x$NLS = "xyes"; then
181   AC_DEFINE(NLS,1,Include natural language support)
182 fi
183
184 dnl Check for new timed pixmap cache
185 TIMEDCACHE=""
186 AC_MSG_CHECKING([whether to use the timed pixmap cache])
187 AC_ARG_ENABLE(
188   timed-cache,
189 [  --enable-timed-cache    use timed pixmap cache [default=yes]],
190   if test x$enableval = "xyes"; then
191     AC_MSG_RESULT([yes])
192     TIMEDCACHE="yes"
193   else
194     AC_MSG_RESULT([no])
195   fi,
196   AC_MSG_RESULT([yes])
197   TIMEDCACHE="yes"
198 )
199 if test x$TIMEDCACHE = "xyes"; then
200   AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
201 fi
202
203 dnl Determine the return type of signal handlers
204 AC_TYPE_SIGNAL
205
206 dnl Determine if maintainer portions of the Makefiles should be included.
207 AM_MAINTAINER_MODE
208
209 dnl Print results
210 AC_MSG_RESULT([])
211 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
212 AC_MSG_RESULT([])
213 AC_MSG_RESULT([Using '$prefix' for installation.])
214 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
215 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
216 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
217 AC_MSG_RESULT([])
218
219 dnl Output files
220 AM_CONFIG_HEADER(config.h)
221 AC_OUTPUT(Makefile
222 src/Makefile
223 util/Makefile
224 data/Makefile
225 data/styles/Makefile
226 doc/Makefile
227 nls/Makefile
228 nls/C/Makefile
229 nls/da_DK/Makefile
230 nls/de_DE/Makefile
231 nls/es_ES/Makefile
232 nls/et_EE/Makefile
233 nls/fr_FR/Makefile
234 nls/hu_HU/Makefile
235 nls/it_IT/Makefile
236 nls/ja_JP/Makefile
237 nls/nl_NL/Makefile
238 nls/pt_BR/Makefile
239 nls/ru_RU/Makefile
240 nls/sl_SI/Makefile
241 nls/sv_SE/Makefile
242 nls/tr_TR/Makefile
243 nls/uk_UA/Makefile
244 nls/zh_CN/Makefile
245 nls/zh_TW/Makefile
246 version.h)