2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([psensor], [0.6.2.x],[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])
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)
57 PKG_CHECK_MODULES(GTK,
59 [AC_DEFINE([HAVE_GTK3],[1],[Use GTK3])],
60 [AC_MSG_WARN("GTK+ 3 not present")])
61 AM_CONDITIONAL(GTK, test -n "$GTK_LIBS")
65 if test "$GTK_LIBS" == ""; then
66 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18)
67 AM_CONDITIONAL(GTK, test -n "$GTK_LIBS")
73 PKG_CHECK_MODULES(GCONF, gconf-2.0)
74 AC_SUBST(GCONF_CFLAGS)
81 PKG_CHECK_MODULES(LIBNOTIFY,
83 [AC_DEFINE([HAVE_LIBNOTIFY],[1],[Use desktop notification])],
84 [AC_MSG_WARN("Desktop notification disabled")])
85 AM_CONDITIONAL(LIBNOTIFY, test -n "$LIBNOTIFY_LIBS")
86 AC_SUBST(LIBNOTIFY_CFLAGS)
87 AC_SUBST(LIBNOTIFY_LIBS)
92 PKG_CHECK_MODULES(APPINDICATOR, appindicator3-0.1,
93 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator3-0.1])],
94 [AC_MSG_WARN(AppIndicator 3-0.1 not present")])
96 if test "$APPINDICATOR_LIBS" == ""; then
97 PKG_CHECK_MODULES(APPINDICATOR,
98 appindicator-0.1 <= 0.2.9 ,
99 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator 0.2.9])
100 AC_DEFINE([HAVE_APPINDICATOR_029],[1],[Use AppIndicator 0.2.9])
102 [AC_MSG_WARN(AppIndicator 0.2.9 not present")])
105 if test "$APPINDICATOR_LIBS" == ""; then
106 PKG_CHECK_MODULES(APPINDICATOR,
107 appindicator-0.1 > 0.2.9,
108 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator > 0.2.9])],
109 [AC_MSG_WARN("AppIndicator > 0.2.9 not present")])
111 AM_CONDITIONAL(APPINDICATOR, test -n "$APPINDICATOR_LIBS")
112 AC_SUBST(APPINDICATOR_CFLAGS)
113 AC_SUBST(APPINDICATOR_LIBS)
115 # Check CURL, needed for remote monitoring
117 PKG_CHECK_MODULES(CURL,
119 [AC_DEFINE([HAVE_CURL],[1],[Use CURL])],
120 [AC_MSG_WARN("Remote monitoring disabled, curl missing")])
121 AM_CONDITIONAL(CURL, test -n "$CURL_LIBS")
122 AC_SUBST(CURL_CFLAGS)
125 # Check JSON, needed for remote monitoring
127 PKG_CHECK_MODULES(JSON,
129 [AC_DEFINE([HAVE_JSON],[1],[Use JSON])],
130 [AC_MSG_WARN("Remote monitoring disabled, json missing")])
131 AM_CONDITIONAL(JSON, test -n "$JSON_LIBS")
132 AC_SUBST(JSON_CFLAGS)
135 # Enables remote monitoring if JSON and CURL is present
136 if test -n "$JSON_LIBS"; then
137 if test -n "$CURL_LIBS"; then
138 AC_DEFINE([HAVE_REMOTE_SUPPORT],[1],[Remote monitoring enabled])
143 # following code from sensors-applet
144 # sensors-applet.sourceforge.net/
145 AC_CHECK_HEADERS(NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h,
146 [ HAVE_NVIDIA=true ], [],
148 #include <X11/Xlib.h>
150 if test -n "${X11_LIBS}"; then
151 LIBS="${LIBS} -lX11 -lXext"
153 if test "${HAVE_NVIDIA}" = "true"; then
154 AC_CHECK_LIB(XNVCtrl,XNVCTRLQueryExtension,
155 [NVIDIA_LIBS="-lXNVCtrl -lX11 -lXext"
156 AC_DEFINE(HAVE_NVIDIA,1,[NVidia support enabled])
160 AM_CONDITIONAL(NVIDIA, test -n "$NVIDIA_LIBS")
161 AC_SUBST(NVIDIA_CFLAGS)
162 AC_SUBST(NVIDIA_LIBS)
165 PKG_CHECK_MODULES(UNITY,
167 [AC_DEFINE([HAVE_UNITY],[1],[Use Unity])],
168 [AC_MSG_WARN(Unity not present)])
169 AC_SUBST(UNITY_CFLAGS)
171 AM_CONDITIONAL(UNITY, test -n "$UNITY_LIBS")
174 AC_ARG_WITH(libatiadl,
175 [ --with-libatiadl[=DIR] use libatiadlxx in DIR],[
176 ATIADL_DIR=${withval}
177 CPPFLAGS="${CPPFLAGS} -I${ATIADL_DIR}/include"
178 LIBS="$LIBS -L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst"
182 AC_CHECK_HEADERS(adl_defines.h,
183 AC_CHECK_LIB(atiadlxx,ADL_Main_Control_Refresh,
185 AC_DEFINE(HAVE_LIBATIADL,1,[libatiadl is available])
186 LIBATIADL_CFLAGS="-I${ATIADL_DIR}/include"
187 LIBATIADL_LIBS="-L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst -latiadlxx -ldl"
190 AM_CONDITIONAL(LIBATIADL, test -n "$LIBATIADL_LIBS")
191 AC_SUBST(LIBATIADL_CFLAGS)
192 AC_SUBST(LIBATIADL_LIBS)
194 ############### psensor-server
196 # libmicrohttpd, mandatory for psensor-server
198 PKG_CHECK_MODULES(LIBMICROHTTPD,
200 [AC_DEFINE([HAVE_LIBMICROHTTPD],[1],[Use libmicrohttpd])],
201 [AC_MSG_WARN("libmicrohttpd not present, psensor-server will NOT be built")])
202 AM_CONDITIONAL(LIBMICROHTTPD, test -n "$LIBMICROHTTPD_LIBS")
203 AC_SUBST(LIBMICROHTTPD_CFLAGS)
204 AC_SUBST(LIBMICROHTTPD_LIBS)
209 [ --with-gtop[=yes|no] use gtop],[
210 with_gtop=$withval],[
215 if test "$with_gtop" = "yes"; then
216 PKG_CHECK_MODULES(GTOP,
218 [AC_DEFINE([HAVE_GTOP],[1],[Use GTOP])],
219 [AC_MSG_WARN("gtop not present, CPU/Memory information will NOT be available")])
221 AM_CONDITIONAL(GTOP, test -n "$GTOP_LIBS")
222 AC_SUBST(GTOP_CFLAGS)
231 icons/hicolor/scalable/Makefile
232 icons/hicolor/14x14/Makefile
233 icons/hicolor/16x16/Makefile
234 icons/hicolor/22x22/Makefile
235 icons/hicolor/24x24/Makefile
236 icons/hicolor/32x32/Makefile
237 icons/hicolor/48x48/Makefile
238 icons/hicolor/64x64/Makefile
239 icons/ubuntu-mono-dark/status/22/Makefile
240 icons/ubuntu-mono-light/status/22/Makefile
241 icons/ubuntu-mono-dark/apps/22/Makefile
247 AC_CHECK_PROGS([HELP2MAN], [help2man])