1 dnl configure.in for Openbox
2 dnl Initialize autoconf and automake
3 AC_INIT(src/blackbox.cc)
4 AM_INIT_AUTOMAKE(openbox,2.2.1,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
20 AC_CHECK_PROGS(regex_cmd, sed)
21 if test x$regex_cmd = "x"; then
22 AC_MSG_ERROR([error. sed is required to build the default menu file.])
25 dnl Check for system header files
26 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)
29 dnl Check for existance of basename(), setlocale() and strftime()
30 AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename,
31 AC_DEFINE(HAVE_BASENAME) LIBS="$LIBS -lgen"))
32 AC_CHECK_FUNCS(getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose)
33 AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl")
34 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
36 dnl Check for X headers and libraries
40 test "$no_x" = "yes" && AC_MSG_ERROR([Openbox requires the X Window System libraries and headers.])
42 test x$x_includes = "x" && x_includes="/usr/include"
43 test x$x_libraries = "x" && x_libraries="/usr/lib"
45 CFLAGS="$CFLAGS $X_CFLAGS"
46 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
48 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
50 AC_MSG_CHECKING(for GCC)
51 if test "$GCC" = "yes"; then
53 CXXFLAGS="${CXXFLAGS} -Wall -W"
55 AC_MSG_RESULT([no, trying other compilers])
56 AC_MSG_CHECKING(for MIPSpro)
57 mips_pro_ver=`$CC -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
58 if test "x$mips_pro_ver" = "x"; then
61 AC_MSG_RESULT([yes, version $mips_pro_ver.])
62 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
63 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
64 if test "x$lang_std_not_set" = "x"; then
65 AC_MSG_RESULT([not set, setting.])
66 CXXFLAGS="${CXXFLAGS} -LANG:std"
68 AC_MSG_RESULT([already set.])
73 dnl Check for required functions in -lX11
74 AC_CHECK_LIB(X11, XOpenDisplay,
76 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
79 LIBS="$LIBS $X_EXTRA_LIBS"
81 dnl Check for XShape extension support and proper library files.
83 AC_MSG_CHECKING([whether to build support for the XShape extension])
85 shape, [ --enable-shape enable support of the XShape extension [default=yes]])
88 if test "$enableval" = "yes"; then
90 AC_CHECK_LIB(Xext, XShapeCombineShape,
91 AC_MSG_CHECKING([for X11/extensions/shape.h])
94 #include <X11/Xutil.h>
95 #include <X11/extensions/shape.h>
96 , long foo = ShapeSet,
105 if test "$SHAPE" = "yes"; then
107 AC_DEFINE(SHAPE,1,Enable support of the XShape extension)
110 dnl Check for Xinerama extension support and proper library files.
112 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
114 xinerama, [ --enable-xinerama enable support of the Xinerama extension [default=no]],
115 if test "$enableval" = "yes"; then
118 AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
119 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
121 #include <X11/Xlib.h>
122 #include <X11/extensions/Xinerama.h>
123 , XineramaScreenInfo foo,
126 LIBS="$LIBS -lXinerama",
136 if test "$XINERAMA" = "yes"; then
137 AC_DEFINE(XINERAMA,1,Enable support of the Xinerama extension)
140 dnl Check for Xft extension support and proper library files.
144 AC_MSG_CHECKING([whether to build support for the Xft extension])
146 xft, [ --enable-xft enable support of the Xft extension [default=yes]])
148 if test "$enableval" = "yes"; then
150 if pkg-config xft; then
152 AC_MSG_RESULT([version 2])
153 CXXFLAGS="`pkg-config --cflags xft` ${CXXFLAGS}"
154 LIBS="${LIBS} `pkg-config --libs xft`"
156 AC_MSG_RESULT([version 1])
159 AC_CHECK_LIB(Xft, XftFontOpenXlfd,
160 AC_MSG_CHECKING([for X11/Xft/Xft.h])
162 #include <X11/Xlib.h>
163 #include <X11/Xft/Xft.h>
167 test "$XFT2" = "yes" || LIBS="$LIBS -lXft"
169 dnl Check for utf8 support in the Xft library
170 dnl AC_CHECK_LIB(Xft, XftDrawStringUtf8,
182 if test "$XFT" = "yes"; then
183 AC_DEFINE(XFT,1,[Enable support of the Xft extension])
184 dnl if test "$XFT_UTF8" = "yes"; then
185 dnl AC_DEFINE(XFT_UTF8,1,[Support for Utf8 text in the Xft extension])
188 AM_CONDITIONAL(XFT, test "$XFT" = "yes")
189 AM_CONDITIONAL(XFT2, test "$XFT2" = "yes");
191 dnl Check for ordered 8bpp dithering
193 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
194 AC_ARG_ENABLE(ordered-pseudo,
195 [ --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
196 dithering [default=no]],
197 if test "$enableval" = "yes"; then
205 if test "$ORDEREDPSEUDO" = "yes"; then
206 AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
209 dnl Check whether to include debugging code
211 AC_MSG_CHECKING([whether to include verbose debugging code])
213 [ --enable-debug include verbose debugging code [default=no]],
214 if test "$enableval" = "yes"; then
216 if test "$GCC" = "yes"; then
217 DEBUG="-DDEBUG -fno-inline -g"
230 dnl Check whether to include natural language support (i18n)
232 AC_MSG_CHECKING([whether to include NLS support])
234 [ --enable-nls include natural language support [default=yes]],
235 if test "$enableval" = "yes"; then
245 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
247 AC_CHECK_PROGS(gencat_cmd, gencat)
248 if test x$gencat_cmd = "x"; then
252 if test "$NLS" = "yes"; then
253 AC_DEFINE(NLS,1,Include natural language support)
257 dnl Check for new timed pixmap cache
259 AC_MSG_CHECKING([whether to use the timed pixmap cache])
262 [ --enable-timed-cache use timed pixmap cache [default=yes]],
263 if test "$enableval" = "yes"; then
272 if test "$TIMEDCACHE" = "yes"; then
273 AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
276 dnl Check for bitmapped buttons
278 AC_MSG_CHECKING([whether to include bitmappable buttons])
281 [ --enable-bitmap-buttons include bitmappable buttons [default=yes]],
282 if test x$enableval = "xyes"; then
291 if test x$BITMAPBUTTONS = "xyes"; then
292 AC_DEFINE(BITMAPBUTTONS,1,Include bitmappable buttons)
295 dnl Determine the return type of signal handlers
298 dnl Determine if maintainer portions of the Makefiles should be included.
303 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
305 AC_MSG_RESULT([Using '$prefix' for installation.])
306 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
307 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
308 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
312 AM_CONFIG_HEADER(config.h)