2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([psensor], [0.6.1.8],[wpitchoune@gmail.com],[psensor],[http://wpitchoune.net/psensor])
7 AM_INIT_AUTOMAKE([-Wall -Werror gnu])
9 AC_CONFIG_SRCDIR([src/compat.h])
10 AC_CONFIG_HEADERS([config.h])
12 # Checks for programs.
19 # Checks for header files.
21 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])
23 # Checks for typedefs, structures, and compiler characteristics.
27 # Checks for library functions.
30 AC_CHECK_FUNCS([gettimeofday memmove socket strdup strtol])
32 AM_GNU_GETTEXT_VERSION([0.16])
33 AM_GNU_GETTEXT([external])
35 ############### common
37 # Checks sensors, required by psensor and psensor-server
38 AC_CHECK_LIB(sensors, sensors_init)
39 AC_CHECK_HEADERS([sensors/sensors.h sensors/errors.h])
40 SENSORS_LIBS=-lsensors
41 AC_SUBST(SENSORS_LIBS)
43 ############### psensor
47 PKG_CHECK_MODULES(X11, x11)
51 PKG_CHECK_MODULES(XEXT, xext)
56 PKG_CHECK_MODULES(GTK, gtk+-2.0 )
61 PKG_CHECK_MODULES(GCONF, gconf-2.0)
62 AC_SUBST(GCONF_CFLAGS)
69 PKG_CHECK_MODULES(LIBNOTIFY,
71 [AC_DEFINE([HAVE_LIBNOTIFY],[1],[Use desktop notification])],
72 [AC_MSG_WARN("Desktop notification disabled")])
73 AM_CONDITIONAL(LIBNOTIFY, test -n "$LIBNOTIFY_LIBS")
74 AC_SUBST(LIBNOTIFY_CFLAGS)
75 AC_SUBST(LIBNOTIFY_LIBS)
80 PKG_CHECK_MODULES(APPINDICATOR,
81 appindicator-0.1 = 0.2.9 ,
82 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator 0.2.9])
83 AC_DEFINE([HAVE_APPINDICATOR_029],[1],[Use AppIndicator 0.2.9])
85 [AC_MSG_WARN(AppIndicator 0.2.9 not present")])
87 if test "$APPINDICATOR_LIBS" == ""; then
88 PKG_CHECK_MODULES(APPINDICATOR,
89 appindicator-0.1 > 0.2.9,
90 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator > 0.2.9])],
91 [AC_MSG_WARN("AppIndicator > 0.2.9 not present")])
93 AM_CONDITIONAL(APPINDICATOR, test -n "$APPINDICATOR_LIBS")
94 AC_SUBST(APPINDICATOR_CFLAGS)
95 AC_SUBST(APPINDICATOR_LIBS)
97 # Check CURL, needed for remote monitoring
99 PKG_CHECK_MODULES(CURL,
101 [AC_DEFINE([HAVE_CURL],[1],[Use CURL])],
102 [AC_MSG_WARN("Remote monitoring disabled, curl missing")])
103 AM_CONDITIONAL(CURL, test -n "$CURL_LIBS")
104 AC_SUBST(CURL_CFLAGS)
107 # Check JSON, needed for remote monitoring
109 PKG_CHECK_MODULES(JSON,
111 [AC_DEFINE([HAVE_JSON],[1],[Use JSON])],
112 [AC_MSG_WARN("Remote monitoring disabled, json missing")])
113 AM_CONDITIONAL(JSON, test -n "$JSON_LIBS")
114 AC_SUBST(JSON_CFLAGS)
117 # Enables remote monitoring if JSON and CURL is present
118 if test -n "$JSON_LIBS"; then
119 if test -n "$CURL_LIBS"; then
120 AC_DEFINE([HAVE_REMOTE_SUPPORT],[1],[Remote monitoring enabled])
125 # following code from sensors-applet
126 # sensors-applet.sourceforge.net/
127 AC_CHECK_HEADERS(NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h,
128 [ HAVE_NVIDIA=true ], [],
130 #include <X11/Xlib.h>
132 if test -n "${X11_LIBS}"; then
133 LIBS="${LIBS} -lX11 -lXext"
135 if test "${HAVE_NVIDIA}" = "true"; then
136 AC_CHECK_LIB(XNVCtrl,XNVCTRLQueryExtension,
137 [NVIDIA_LIBS="-lXNVCtrl -lX11 -lXext"
138 AC_DEFINE(HAVE_NVIDIA,1,[NVidia support enabled])
142 AM_CONDITIONAL(NVIDIA, test -n "$NVIDIA_LIBS")
143 AC_SUBST(NVIDIA_CFLAGS)
144 AC_SUBST(NVIDIA_LIBS)
146 ############### psensor-server
148 # Checks Lua 5.1 (required)
150 PKG_CHECK_MODULES(LUA,
152 [AC_DEFINE([HAVE_LUA],[1],[Use Lua])],
153 [AC_MSG_WARN(Lua not present, checks Lua5.1)])
155 # Ubuntu pkg module is lua5.1 not lua
156 if test "$LUA_LIBS" == ""; then
157 PKG_CHECK_MODULES(LUA,
159 [AC_DEFINE([HAVE_LUA],[1],[Use Lua5.1])],
160 [AC_MSG_WARN(Lua5.1 not present, psensor-server will NOT be built")])
162 AM_CONDITIONAL(LUA, test -n "$LUA_LIBS")
166 # libmicrohttpd, mandatory for psensor-server
168 PKG_CHECK_MODULES(LIBMICROHTTPD,
170 [AC_DEFINE([HAVE_LIBMICROHTTPD],[1],[Use libmicrohttpd])],
171 [AC_MSG_WARN("libmicrohttpd not present, psensor-server will NOT be built")])
172 AM_CONDITIONAL(LIBMICROHTTPD, test -n "$LIBMICROHTTPD_LIBS")
173 AC_SUBST(LIBMICROHTTPD_CFLAGS)
174 AC_SUBST(LIBMICROHTTPD_LIBS)
179 [ --with-gtop[=yes|no] use gtop],[
180 with_gtop=$withval],[
185 if test "$with_gtop" = "yes"; then
186 PKG_CHECK_MODULES(GTOP,
188 [AC_DEFINE([HAVE_GTOP],[1],[Use GTOP])],
189 [AC_MSG_WARN("gtop not present, CPU/Memory information will NOT be available")])
191 AM_CONDITIONAL(GTOP, test -n "$GTOP_LIBS")
192 AC_SUBST(GTOP_CFLAGS)
200 src/libpsensor_json/Makefile
202 pixmaps/scalable/Makefile
203 pixmaps/48x48/Makefile
209 AC_CHECK_PROGS([HELP2MAN], [help2man])