2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([psensor], [0.6.2.12],[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)
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)
79 PKG_CHECK_MODULES(APPINDICATOR,
80 appindicator-0.1 <= 0.2.9 ,
81 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator 0.2.9])
82 AC_DEFINE([HAVE_APPINDICATOR_029],[1],[Use AppIndicator 0.2.9])
84 [AC_MSG_WARN(AppIndicator 0.2.9 not present")])
86 if test "$APPINDICATOR_LIBS" == ""; then
87 PKG_CHECK_MODULES(APPINDICATOR,
88 appindicator-0.1 > 0.2.9,
89 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator > 0.2.9])],
90 [AC_MSG_WARN("AppIndicator > 0.2.9 not present")])
92 AM_CONDITIONAL(APPINDICATOR, test -n "$APPINDICATOR_LIBS")
93 AC_SUBST(APPINDICATOR_CFLAGS)
94 AC_SUBST(APPINDICATOR_LIBS)
96 # Check CURL, needed for remote monitoring
98 PKG_CHECK_MODULES(CURL,
100 [AC_DEFINE([HAVE_CURL],[1],[Use CURL])],
101 [AC_MSG_WARN("Remote monitoring disabled, curl missing")])
102 AM_CONDITIONAL(CURL, test -n "$CURL_LIBS")
103 AC_SUBST(CURL_CFLAGS)
106 # Check JSON, needed for remote monitoring
108 PKG_CHECK_MODULES(JSON,
110 [AC_DEFINE([HAVE_JSON],[1],[Use JSON])],
111 [AC_MSG_WARN("Remote monitoring disabled, json missing")])
112 AM_CONDITIONAL(JSON, test -n "$JSON_LIBS")
113 AC_SUBST(JSON_CFLAGS)
116 # Enables remote monitoring if JSON and CURL is present
117 if test -n "$JSON_LIBS"; then
118 if test -n "$CURL_LIBS"; then
119 AC_DEFINE([HAVE_REMOTE_SUPPORT],[1],[Remote monitoring enabled])
124 # following code from sensors-applet
125 # sensors-applet.sourceforge.net/
126 AC_CHECK_HEADERS(NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h,
127 [ HAVE_NVIDIA=true ], [],
129 #include <X11/Xlib.h>
131 if test -n "${X11_LIBS}"; then
132 LIBS="${LIBS} -lX11 -lXext"
134 if test "${HAVE_NVIDIA}" = "true"; then
135 AC_CHECK_LIB(XNVCtrl,XNVCTRLQueryExtension,
136 [NVIDIA_LIBS="-lXNVCtrl -lX11 -lXext"
137 AC_DEFINE(HAVE_NVIDIA,1,[NVidia support enabled])
141 AM_CONDITIONAL(NVIDIA, test -n "$NVIDIA_LIBS")
142 AC_SUBST(NVIDIA_CFLAGS)
143 AC_SUBST(NVIDIA_LIBS)
146 PKG_CHECK_MODULES(UNITY,
148 [AC_DEFINE([HAVE_UNITY],[1],[Use Unity])],
149 [AC_MSG_WARN(Unity not present)])
150 AC_SUBST(UNITY_CFLAGS)
152 AM_CONDITIONAL(UNITY, test -n "$UNITY_LIBS")
155 AC_ARG_WITH(libatiadl,
156 [ --with-libatiadl[=DIR] use libatiadlxx in DIR],[
157 ATIADL_DIR=${withval}
158 CPPFLAGS="${CPPFLAGS} -I${ATIADL_DIR}/include"
159 LIBS="$LIBS -L/usr/lib/fglrx"
163 AC_CHECK_HEADERS(adl_defines.h,
164 AC_CHECK_LIB(atiadlxx,ADL_Main_Control_Refresh,
166 AC_DEFINE(HAVE_LIBATIADL,1,[libatiadl is available])
167 LIBATIADL_CFLAGS="-I${ATIADL_DIR}/include"
168 LIBATIADL_LIBS="-L/usr/lib/fglrx -latiadlxx"
171 AM_CONDITIONAL(LIBATIADL, test -n "$LIBATIADL_LIBS")
172 AC_SUBST(LIBATIADL_CFLAGS)
173 AC_SUBST(LIBATIADL_LIBS)
175 ############### psensor-server
177 # libmicrohttpd, mandatory for psensor-server
179 PKG_CHECK_MODULES(LIBMICROHTTPD,
181 [AC_DEFINE([HAVE_LIBMICROHTTPD],[1],[Use libmicrohttpd])],
182 [AC_MSG_WARN("libmicrohttpd not present, psensor-server will NOT be built")])
183 AM_CONDITIONAL(LIBMICROHTTPD, test -n "$LIBMICROHTTPD_LIBS")
184 AC_SUBST(LIBMICROHTTPD_CFLAGS)
185 AC_SUBST(LIBMICROHTTPD_LIBS)
190 [ --with-gtop[=yes|no] use gtop],[
191 with_gtop=$withval],[
196 if test "$with_gtop" = "yes"; then
197 PKG_CHECK_MODULES(GTOP,
199 [AC_DEFINE([HAVE_GTOP],[1],[Use GTOP])],
200 [AC_MSG_WARN("gtop not present, CPU/Memory information will NOT be available")])
202 AM_CONDITIONAL(GTOP, test -n "$GTOP_LIBS")
203 AC_SUBST(GTOP_CFLAGS)
213 src/libpsensor_json/Makefile
215 icons/hicolor/scalable/Makefile
216 icons/hicolor/14x14/Makefile
217 icons/hicolor/16x16/Makefile
218 icons/hicolor/22x22/Makefile
219 icons/hicolor/24x24/Makefile
220 icons/hicolor/32x32/Makefile
221 icons/hicolor/48x48/Makefile
222 icons/hicolor/64x64/Makefile
223 icons/ubuntu-mono-dark/status/22/Makefile
224 icons/ubuntu-mono-light/status/22/Makefile
225 icons/ubuntu-mono-dark/apps/22/Makefile
231 AC_CHECK_PROGS([HELP2MAN], [help2man])