upower/configure.ac

246 lines
6.6 KiB
Text
Raw Normal View History

2008-05-08 22:29:38 -04:00
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59c)
2009-07-22 13:06:00 +01:00
AC_INIT(DeviceKit-power, 011, http://lists.freedesktop.org/mailman/listinfo/devkit-devel)
AM_INIT_AUTOMAKE(DeviceKit-power, 011)
2008-05-08 22:29:38 -04:00
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
# enable nice build output on automake1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
# use this in dkp-version.h
AC_SUBST(VERSION)
# libtool versioning - this applies to devkit-power-gobject
#
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
#
# increment;
# CURRENT If the API or ABI interface has changed (reset REVISION to 0)
# REVISION If the API and ABI remains the same, but bugs are fixed.
# AGE If libpackagekit can be linked into executables which can be
# built with previous versions of this library. Don't use.
LT_CURRENT=1
LT_REVISION=0
LT_AGE=0
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
2008-05-08 22:29:38 -04:00
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AM_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_SYS_LARGEFILE
AM_PROG_CC_C_O
# Taken from dbus
AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(man-pages, [ --enable-man-pages build manual pages],enable_man_pages=$enableval,enable_man_pages=yes)
if test "${enable_man_page}" != no; then
dnl
dnl Check for xsltproc
dnl
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
enable_man_pages=no
fi
fi
AM_CONDITIONAL(MAN_PAGES_ENABLED, test x$enable_man_pages = xyes)
GTK_DOC_CHECK([1.3])
# udev rules go in /lib, not /usr/lib
if test "$prefix" = "/usr" -o "$prefix" = "/usr/local" ; then
slashlibdir=/lib
else
slashlibdir=$prefix/lib
fi
AC_SUBST(slashlibdir)
2008-05-08 22:29:38 -04:00
#### gcc warning flags
2008-08-01 11:10:04 +01:00
dnl ---------------------------------------------------------------------------
dnl - Extra verbose warning switches, disable if needed
dnl ---------------------------------------------------------------------------
if test "$GCC" = "yes"; then
CPPFLAGS="$CPPFLAGS -Werror -Wcast-align -Wno-uninitialized"
CPPFLAGS="$CPPFLAGS -Wall -Wformat-security"
# CPPFLAGS="$CPPFLAGS -Wall"
fi
2008-05-08 22:29:38 -04:00
if test "x$GCC" = "xyes"; then
changequote(,)dnl
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wnested-externs[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wnested-externs" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wpointer-arith[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wpointer-arith" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wcast-align[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wcast-align" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wsign-compare[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wsign-compare" ;;
esac
case " $CFLAGS " in
*[\ \ ]-Wno-strict-aliasing[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wno-strict-aliasing" ;;
esac
2008-05-08 22:29:38 -04:00
if test "x$enable_ansi" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-ansi[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -ansi" ;;
esac
case " $CFLAGS " in
*[\ \ ]-D_POSIX_C_SOURCE*) ;;
*) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
esac
case " $CFLAGS " in
*[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
esac
case " $CFLAGS " in
*[\ \ ]-pedantic[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -pedantic" ;;
esac
fi
changequote([,])dnl
fi
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.6.0])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.0])
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
2008-11-11 09:31:16 -05:00
PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= 0.76])
2008-05-08 22:29:38 -04:00
AC_SUBST(DBUS_GLIB_CFLAGS)
AC_SUBST(DBUS_GLIB_LIBS)
2009-07-06 13:41:48 +01:00
PKG_CHECK_MODULES(POLKIT, [polkit-gobject-1 >= 0.91])
AC_SUBST(POLKIT_CFLAGS)
AC_SUBST(POLKIT_LIBS)
2008-05-08 22:29:38 -04:00
PKG_CHECK_MODULES(GIO, [gio-2.0 >= 2.16.1])
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
dnl ---------------------------------------------------------------------------
dnl - Compile time default choice of backend
dnl ---------------------------------------------------------------------------
AC_ARG_WITH([backend],
AS_HELP_STRING([--with-backend=<option>],
[Default backend to use linux, dummy (dummy)]))
# default to a sane option
if test x$with_backend = x; then
if test -e /usr/include/libudev.h ; then
with_backend=linux
else
with_backend=dummy
fi
fi
AC_DEFINE_UNQUOTED(BACKEND, "$with_backend", [backend])
AC_SUBST(BACKEND, "$with_backend")
# only need GUdev on linux
if test x$with_backend = xlinux; then
PKG_CHECK_MODULES(GUDEV, [gudev-1.0 >= 001])
AC_SUBST(GUDEV_CFLAGS)
AC_SUBST(GUDEV_LIBS)
dnl Check libusb also
AC_CHECK_HEADERS(usb.h, , [AC_MSG_ERROR([Can't find usb.h. Please install libusb.])])
AC_CHECK_LIB([usb], [usb_find_devices], [], [AC_MSG_ERROR([Can't use libusb.])])
fi
2008-08-11 12:28:08 +01:00
2008-05-08 22:29:38 -04:00
if test "x$GCC" = "xyes"; then
LDFLAGS="-Wl,--as-needed $LDFLAGS"
fi
2008-11-11 09:31:16 -05:00
IT_PROG_INTLTOOL([0.40.0])
2008-05-08 22:29:38 -04:00
GETTEXT_PACKAGE=DeviceKit-power
AC_SUBST([GETTEXT_PACKAGE])
AM_GLIB_GNU_GETTEXT
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[gettext domain])
AC_OUTPUT([
Makefile
devkit-power-gobject.pc
2008-05-08 22:29:38 -04:00
src/Makefile
src/dummy/Makefile
src/linux/Makefile
2008-05-08 22:29:38 -04:00
tools/Makefile
doc/Makefile
doc/version.xml
doc/man/Makefile
doc/dbus/Makefile
policy/Makefile
rules/Makefile
devkit-power-gobject/Makefile
devkit-power-gobject/dkp-version.h
2008-05-08 22:29:38 -04:00
po/Makefile.in
])
dnl ==========================================================================
echo "
DeviceKit-power $VERSION
=======================
prefix: ${prefix}
libdir: ${libdir}
libexecdir: ${libexecdir}
bindir: ${bindir}
sbindir: ${sbindir}
datadir: ${datadir}
sysconfdir: ${sysconfdir}
localstatedir: ${localstatedir}
docdir: ${docdir}
compiler: ${CC}
cflags: ${CFLAGS}
cppflags: ${CPPFLAGS}
xsltproc: ${XSLTPROC}
Backend: ${with_backend}
2008-05-08 22:29:38 -04:00
Maintainer mode: ${USE_MAINTAINER_MODE}
Building api docs: ${enable_gtk_doc}
Building man pages: ${enable_man_pages}
"