# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
-AC_INIT([psensor], [0.6.2.9],[jeanfi@gmail.com],[psensor],[http://wpitchoune.net/psensor])
+AC_INIT([psensor], [0.7.0.x],[jeanfi@gmail.com],[psensor],[http://wpitchoune.net/psensor])
AM_INIT_AUTOMAKE([-Wall -Werror gnu])
# Checks for header files.
AC_PATH_X
-AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h getopt.h])
+AC_CHECK_HEADERS([stdbool.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AM_GNU_GETTEXT_VERSION([0.16])
AM_GNU_GETTEXT([external])
+# Gconf
+AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
+
+if test x"$GCONFTOOL" = xno; then
+ AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
+fi
+
+AM_GCONF_SOURCE_2
+
############### common
+# Checks pthread
+AC_CHECK_LIB(pthread, pthread_create)
+PTHREAD_LIBS=-pthread
+AC_SUBST(PTHREAD_LIBS)
+
# Checks sensors, required by psensor and psensor-server
AC_CHECK_LIB(sensors, sensors_init)
AC_CHECK_HEADERS([sensors/sensors.h sensors/errors.h])
AC_SUBST(XEXT_CFLAGS)
AC_SUBST(XEXT_LIBS)
-# Checks GTK
-PKG_CHECK_MODULES(GTK, gtk+-2.0 )
+# Checks GTK+ 3.0
+PKG_CHECK_MODULES(GTK, gtk+-3.0)
+# ensure that only allowed headers are included
+GTK_CFLAGS+=" -DGTK_DISABLE_SINGLE_INCLUDES "
+# ensure that no gtk deprecated symbols are used
+GTK_CFLAGS+=" -DGDK_DISABLE_DEPRECATED "
+GTK_CFLAGS+=" -DGTK_DISABLE_DEPRECATED "
+# ensure use of accessors
+GTK_CFLAGS+=" -DGSEAL_ENABLE "
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
### Optional
+# check libatasmart
+PKG_CHECK_MODULES(ATASMART, libatasmart,
+ [AC_DEFINE([HAVE_ATASMART],[1],[Use libatasmart])],
+ [AC_MSG_WARN("Library atasmart not present")])
+
+AM_CONDITIONAL(ATASMART, test -n "$ATASMART_LIBS")
+AC_SUBST(ATASMART_CFLAGS)
+AC_SUBST(ATASMART_LIBS)
+
# Check libnotify
LIBNOTIFY_LIBS=
PKG_CHECK_MODULES(LIBNOTIFY,
# Checks AppIndicator
APPINDICATOR_LIBS=
-PKG_CHECK_MODULES(APPINDICATOR,
+
+PKG_CHECK_MODULES(APPINDICATOR, appindicator3-0.1,
+ [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator3-0.1])],
+ [AC_MSG_WARN(AppIndicator 3-0.1 not present")])
+
+if test "$APPINDICATOR_LIBS" == ""; then
+ PKG_CHECK_MODULES(APPINDICATOR,
appindicator-0.1 <= 0.2.9 ,
[AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator 0.2.9])
AC_DEFINE([HAVE_APPINDICATOR_029],[1],[Use AppIndicator 0.2.9])
],
[AC_MSG_WARN(AppIndicator 0.2.9 not present")])
+fi
if test "$APPINDICATOR_LIBS" == ""; then
PKG_CHECK_MODULES(APPINDICATOR,
AC_SUBST(UNITY_LIBS)
AM_CONDITIONAL(UNITY, test -n "$UNITY_LIBS")
-############### psensor-server
+# libatiadl
+AC_ARG_WITH(libatiadl,
+[ --with-libatiadl[=DIR] use libatiadlxx in DIR],[
+ ATIADL_DIR=${withval}
+ CPPFLAGS="${CPPFLAGS} -I${ATIADL_DIR}/include"
+ LIBS="$LIBS -L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst"
+ ]
+)
+
+AC_CHECK_HEADERS(adl_defines.h,
+ AC_CHECK_LIB(atiadlxx,ADL_Main_Control_Refresh,
+ [
+ AC_DEFINE(HAVE_LIBATIADL,1,[libatiadl is available])
+ LIBATIADL_CFLAGS="-I${ATIADL_DIR}/include"
+ LIBATIADL_LIBS="-L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst -latiadlxx -ldl"
+ ]))
+
+AM_CONDITIONAL(LIBATIADL, test -n "$LIBATIADL_LIBS")
+AC_SUBST(LIBATIADL_CFLAGS)
+AC_SUBST(LIBATIADL_LIBS)
-# Checks Lua 5.1
-LUA_LIBS=
-PKG_CHECK_MODULES(LUA,
- lua,
- [AC_DEFINE([HAVE_LUA],[1],[Use Lua])],
- [AC_MSG_WARN(Lua not present, checks Lua5.1)])
-
-# Ubuntu pkg module is lua5.1 not lua
-if test "$LUA_LIBS" == ""; then
- PKG_CHECK_MODULES(LUA,
- lua5.1,
- [AC_DEFINE([HAVE_LUA],[1],[Use Lua5.1])],
- [AC_MSG_WARN(Lua5.1 not present, psensor-server will NOT be built")])
-fi
-AM_CONDITIONAL(LUA, test -n "$LUA_LIBS")
-AC_SUBST(LUA_CFLAGS)
-AC_SUBST(LUA_LIBS)
+############### psensor-server
# libmicrohttpd, mandatory for psensor-server
LIBMICROHTTPD_LIBS=
AC_CONFIG_FILES([
Makefile
+ doc/Makefile
src/Makefile
src/glade/Makefile
- src/plib/Makefile
src/lib/Makefile
- src/unity/Makefile
- src/libpsensor_json/Makefile
src/server/Makefile
- pixmaps/scalable/Makefile
- pixmaps/14x14/Makefile
- pixmaps/16x16/Makefile
- pixmaps/22x22/Makefile
- pixmaps/24x24/Makefile
- pixmaps/32x32/Makefile
- pixmaps/48x48/Makefile
- pixmaps/64x64/Makefile
+ icons/hicolor/scalable/Makefile
+ icons/hicolor/14x14/Makefile
+ icons/hicolor/16x16/Makefile
+ icons/hicolor/22x22/Makefile
+ icons/hicolor/24x24/Makefile
+ icons/hicolor/32x32/Makefile
+ icons/hicolor/48x48/Makefile
+ icons/hicolor/64x64/Makefile
+ icons/ubuntu-mono-dark/status/22/Makefile
+ icons/ubuntu-mono-light/status/22/Makefile
+ icons/ubuntu-mono-dark/apps/22/Makefile
www/Makefile
po/Makefile.in
tests/Makefile
AC_CHECK_PROGS([HELP2MAN], [help2man])
+AC_CHECK_PROG(HAVE_CPPCHECK, cppcheck, yes)
+AM_CONDITIONAL(CPPCHECK, test -n "$HAVE_CPPCHECK")
+
AC_OUTPUT