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.
148 AC_MSG_CHECKING([whether to build support for the Xft extension])
150 xft, [ --enable-xft enable support of the Xft extension @<:@default=yes@:>@])
152 if test "$enableval" = "yes"; then
154 if pkg-config xft; then
156 AC_MSG_RESULT([version 2])
157 S_CXXFLAGS=${CXXFLAGS}
159 XFT_CFLAGS="`pkg-config --cflags xft`"
160 XFT_LIBS="`pkg-config --libs xft`"
161 CXXFLAGS="${XFT_CFLAGS} ${CXXFLAGS}"
162 LIBS="${LIBS} ${XFT_LIBS}"
163 AC_CHECK_LIB(Xft, XftFontOpenXlfd,
164 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft2])
167 #include <X11/Xlib.h>
168 #include <X11/Xft/Xft.h>
184 AC_MSG_RESULT([** WARNING: Xft support is disabled! **])
189 CXXFLAGS=${S_CXXFLAGS}
192 AC_MSG_RESULT([version 1])
193 AC_CHECK_LIB(Xft, XftFontOpenXlfd,
194 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft1])
197 #include <X11/Xlib.h>
198 #include <X11/Xft/Xft.h>
206 XFT_LIBS="$LIBS -lXft"
208 dnl Check for utf8 support in the Xft library
209 dnl AC_CHECK_LIB(Xft, XftDrawStringUtf8,
216 AC_MSG_RESULT([** WARNING: Xft support is disabled! **])
225 if test "$XFT" = "yes"; then
226 AC_SUBST([XFT_CFLAGS])
228 AC_DEFINE(XFT,1,[Enable support of the Xft extension])
229 dnl if test "$XFT_UTF8" = "yes"; then
230 dnl AC_DEFINE(XFT_UTF8,1,[Support for Utf8 text in the Xft extension])
233 AM_CONDITIONAL(XFT, test "$XFT" = "yes")
234 AM_CONDITIONAL(XFT2, test "$XFT2" = "yes")
236 dnl Check for ordered 8bpp dithering
238 AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
239 AC_ARG_ENABLE(ordered-pseudo,
240 [ --enable-ordered-pseudo include code for ordered pseudocolor (8bpp)
241 dithering @<:@default=no@:>@],
242 if test "$enableval" = "yes"; then
250 if test "$ORDEREDPSEUDO" = "yes"; then
251 AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering)
254 dnl Check whether to include debugging code
256 AC_MSG_CHECKING([whether to include verbose debugging code])
258 [ --enable-debug include verbose debugging code @<:@default=no@:>@],
259 if test "$enableval" = "yes"; then
261 if test "$GCC" = "yes"; then
262 DEBUG="-DDEBUG -fno-inline -g"
275 dnl Check whether to include natural language support (i18n)
277 AC_MSG_CHECKING([whether to include NLS support])
279 [ --enable-nls include natural language support @<:@default=yes@:>@],
280 if test "$enableval" = "yes"; then
290 AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4")
292 AC_CHECK_PROGS(gencat_cmd, gencat)
293 if test x$gencat_cmd = "x"; then
297 if test "$NLS" = "yes"; then
298 AC_DEFINE(NLS,1,Include natural language support)
302 dnl Check for new timed pixmap cache
304 AC_MSG_CHECKING([whether to use the timed pixmap cache])
307 [ --enable-timed-cache use timed pixmap cache @<:@default=yes@:>@],
308 if test "$enableval" = "yes"; then
317 if test "$TIMEDCACHE" = "yes"; then
318 AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
321 dnl Check for bitmapped buttons
323 AC_MSG_CHECKING([whether to include bitmappable buttons])
326 [ --enable-bitmap-buttons include bitmappable buttons @<:@default=yes@:>@],
327 if test x$enableval = "xyes"; then
336 if test x$BITMAPBUTTONS = "xyes"; then
337 AC_DEFINE(BITMAPBUTTONS,1,Include bitmappable buttons)
340 dnl Determine the return type of signal handlers
345 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
347 AC_MSG_RESULT([Using '$prefix' for installation.])
348 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
349 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
350 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
354 AM_CONFIG_HEADER(config.h)
361 data/buttons/Makefile