# configure.ac # # Copyright: Francis BACQUE # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(bbdock, 0.2.6, Markus Fisch) AC_CONFIG_SRCDIR([src/Dock.cc]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE # Checks for programs. AC_PROG_CXX AC_PROG_CC CPPFLAGS="$CPPFLAGS -I$prefix/include" LDFLAGS="$LDFLAGS -L$prefix/lib" if test "x$prefix" != "x/usr/local"; then CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" fi # Checks for libraries. ############################################ # Thanks to blackbox developpers! # Check for X headers and libraries AC_PATH_X if test "x$no_x" = "xyes"; then AC_MSG_ERROR([bbdock requires the X Window System libraries and headers.]) fi if test "x$x_includes" != "x"; then CPPFLAGS="$CPPFLAGS -I$x_includes" CXXFLAGS="$CXXFLAGS -I$x_includes" fi if test "x$x_libraries" != "x"; then LIBS="$LIBS -L$x_libraries" fi # Check for required functions in -lX11 XLIB= AC_CHECK_LIB([X11], [XOpenDisplay], [XLIB=yes], [XLIB=no]) test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 libraries not found]) AC_CHECK_HEADERS([X11/Xlib.h], [XLIB=yes], [XLIB=no]) test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 headers not found]) AC_CHECK_HEADERS([X11/Xatom.h X11/Xlocale.h X11/Xresource.h X11/Xutil.h X11/keysym.h], [XLIB=yes], [XLIB=no], [ #include ]) test "x$XLIB" = "xno" && AC_MSG_ERROR([standard X11 headers not found]) # Check for SHAPE extension support and proper library files. AC_MSG_CHECKING([whether to build support for the SHAPE extension]) AC_ARG_ENABLE([shape], AC_HELP_STRING([--enable-shape], [enable support of the SHAPE extension @<:@default=yes@:>@]), [SHAPE="$enableval"], [SHAPE=yes]) AC_MSG_RESULT([$SHAPE]) if test "x$SHAPE" = "xyes"; then AC_CHECK_LIB([Xext], [XShapeCombineShape], [SHAPE=yes], [SHAPE=no]) if test "x$SHAPE" = "xyes"; then save_LIBS="$LIBS" if echo "$LIBS" | grep -q Xext 2>&1 >/dev/null; then LIBS="$LIBS -lXext" fi AC_CHECK_HEADERS([X11/extensions/shape.h], [SHAPE=yes], [SHAPE=no], [ #include ]) if test "x$SHAPE" = "xyes"; then SHAPE="-DSHAPE" else SHAPE= LIBS="$save_LIBS" fi else SHAPE= fi else SHAPE= fi AC_SUBST([SHAPE]) LIBS="$LIBS -lX11" ############################################ AC_CHECK_LIB([png], [png_check_sig]) AC_CHECK_LIB([z], [zlibVersion]) # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([stdlib.h string.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_HEADER_TIME # Checks for library functions. AC_FUNC_FORK AC_FUNC_SELECT_ARGTYPES AC_CHECK_FUNCS([bzero select strcasecmp strchr strcspn strstr]) AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT