1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
|
AC_INIT(src/main.cc)
AC_PREREQ(2.52)
AM_INIT_AUTOMAKE(fbdesk,1.4.1,no-define)
AC_LANG_CPLUSPLUS
dnl Locate required external software
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AM_PROG_LIBTOOL
dnl Check for system header files
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h signal.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h)
AC_CHECK_HEADERS(sstream, ,
[ AC_CHECK_HEADERS(strstream,,
[AC_MSG_ERROR([Your libstdc++ doesn't have the sstream or strstream classes])]
)]
)
AC_HEADER_TIME
dnl Determine the return type of signal handlers
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(sigaction strcasestr)
dnl Check for X headers and libraries
AC_PATH_X
AC_PATH_XTRA
test x$no_x = "xyes" && AC_MSG_ERROR([fbdesk requires the X Window System libraries and headers.])
test x$x_includes = "x" && x_includes="/usr/include"
test x$x_libraries = "x" && x_libraries="/usr/lib"
CFLAGS="$CFLAGS $X_CFLAGS"
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
LIBS="$LIBS $X_LIBS"
LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
dnl Check for required functions in -lX11
AC_CHECK_LIB(X11, XOpenDisplay,
LIBS="$LIBS -lX11",
AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
)
LIBS="$LIBS $X_EXTRA_LIBS"
Xext_lib=""
dnl Check for XShape extension support and proper library files.
SHAPE=""
AC_MSG_CHECKING([whether to build support for the XShape extension])
AC_ARG_ENABLE(
shape, [ --enable-shape enable support of the XShape extension [default=yes]])
: ${enableval="yes"}
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xext, XShapeCombineShape,
AC_MSG_CHECKING([for X11/extensions/shape.h])
AC_TRY_LINK(
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
, long foo = ShapeSet,
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SHAPE, 1, "Shape extension support")
Xext_lib="-lXext",
AC_MSG_RESULT([no])
)
)
else
AC_MSG_RESULT([no])
fi
AC_SUBST(SHAPE)
CXXFLAGS="$CXXFLAGS $SHAPE"
LIBS="$LIBS $Xext_lib"
XPM=false
AC_MSG_CHECKING([whether to have Xpm (pixmap themes) support])
AC_ARG_ENABLE(
xpm,
[ --enable-xpm Xpm (pixmap themes) support [default=yes]],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xpm, XpmReadFileToPixmap,
AC_DEFINE(HAVE_XPM, 1, "Xpm support")
XPM=true
LIBS="$LIBS -lXpm")
else
AC_MSG_RESULT([no])
fi,
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xpm, XpmReadFileToPixmap,
AC_DEFINE(HAVE_XPM, 1, "Xpm support")
XPM=true
LIBS="$LIBS -lXpm")
)
AM_CONDITIONAL(XPM, test x$XPM = xtrue)
dnl Check whether to include debugging code
DEBUG=""
AC_MSG_CHECKING([whether to include verbose debugging code])
AC_ARG_ENABLE(debug,
[ --enable-debug include verbose debugging code [default=no]],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
DEBUG="-DDEBUG -fno-inline"
else
AC_MSG_RESULT([no])
fi,
AC_MSG_RESULT([no])
)
AC_SUBST(DEBUG)
CXXFLAGS="$CXXFLAGS $DEBUG"
AC_MSG_CHECKING([whether to have Xrender (transparent) support])
AC_ARG_ENABLE(
xrender,
[ --enable-xrender Xrender (transparent) support [default=yes]],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrender, XRenderCreatePicture,
AC_DEFINE(HAVE_XRENDER, 1, "Xrender support")
LIBS="$LIBS -lXrender")
else
AC_MSG_RESULT([no])
fi,
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrender, XRenderCreatePicture,
AC_DEFINE(HAVE_XRENDER, 1, "Xrender support")
LIBS="$LIBS -lXrender")
)
AC_MSG_CHECKING([whether to have Xft support])
AM_PATH_XFT(yes,
XFT=true,
XFT=false
)
if test "x$XFT" = "xtrue" ; then
AC_DEFINE(USE_XFT, 1, "antialias support")
AC_MSG_CHECKING([Xft UTF-8 support])
AC_TRY_LINK([
#include <X11/Xft/Xft.h>
], [ XftDrawStringUtf8(0, 0, 0, 0, 0, 0, 0); return 0; ],
AC_DEFINE(HAVE_XFT_UTF8_STRING, 1, "Xft UTF8 support")
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
fi
AM_CONDITIONAL(XFT, test x$XFT = xtrue)
AC_MSG_CHECKING([whether to have Xmb (multibyte font, utf-8) support])
AC_ARG_ENABLE(
xmb,
[ --enable-xmb Xmb (multibyte font, utf-8) support [default=yes]],
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(USE_XMB, 1, "multibyte support")
MULTIBYTE=true
else
AC_MSG_RESULT([no])
MULTIBYTE=false
fi,
AC_MSG_RESULT([yes])
AC_DEFINE(USE_XMB, 1, "multibyte support")
MULTIBYTE=true
)
AM_CONDITIONAL(MULTIBYTE, test x$MULTIBYTE = xtrue)
AC_ARG_ENABLE(png,--enable-png support loading PNG images [default=yes],
, enable_png=yes)
if test x$enable_png = xyes; then
AC_PATH_PROG(LIBPNG_CONFIG, libpng-config, no)
if test "x$LIBPNG_CONFIG" = "xno"; then
AC_CHECK_LIB(png, png_create_read_struct, have_libpng=yes, , -lz)
if test x$have_libpng != xyes; then
AC_MSG_WARN([Unable to find PNG library (http://www.libpng.org/pub/png/libpng.html)])
fi
dnl libpng requires libz
AC_CHECK_LIB(z, uncompress, have_libz=yes)
if test x$have_libz != xyes; then
AC_MSG_WARN([Unable to find Zlib library (http://www.gzip.org/zlib/)])
fi
if test x$have_libpng = xyes -a x$have_libz = xyes; then
LIBS="$LIBS -lpng -lz"
AC_DEFINE(HAVE_PNG, 1, "Png support")
else
AC_MSG_WARN(PNG image loading disabled)
fi
else dnl try with libpng-config
CXXFLAGS="$CXXFLAGS `libpng-config --cflags`"
LIBS="$LIBS `libpng-config --libs`"
have_libpng="yes"
AC_DEFINE(HAVE_PNG, 1, "Png support")
fi
fi
AM_CONDITIONAL(PNG, test x$have_libpng = xyes)
dnl Check whether to use imlib2
IMLIB2=true
AC_MSG_CHECKING([whether to have Imlib2 (pixmap themes) support])
AC_ARG_ENABLE(imlib2,
[AC_HELP_STRING([--enable-imlib2],
[Imlib2 (pixmap themes) support [default=yes]])], ,
[enable_imlib2=yes])
if test x$enable_imlib2 = "xyes"; then
AC_MSG_RESULT([yes])
AC_PATH_GENERIC(imlib2, 1.0.0,
[
IMLIB2=true
AC_DEFINE(HAVE_IMLIB2, [], [Imlib2 support])
IMLIB2_LIBS=`imlib2-config --libs`
IMLIB2_CFLAGS=`imlib2-config --cflags`
LIBS="$LIBS $IMLIB2_LIBS"
CXXFLAGS="$CXXFLAGS $IMLIB2_CFLAGS"
], [ AC_MSG_RESULT(no)]
)
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(IMLIB2, test x$IMLIB2 = xtrue)
dnl Print results
AC_MSG_RESULT([])
AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([])
AC_MSG_RESULT([Using '$prefix' for installation.])
AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
AC_MSG_RESULT([])
dnl Output files
AM_CONFIG_HEADER(config.h)
AC_OUTPUT(
Makefile
version.h
src/Makefile
src/FbTk/Makefile
)
|