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 # 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 # Determine if maintainer portions of the Makefiles should be included.
48 # 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 # Determine the return type of signal handlers
55 # 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"
78 [ --with-python=path Set location of Python executable],
83 if ! test "$PYTHON"; then
84 AC_CHECK_PROGS(PYTHON, $prefix/bin/python python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4)
86 if ! test "$PYTHON"; then
87 AC_MSG_ERROR([Openbox requires the use of Python. This is its secret special formula for extreme sexiness.
88 See http://www.python.org
92 # Find our python paths
93 AC_MSG_CHECKING([for Python version])
94 # Need to do this hack since autoconf replaces __file__ with the name of the configure file
96 PYVERSION=`($PYTHON -c "import string,operator; print operator.getitem(string.split(string.__$filehack,'/'),-2)")`
97 AC_MSG_RESULT([$PYVERSION])
99 AC_MSG_CHECKING([for Python prefix])
100 PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
101 AC_MSG_RESULT([$PYPREFIX])
102 AC_MSG_CHECKING([for Python exec-prefix])
103 PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null`
104 AC_MSG_RESULT([$PYEPREFIX])
106 # Find the include directory
107 AC_MSG_CHECKING([for Python header files])
108 if test -r "$PYPREFIX/include/$PYVERSION/Python.h"; then
109 PYTHON_CFLAGS="-I$PYPREFIX/include/$PYVERSION"
111 if test -z "$PYTHON_CFLAGS"; then
112 if test -r "$PYPREFIX/include/Py/Python.h"; then
113 PYTHON_CFLAGS="-I$PYPREFIX/include/Py"
116 if ! test "$PYTHON_CFLAGS"; then
117 AC_MSG_ERROR([Not found])
119 AC_MSG_RESULT([$PYTHON_CFLAGS])
122 # Set the library directory blindly. This probably won't work with older versions
123 AC_MSG_CHECKING([for Python library])
124 dirs="$PYVERSION/config $PYVERSION/lib python/lib"
126 if test -d "$PYEPREFIX/lib/$i"; then
127 PYLIB="$PYEPREFIX/lib/$i"
131 if ! test "$PYLIB"; then
132 AC_MSG_ERROR([Not found])
134 AC_MSG_RESULT([$PYLIB])
137 # Check for really old versions
138 if test -r "$PYLIB/libPython.a"; then
139 PYTHON_LIBS="-L$PYLIB -lModules -lPython -lObjects -lParser"
141 PYTHON_LIBS="-L$PYLIB -l$PYVERSION"
144 AC_SUBST([PYTHON_CFLAGS])
145 AC_SUBST([PYTHON_LIBS])
147 # Check for X headers and libraries
150 test "$no_x" = "yes" && AC_MSG_ERROR([No Xlibs found.])
151 test -z "$x_includes" && x_includes="/usr/include"
152 test -z "$x_libraries" && x_libraries="/usr/lib"
154 CFLAGS="$CFLAGS $X_CFLAGS"
155 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
156 LDFLAGS="$LDFLAGS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
158 # Check for required functions in -lX11
159 AC_CHECK_LIB([X11], [XOpenDisplay],
161 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
169 XFT_MIN=$XFT_MIN_MAJOR.$XFT_MIN_MINOR.$XFT_MIN_REVISION
170 AC_MSG_CHECKING([for Xft version >= $XFT_MIN])
171 if ! pkg-config --atleast-version $XFT_MIN xft; then
173 AC_MSG_ERROR([Openbox requires the Xft version >= $XFT_MIN font library.
174 See http://www.fontconfig.org/
184 XFT_CFLAGS="`pkg-config --cflags xft`"
185 XFT_LIBS="`pkg-config --libs xft`"
187 # Set these for checking with the tests below. They'll be restored after
188 LIBS="$LIBS $XFT_LIBS"
189 CFLAGS="$XFT_CFLAGS $CFLAGS"
191 AC_CHECK_LIB([Xft], [XftFontOpenName],
192 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft >= $XFT_MIN])
195 #include <X11/Xlib.h>
196 #include <X11/Xft/Xft.h>
199 #if !defined(XFT_MAJOR)
200 # error Xft.h is too old
202 #if XFT_MAJOR < $XFT_MIN_MAJOR
203 # error Xft.h is too old
205 #if XFT_MAJOR == $XFT_MIN_MAJOR
206 # if XFT_MINOR < $XFT_MIN_MINOR
207 # error Xft.h is too old
210 #if XFT_MAJOR == $XFT_MIN_MAJOR
211 # if XFT_MAJOR == $XFT_MIN_MINOR
212 # if XFT_REVISION < $XFT_MIN_REVISION
213 # error Xft.h is too old
226 AC_MSG_ERROR([Openbox requires the Xft version >= $XFT_MIN font library.
227 See http://www.fontconfig.org/
232 AC_MSG_CHECKING([if we can compile with Xft])
235 #include <X11/Xlib.h>
236 #include <X11/Xft/Xft.h>
247 AC_MSG_ERROR([Unable to compile with the Xft library.
252 # Restore the old values. Use XFT_CFLAGS and XFT_LIBS in the Makefile.am's
256 AC_SUBST([XFT_CFLAGS])
259 # Check for XShape extension support
260 AC_CHECK_LIB([Xext], [XShapeCombineShape],
261 AC_MSG_CHECKING([for X11/extensions/shape.h])
264 #include <X11/Xlib.h>
265 #include <X11/Xutil.h>
266 #include <X11/extensions/shape.h>
274 AC_DEFINE([SHAPE], [1], [Found the XShape extension])
283 AC_MSG_CHECKING([for the XShape extension])
284 if test "$SHAPE" = "yes"; then
290 # Check for Xinerama extension support
291 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
293 AC_ARG_ENABLE([xinerama],
294 [ --enable-xinerama enable support of the Xinerama extension @<:@default=no@:>@],
295 if test "$enableval" = "yes"; then
298 AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
300 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
303 #include <X11/Xlib.h>
304 #include <X11/extensions/Xinerama.h>
307 XineramaScreenInfo foo
312 AC_DEFINE([XINERAMA], [1],
313 [Enable support of the Xinerama extension])
314 LIBS="$LIBS -lXinerama"
323 AC_MSG_CHECKING([for the Xinerama extension])
324 if test "$XINRERAMA" = "yes"; then
337 AC_CONFIG_FILES([Makefile
354 AC_MSG_RESULT([$PACKAGE version $VERSION configured successfully.])
357 AC_MSG_RESULT([Using '$prefix' for installation.])
358 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
359 AC_MSG_RESULT([Building with '$CFLAGS' for C++ compiler flags.])
360 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
362 AC_MSG_RESULT([configure complete, now type \"make\"])