1 dnl configure.in for Blackbox - an X11 Window manager
2 dnl Initialize autoconf and automake
4 AC_INIT([blackbox], [0.70.1cvs], [http://blackboxwm.sourceforge.net])
5 AM_INIT_AUTOMAKE([blackbox], [0.70.1cvs])
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_CHECK_FUNCS([nl_langinfo])
116 dnl needed for some X11 libs
119 [LIBS="$LIBS -lnsl"])
120 AC_CHECK_LIB([socket],
122 [LIBS="$LIBS -lsocket"])
124 dnl Check for X headers and libraries
127 if test "x$no_x" = "xyes"; then
128 AC_MSG_ERROR([Blackbox requires the X Window System libraries and headers.])
131 if test "x$x_includes" != "x"; then
132 CPPFLAGS="$CPPFLAGS -I$x_includes"
133 CXXFLAGS="$CXXFLAGS -I$x_includes"
135 if test "x$x_libraries" != "x"; then
136 LIBS="$LIBS -L$x_libraries"
139 dnl Check for required functions in -lX11
141 AC_CHECK_LIB([X11], [XOpenDisplay], [XLIB=yes], [XLIB=no])
142 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 libraries not found])
144 AC_CHECK_HEADERS([X11/Xlib.h], [XLIB=yes], [XLIB=no])
145 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 headers not found])
147 AC_CHECK_HEADERS([X11/Xatom.h X11/Xlocale.h X11/Xresource.h X11/Xutil.h X11/keysym.h], [XLIB=yes], [XLIB=no],
149 #include <X11/Xlib.h>
151 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 headers not found])
153 dnl Check for SHAPE extension support and proper library files.
154 AC_MSG_CHECKING([whether to build support for the SHAPE extension])
155 AC_ARG_ENABLE([shape],
156 AC_HELP_STRING([--enable-shape],
157 [enable support of the SHAPE extension @<:@default=yes@:>@]),
158 [SHAPE="$enableval"],
160 AC_MSG_RESULT([$SHAPE])
162 if test "x$SHAPE" = "xyes"; then
163 AC_CHECK_LIB([Xext], [XShapeCombineShape], [SHAPE=yes], [SHAPE=no])
165 if test "x$SHAPE" = "xyes"; then
168 if echo "$LIBS" | grep -q Xext 2>&1 >/dev/null; then
171 AC_CHECK_HEADERS([X11/extensions/shape.h], [SHAPE=yes], [SHAPE=no],
173 #include <X11/Xlib.h>
176 if test "x$SHAPE" = "xyes"; then
190 dnl Check for MIT-SHM extension support and proper library files.
191 AC_MSG_CHECKING([whether to build support for the MIT-SHM extension])
192 AC_ARG_ENABLE([mitshm],
193 AC_HELP_STRING([--enable-mitshm],
194 [enable support of the MIT-SHM extension @<:@default=yes@:>@]),
195 [MITSHM="$enableval"],
197 AC_MSG_RESULT([$MITSHM])
199 if test "x$MITSHM" = "xyes"; then
200 AC_CHECK_LIB([Xext], [XShmPutImage], [MITSHM=yes], [MITSHM=no])
202 if test "x$MITSHM" = "xyes"; then
206 AC_CHECK_HEADERS([X11/extensions/XShm.h], [MITSHM=yes], [MITSHM=no],
208 #include <X11/Xlib.h>
211 if test "x$MITSHM" = "xyes"; then
227 dnl Check for Xft libraries
228 AC_MSG_CHECKING([whether to build support for Xft])
230 AC_HELP_STRING([--enable-xft],
231 [enable support for the Xft library @<:@default=yes@:>@]),
234 AC_MSG_RESULT([$XFT])
236 if test "x$XFT" = "xyes"; then
237 PKG_CHECK_MODULES([xft],
240 XFT_PKGCONFIG="xft >= 2.0.0"
241 CXXFLAGS="$CXXFLAGS $xft_CFLAGS"
242 LIBS="$LIBS $xft_LIBS"],
250 AC_SUBST([XFT_PKGCONFIG])
252 dnl Check whether to include debugging code
253 AC_MSG_CHECKING([whether to include verbose debugging code])
254 AC_ARG_ENABLE([debug],
255 AC_HELP_STRING([--enable-debug],
256 [include verbose debugging code @<:@default=no@:>@]),
257 [DEBUG="$enableval"],
259 AC_MSG_RESULT([$DEBUG])
261 if test "x$DEBUG" = "xyes"; then
262 DEBUG="-DDEBUG -fno-inline -g"
268 dnl Check whether to include natural language support (i18n)
269 AC_MSG_CHECKING([whether to include NLS support])
271 AC_HELP_STRING([--enable-nls],
272 [include natural language support @<:@default=yes@:>@]),
275 AC_MSG_RESULT([$NLS])
277 if test "x$NLS" = "xyes"; then
284 dnl Determine if maintainer portions of the Makefiles should be included.
288 AM_CONFIG_HEADER(config.h)
308 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
310 AC_MSG_RESULT([Using '$prefix' for installation.])
311 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
312 AC_MSG_RESULT([Building with '$CPPFLAGS $CXXFLAGS' for C++ compiler flags.])
313 AC_MSG_RESULT([Building with '$LDFLAGS $LIBS' libraries.])