2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([psensor], [0.6.2.15],[jeanfi@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 sys/sysinfo.h])
23 # Checks for typedefs, structures, and compiler characteristics.
27 # Checks for library functions.
30 AC_CHECK_FUNCS([gettimeofday memmove socket strdup strtol])
32 # Detects whether the function sysinfo is available
33 # At least kfreebsd 6.0.3 does not provide it.
35 AC_CHECK_FUNC(sysinfo,
36 [SYSINFO_FCT='1' AC_DEFINE([HAVE_SYSINFO_FCT],[1],[Use sysinfo])],
37 [AC_MSG_WARN("sysinfo function not present")])
38 AM_CONDITIONAL(SYSINFO_FCT, test -n "$SYSINFO_FCT")
40 AM_GNU_GETTEXT_VERSION([0.16])
41 AM_GNU_GETTEXT([external])
43 ############### common
45 # Checks sensors, required by psensor and psensor-server
46 AC_CHECK_LIB(sensors, sensors_init)
47 AC_CHECK_HEADERS([sensors/sensors.h sensors/errors.h])
48 SENSORS_LIBS=-lsensors
49 AC_SUBST(SENSORS_LIBS)
51 ############### psensor
55 PKG_CHECK_MODULES(X11, x11)
59 PKG_CHECK_MODULES(XEXT, xext)
65 PKG_CHECK_MODULES(GTK,
67 [AC_DEFINE([HAVE_GTK3],[1],[Use GTK3])],
68 [AC_MSG_WARN("GTK+ 3 not present")])
69 AM_CONDITIONAL(GTK, test -n "$GTK_LIBS")
73 if test "$GTK_LIBS" == ""; then
74 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18)
75 AM_CONDITIONAL(GTK, test -n "$GTK_LIBS")
81 PKG_CHECK_MODULES(GCONF, gconf-2.0)
82 AC_SUBST(GCONF_CFLAGS)
89 PKG_CHECK_MODULES(LIBNOTIFY,
91 [AC_DEFINE([HAVE_LIBNOTIFY],[1],[Use desktop notification])],
92 [AC_MSG_WARN("Desktop notification disabled")])
93 AM_CONDITIONAL(LIBNOTIFY, test -n "$LIBNOTIFY_LIBS")
94 AC_SUBST(LIBNOTIFY_CFLAGS)
95 AC_SUBST(LIBNOTIFY_LIBS)
100 PKG_CHECK_MODULES(APPINDICATOR, appindicator3-0.1,
101 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator3-0.1])],
102 [AC_MSG_WARN(AppIndicator 3-0.1 not present")])
104 if test "$APPINDICATOR_LIBS" == ""; then
105 PKG_CHECK_MODULES(APPINDICATOR,
106 appindicator-0.1 <= 0.2.9 ,
107 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator 0.2.9])
108 AC_DEFINE([HAVE_APPINDICATOR_029],[1],[Use AppIndicator 0.2.9])
110 [AC_MSG_WARN(AppIndicator 0.2.9 not present")])
113 if test "$APPINDICATOR_LIBS" == ""; then
114 PKG_CHECK_MODULES(APPINDICATOR,
115 appindicator-0.1 > 0.2.9,
116 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator > 0.2.9])],
117 [AC_MSG_WARN("AppIndicator > 0.2.9 not present")])
119 AM_CONDITIONAL(APPINDICATOR, test -n "$APPINDICATOR_LIBS")
120 AC_SUBST(APPINDICATOR_CFLAGS)
121 AC_SUBST(APPINDICATOR_LIBS)
123 # Check CURL, needed for remote monitoring
125 PKG_CHECK_MODULES(CURL,
127 [AC_DEFINE([HAVE_CURL],[1],[Use CURL])],
128 [AC_MSG_WARN("Remote monitoring disabled, curl missing")])
129 AM_CONDITIONAL(CURL, test -n "$CURL_LIBS")
130 AC_SUBST(CURL_CFLAGS)
133 # Check JSON, needed for remote monitoring
135 PKG_CHECK_MODULES(JSON,
137 [AC_DEFINE([HAVE_JSON],[1],[Use JSON])],
138 [AC_MSG_WARN("Remote monitoring disabled, json missing")])
139 AM_CONDITIONAL(JSON, test -n "$JSON_LIBS")
140 AC_SUBST(JSON_CFLAGS)
143 # Enables remote monitoring if JSON and CURL is present
144 if test -n "$JSON_LIBS"; then
145 if test -n "$CURL_LIBS"; then
146 AC_DEFINE([HAVE_REMOTE_SUPPORT],[1],[Remote monitoring enabled])
151 # following code from sensors-applet
152 # sensors-applet.sourceforge.net/
153 AC_CHECK_HEADERS(NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h,
154 [ HAVE_NVIDIA=true ], [],
156 #include <X11/Xlib.h>
158 if test -n "${X11_LIBS}"; then
159 LIBS="${LIBS} -lX11 -lXext"
161 if test "${HAVE_NVIDIA}" = "true"; then
162 AC_CHECK_LIB(XNVCtrl,XNVCTRLQueryExtension,
163 [NVIDIA_LIBS="-lXNVCtrl -lX11 -lXext"
164 AC_DEFINE(HAVE_NVIDIA,1,[NVidia support enabled])
168 AM_CONDITIONAL(NVIDIA, test -n "$NVIDIA_LIBS")
169 AC_SUBST(NVIDIA_CFLAGS)
170 AC_SUBST(NVIDIA_LIBS)
173 PKG_CHECK_MODULES(UNITY,
175 [AC_DEFINE([HAVE_UNITY],[1],[Use Unity])],
176 [AC_MSG_WARN(Unity not present)])
177 AC_SUBST(UNITY_CFLAGS)
179 AM_CONDITIONAL(UNITY, test -n "$UNITY_LIBS")
182 AC_ARG_WITH(libatiadl,
183 [ --with-libatiadl[=DIR] use libatiadlxx in DIR],[
184 ATIADL_DIR=${withval}
185 CPPFLAGS="${CPPFLAGS} -I${ATIADL_DIR}/include"
186 LIBS="$LIBS -L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst"
190 AC_CHECK_HEADERS(adl_defines.h,
191 AC_CHECK_LIB(atiadlxx,ADL_Main_Control_Refresh,
193 AC_DEFINE(HAVE_LIBATIADL,1,[libatiadl is available])
194 LIBATIADL_CFLAGS="-I${ATIADL_DIR}/include"
195 LIBATIADL_LIBS="-L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst -latiadlxx -ldl"
198 AM_CONDITIONAL(LIBATIADL, test -n "$LIBATIADL_LIBS")
199 AC_SUBST(LIBATIADL_CFLAGS)
200 AC_SUBST(LIBATIADL_LIBS)
202 ############### psensor-server
204 # libmicrohttpd, mandatory for psensor-server
206 PKG_CHECK_MODULES(LIBMICROHTTPD,
208 [AC_DEFINE([HAVE_LIBMICROHTTPD],[1],[Use libmicrohttpd])],
209 [AC_MSG_WARN("libmicrohttpd not present, psensor-server will NOT be built")])
210 AM_CONDITIONAL(LIBMICROHTTPD, test -n "$LIBMICROHTTPD_LIBS")
211 AC_SUBST(LIBMICROHTTPD_CFLAGS)
212 AC_SUBST(LIBMICROHTTPD_LIBS)
217 [ --with-gtop[=yes|no] use gtop],[
218 with_gtop=$withval],[
223 if test "$with_gtop" = "yes"; then
224 PKG_CHECK_MODULES(GTOP,
226 [AC_DEFINE([HAVE_GTOP],[1],[Use GTOP])],
227 [AC_MSG_WARN("gtop not present, CPU/Memory information will NOT be available")])
229 AM_CONDITIONAL(GTOP, test -n "$GTOP_LIBS")
230 AC_SUBST(GTOP_CFLAGS)
239 icons/hicolor/scalable/Makefile
240 icons/hicolor/14x14/Makefile
241 icons/hicolor/16x16/Makefile
242 icons/hicolor/22x22/Makefile
243 icons/hicolor/24x24/Makefile
244 icons/hicolor/32x32/Makefile
245 icons/hicolor/48x48/Makefile
246 icons/hicolor/64x64/Makefile
247 icons/ubuntu-mono-dark/status/22/Makefile
248 icons/ubuntu-mono-light/status/22/Makefile
249 icons/ubuntu-mono-dark/apps/22/Makefile
255 AC_CHECK_PROGS([HELP2MAN], [help2man])