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