1 AC_INIT(src/blackbox.cc)
2 AM_INIT_AUTOMAKE(openbox, 2.90.0, no-define)
7 dnl Determine default prefix
8 test "$prefix" = "NONE" && prefix="$ac_default_prefix"
10 dnl We're in the C++ world
16 dnl AC_PROG_LIBTOOL dont need this until we're doing plugins/engines
18 AC_CHECK_PROGS(regex_cmd, sed)
19 if test x$regex_cmd = "x"; then
20 AC_MSG_ERROR([error. sed is required to build the default menu file.])
23 dnl Check what compiler we are using
24 AC_MSG_CHECKING(for GCC)
25 if test "$GCC" = "yes"; then
27 CXXFLAGS="$CXXFLAGS -Wall -W -pedantic"
29 AC_MSG_RESULT([no, trying other compilers])
30 AC_MSG_CHECKING(for MIPSpro)
31 mips_pro_ver=`$CXX -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
32 if test -z "$mips_pro_ver"; then
35 AC_MSG_RESULT([yes, version $mips_pro_ver.])
36 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
37 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
38 if test "x$lang_std_not_set" = "x"; then
39 AC_MSG_RESULT([not set, setting.])
40 CXXFLAGS="${CXXFLAGS} -LANG:std"
42 AC_MSG_RESULT([already set.])
47 dnl Determine if maintainer portions of the Makefiles should be included.
50 dnl Check for system header files
51 AC_CHECK_HEADERS(ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdio.h stdlib.h string.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)
54 dnl Determine the return type of signal handlers
57 dnl Check whether to include debugging code
59 AC_MSG_CHECKING([whether to include verbose debugging code])
61 [ --enable-debug include verbose debugging code [default=no]],
62 if test "$enableval" = "yes"; then
64 if test "$GCC" = "yes"; then
65 DEBUG="-DDEBUG -fno-inline -g"
76 CXXFLAGS="$CXXFLAGS $DEBUG"
78 dnl Check for X headers and libraries
81 test "$no_x" = "yes" && AC_MSG_ERROR([No Xlibs found.])
82 test -z "$x_includes" && x_includes="/usr/include"
83 test -z "$x_libraries" && x_libraries="/usr/lib"
85 CXXFLAGS="$CXXFLAGS $X_CXXFLAGS"
86 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
87 LDFLAGS="$LDFLAGS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
89 dnl Check for required functions in -lX11
90 AC_CHECK_LIB(X11, XOpenDisplay,
92 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
95 dnl Check for XShape extension support
96 AC_CHECK_LIB(Xext, XShapeCombineShape,
97 AC_MSG_CHECKING([for X11/extensions/shape.h])
99 [#include <X11/Xlib.h>
100 #include <X11/Xutil.h>
101 #include <X11/extensions/shape.h>],
106 AC_DEFINE(HAVE_SHAPE,1,Found the XShape extension)
113 AC_MSG_CHECKING([for the XShape extension])
114 if test "$SHAPE" = "yes"; then
120 dnl Check for Xinerama extension support
121 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
123 AC_ARG_ENABLE(xinerama,
124 [ --enable-xinerama enable support of the Xinerama extension [default=no]],
125 if test "$enableval" = "yes"; then
128 AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
129 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
131 [#include <X11/Xlib.h>
132 #include <X11/extensions/Xinerama.h>],
133 XineramaScreenInfo foo,
137 AC_DEFINE(XINERAMA,1,Enable support of the Xinerama extension)
138 LIBS="$LIBS -lXinerama",
144 AC_MSG_CHECKING([for the Xinerama extension])
145 if test "$XINRERAMA" = "yes"; then
158 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
160 AC_MSG_RESULT([Using '$prefix' for installation.])
161 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
162 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
163 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
168 AM_CONFIG_HEADER(config.h)