2 AM_CONFIG_HEADER(config.h)
3 AM_INIT_AUTOMAKE([openbox], [2.90.0cvs])
7 test "$prefix" = "NONE" && prefix="$ac_default_prefix"
9 AC_PATH_PROG([regex_cmd], [sed])
10 test "$regex_cmd" || AC_MSG_ERROR([sed not found])
15 LIBTOOL="$LIBTOOL --silent"
19 AM_GNU_GETTEXT_VERSION(0.11.5)
20 AM_GNU_GETTEXT([external])
24 # Check what compiler we are using
25 AC_MSG_CHECKING([for GCC])
26 if test "$GCC" = "yes"; then
28 CXXFLAGS="$CXXFLAGS -Wall -W"
31 AC_MSG_RESULT([no, trying other compilers])
32 AC_MSG_CHECKING(for MIPSpro)
33 mips_pro_ver=`$CXX -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
34 if test -z "$mips_pro_ver"; then
37 AC_MSG_RESULT([yes, version $mips_pro_ver.])
38 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
39 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
40 if test "x$lang_std_not_set" = "x"; then
41 AC_MSG_RESULT([not set, setting.])
42 CXXFLAGS="${CXXFLAGS} -LANG:std"
44 AC_MSG_RESULT([already set.])
49 # Determine if maintainer portions of the Makefiles should be included.
52 # Check for system header files
53 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)
56 # Determine the return type of signal handlers
59 # Check whether to include debugging code
61 AC_MSG_CHECKING([whether to include verbose debugging code])
62 AC_ARG_ENABLE([debug],
63 [ --enable-debug include verbose debugging code @<:@default=no@:>@],
64 if test "$enableval" = "yes"; then
66 if test "$GCC" = "yes"; then
67 DEBUG="-DDEBUG -fno-inline -g"
78 CXXFLAGS="$CXXFLAGS $DEBUG"
82 [ --with-python=path Set location of Python executable],
87 if ! test "$PYTHON"; then
88 AC_CHECK_PROGS(PYTHON, $prefix/bin/python python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4)
90 if ! test "$PYTHON"; then
91 AC_MSG_ERROR([Openbox requires the use of Python. This is its secret special formula for extreme sexiness.
92 See http://www.python.org
96 # Find our python paths
97 AC_MSG_CHECKING([for Python version])
98 # Need to do this hack since autoconf replaces __file__ with the name of the configure file
100 PYVERSION=`($PYTHON -c "import string,operator; print operator.getitem(string.split(string.__$filehack,'/'),-2)")`
101 AC_MSG_RESULT([$PYVERSION])
103 AC_MSG_CHECKING([for Python prefix])
104 PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
105 AC_MSG_RESULT([$PYPREFIX])
106 AC_MSG_CHECKING([for Python exec-prefix])
107 PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null`
108 AC_MSG_RESULT([$PYEPREFIX])
110 # Find the include directory
111 AC_MSG_CHECKING([for Python header files])
112 if test -r "$PYPREFIX/include/$PYVERSION/Python.h"; then
113 PYTHON_CFLAGS="-I$PYPREFIX/include/$PYVERSION"
115 if test -z "$PYTHON_CFLAGS"; then
116 if test -r "$PYPREFIX/include/Py/Python.h"; then
117 PYTHON_CFLAGS="-I$PYPREFIX/include/Py"
120 if ! test "$PYTHON_CFLAGS"; then
121 AC_MSG_ERROR([Not found])
123 AC_MSG_RESULT([$PYTHON_CFLAGS])
126 # Find the python library
128 AC_MSG_CHECKING([for Python library])
129 dirs="$PYEPREFIX/lib $PYEPREFIX/lib/$PYVERSION/config \
130 $PYEPREFIX/lib/$PYVERSION/lib $PYEPREFIX/lib/python/lib"
132 # look for really old versions
133 if test -r "$i/lib$PYVERSION.so"; then
135 PYTHON_LIBS="-L$PYLIB -l$PYVERSION"
138 if test -r "$i/libPython.a"; then
140 PYTHON_LIBS="-L$PYLIB -lModules -lPython -lObjects -lParser"
143 if test -r "$i/lib$PYVERSION.a"; then
145 PYTHON_LIBS="-L$PYLIB -l$PYVERSION -lpthread -ldl -lutil -lm"
152 if ! test "$PYLIB"; then
153 AC_MSG_ERROR([Not found])
155 AC_MSG_RESULT([$PYLIB])
158 AC_SUBST([PYTHON_CFLAGS])
159 AC_SUBST([PYTHON_LIBS])
161 # Check for X headers and libraries
164 test "$no_x" = "yes" && AC_MSG_ERROR([No Xlibs found.])
165 test -z "$x_includes" && x_includes="/usr/include"
166 test -z "$x_libraries" && x_libraries="/usr/lib"
168 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
169 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
170 LDFLAGS="$LDFLAGS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
172 # Check for required functions in -lX11
173 AC_CHECK_LIB([X11], [XOpenDisplay],
175 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
183 XFT_MIN=$XFT_MIN_MAJOR.$XFT_MIN_MINOR.$XFT_MIN_REVISION
184 AC_MSG_CHECKING([for Xft version >= $XFT_MIN])
185 if ! pkg-config --atleast-version $XFT_MIN xft; then
187 AC_MSG_ERROR([Openbox requires the Xft version >= $XFT_MIN font library.
188 See http://www.fontconfig.org/
196 OLDCXXFLAGS=$CXXFLAGS
198 XFT_CFLAGS="`pkg-config --cflags xft`"
199 XFT_LIBS="`pkg-config --libs xft`"
201 # Set these for checking with the tests below. They'll be restored after
202 LIBS="$LIBS $XFT_LIBS"
203 CXXFLAGS="$XFT_CFLAGS $CXXFLAGS"
205 AC_CHECK_LIB([Xft], [XftFontOpenName],
206 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft >= $XFT_MIN])
209 #include <X11/Xlib.h>
210 #include <X11/Xft/Xft.h>
213 #if !defined(XFT_MAJOR)
214 # error Xft.h is too old
216 #if XFT_MAJOR < $XFT_MIN_MAJOR
217 # error Xft.h is too old
219 #if XFT_MAJOR == $XFT_MIN_MAJOR
220 # if XFT_MINOR < $XFT_MIN_MINOR
221 # error Xft.h is too old
224 #if XFT_MAJOR == $XFT_MIN_MAJOR
225 # if XFT_MAJOR == $XFT_MIN_MINOR
226 # if XFT_REVISION < $XFT_MIN_REVISION
227 # error Xft.h is too old
240 AC_MSG_ERROR([Openbox requires the Xft version >= $XFT_MIN font library.
241 See http://www.fontconfig.org/
246 AC_MSG_CHECKING([if we can compile with Xft])
249 #include <X11/Xlib.h>
250 #include <X11/Xft/Xft.h>
261 AC_MSG_ERROR([Unable to compile with the Xft library.
266 # Restore the old values. Use XFT_CFLAGS and XFT_LIBS in the Makefile.am's
268 CXXFLAGS=$OLDCXXFLAGS
270 AC_SUBST([XFT_CFLAGS])
273 # Check for XKB extension support
274 AC_CHECK_LIB([X11], [XkbBell],
275 AC_MSG_CHECKING([for X11/XKBlib.h])
278 #include <X11/Xlib.h>
279 #include <X11/Xutil.h>
280 #include <X11/XKBlib.h>
290 AC_DEFINE([XKB], [1], [Found the XKB extension])
298 AC_MSG_CHECKING([for the XKB extension])
299 if test "$XKB" = "yes"; then
305 # Check for XShape extension support
306 AC_CHECK_LIB([Xext], [XShapeCombineShape],
307 AC_MSG_CHECKING([for X11/extensions/shape.h])
310 #include <X11/Xlib.h>
311 #include <X11/Xutil.h>
312 #include <X11/extensions/shape.h>
320 AC_DEFINE([SHAPE], [1], [Found the XShape extension])
329 AC_MSG_CHECKING([for the XShape extension])
330 if test "$SHAPE" = "yes"; then
336 # Check for Xinerama extension support
337 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
339 AC_ARG_ENABLE([xinerama],
340 [ --enable-xinerama enable support of the Xinerama extension @<:@default=no@:>@],
341 if test "$enableval" = "yes"; then
344 AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
346 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
349 #include <X11/Xlib.h>
350 #include <X11/extensions/Xinerama.h>
353 XineramaScreenInfo foo
358 AC_DEFINE([XINERAMA], [1],
359 [Enable support of the Xinerama extension])
360 LIBS="$LIBS -lXinerama"
369 AC_MSG_CHECKING([for the Xinerama extension])
370 if test "$XINRERAMA" = "yes"; then
381 AC_CONFIG_FILES([Makefile po/Makefile.in
390 data/buttons/Makefile
397 AC_MSG_RESULT([$PACKAGE version $VERSION configured successfully.])
400 AC_MSG_RESULT([Using '$prefix' for installation.])
401 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
402 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
403 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
405 AC_MSG_RESULT([configure complete, now type \"make\"])