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
15 dnl AC_PROG_LIBTOOL dont need this until we're doing plugins/engines
17 AC_CHECK_PROGS(regex_cmd, sed)
18 if test x$regex_cmd = "x"; then
19 AC_MSG_ERROR([error. sed is required to build the default menu file.])
22 dnl Check what compiler we are using
23 AC_MSG_CHECKING(for GCC)
24 if test "$GCC" = "yes"; then
26 CXXFLAGS="$CXXFLAGS -Wall -W -pedantic"
28 AC_MSG_RESULT([no, trying other compilers])
29 AC_MSG_CHECKING(for MIPSpro)
30 mips_pro_ver=`$CXX -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
31 if test -z "$mips_pro_ver"; then
34 AC_MSG_RESULT([yes, version $mips_pro_ver.])
35 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
36 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
37 if test "x$lang_std_not_set" = "x"; then
38 AC_MSG_RESULT([not set, setting.])
39 CXXFLAGS="${CXXFLAGS} -LANG:std"
41 AC_MSG_RESULT([already set.])
46 dnl Determine if maintainer portions of the Makefiles should be included.
49 dnl Check for system header files
50 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)
53 dnl Determine the return type of signal handlers
56 dnl Check whether to include debugging code
58 AC_MSG_CHECKING([whether to include verbose debugging code])
60 [ --enable-debug include verbose debugging code [default=no]],
61 if test "$enableval" = "yes"; then
63 if test "$GCC" = "yes"; then
64 DEBUG="-DDEBUG -fno-inline -g"
75 CXXFLAGS="$CXXFLAGS $DEBUG"
77 dnl Check for X headers and libraries
80 test "$no_x" = "yes" && AC_MSG_ERROR([No Xlibs found.])
81 test -z "$x_includes" && x_includes="/usr/include"
82 test -z "$x_libraries" && x_libraries="/usr/lib"
84 CXXFLAGS="$CXXFLAGS $X_CXXFLAGS"
85 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
86 LDFLAGS="$LDFLAGS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
88 dnl Check for required functions in -lX11
89 AC_CHECK_LIB(X11, XOpenDisplay,
91 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
94 dnl Check for XShape extension support
95 AC_CHECK_LIB(Xext, XShapeCombineShape,
96 AC_MSG_CHECKING([for X11/extensions/shape.h])
98 [#include <X11/Xlib.h>
99 #include <X11/Xutil.h>
100 #include <X11/extensions/shape.h>],
105 AC_DEFINE(HAVE_SHAPE,1,Found the XShape extension)
112 AC_MSG_CHECKING([for the XShape extension])
113 if test "$SHAPE" = "yes"; then
119 dnl Check for Xinerama extension support
120 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
122 AC_ARG_ENABLE(xinerama,
123 [ --enable-xinerama enable support of the Xinerama extension [default=no]],
124 if test "$enableval" = "yes"; then
127 AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
128 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
130 [#include <X11/Xlib.h>
131 #include <X11/extensions/Xinerama.h>],
132 XineramaScreenInfo foo,
136 AC_DEFINE(XINERAMA,1,Enable support of the Xinerama extension)
137 LIBS="$LIBS -lXinerama",
143 AC_MSG_CHECKING([for the Xinerama extension])
144 if test "$XINRERAMA" = "yes"; then
157 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
159 AC_MSG_RESULT([Using '$prefix' for installation.])
160 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
161 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
162 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
167 AM_CONFIG_HEADER(config.h)