2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([psensor], [0.7.0.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)
56 PKG_CHECK_MODULES(GTK, gtk+-3.0)
57 # ensure that only allowed headers are included
58 GTK_CFLAGS+=" -DGTK_DISABLE_SINGLE_INCLUDES "
59 # ensure that no gtk deprecated symbols are used
60 GTK_CFLAGS+=" -DGDK_DISABLE_DEPRECATED "
61 GTK_CFLAGS+=" -DGTK_DISABLE_DEPRECATED "
62 # ensure use of accessors
63 GTK_CFLAGS+=" -DGSEAL_ENABLE "
68 PKG_CHECK_MODULES(GCONF, gconf-2.0)
69 AC_SUBST(GCONF_CFLAGS)
75 PKG_CHECK_MODULES(ATASMART, libatasmart,
76 [AC_DEFINE([HAVE_ATASMART],[1],[Use libatasmart])],
77 [AC_MSG_WARN("Library atasmart not present")])
79 AM_CONDITIONAL(ATASMART, test -n "$ATASMART_LIBS")
80 AC_SUBST(ATASMART_CFLAGS)
81 AC_SUBST(ATASMART_LIBS)
85 PKG_CHECK_MODULES(LIBNOTIFY,
87 [AC_DEFINE([HAVE_LIBNOTIFY],[1],[Use desktop notification])],
88 [AC_MSG_WARN("Desktop notification disabled")])
89 AM_CONDITIONAL(LIBNOTIFY, test -n "$LIBNOTIFY_LIBS")
90 AC_SUBST(LIBNOTIFY_CFLAGS)
91 AC_SUBST(LIBNOTIFY_LIBS)
96 PKG_CHECK_MODULES(APPINDICATOR, appindicator3-0.1,
97 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator3-0.1])],
98 [AC_MSG_WARN(AppIndicator 3-0.1 not present")])
100 if test "$APPINDICATOR_LIBS" == ""; then
101 PKG_CHECK_MODULES(APPINDICATOR,
102 appindicator-0.1 <= 0.2.9 ,
103 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator 0.2.9])
104 AC_DEFINE([HAVE_APPINDICATOR_029],[1],[Use AppIndicator 0.2.9])
106 [AC_MSG_WARN(AppIndicator 0.2.9 not present")])
109 if test "$APPINDICATOR_LIBS" == ""; then
110 PKG_CHECK_MODULES(APPINDICATOR,
111 appindicator-0.1 > 0.2.9,
112 [AC_DEFINE([HAVE_APPINDICATOR],[1],[Use AppIndicator > 0.2.9])],
113 [AC_MSG_WARN("AppIndicator > 0.2.9 not present")])
115 AM_CONDITIONAL(APPINDICATOR, test -n "$APPINDICATOR_LIBS")
116 AC_SUBST(APPINDICATOR_CFLAGS)
117 AC_SUBST(APPINDICATOR_LIBS)
119 # Check CURL, needed for remote monitoring
121 PKG_CHECK_MODULES(CURL,
123 [AC_DEFINE([HAVE_CURL],[1],[Use CURL])],
124 [AC_MSG_WARN("Remote monitoring disabled, curl missing")])
125 AM_CONDITIONAL(CURL, test -n "$CURL_LIBS")
126 AC_SUBST(CURL_CFLAGS)
129 # Check JSON, needed for remote monitoring
131 PKG_CHECK_MODULES(JSON,
133 [AC_DEFINE([HAVE_JSON],[1],[Use JSON])],
134 [AC_MSG_WARN("Remote monitoring disabled, json missing")])
135 AM_CONDITIONAL(JSON, test -n "$JSON_LIBS")
136 AC_SUBST(JSON_CFLAGS)
139 # Enables remote monitoring if JSON and CURL is present
140 if test -n "$JSON_LIBS"; then
141 if test -n "$CURL_LIBS"; then
142 AC_DEFINE([HAVE_REMOTE_SUPPORT],[1],[Remote monitoring enabled])
147 # following code from sensors-applet
148 # sensors-applet.sourceforge.net/
149 AC_CHECK_HEADERS(NVCtrl/NVCtrl.h NVCtrl/NVCtrlLib.h,
150 [ HAVE_NVIDIA=true ], [],
152 #include <X11/Xlib.h>
154 if test -n "${X11_LIBS}"; then
155 LIBS="${LIBS} -lX11 -lXext"
157 if test "${HAVE_NVIDIA}" = "true"; then
158 AC_CHECK_LIB(XNVCtrl,XNVCTRLQueryExtension,
159 [NVIDIA_LIBS="-lXNVCtrl -lX11 -lXext"
160 AC_DEFINE(HAVE_NVIDIA,1,[NVidia support enabled])
164 AM_CONDITIONAL(NVIDIA, test -n "$NVIDIA_LIBS")
165 AC_SUBST(NVIDIA_CFLAGS)
166 AC_SUBST(NVIDIA_LIBS)
169 PKG_CHECK_MODULES(UNITY,
171 [AC_DEFINE([HAVE_UNITY],[1],[Use Unity])],
172 [AC_MSG_WARN(Unity not present)])
173 AC_SUBST(UNITY_CFLAGS)
175 AM_CONDITIONAL(UNITY, test -n "$UNITY_LIBS")
178 AC_ARG_WITH(libatiadl,
179 [ --with-libatiadl[=DIR] use libatiadlxx in DIR],[
180 ATIADL_DIR=${withval}
181 CPPFLAGS="${CPPFLAGS} -I${ATIADL_DIR}/include"
182 LIBS="$LIBS -L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst"
186 AC_CHECK_HEADERS(adl_defines.h,
187 AC_CHECK_LIB(atiadlxx,ADL_Main_Control_Refresh,
189 AC_DEFINE(HAVE_LIBATIADL,1,[libatiadl is available])
190 LIBATIADL_CFLAGS="-I${ATIADL_DIR}/include"
191 LIBATIADL_LIBS="-L/usr/lib/fglrx -L/usr/lib64/fglrx -L/usr/lib/catalyst -L/usr/lib64/catalyst -latiadlxx -ldl"
194 AM_CONDITIONAL(LIBATIADL, test -n "$LIBATIADL_LIBS")
195 AC_SUBST(LIBATIADL_CFLAGS)
196 AC_SUBST(LIBATIADL_LIBS)
198 ############### psensor-server
200 # libmicrohttpd, mandatory for psensor-server
202 PKG_CHECK_MODULES(LIBMICROHTTPD,
204 [AC_DEFINE([HAVE_LIBMICROHTTPD],[1],[Use libmicrohttpd])],
205 [AC_MSG_WARN("libmicrohttpd not present, psensor-server will NOT be built")])
206 AM_CONDITIONAL(LIBMICROHTTPD, test -n "$LIBMICROHTTPD_LIBS")
207 AC_SUBST(LIBMICROHTTPD_CFLAGS)
208 AC_SUBST(LIBMICROHTTPD_LIBS)
213 [ --with-gtop[=yes|no] use gtop],[
214 with_gtop=$withval],[
219 if test "$with_gtop" = "yes"; then
220 PKG_CHECK_MODULES(GTOP,
222 [AC_DEFINE([HAVE_GTOP],[1],[Use GTOP])],
223 [AC_MSG_WARN("gtop not present, CPU/Memory information will NOT be available")])
225 AM_CONDITIONAL(GTOP, test -n "$GTOP_LIBS")
226 AC_SUBST(GTOP_CFLAGS)
235 icons/hicolor/scalable/Makefile
236 icons/hicolor/14x14/Makefile
237 icons/hicolor/16x16/Makefile
238 icons/hicolor/22x22/Makefile
239 icons/hicolor/24x24/Makefile
240 icons/hicolor/32x32/Makefile
241 icons/hicolor/48x48/Makefile
242 icons/hicolor/64x64/Makefile
243 icons/ubuntu-mono-dark/status/22/Makefile
244 icons/ubuntu-mono-light/status/22/Makefile
245 icons/ubuntu-mono-dark/apps/22/Makefile
251 AC_CHECK_PROGS([HELP2MAN], [help2man])