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"
17 AM_GNU_GETTEXT_VERSION(0.11.5)
18 AM_GNU_GETTEXT([external])
22 # Check what compiler we are using
23 AC_MSG_CHECKING([for GCC])
24 if test "$GCC" = "yes"; then
26 CXXFLAGS="$CXXFLAGS -Wall -W"
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 # Determine if maintainer portions of the Makefiles should be included.
50 # 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 # Determine the return type of signal handlers
57 # Check whether to include debugging code
59 AC_MSG_CHECKING([whether to include verbose debugging code])
60 AC_ARG_ENABLE([debug],
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"
80 [ --with-python=path Set location of Python executable],
85 if ! test "$PYTHON"; then
86 AC_CHECK_PROGS(PYTHON, $prefix/bin/python python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4)
88 if ! test "$PYTHON"; then
89 AC_MSG_ERROR([Openbox requires the use of Python. This is its secret special formula for extreme sexiness.
90 See http://www.python.org
94 # Find our python paths
95 AC_MSG_CHECKING([for Python version])
96 # Need to do this hack since autoconf replaces __file__ with the name of the configure file
98 PYVERSION=`($PYTHON -c "import string,operator; print operator.getitem(string.split(string.__$filehack,'/'),-2)")`
99 AC_MSG_RESULT([$PYVERSION])
101 AC_MSG_CHECKING([for Python prefix])
102 PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null`
103 AC_MSG_RESULT([$PYPREFIX])
104 AC_MSG_CHECKING([for Python exec-prefix])
105 PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null`
106 AC_MSG_RESULT([$PYEPREFIX])
108 # Find the include directory
109 AC_MSG_CHECKING([for Python header files])
110 if test -r "$PYPREFIX/include/$PYVERSION/Python.h"; then
111 PYTHON_CFLAGS="-I$PYPREFIX/include/$PYVERSION"
113 if test -z "$PYTHON_CFLAGS"; then
114 if test -r "$PYPREFIX/include/Py/Python.h"; then
115 PYTHON_CFLAGS="-I$PYPREFIX/include/Py"
118 if ! test "$PYTHON_CFLAGS"; then
119 AC_MSG_ERROR([Not found])
121 AC_MSG_RESULT([$PYTHON_CFLAGS])
124 # Set the library directory blindly. This probably won't work with older versions
125 AC_MSG_CHECKING([for Python library])
126 dirs="$PYVERSION/config $PYVERSION/lib python/lib"
128 if test -d "$PYEPREFIX/lib/$i"; then
129 PYLIB="$PYEPREFIX/lib/$i"
133 if ! test "$PYLIB"; then
134 AC_MSG_ERROR([Not found])
136 AC_MSG_RESULT([$PYLIB])
139 # Check for really old versions
140 if test -r "$PYLIB/libPython.a"; then
141 PYTHON_LIBS="-L$PYLIB -lModules -lPython -lObjects -lParser"
143 PYTHON_LIBS="-L$PYLIB -l$PYVERSION"
146 AC_SUBST([PYTHON_CFLAGS])
147 AC_SUBST([PYTHON_LIBS])
149 # Check for X headers and libraries
152 test "$no_x" = "yes" && AC_MSG_ERROR([No Xlibs found.])
153 test -z "$x_includes" && x_includes="/usr/include"
154 test -z "$x_libraries" && x_libraries="/usr/lib"
156 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
157 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
158 LDFLAGS="$LDFLAGS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
160 # Check for required functions in -lX11
161 AC_CHECK_LIB([X11], [XOpenDisplay],
163 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
171 XFT_MIN=$XFT_MIN_MAJOR.$XFT_MIN_MINOR.$XFT_MIN_REVISION
172 AC_MSG_CHECKING([for Xft version >= $XFT_MIN])
173 if ! pkg-config --atleast-version $XFT_MIN xft; then
175 AC_MSG_ERROR([Openbox requires the Xft version >= $XFT_MIN font library.
176 See http://www.fontconfig.org/
184 OLDCXXFLAGS=$CXXFLAGS
186 XFT_CFLAGS="`pkg-config --cflags xft`"
187 XFT_LIBS="`pkg-config --libs xft`"
189 # Set these for checking with the tests below. They'll be restored after
190 LIBS="$LIBS $XFT_LIBS"
191 CXXFLAGS="$XFT_CFLAGS $CXXFLAGS"
193 AC_CHECK_LIB([Xft], [XftFontOpenName],
194 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft >= $XFT_MIN])
197 #include <X11/Xlib.h>
198 #include <X11/Xft/Xft.h>
201 #if !defined(XFT_MAJOR)
202 # error Xft.h is too old
204 #if XFT_MAJOR < $XFT_MIN_MAJOR
205 # error Xft.h is too old
207 #if XFT_MAJOR == $XFT_MIN_MAJOR
208 # if XFT_MINOR < $XFT_MIN_MINOR
209 # error Xft.h is too old
212 #if XFT_MAJOR == $XFT_MIN_MAJOR
213 # if XFT_MAJOR == $XFT_MIN_MINOR
214 # if XFT_REVISION < $XFT_MIN_REVISION
215 # error Xft.h is too old
228 AC_MSG_ERROR([Openbox requires the Xft version >= $XFT_MIN font library.
229 See http://www.fontconfig.org/
234 AC_MSG_CHECKING([if we can compile with Xft])
237 #include <X11/Xlib.h>
238 #include <X11/Xft/Xft.h>
249 AC_MSG_ERROR([Unable to compile with the Xft library.
254 # Restore the old values. Use XFT_CFLAGS and XFT_LIBS in the Makefile.am's
256 CXXFLAGS=$OLDCXXFLAGS
258 AC_SUBST([XFT_CFLAGS])
261 # Check for XKB extension support
262 AC_CHECK_LIB([X11], [XkbBell],
263 AC_MSG_CHECKING([for X11/XKBlib.h])
266 #include <X11/Xlib.h>
267 #include <X11/Xutil.h>
268 #include <X11/XKBlib.h>
278 AC_DEFINE([XKB], [1], [Found the XKB extension])
286 AC_MSG_CHECKING([for the XKB extension])
287 if test "$XKB" = "yes"; then
293 # Check for XShape extension support
294 AC_CHECK_LIB([Xext], [XShapeCombineShape],
295 AC_MSG_CHECKING([for X11/extensions/shape.h])
298 #include <X11/Xlib.h>
299 #include <X11/Xutil.h>
300 #include <X11/extensions/shape.h>
308 AC_DEFINE([SHAPE], [1], [Found the XShape extension])
317 AC_MSG_CHECKING([for the XShape extension])
318 if test "$SHAPE" = "yes"; then
324 # Check for Xinerama extension support
325 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
327 AC_ARG_ENABLE([xinerama],
328 [ --enable-xinerama enable support of the Xinerama extension @<:@default=no@:>@],
329 if test "$enableval" = "yes"; then
332 AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
334 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
337 #include <X11/Xlib.h>
338 #include <X11/extensions/Xinerama.h>
341 XineramaScreenInfo foo
346 AC_DEFINE([XINERAMA], [1],
347 [Enable support of the Xinerama extension])
348 LIBS="$LIBS -lXinerama"
357 AC_MSG_CHECKING([for the Xinerama extension])
358 if test "$XINRERAMA" = "yes"; then
369 AC_CONFIG_FILES([Makefile po/Makefile.in
384 AC_MSG_RESULT([$PACKAGE version $VERSION configured successfully.])
387 AC_MSG_RESULT([Using '$prefix' for installation.])
388 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
389 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
390 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
392 AC_MSG_RESULT([configure complete, now type \"make\"])