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
18 dnl Determine if maintainer portions of the Makefiles should be included.
23 AC_CHECK_PROGS(regex_cmd, sed)
24 if test x$regex_cmd = "x"; then
25 AC_MSG_ERROR([error. sed is required to build the default menu file.])
28 dnl Check for system header files
29 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)
32 dnl Check for existance of basename(), setlocale() and strftime()
33 AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename,
34 AC_DEFINE(HAVE_BASENAME) LIBS="$LIBS -lgen"))
35 AC_CHECK_FUNCS(getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose)
36 AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl")
37 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
39 dnl Check for X headers and libraries
43 test "$no_x" = "yes" && AC_MSG_ERROR([Openbox requires the X Window System libraries and headers.])
45 test x$x_includes = "x" && x_includes="/usr/include"
46 test x$x_libraries = "x" && x_libraries="/usr/lib"
48 CFLAGS="$CFLAGS $X_CFLAGS"
49 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
51 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
53 AC_MSG_CHECKING(for GCC)
54 if test "$GCC" = "yes"; then
56 CXXFLAGS="${CXXFLAGS} -Wall -W"
58 AC_MSG_RESULT([no, trying other compilers])
59 AC_MSG_CHECKING(for MIPSpro)
60 mips_pro_ver=`$CC -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
61 if test "x$mips_pro_ver" = "x"; then
64 AC_MSG_RESULT([yes, version $mips_pro_ver.])
65 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
66 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
67 if test "x$lang_std_not_set" = "x"; then
68 AC_MSG_RESULT([not set, setting.])
69 CXXFLAGS="${CXXFLAGS} -LANG:std"
71 AC_MSG_RESULT([already set.])
76 dnl Check for required functions in -lX11
77 AC_CHECK_LIB(X11, XOpenDisplay,
79 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
82 LIBS="$LIBS $X_EXTRA_LIBS"
84 dnl Check for XShape extension support and proper library files.
86 AC_MSG_CHECKING([whether to build support for the XShape extension])
88 shape, [ --enable-shape enable support of the XShape extension @<:@default=yes@:>@])
91 if test "$enableval" = "yes"; then
93 AC_CHECK_LIB(Xext, XShapeCombineShape,
94 AC_MSG_CHECKING([for X11/extensions/shape.h])
97 #include <X11/Xutil.h>
98 #include <X11/extensions/shape.h>
99 , long foo = ShapeSet,
108 if test "$SHAPE" = "yes"; then
110 AC_DEFINE(SHAPE,1,Enable support of the XShape extension)
113 dnl Check for Xinerama extension support and proper library files.
115 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
117 xinerama, [ --enable-xinerama enable support of the Xinerama extension @<:@default=no@:>@],
118 if test "$enableval" = "yes"; then
121 AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
122 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
124 #include <X11/Xlib.h>
125 #include <X11/extensions/Xinerama.h>
126 , XineramaScreenInfo foo,
129 LIBS="$LIBS -lXinerama",
139 if test "$XINERAMA" = "yes"; then
140 AC_DEFINE(XINERAMA,1,Enable support of the Xinerama extension)
143 dnl Check for Xft extension support and proper library files.
147 AC_MSG_CHECKING([whether to build support for the Xft extension])
149 xft, [ --enable-xft enable support of the Xft extension @<:@default=yes@:>@])
151 if test "$enableval" = "yes"; then
153 if pkg-config xft; then
155 AC_MSG_RESULT([version 2])
156 CXXFLAGS="`pkg-config --cflags xft` ${CXXFLAGS}"
157 LIBS="${LIBS} `pkg-config --libs xft`"
159 AC_MSG_RESULT([version 1])
162 AC_CHECK_LIB(Xft, XftFontOpenXlfd,
163 AC_MSG_CHECKING([for X11/Xft/Xft.h])
165 #include <X11/Xlib.h>
166 #include <X11/Xft/Xft.h>
170 test "$XFT2" = "yes" || LIBS="$LIBS -lXft"
172 dnl Check for utf8 support in the Xft library
173 dnl AC_CHECK_LIB(Xft, XftDrawStringUtf8,
185 if test "$XFT" = "yes"; then
186 AC_DEFINE(XFT,1,[Enable support of the Xft extension])
187 dnl if test "$XFT_UTF8" = "yes"; then
188 dnl AC_DEFINE(XFT_UTF8,1,[Support for Utf8 text in the Xft extension])
191 AM_CONDITIONAL(XFT, test "$XFT" = "yes")
192 AM_CONDITIONAL(XFT2, test "$XFT2" = "yes")
194 dnl Check for ordered 8bpp dithering
196 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
197 AC_ARG_ENABLE(ordered-pseudo,
198 [ --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
199 dithering @<:@default=no@:>@],
200 if test "$enableval" = "yes"; then
208 if test "$ORDEREDPSEUDO" = "yes"; then
209 AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
212 dnl Check whether to include debugging code
214 AC_MSG_CHECKING([whether to include verbose debugging code])
216 [ --enable-debug include verbose debugging code @<:@default=no@:>@],
217 if test "$enableval" = "yes"; then
219 if test "$GCC" = "yes"; then
220 DEBUG="-DDEBUG -fno-inline -g"
233 dnl Check whether to include natural language support (i18n)
235 AC_MSG_CHECKING([whether to include NLS support])
237 [ --enable-nls include natural language support @<:@default=yes@:>@],
238 if test "$enableval" = "yes"; then
248 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
250 AC_CHECK_PROGS(gencat_cmd, gencat)
251 if test x$gencat_cmd = "x"; then
255 if test "$NLS" = "yes"; then
256 AC_DEFINE(NLS,1,Include natural language support)
260 dnl Check for new timed pixmap cache
262 AC_MSG_CHECKING([whether to use the timed pixmap cache])
265 [ --enable-timed-cache use timed pixmap cache @<:@default=yes@:>@],
266 if test "$enableval" = "yes"; then
275 if test "$TIMEDCACHE" = "yes"; then
276 AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
279 dnl Check for bitmapped buttons
281 AC_MSG_CHECKING([whether to include bitmappable buttons])
284 [ --enable-bitmap-buttons include bitmappable buttons @<:@default=yes@:>@],
285 if test x$enableval = "xyes"; then
294 if test x$BITMAPBUTTONS = "xyes"; then
295 AC_DEFINE(BITMAPBUTTONS,1,Include bitmappable buttons)
298 dnl Determine the return type of signal handlers
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)
319 data/buttons/Makefile