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 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
|
m4_pattern_allow(AM_CONFIG_HEADERS)
dnl init autotools
AC_INIT(pekwm, 0.1.17)
AC_CONFIG_SRCDIR(src/main.cc)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
dnl Check for programs
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_SED
PKG_PROG_PKG_CONFIG
AC_LANG([C++])
dnl Check for /usr/xpg4/bin/sh and use that in scripts if it does
dnl exist, Solaris /bin/sh does feel like behaving with the standard
dnl scripts it seems.
AC_CHECK_PROG([SH], [sh], [/usr/xpg4/bin/sh], [/bin/sh], [/usr/xpg4/bin])
dnl Check for iconv
AM_ICONV
if test "x$am_cv_func_iconv" != "xyes"; then
AC_MSG_ERROR([Could not find iconv.])
fi
LIBS="$LIBS $LIBICONV"
CXXFLAGS="$CXXFLAGS $INCICONV"
dnl Check for iconvctl
AC_CHECK_FUNC(iconvctl, [AC_DEFINE(HAVE_ICONVCTL, [1], [Define to 1 if you the iconvctl call])], )
dnl add x11 to the env
AC_PATH_X
AC_PATH_XTRA
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
LIBS="$LIBS $X_LIBS"
LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
dnl Check for libraries
AC_CHECK_LIB(X11, XOpenDisplay,
LIBS="$LIBS -lX11",
AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
)
dnl Check for XShape extension support and proper library files
enableval="yes"
AC_MSG_CHECKING([whether to build support for the XShape extension])
AC_ARG_ENABLE(shape,
AC_HELP_STRING([--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_COMPILE(
#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], [Define to 1 if you have an XShape capable server])
LIBS="$LIBS -lXext"
FEATURES="$FEATURES XShape",
AC_MSG_RESULT([no])))
else
AC_MSG_RESULT([no])
CONFIGOPTS="$CONFIGOPTS --disable-shape"
fi
dnl Check for Xinerama support
AC_MSG_CHECKING([whether to build support for the Xinerama extension])
AC_ARG_ENABLE(xinerama,
AC_HELP_STRING([--enable-xinerama],
[enable xinerama extension [default=yes]]), ,
[enable_xinerama=yes])
if test "x$enable_xinerama" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
AC_DEFINE(HAVE_XINERAMA, [1], [Define to 1 if you want Xinerama support to be])
LIBS="$LIBS -lXinerama"
FEATURES="$FEATURES Xinerama")
else
AC_MSG_RESULT([no])
fi
dnl Check for Xft support
AC_MSG_CHECKING([whether to support Xft fonts])
AC_ARG_ENABLE(xft,
AC_HELP_STRING([--enable-xft],
[enable Xft font support [default=yes]]), ,
[enable_xft=yes])
if test "x$enable_xft" = "xyes"; then
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES([xft], [xft >= 2.0.0], HAVE_XFT=yes, HAVE_XFT=no)
if test "x$HAVE_XFT" = "xyes"
then
AC_DEFINE(HAVE_XFT, [1], [Define to 1 if you want Xft2 font support])
LIBS="$LIBS $xft_LIBS"
CXXFLAGS="$CXXFLAGS $xft_CFLAGS"
FEATURES="$FEATURES Xft";
else
AC_MSG_WARN([Couldn't find Xft >= 2.0.0])
fi
else
AC_MSG_RESULT([no])
fi
dnl Check for PNG support
AC_MSG_CHECKING([wheter to build support for PNG images])
AC_ARG_ENABLE(image-png,
AC_HELP_STRING([--enable-image-png],
[enable support for PNG images [default=yes]]), ,
[enable_image_png=yes])
if test "x$enable_image_png" = "xyes"; then
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES([libpng12], [libpng12 >= 1.2.0], HAVE_LIBPNG=yes, HAVE_LIBPNG=no)
if test "x$HAVE_LIBPNG" = "xyes"; then
AC_DEFINE(HAVE_IMAGE_PNG, [1], [Define to 1 if you have libpng12])
LIBS="$LIBS $libpng12_LIBS"
CXXFLAGS="$CXXFLAGS $libpng12_CFLAGS"
FEATURES="$FEATURES image-png"
else
PKG_CHECK_MODULES([libpng], [libpng >= 1.0.0], HAVE_LIBPNG=yes, HAVE_LIBPNG=no)
if test "x$HAVE_LIBPNG" = "xyes"; then
AC_DEFINE(HAVE_IMAGE_PNG, [1], [Define to 1 if you have libpng12])
LIBS="$LIBS $libpng_LIBS"
CXXFLAGS="$CXXFLAGS $libpng_CFLAGS"
FEATURES="$FEATURES image-png"
else
AC_MSG_RESULT([no])
fi
fi
else
AC_MSG_RESULT([no])
fi
dnl Check for default theme
if test "x$HAVE_LIBPNG" = "xyes"; then
THEME="default"
else
AC_MSG_ERROR([Could not find libpng.])
fi
AC_SUBST([THEME])
dnl Check for JPEG support
AC_MSG_CHECKING([wheter to build support for JPEG images])
AC_ARG_ENABLE(image-jpeg,
AC_HELP_STRING([--enable-image-jpeg],
[enable support for JPEG images [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(jpeg, jpeg_read_header,
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP([#include <jpeglib.h>],
jpeg_ok=yes,
jpeg_ok=no)
AC_MSG_RESULT($jpeg_ok)
if test "$jpeg_ok" = yes; then
AC_DEFINE(HAVE_IMAGE_JPEG, [1], [Define to 1 if you have jpeg6b])
LIBS="$LIBS -ljpeg"
FEATURES="$FEATURES image-jpeg"
fi,
AC_MSG_RESULT([no]))
else
AC_MSG_RESULT([no])
fi
dnl Check for XPM support
AC_MSG_CHECKING([wheter to build support XPM images])
AC_ARG_ENABLE(image-xpm,
AC_HELP_STRING([--enable-image-xpm],
[enable support for XPM images [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xpm, XpmReadFileToPixmap,
AC_MSG_CHECKING([for X11/xpm.h])
AC_TRY_COMPILE(
#include <X11/xpm.h>
, int foo = XpmSuccess,
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_IMAGE_XPM, [1], [Define to 1 if you libXpm])
LIBS="$LIBS -lXpm"
FEATURES="$FEATURES image-xpm",
AC_MSG_RESULT([no])))
else
AC_MSG_RESULT([no])
fi
dnl Check for XRANDR support
AC_MSG_CHECKING([wheter to build support for the XRANDR extension])
AC_ARG_ENABLE(xrandr,
AC_HELP_STRING([--enable-xrandr],
[enable support for the XRANDR extension [default=yes]]), ,
[enable_xrandr=yes])
if test "x$enable_xrandr" = "xyes"; then
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES([xrandr], [xrandr >= 1.2.0], HAVE_XRANDR=yes, HAVE_XRANDR=no)
if test "x$HAVE_XRANDR" = "xyes"
then
AC_DEFINE(HAVE_XRANDR, [1], [Define to 1 if you have an XRANDR capable server])
LIBS="$LIBS $xrandr_LIBS"
CXXFLAGS="$CXXFLAGS $xrandr_CFLAGS"
FEATURES="$FEATURES Xrandr"
else
AC_MSG_WARN([Couldn't find Xrandr >= 1.2.0])
fi
else
AC_MSG_RESULT([no])
fi
dnl Check for header files
AC_STDC_HEADERS
AC_CHECK_HEADERS([limits])
dnl Check for library functions
AC_CHECK_FUNC(setenv, [AC_DEFINE(HAVE_SETENV, [1], [Define to 1 if you the setenv systam call])], )
AC_CHECK_FUNC(unsetenv, [AC_DEFINE(HAVE_UNSETENV, [1], [Define to 1 if you the unsetenv systam call])], )
AC_CHECK_FUNC(swprintf, [AC_DEFINE(HAVE_SWPRINTF, [1], [Define to 1 if you have swprintf])], )
dnl Check whether time.h has timersub
AC_MSG_CHECKING(for timersub in time.h)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <sys/time.h>],
[struct timeval *a; timersub(a, a, a);])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_TIMERSUB], 1, [Define to 1 if your system defines timersub.]),
AC_MSG_RESULT(no)
)
dnl Check for required Xlib headers
AC_CHECK_HEADERS([X11/Xutil.h], , AC_MSG_ERROR([Could not find X11/Xutil.h header file]))
dnl Check for XkbKeycodeToKeysym replacing XKeycodeToKeysym
AC_CHECK_HEADERS([X11/XKBlib.h])
dnl Check simple toggles ( no outer dependecies )
dnl Check whether to include debugging code
AC_MSG_CHECKING([whether to include verbose debugging code])
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[include verbose debugging code [default=no]]), ,
[enable_debug=no])
if test "x$enable_debug" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(DEBUG, [1], [Define to 1 to compile in debug information])
FEATURES="$FEATURES debug"
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([DEBUG_INFRASTRUCTURE], [test x"$enable_debug" = "xyes"])
dnl Check wheter to use strict warnings
AC_MSG_CHECKING([whether to use strict compile-time warnings])
AC_ARG_ENABLE(pedantic,
AC_HELP_STRING([--enable-pedantic],
[turn on strict compile-time warnings [default=no]]), ,
[enable_pedantic=no])
if test "$enable_pedantic" = "yes"; then
AC_MSG_RESULT([yes])
if test "x$GXX" = "xyes"; then
CXXFLAGS="-Wall -Werror -pedantic $CXXFLAGS"
fi
FEATURES="$FEATURES pedantic"
else
AC_MSG_RESULT([no])
fi
dnl define build info
EVO=`date`
AC_DEFINE_UNQUOTED(FEATURES, "$FEATURES", [Build info, do not touch])
dnl create the makefiles
AC_OUTPUT(Makefile
src/Makefile
data/Makefile
data/themes/Makefile
data/themes/default/Makefile
data/themes/default-plain/Makefile
data/scripts/Makefile
doc/Makefile
contrib/Makefile
contrib/lobo/Makefile)
dnl print results
AC_MSG_RESULT([*])
AC_MSG_RESULT([* $PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([*])
AC_MSG_RESULT([* PREFIX: $prefix])
AC_MSG_RESULT([* FEATURES: $FEATURES])
AC_MSG_RESULT([* CXXFLAGS: $CXXFLAGS])
AC_MSG_RESULT([* LIBS: $LIBS])
AC_MSG_RESULT([*])
|