1 dnl configure.in for Openbox
2 dnl Initialize autoconf and automake
3 AC_INIT(src/blackbox.cc)
4 AM_INIT_AUTOMAKE(openbox,2.1.0,no-define)
6 dnl Determine default prefix
7 test x$prefix = "xNONE" && prefix="$ac_default_prefix"
9 dnl Check for various flavors of UNIX(r)
13 dnl Locate required external software
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.])
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)
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")
34 dnl Check for X headers and libraries
38 test x$no_x = "xyes" && AC_MSG_ERROR([Openbox requires the X Window System libraries and headers.])
40 test x$x_includes = "x" && x_includes="/usr/include"
41 test x$x_libraries = "x" && x_libraries="/usr/lib"
43 CFLAGS="$CFLAGS $X_CFLAGS"
44 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
46 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
48 AC_MSG_CHECKING(for GCC)
49 if test x$GCC = "xyes"; then
51 CXXFLAGS="${CXXFLAGS} -Wall -W"
53 AC_MSG_RESULT([no, trying other compilers])
54 AC_MSG_CHECKING(for MIPSpro)
55 mips_pro_ver=`$CC -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
56 if test "x$mips_pro_ver" = "x"; then
59 AC_MSG_RESULT([yes, version $mips_pro_ver.])
60 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
61 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
62 if test "x$lang_std_not_set" = "x"; then
63 AC_MSG_RESULT([not set, setting.])
64 CXXFLAGS="${CXXFLAGS} -LANG:std"
66 AC_MSG_RESULT([already set.])
71 dnl Check for required functions in -lX11
72 AC_CHECK_LIB(X11, XOpenDisplay,
74 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
77 LIBS="$LIBS $X_EXTRA_LIBS"
79 dnl Check for XShape extension support and proper library files.
81 AC_MSG_CHECKING([whether to build support for the XShape extension])
83 shape, [ --enable-shape enable support of the XShape extension [default=yes]])
86 if test x$enableval = "xyes"; then
88 AC_CHECK_LIB(Xext, XShapeCombineShape,
89 AC_MSG_CHECKING([for X11/extensions/shape.h])
92 #include <X11/Xutil.h>
93 #include <X11/extensions/shape.h>
94 , long foo = ShapeSet,
103 if test x$SHAPE = "xyes"; then
105 AC_DEFINE(SHAPE,1,Enable support of the XShape extension)
108 dnl Check for Xinerama extension support and proper library files.
110 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
112 xinerama, [ --enable-xinerama enable support of the Xinerama extension [default=no]],
113 if test x$enableval = "xyes"; then
116 AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
117 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
119 #include <X11/Xlib.h>
120 #include <X11/extensions/Xinerama.h>
121 , XineramaScreenInfo foo,
124 LIBS="$LIBS -lXinerama",
134 if test x$XINERAMA = "xyes"; then
135 AC_DEFINE(XINERAMA,1,Enable support of the Xinerama extension)
138 dnl Check for Xft extension support and proper library files.
140 AC_MSG_CHECKING([whether to build support for the Xft extension])
142 xft, [ --enable-xft enable support of the Xft extension [default=yes]])
144 if test x$enableval = "xyes"; then
147 AC_CHECK_LIB(Xft, XftFontOpenXlfd,
148 AC_MSG_CHECKING([for X11/Xft/Xft.h])
150 #include <X11/Xlib.h>
151 #include <X11/Xft/Xft.h>
163 if test x$XFT = "xyes"; then
164 AC_DEFINE(XFT,1,Enable support of the Xft extension)
167 dnl Check for ordered 8bpp dithering
169 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
170 AC_ARG_ENABLE(ordered-pseudo,
171 [ --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
172 dithering [default=no]],
173 if test x$enableval = "xyes"; then
181 if test x$ORDEREDPSEUDO = "xyes"; then
182 AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
185 dnl Check whether to include debugging code
187 AC_MSG_CHECKING([whether to include verbose debugging code])
189 [ --enable-debug include verbose debugging code [default=no]],
190 if test x$enableval = "xyes"; then
192 if test x$GCC = "xyes"; then
193 DEBUG="-DDEBUG -fno-inline -g"
206 dnl Check whether to include natural language support (i18n)
208 AC_MSG_CHECKING([whether to include NLS support])
210 [ --enable-nls include natural language support [default=yes]],
211 if test x$enableval = "xyes"; then
221 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
223 AC_CHECK_PROGS(gencat_cmd, gencat)
224 if test x$gencat_cmd = "x"; then
228 if test x$NLS = "xyes"; then
229 AC_DEFINE(NLS,1,Include natural language support)
233 dnl Check for new timed pixmap cache
235 AC_MSG_CHECKING([whether to use the timed pixmap cache])
238 [ --enable-timed-cache use timed pixmap cache [default=yes]],
239 if test x$enableval = "xyes"; then
248 if test x$TIMEDCACHE = "xyes"; then
249 AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
252 dnl Determine the return type of signal handlers
255 dnl Determine if maintainer portions of the Makefiles should be included.
260 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
262 AC_MSG_RESULT([Using '$prefix' for installation.])
263 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
264 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
265 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
269 AM_CONFIG_HEADER(config.h)