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)
7 dnl Determine default prefix
8 test x$prefix = "xNONE" && prefix="$ac_default_prefix"
10 dnl Check for various flavors of UNIX(r)
14 dnl Locate required external software
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.])
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)
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")
35 dnl Check for X headers and libraries
39 test x$no_x = "xyes" && AC_MSG_ERROR([Openbox requires the X Window System libraries and headers.])
41 test x$x_includes = "x" && x_includes="/usr/include"
42 test x$x_libraries = "x" && x_libraries="/usr/lib"
44 CFLAGS="$CFLAGS $X_CFLAGS"
45 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
47 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
49 dnl Check for required functions in -lX11
50 AC_CHECK_LIB(X11, XOpenDisplay,
52 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
55 LIBS="$LIBS $X_EXTRA_LIBS"
59 dnl Check for XShape extension support and proper library files.
61 AC_MSG_CHECKING([whether to build support for the XShape extension])
63 shape, [ --enable-shape enable support of the XShape extension [default=yes]])
66 if test x$enableval = "xyes"; then
68 AC_CHECK_LIB(Xext, XShapeCombineShape,
69 AC_MSG_CHECKING([for X11/extensions/shape.h])
72 #include <X11/Xutil.h>
73 #include <X11/extensions/shape.h>
74 , long foo = ShapeSet,
76 SHAPE="-DSHAPE"; Xext_lib="-lXext",
85 LIBS="$LIBS $Xext_lib"
87 dnl Check for the Slit
89 AC_MSG_CHECKING([whether to include the Slit])
91 slit, [ --enable-slit include code for the Slit [default=yes]],
92 if test x$enableval = "xyes"; then
103 dnl Check for ordered 8bpp dithering
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
111 ORDEREDPSEUDO="-DORDEREDPSEUDO"
117 AC_SUBST(ORDEREDPSEUDO)
119 dnl Check for event clobbering
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
127 CLOBBER="-DNOCLOBBER"
135 dnl Check whether to include debugging code
137 AC_MSG_CHECKING([whether to include verbose debugging code])
139 [ --enable-debug include verbose debugging code [default=no]],
140 if test x$enableval = "xyes"; then
142 DEBUG="-DDEBUG -Wall -W"
150 dnl Check whether to include natural language support (i18n)
152 AC_MSG_CHECKING([whether to include NLS support])
154 [ --enable-nls include natural language support [default=yes]],
155 if test x$enableval = "xyes"; then
166 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
168 AC_CHECK_PROGS(gencat_cmd, gencat)
169 if test x$gencat_cmd = "x"; then
174 dnl Check for new timed pixmap cache
176 AC_MSG_CHECKING([whether to use the new timed pixmap cache])
179 [ --enable-timed-cache use new timed pixmap cache [default=yes]],
180 if test x$enableval = "xyes"; then
182 TIMEDCACHE="-DTIMEDCACHE"
187 TIMEDCACHE="-DTIMEDCACHE"
191 dnl Determine the return type of signal handlers
194 dnl Determine if maintainer portions of the Makefiles should be included.
199 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
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.])
208 AM_CONFIG_HEADER(config.h)