1 dnl configure.in for Blackbox - an X11 Window manager
2 dnl Initialize autoconf and automake
4 AC_INIT([blackbox], [0.70.0cvs], [http://blackboxwm.sourceforge.net])
5 AM_INIT_AUTOMAKE([blackbox], [0.70.0cvs])
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 CXXFLAGS="${CXXFLAGS} -Wall -W -pedantic"
52 gxx_ver=`$CXX -dumpversion|sed -e 's/\..*//'`
53 AC_MSG_CHECKING([GNU C++ major version])
54 AC_MSG_RESULT([$gxx_ver])
55 if test "$gxx_ver" -ge 3; then
56 CXXFLAGS="${CXXFLAGS} -Woverloaded-virtual -Wshadow"
59 mips_pro_ver=`$CC -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
60 if test "x$mips_pro_ver" != "x"; then
61 AC_MSG_CHECKING([for MIPSpro version])
62 AC_MSG_RESULT([$mips_pro_ver.])
63 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
64 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
65 if test "x$lang_std_not_set" = "x"; then
66 AC_MSG_RESULT([not set, setting.])
67 CXXFLAGS="${CXXFLAGS} -LANG:std"
69 AC_MSG_RESULT([already set.])
74 dnl Check if some required functions live in the C library, or in an
78 AC_CHECK_FUNCS([iconv_open],
80 [AC_CHECK_LIB([iconv],
83 [AC_CHECK_LIB([iconv],
86 [AC_MSG_ERROR([Blackbox requires iconv(3) support.])])
91 dnl check if we are using GNU libiconv
92 AC_MSG_CHECKING([for GNU libiconv])
94 #include <sys/types.h>
97 int main(int, char **) {
101 size_t inbytes, outbytes;
102 iconv(cd, &inp, &inbytes, &outp, &outbytes);
106 [AC_DEFINE([HAVE_GNU_LIBICONV], [1],
107 [Define to 1 when using GNU libiconv])
108 AC_MSG_RESULT([yes])],
109 [AC_MSG_RESULT([no, assuming POSIX compliance])]
113 AC_CHECK_FUNCS([setlocale],
115 [AC_CHECK_LIB([xpg4],
118 [AC_MSG_ERROR([Blackbox requires setlocale(3) support.])])
122 AC_CHECK_FUNCS([nl_langinfo])
124 dnl needed for some X11 libs
127 [LIBS="$LIBS -lnsl"])
128 AC_CHECK_LIB([socket],
130 [LIBS="$LIBS -lsocket"])
132 dnl Check for X headers and libraries
135 if test "x$no_x" = "xyes"; then
136 AC_MSG_ERROR([Blackbox requires the X Window System libraries and headers.])
139 if test "x$x_includes" != "x"; then
140 CPPFLAGS="$CPPFLAGS -I$x_includes"
141 CXXFLAGS="$CXXFLAGS -I$x_includes"
143 if test "x$x_libraries" != "x"; then
144 LIBS="$LIBS -L$x_libraries"
147 dnl Check for required functions in -lX11
149 AC_CHECK_LIB([X11], [XOpenDisplay], [XLIB=yes], [XLIB=no])
150 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 libraries not found])
152 AC_CHECK_HEADERS([X11/Xlib.h], [XLIB=yes], [XLIB=no])
153 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 headers not found])
155 AC_CHECK_HEADERS([X11/Xatom.h X11/Xlocale.h X11/Xresource.h X11/Xutil.h X11/keysym.h], [XLIB=yes], [XLIB=no],
157 #include <X11/Xlib.h>
159 test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 headers not found])
161 dnl Check for SHAPE extension support and proper library files.
162 AC_MSG_CHECKING([whether to build support for the SHAPE extension])
163 AC_ARG_ENABLE([shape],
164 AC_HELP_STRING([--enable-shape],
165 [enable support of the SHAPE extension @<:@default=yes@:>@]),
166 [SHAPE="$enableval"],
168 AC_MSG_RESULT([$SHAPE])
170 if test "x$SHAPE" = "xyes"; then
171 AC_CHECK_LIB([Xext], [XShapeCombineShape], [SHAPE=yes], [SHAPE=no])
173 if test "x$SHAPE" = "xyes"; then
176 if echo "$LIBS" | grep -q Xext 2>&1 >/dev/null; then
179 AC_CHECK_HEADERS([X11/extensions/shape.h], [SHAPE=yes], [SHAPE=no],
181 #include <X11/Xlib.h>
184 if test "x$SHAPE" = "xyes"; then
198 dnl Check for MIT-SHM extension support and proper library files.
199 AC_MSG_CHECKING([whether to build support for the MIT-SHM extension])
200 AC_ARG_ENABLE([mitshm],
201 AC_HELP_STRING([--enable-mitshm],
202 [enable support of the MIT-SHM extension @<:@default=yes@:>@]),
203 [MITSHM="$enableval"],
205 AC_MSG_RESULT([$MITSHM])
207 if test "x$MITSHM" = "xyes"; then
208 AC_CHECK_LIB([Xext], [XShmPutImage], [MITSHM=yes], [MITSHM=no])
210 if test "x$MITSHM" = "xyes"; then
214 AC_CHECK_HEADERS([X11/extensions/XShm.h], [MITSHM=yes], [MITSHM=no],
216 #include <X11/Xlib.h>
219 if test "x$MITSHM" = "xyes"; then
235 dnl Check for Xft libraries
236 AC_MSG_CHECKING([whether to build support for Xft])
238 AC_HELP_STRING([--enable-xft],
239 [enable support for the Xft library @<:@default=yes@:>@]),
242 AC_MSG_RESULT([$XFT])
244 if test "x$XFT" = "xyes"; then
245 PKG_CHECK_MODULES([xft],
248 XFT_PKGCONFIG="xft >= 2.0.0"
249 CXXFLAGS="$CXXFLAGS $xft_CFLAGS"
250 LIBS="$LIBS $xft_LIBS"],
258 AC_SUBST([XFT_PKGCONFIG])
260 dnl Check whether to include debugging code
261 AC_MSG_CHECKING([whether to include verbose debugging code])
262 AC_ARG_ENABLE([debug],
263 AC_HELP_STRING([--enable-debug],
264 [include verbose debugging code @<:@default=no@:>@]),
265 [DEBUG="$enableval"],
267 AC_MSG_RESULT([$DEBUG])
269 if test "x$DEBUG" = "xyes"; then
270 DEBUG="-DDEBUG -fno-inline -g"
276 dnl Check whether to include natural language support (i18n)
277 AC_MSG_CHECKING([whether to include NLS support])
279 AC_HELP_STRING([--enable-nls],
280 [include natural language support @<:@default=yes@:>@]),
283 AC_MSG_RESULT([$NLS])
285 if test "x$NLS" = "xyes"; then
292 dnl Determine if maintainer portions of the Makefiles should be included.
296 AM_CONFIG_HEADER(config.h)
316 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
318 AC_MSG_RESULT([Using '$prefix' for installation.])
319 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
320 AC_MSG_RESULT([Building with '$CPPFLAGS $CXXFLAGS' for C++ compiler flags.])
321 AC_MSG_RESULT([Building with '$LDFLAGS $LIBS' libraries.])