2 AM_CONFIG_HEADER(config.h)
3 AM_INIT_AUTOMAKE([openbox], [2.90.0cvs])
7 AC_PATH_PROG([regex_cmd], [sed])
8 test -z $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 CPPFLAGS="$CPPFLAGS -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 CPPFLAGS)
35 lang_std_not_set=`echo $CPPFLAGS | grep "\-LANG:std"`
36 if test "x$lang_std_not_set" = "x"; then
37 AC_MSG_RESULT([not set, setting.])
38 CPPFLAGS="${CPPFLAGS} -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 CPPFLAGS="$CPPFLAGS $DEBUG"
76 dnl Check for X headers and libraries
79 test "$no_x" = "yes" && AC_MSG_ERROR([No Xlibs found.])
80 test -z "$x_includes" && x_includes="/usr/include"
81 test -z "$x_libraries" && x_libraries="/usr/lib"
83 CPPFLAGS="$CPPFLAGS $X_CPPFLAGS"
84 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
85 LDFLAGS="$LDFLAGS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
87 dnl Check for required functions in -lX11
88 AC_CHECK_LIB([X11], [XOpenDisplay],
90 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
95 AC_MSG_CHECKING([for Xft version 2])
102 if pkg-config xft; then
104 XFT_CFLAGS="`pkg-config --cflags xft`"
105 XFT_LIBS="`pkg-config --libs xft`"
107 dnl Set these for checking with the tests below. They'll be restored after
108 LIBS="$LIBS $XFT_LIBS"
109 CPPFLAGS="$XFT_CFLAGS $CPPFLAGS"
111 dnl This is for Xft version 1
116 AC_CHECK_LIB([Xft], [XftFontOpenXlfd],
117 AC_MSG_CHECKING([for X11/Xft/Xft.h])
120 #include <X11/Xlib.h>
121 #include <X11/Xft/Xft.h>
131 AC_MSG_ERROR([Openbox requires the Xft font library.
132 See http://www.fontconfig.org/
137 dnl Restore the old values. Use XFT_CFLAGS and XFT_LIBS in the Makefile.am's
139 CPPFLAGS=$OLDCPPFLAGS
141 AC_SUBST([XFT_CFLAGS])
144 dnl Check for XShape extension support
145 AC_CHECK_LIB([Xext], [XShapeCombineShape],
146 AC_MSG_CHECKING([for X11/extensions/shape.h])
149 #include <X11/Xlib.h>
150 #include <X11/Xutil.h>
151 #include <X11/extensions/shape.h>
159 AC_DEFINE([SHAPE], [1], [Found the XShape extension])
168 AC_MSG_CHECKING([for the XShape extension])
169 if test "$SHAPE" = "yes"; then
175 dnl Check for Xinerama extension support
176 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
178 AC_ARG_ENABLE([xinerama],
179 [ --enable-xinerama enable support of the Xinerama extension @<:@default=no@:>@],
180 if test "$enableval" = "yes"; then
183 AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
185 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
188 #include <X11/Xlib.h>
189 #include <X11/extensions/Xinerama.h>
192 XineramaScreenInfo foo
197 AC_DEFINE([XINERAMA], [1],
198 [Enable support of the Xinerama extension])
199 LIBS="$LIBS -lXinerama"
208 AC_MSG_CHECKING([for the Xinerama extension])
209 if test "$XINRERAMA" = "yes"; then
222 AC_CONFIG_FILES([Makefile
239 AC_MSG_RESULT([$PACKAGE version $VERSION configured successfully.])
242 AC_MSG_RESULT([Using '$prefix' for installation.])
243 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
244 AC_MSG_RESULT([Building with '$CPPFLAGS' for C++ compiler flags.])
245 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
247 AC_MSG_RESULT([configure complete, now type \"make\"])