# ================= initialization =================== # AC_INIT([GNOME Sensors Applet], [1.6.1], [pragmatine@gmail.com], [sensors-applet]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/main.c]) AM_CONFIG_HEADER([src/config.h]) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE # ============== basic compiler settings ============= # AC_PROG_CC AC_HEADER_STDC # =========== take care of some localization ========= # AH_TEMPLATE([GETTEXT_PACKAGE], [Package name for gettext]) GETTEXT_PACKAGE=sensors-applet AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE") AC_SUBST(GETTEXT_PACKAGE) ALL_LINGUAS="de es fi fr it pl ro ru" AM_GLIB_GNU_GETTEXT AC_PROG_INTLTOOL # ========== export compiler / linker options ======== # AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) # ============== look for dependencies =============== # # check for headers needed for standard interfaces AC_CHECK_HEADERS(stdio.h sys/types.h sys/socket.h netinet/in.h arpa/inet.h) GLIB_REQUIRED=2.6.0 GTK_REQUIRED=2.4.0 LIBPANEL_REQUIRED=2.0.0 LIBGNOME_REQUIRED=2.8.0 LIBGNOMEUI_REQUIRED=2.8.0 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) PKG_CHECK_MODULES(GNOME, libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libpanelapplet-2.0 >= $LIBPANEL_REQUIRED) AC_SUBST(GNOME_CFLAGS) AC_SUBST(GNOME_LIBS) PKG_CHECK_MODULES(GTK26TEST, gtk+-2.0 >= 2.6.0, gtk26present=true, gtk26present=false) if test "$gtk26present" = "true"; then echo "Building against GTK+ >=2.6.0" AC_DEFINE(HAVE_GTK_26, 1, GTK 2.6 Found) fi if test "$gtk26present" = "false"; then echo "Building against a version of GTK+ < 2.6.0 but >= 2.4.0" fi # allow user to specify libsensors support AC_ARG_WITH(libsensors, [ --with-libsensors[=DIR] use libsensors in DIR],[ if test "$withval" != "no" -a "$withval" != "yes"; then SENSORS_DIR=$withval CPPFLAGS="${CPPFLAGS} -I$withval/include/sensors" LDFLAGS="${LDFLAGS} -L$withval/lib" fi ]) if test "$with_libsensors" = "no"; then echo "Disabling lmsensors support" else # check for specfic headers needed for libsensors-sensors-interface AC_CHECK_HEADERS(assert.h regex.h) AC_CHECK_HEADERS(sensors/sensors.h, AC_CHECK_LIB(sensors, sensors_init,[ AC_DEFINE(HAVE_LIBSENSORS,1,[libsensors is available]) if test "x${SENSORS_DIR}" != "x"; then SENSORS_CFLAGS="-I${SENSORS_DIR}/include" SENSORS_LIBS="-L${SENSORS_DIR}/lib -lsensors" [case ${host} in *-*-solaris*) SENSORS_LIBS="-L${SENSORS_DIR}/lib -R${SENSORS_DIR}/lib -lsensors" ;; esac] else SENSORS_LIBS="-lsensors" fi])) fi AM_CONDITIONAL(LIBSENSORS, test -n "$SENSORS_LIBS") AC_SUBST(SENSORS_CFLAGS) AC_SUBST(SENSORS_LIBS) # for help docs stuff AC_PATH_PROG(XSLTPROC, xsltproc, no) if test x"$XSLTPROC" = xno; then AC_MSG_ERROR([xsltproc executable not found in your path - should be installed with libxslt]) fi GNOME_COMPILE_WARNINGS(maximum) # ================ gnome-doc-utils stuff ============= # GNOME_DOC_INIT # ================= generate files =================== # AC_CONFIG_FILES([ Makefile src/Makefile pixmaps/Makefile po/Makefile.in help/Makefile ]) AC_OUTPUT