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.
146 AC_MSG_CHECKING([whether to build support for the Xft extension])
148 xft, [ --enable-xft enable support of the Xft extension @<:@default=yes@:>@])
150 if test "$enableval" = "yes"; then
152 if pkg-config xft; then
154 AC_MSG_RESULT([version 2])
155 S_CXXFLAGS=${CXXFLAGS}
157 XFT_CFLAGS="`pkg-config --cflags xft`"
158 XFT_LIBS="`pkg-config --libs xft`"
159 CXXFLAGS="${XFT_CFLAGS} ${CXXFLAGS}"
160 LIBS="${LIBS} ${XFT_LIBS}"
161 AC_CHECK_LIB(Xft, XftFontOpenXlfd,
162 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft2])
165 #include <X11/Xlib.h>
166 #include <X11/Xft/Xft.h>
180 AC_MSG_RESULT([** WARNING: Xft support is disabled! **])
186 AC_MSG_RESULT([version 1])
187 AC_CHECK_LIB(Xft, XftFontOpenXlfd,
188 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft1])
191 #include <X11/Xlib.h>
192 #include <X11/Xft/Xft.h>
200 XFT_LIBS="$LIBS -lXft"
202 dnl Check for utf8 support in the Xft library
203 dnl AC_CHECK_LIB(Xft, XftDrawStringUtf8,
210 AC_MSG_RESULT([** WARNING: Xft support is disabled! **])
219 if test "$XFT" = "yes"; then
220 AC_SUBST([XFT_CFLAGS])
222 AC_DEFINE(XFT,1,[Enable support of the Xft extension])
223 dnl if test "$XFT_UTF8" = "yes"; then
224 dnl AC_DEFINE(XFT_UTF8,1,[Support for Utf8 text in the Xft extension])
227 AM_CONDITIONAL(XFT, test "$XFT" = "yes")
228 AM_CONDITIONAL(XFT2, test "$XFT2" = "yes")
230 dnl Check for ordered 8bpp dithering
232 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
233 AC_ARG_ENABLE(ordered-pseudo,
234 [ --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
235 dithering @<:@default=no@:>@],
236 if test "$enableval" = "yes"; then
244 if test "$ORDEREDPSEUDO" = "yes"; then
245 AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
248 dnl Check whether to include debugging code
250 AC_MSG_CHECKING([whether to include verbose debugging code])
252 [ --enable-debug include verbose debugging code @<:@default=no@:>@],
253 if test "$enableval" = "yes"; then
255 if test "$GCC" = "yes"; then
256 DEBUG="-DDEBUG -fno-inline -g"
269 dnl Check whether to include natural language support (i18n)
271 AC_MSG_CHECKING([whether to include NLS support])
273 [ --enable-nls include natural language support @<:@default=yes@:>@],
274 if test "$enableval" = "yes"; then
284 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
286 AC_CHECK_PROGS(gencat_cmd, gencat)
287 if test x$gencat_cmd = "x"; then
291 if test "$NLS" = "yes"; then
292 AC_DEFINE(NLS,1,Include natural language support)
296 dnl Check for new timed pixmap cache
298 AC_MSG_CHECKING([whether to use the timed pixmap cache])
301 [ --enable-timed-cache use timed pixmap cache @<:@default=yes@:>@],
302 if test "$enableval" = "yes"; then
311 if test "$TIMEDCACHE" = "yes"; then
312 AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
315 dnl Check for bitmapped buttons
317 AC_MSG_CHECKING([whether to include bitmappable buttons])
320 [ --enable-bitmap-buttons include bitmappable buttons @<:@default=yes@:>@],
321 if test x$enableval = "xyes"; then
330 if test x$BITMAPBUTTONS = "xyes"; then
331 AC_DEFINE(BITMAPBUTTONS,1,Include bitmappable buttons)
334 dnl Determine the return type of signal handlers
339 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
341 AC_MSG_RESULT([Using '$prefix' for installation.])
342 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
343 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
344 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
348 AM_CONFIG_HEADER(config.h)
355 data/buttons/Makefile