2 AM_CONFIG_HEADER(config.h)
3 AM_INIT_AUTOMAKE([openbox], [2.90.0cvs])
7 AC_PATH_PROG([regex_cmd], [sed])
8 test "$regex_cmd" || AC_MSG_ERROR([sed not found])
13 LIBTOOL="$LIBTOOL --silent"
21 dnl Check what compiler we are using
22 AC_MSG_CHECKING([for GCC])
23 if test "$GCC" = "yes"; then
25 CFLAGS="$CFLAGS -Wall -W -pedantic"
27 AC_MSG_RESULT([no, trying other compilers])
28 AC_MSG_CHECKING(for MIPSpro)
29 mips_pro_ver=`$CXX -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
30 if test -z "$mips_pro_ver"; then
33 AC_MSG_RESULT([yes, version $mips_pro_ver.])
34 AC_MSG_CHECKING(for -LANG:std in CFLAGS)
35 lang_std_not_set=`echo $CFLAGS | grep "\-LANG:std"`
36 if test "x$lang_std_not_set" = "x"; then
37 AC_MSG_RESULT([not set, setting.])
38 CFLAGS="${CFLAGS} -LANG:std"
40 AC_MSG_RESULT([already set.])
45 dnl Determine if maintainer portions of the Makefiles should be included.
48 dnl Check for system header files
49 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)
52 dnl Determine the return type of signal handlers
55 dnl Check whether to include debugging code
57 AC_MSG_CHECKING([whether to include verbose debugging code])
58 AC_ARG_ENABLE([debug],
59 [ --enable-debug include verbose debugging code @<:@default=no@:>@],
60 if test "$enableval" = "yes"; then
62 if test "$GCC" = "yes"; then
63 DEBUG="-DDEBUG -fno-inline -g"
74 CFLAGS="$CFLAGS $DEBUG"
77 AC_CHECK_HEADER([python2.2/Python.h],
79 AC_MSG_ERROR([Openbox requires the use of Python 2.2. This is its secret special formula for extreme sexiness.
80 See http://www.python.org
82 AC_CHECK_LIB([python2.2], [Py_Initialize],
83 PYTHON_LDFLAGS="-lpython2.2",
84 dnl -Xlinker -export-dynamic",
85 AC_MSG_ERROR([Openbox requires the use of Python 2.2. This is its secret special formula for extreme sexiness.
86 See http://www.python.org
88 PYTHON_CFLAGS="-I/usr/include/python2.2 -I/usr/gwar/include/python2.2"
89 AC_SUBST([PYTHON_CFLAGS])
90 AC_SUBST([PYTHON_LDFLAGS])
95 dnl Check for X headers and libraries
98 test "$no_x" = "yes" && AC_MSG_ERROR([No Xlibs found.])
99 test -z "$x_includes" && x_includes="/usr/include"
100 test -z "$x_libraries" && x_libraries="/usr/lib"
102 CFLAGS="$CFLAGS $X_CFLAGS"
103 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
104 LDFLAGS="$LDFLAGS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
106 dnl Check for required functions in -lX11
107 AC_CHECK_LIB([X11], [XOpenDisplay],
109 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
113 dnl Check for Xft >= 2
117 XFT_MIN=$XFT_MIN_MAJOR.$XFT_MIN_MINOR.$XFT_MIN_REVISION
118 AC_MSG_CHECKING([for Xft version >= $XFT_MIN])
119 if ! pkg-config --atleast-version $XFT_MIN xft; then
121 AC_MSG_ERROR([Openbox requires the Xft version >= $XFT_MIN font library.
122 See http://www.fontconfig.org/
132 XFT_CFLAGS="`pkg-config --cflags xft`"
133 XFT_LIBS="`pkg-config --libs xft`"
135 dnl Set these for checking with the tests below. They'll be restored after
136 LIBS="$LIBS $XFT_LIBS"
137 CFLAGS="$XFT_CFLAGS $CFLAGS"
139 AC_CHECK_LIB([Xft], [XftFontOpenName],
140 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft >= $XFT_MIN])
143 #include <X11/Xlib.h>
144 #include <X11/Xft/Xft.h>
147 #if !defined(XFT_MAJOR)
148 # error Xft.h is too old
150 #if XFT_MAJOR < $XFT_MIN_MAJOR
151 # error Xft.h is too old
153 #if XFT_MAJOR == $XFT_MIN_MAJOR
154 # if XFT_MINOR < $XFT_MIN_MINOR
155 # error Xft.h is too old
158 #if XFT_MAJOR == $XFT_MIN_MAJOR
159 # if XFT_MAJOR == $XFT_MIN_MINOR
160 # if XFT_REVISION < $XFT_MIN_REVISION
161 # error Xft.h is too old
174 AC_MSG_ERROR([Openbox requires the Xft version >= $XFT_MIN font library.
175 See http://www.fontconfig.org/
180 AC_MSG_CHECKING([if we can compile with Xft])
183 #include <X11/Xlib.h>
184 #include <X11/Xft/Xft.h>
195 AC_MSG_ERROR([Unable to compile with the Xft library.
200 dnl Restore the old values. Use XFT_CFLAGS and XFT_LIBS in the Makefile.am's
204 AC_SUBST([XFT_CFLAGS])
207 dnl Check for XShape extension support
208 AC_CHECK_LIB([Xext], [XShapeCombineShape],
209 AC_MSG_CHECKING([for X11/extensions/shape.h])
212 #include <X11/Xlib.h>
213 #include <X11/Xutil.h>
214 #include <X11/extensions/shape.h>
222 AC_DEFINE([SHAPE], [1], [Found the XShape extension])
231 AC_MSG_CHECKING([for the XShape extension])
232 if test "$SHAPE" = "yes"; then
238 dnl Check for Xinerama extension support
239 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
241 AC_ARG_ENABLE([xinerama],
242 [ --enable-xinerama enable support of the Xinerama extension @<:@default=no@:>@],
243 if test "$enableval" = "yes"; then
246 AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
248 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
251 #include <X11/Xlib.h>
252 #include <X11/extensions/Xinerama.h>
255 XineramaScreenInfo foo
260 AC_DEFINE([XINERAMA], [1],
261 [Enable support of the Xinerama extension])
262 LIBS="$LIBS -lXinerama"
271 AC_MSG_CHECKING([for the Xinerama extension])
272 if test "$XINRERAMA" = "yes"; then
285 AC_CONFIG_FILES([Makefile
302 AC_MSG_RESULT([$PACKAGE version $VERSION configured successfully.])
305 AC_MSG_RESULT([Using '$prefix' for installation.])
306 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
307 AC_MSG_RESULT([Building with '$CFLAGS' for C++ compiler flags.])
308 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
310 AC_MSG_RESULT([configure complete, now type \"make\"])