1 dnl configure.in for Blackbox - an X11 Window manager
2 dnl Initialize autoconf and automake
4 AC_INIT([blackbox], [0.70.2], [http://blackboxwm.sourceforge.net])
5 AM_INIT_AUTOMAKE([blackbox], [0.70.2])
6 AC_CONFIG_SRCDIR([src/blackbox.cc])
8 dnl Determine default prefix
9 test "x$prefix" = "xNONE" && prefix="$ac_default_prefix"
11 dnl Look in the most logical places for external libraries
12 CPPFLAGS="$CPPFLAGS -I$prefix/include"
13 LDFLAGS="$LDFLAGS -L$prefix/lib"
14 if test "x$prefix" != "x/usr/local"; then
15 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
16 LDFLAGS="$LDFLAGS -L/usr/local/lib"
19 dnl Locate required external software
22 dnl Blackbox requires ANSI C headers
24 if test "$ac_cv_header_stdc" = "no"; then
25 AC_MSG_ERROR([Blackbox requires ANSI C headers.])
31 dnl libbt shouldn't be shared by default (yet)
34 AC_SUBST(LIBTOOL_DEPS)
36 AC_CHECK_PROGS([regex_cmd], [sed])
37 if test "x$regex_cmd" = "x"; then
38 AC_MSG_ERROR([error. sed is required to build the default menu file.])
41 AC_CHECK_PROGS([gencat_cmd], [gencat])
42 if test "x$gencat_cmd" = "x"; then
49 dnl Compiler specific options
50 if test "x$GXX" != "xyes"; then
51 mips_pro_ver=`$CC -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
52 if test "x$mips_pro_ver" != "x"; then
53 AC_MSG_CHECKING([for MIPSpro version])
54 AC_MSG_RESULT([$mips_pro_ver.])
55 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
56 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
57 if test "x$lang_std_not_set" = "x"; then
58 AC_MSG_RESULT([not set, setting.])
59 CXXFLAGS="${CXXFLAGS} -LANG:std"
61 AC_MSG_RESULT([already set.])
66 dnl Check if some required functions live in the C library, or in an
70 AC_CHECK_FUNCS([iconv_open],
72 [AC_CHECK_LIB([iconv],
75 [AC_CHECK_LIB([iconv],
78 [AC_MSG_ERROR([Blackbox requires iconv(3) support.])])
83 dnl check if we are using GNU libiconv
84 AC_MSG_CHECKING([for GNU libiconv])
86 #include <sys/types.h>
89 int main(int, char **) {
93 size_t inbytes, outbytes;
94 iconv(cd, &inp, &inbytes, &outp, &outbytes);
98 [AC_DEFINE([HAVE_GNU_LIBICONV], [1],
99 [Define to 1 when using GNU libiconv])
100 AC_MSG_RESULT([yes])],
101 [AC_MSG_RESULT([no, assuming POSIX compliance])]
105 AC_CHECK_FUNCS([setlocale],
107 [AC_CHECK_LIB([xpg4],
110 [AC_MSG_ERROR([Blackbox requires setlocale(3) support.])])
114 AC_MSG_CHECKING([for nl_langinfo])
116 #include <langinfo.h>
118 int main(int, char **)
121 x = nl_langinfo(CODESET);
125 [AC_DEFINE([HAVE_NL_LANGINFO], [1],
126 [Define to 1 if you system has nl_langinfo(3)])
127 AC_MSG_RESULT([yes])],
128 [AC_MSG_RESULT([no])]
131 dnl needed for some X11 libs
134 [LIBS="$LIBS -lnsl"])
135 AC_CHECK_LIB([socket],
137 [LIBS="$LIBS -lsocket"])
139 dnl Check for X headers and libraries
142 if test "x$no_x" = "xyes"; then
143 AC_MSG_ERROR([Blackbox requires the X Window System libraries and headers.])
146 if test "x$x_includes" != "x"; then
147 CPPFLAGS="$CPPFLAGS -I$x_includes"
148 CXXFLAGS="$CXXFLAGS -I$x_includes"
150 if test "x$x_libraries" != "x"; then
151 LIBS="$LIBS -L$x_libraries"
154 dnl Check for required functions in -lX11
156 AC_CHECK_LIB([X11], [XOpenDisplay], [XLIB=yes], [XLIB=no])
157 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 libraries not found])
159 AC_CHECK_HEADERS([X11/Xlib.h], [XLIB=yes], [XLIB=no])
160 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 headers not found])
162 AC_CHECK_HEADERS([X11/Xatom.h X11/Xlocale.h X11/Xresource.h X11/Xutil.h X11/keysym.h], [XLIB=yes], [XLIB=no],
164 #include <X11/Xlib.h>
166 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 headers not found])
168 dnl Check for SHAPE extension support and proper library files.
169 AC_MSG_CHECKING([whether to build support for the SHAPE extension])
170 AC_ARG_ENABLE([shape],
171 AC_HELP_STRING([--enable-shape],
172 [enable support of the SHAPE extension @<:@default=yes@:>@]),
173 [SHAPE="$enableval"],
175 AC_MSG_RESULT([$SHAPE])
177 if test "x$SHAPE" = "xyes"; then
178 AC_CHECK_LIB([Xext], [XShapeCombineShape], [SHAPE=yes], [SHAPE=no])
180 if test "x$SHAPE" = "xyes"; then
183 if echo "$LIBS" | grep -q Xext 2>&1 >/dev/null; then
186 AC_CHECK_HEADERS([X11/extensions/shape.h], [SHAPE=yes], [SHAPE=no],
188 #include <X11/Xlib.h>
191 if test "x$SHAPE" = "xyes"; then
205 dnl Check for MIT-SHM extension support and proper library files.
206 AC_MSG_CHECKING([whether to build support for the MIT-SHM extension])
207 AC_ARG_ENABLE([mitshm],
208 AC_HELP_STRING([--enable-mitshm],
209 [enable support of the MIT-SHM extension @<:@default=yes@:>@]),
210 [MITSHM="$enableval"],
212 AC_MSG_RESULT([$MITSHM])
214 if test "x$MITSHM" = "xyes"; then
215 AC_CHECK_LIB([Xext], [XShmPutImage], [MITSHM=yes], [MITSHM=no])
217 if test "x$MITSHM" = "xyes"; then
221 AC_CHECK_HEADERS([X11/extensions/XShm.h], [MITSHM=yes], [MITSHM=no],
223 #include <X11/Xlib.h>
226 if test "x$MITSHM" = "xyes"; then
242 dnl Check for Xft libraries
243 AC_MSG_CHECKING([whether to build support for Xft])
245 AC_HELP_STRING([--enable-xft],
246 [enable support for the Xft library @<:@default=yes@:>@]),
249 AC_MSG_RESULT([$XFT])
251 if test "x$XFT" = "xyes"; then
252 PKG_CHECK_MODULES([xft],
255 XFT_PKGCONFIG="xft >= 2.0.0"
256 CXXFLAGS="$CXXFLAGS $xft_CFLAGS"
257 LIBS="$LIBS $xft_LIBS"],
265 AC_SUBST([XFT_PKGCONFIG])
267 dnl Check whether to include debugging code
268 AC_MSG_CHECKING([whether to include verbose debugging code])
269 AC_ARG_ENABLE([debug],
270 AC_HELP_STRING([--enable-debug],
271 [include verbose debugging code @<:@default=no@:>@]),
272 [DEBUG="$enableval"],
274 AC_MSG_RESULT([$DEBUG])
276 if test "x$DEBUG" = "xyes"; then
277 DEBUG="-DDEBUG -fno-inline -g"
283 dnl Check whether to include natural language support (i18n)
284 AC_MSG_CHECKING([whether to include NLS support])
286 AC_HELP_STRING([--enable-nls],
287 [include natural language support @<:@default=yes@:>@]),
290 AC_MSG_RESULT([$NLS])
292 if test "x$NLS" = "xyes"; then
299 dnl Determine if maintainer portions of the Makefiles should be included.
303 AM_CONFIG_HEADER(config.h)
323 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
325 AC_MSG_RESULT([Using '$prefix' for installation.])
326 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
327 AC_MSG_RESULT([Building with '$CPPFLAGS $CXXFLAGS' for C++ compiler flags.])
328 AC_MSG_RESULT([Building with '$LDFLAGS $LIBS' libraries.])