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])
33 AC_CHECK_FUNC(sysinfo,
34 [SYSINFO_FCT='1' AC_DEFINE([HAVE_SYSINFO_FCT],[1],[Use sysinfo])],
35 [AC_MSG_WARN("sysinfo function not present")])
36 AM_CONDITIONAL(SYSINFO_FCT, test -n "$SYSINFO_FCT")
38 AM_GNU_GETTEXT_VERSION([0.16])
39 AM_GNU_GETTEXT([external])
41 ############### common
43 # Checks sensors, required by psensor and psensor-server
44 AC_CHECK_LIB(sensors, sensors_init)
45 AC_CHECK_HEADERS([sensors/sensors.h sensors/errors.h])
46 SENSORS_LIBS=-lsensors
47 AC_SUBST(SENSORS_LIBS)
49 ############### psensor
53 PKG_CHECK_MODULES(X11, x11)
57 PKG_CHECK_MODULES(XEXT, xext)
63 PKG_CHECK_MODULES(GTK,
65 [AC_DEFINE([HAVE_GTK3],[1],[Use GTK3])],
66 [AC_MSG_WARN("GTK+ 3 not present")])
67 AM_CONDITIONAL(GTK, test -n "$GTK_LIBS")
71 if test "$GTK_LIBS" == ""; then
72 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18)
73 AM_CONDITIONAL(GTK, test -n "$GTK_LIBS")
79 PKG_CHECK_MODULES(GCONF, gconf-2.0)
80 AC_SUBST(GCONF_CFLAGS)
87 PKG_CHECK_MODULES(LIBNOTIFY,
89 [AC_DEFINE([HAVE_LIBNOTIFY],[1],[Use desktop notification])],
90 [AC_MSG_WARN("Desktop notification disabled")])
91 AM_CONDITIONAL(LIBNOTIFY, test -n "$LIBNOTIFY_LIBS")
92 AC_SUBST(LIBNOTIFY_CFLAGS)
93 AC_SUBST(LIBNOTIFY_LIBS)
98 PKG_CHECK_MODULES(APPINDICATOR, appindicator3-0.1,
99 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator3-0.1])],
100 [AC_MSG_WARN(AppIndicator 3-0.1 not present")])
102 if test "$APPINDICATOR_LIBS" == ""; then
103 PKG_CHECK_MODULES(APPINDICATOR,
104 appindicator-0.1 <= 0.2.9 ,
105 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator 0.2.9])
106 AC_DEFINE([HAVE_APPINDICATOR_029],[1],[Use AppIndicator 0.2.9])
108 [AC_MSG_WARN(AppIndicator 0.2.9 not present")])
111 if test "$APPINDICATOR_LIBS" == ""; then
112 PKG_CHECK_MODULES(APPINDICATOR,
113 appindicator-0.1 > 0.2.9,
114 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator > 0.2.9])],
115 [AC_MSG_WARN("AppIndicator > 0.2.9 not present")])
117 AM_CONDITIONAL(APPINDICATOR, test -n "$APPINDICATOR_LIBS")
118 AC_SUBST(APPINDICATOR_CFLAGS)
119 AC_SUBST(APPINDICATOR_LIBS)
121 # Check CURL, needed for remote monitoring
123 PKG_CHECK_MODULES(CURL,
125 [AC_DEFINE([HAVE_CURL],[1],[Use CURL])],
126 [AC_MSG_WARN("Remote monitoring disabled, curl missing")])
127 AM_CONDITIONAL(CURL, test -n "$CURL_LIBS")
128 AC_SUBST(CURL_CFLAGS)
131 # Check JSON, needed for remote monitoring
133 PKG_CHECK_MODULES(JSON,
135 [AC_DEFINE([HAVE_JSON],[1],[Use JSON])],
136 [AC_MSG_WARN("Remote monitoring disabled, json missing")])
137 AM_CONDITIONAL(JSON, test -n "$JSON_LIBS")
138 AC_SUBST(JSON_CFLAGS)
141 # Enables remote monitoring if JSON and CURL is present
142 if test -n "$JSON_LIBS"; then
143 if test -n "$CURL_LIBS"; then
144 AC_DEFINE([HAVE_REMOTE_SUPPORT],[1],[Remote monitoring enabled])
149 # following code from sensors-applet
150 # sensors-applet.sourceforge.net/
151 AC_CHECK_HEADERS(NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h,
152 [ HAVE_NVIDIA=true ], [],
154 #include <X11/Xlib.h>
156 if test -n "${X11_LIBS}"; then
157 LIBS="${LIBS} -lX11 -lXext"
159 if test "${HAVE_NVIDIA}" = "true"; then
160 AC_CHECK_LIB(XNVCtrl,XNVCTRLQueryExtension,
161 [NVIDIA_LIBS="-lXNVCtrl -lX11 -lXext"
162 AC_DEFINE(HAVE_NVIDIA,1,[NVidia support enabled])
166 AM_CONDITIONAL(NVIDIA, test -n "$NVIDIA_LIBS")
167 AC_SUBST(NVIDIA_CFLAGS)
168 AC_SUBST(NVIDIA_LIBS)
171 PKG_CHECK_MODULES(UNITY,
173 [AC_DEFINE([HAVE_UNITY],[1],[Use Unity])],
174 [AC_MSG_WARN(Unity not present)])
175 AC_SUBST(UNITY_CFLAGS)
177 AM_CONDITIONAL(UNITY, test -n "$UNITY_LIBS")
180 AC_ARG_WITH(libatiadl,
181 [ --with-libatiadl[=DIR] use libatiadlxx in DIR],[
182 ATIADL_DIR=${withval}
183 CPPFLAGS="${CPPFLAGS} -I${ATIADL_DIR}/include"
184 LIBS="$LIBS -L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst"
188 AC_CHECK_HEADERS(adl_defines.h,
189 AC_CHECK_LIB(atiadlxx,ADL_Main_Control_Refresh,
191 AC_DEFINE(HAVE_LIBATIADL,1,[libatiadl is available])
192 LIBATIADL_CFLAGS="-I${ATIADL_DIR}/include"
193 LIBATIADL_LIBS="-L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst -latiadlxx -ldl"
196 AM_CONDITIONAL(LIBATIADL, test -n "$LIBATIADL_LIBS")
197 AC_SUBST(LIBATIADL_CFLAGS)
198 AC_SUBST(LIBATIADL_LIBS)
200 ############### psensor-server
202 # libmicrohttpd, mandatory for psensor-server
204 PKG_CHECK_MODULES(LIBMICROHTTPD,
206 [AC_DEFINE([HAVE_LIBMICROHTTPD],[1],[Use libmicrohttpd])],
207 [AC_MSG_WARN("libmicrohttpd not present, psensor-server will NOT be built")])
208 AM_CONDITIONAL(LIBMICROHTTPD, test -n "$LIBMICROHTTPD_LIBS")
209 AC_SUBST(LIBMICROHTTPD_CFLAGS)
210 AC_SUBST(LIBMICROHTTPD_LIBS)
215 [ --with-gtop[=yes|no] use gtop],[
216 with_gtop=$withval],[
221 if test "$with_gtop" = "yes"; then
222 PKG_CHECK_MODULES(GTOP,
224 [AC_DEFINE([HAVE_GTOP],[1],[Use GTOP])],
225 [AC_MSG_WARN("gtop not present, CPU/Memory information will NOT be available")])
227 AM_CONDITIONAL(GTOP, test -n "$GTOP_LIBS")
228 AC_SUBST(GTOP_CFLAGS)
237 icons/hicolor/scalable/Makefile
238 icons/hicolor/14x14/Makefile
239 icons/hicolor/16x16/Makefile
240 icons/hicolor/22x22/Makefile
241 icons/hicolor/24x24/Makefile
242 icons/hicolor/32x32/Makefile
243 icons/hicolor/48x48/Makefile
244 icons/hicolor/64x64/Makefile
245 icons/ubuntu-mono-dark/status/22/Makefile
246 icons/ubuntu-mono-light/status/22/Makefile
247 icons/ubuntu-mono-dark/apps/22/Makefile
253 AC_CHECK_PROGS([HELP2MAN], [help2man])