File: configure.in

package info (click to toggle)
xfce4-sensors-plugin 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,652 kB
  • sloc: sh: 11,446; ansic: 5,108; makefile: 225
file content (439 lines) | stat: -rw-r--r-- 13,275 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
dnl
dnl This file was autogenerated from "configure.in.in".
dnl Edit that file instead!
dnl

dnl $Id$
dnl configure.in.in
dnl
dnl xfce4-sensors-plugin - Sensors plugin for xfce4-panel
dnl
dnl 2003,2004, 2007 Benedikt Meurer <benny@xfce.org>
dnl 2007-2011 Fabian Nowak <timystery@arcor.de>
dnl

m4_define([libxfce4sensors_verinfo], [3:4:2])

m4_define([xfce4_sensors_version_major], [1])
m4_define([xfce4_sensors_version_minor], [2])
m4_define([xfce4_sensors_version_micro], [5])
m4_define([xfce4_sensors_version_nano], [])
m4_define([xfce4_sensors_version_build], [c6a2a74])
m4_define([xfce4_sensors_version_tag], []) dnl may be set to 'git'
m4_define([xfce4_sensors_version], [xfce4_sensors_version_major().xfce4_sensors_version_minor().xfce4_sensors_version_micro()ifelse(xfce4_sensors_version_nano(), [], [], [.xfce4_sensors_version_nano()])ifelse(xfce4_sensors_version_tag(), [git], [xfce4_sensors_version_tag()-xfce4_sensors_version_build()], [xfce4_sensors_version_tag()])])


AC_INIT([xfce4-sensors-plugin], [xfce4_sensors_version], [timystery@arcor.de])
AC_PREREQ([2.50])
AC_CANONICAL_TARGET()

PLUGIN_VERSION=xfce4_sensors_version()
AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME], [AC_PACKAGE_VERSION])
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE

dnl Check for UNIX variants
AC_AIX
AC_ISC_POSIX
AC_MINIX

dnl Check for basic programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LD
AC_PROG_INSTALL

AC_PROG_LIBTOOL
LT_PREREQ([2.2.6])
LT_INIT([disable-static])

AC_PROG_INTLTOOL

dnl ****************************
dnl *** Intltool-update hack ***
dnl ****************************
AC_CONFIG_COMMANDS([intltool-update],
    [(if test `stat --printf "%s" intltool-update` != "0"; then sed -e 's/^\("desktop.*".*\)/\1\n"rc(?:\\\\.in)+|"\./' intltool-update > intltool-update-tmp &&
      mv intltool-update-tmp intltool-update && chmod 755 intltool-update; fi)])

dnl Check for standard header files
AC_HEADER_STDC

dnl Check for libsensors depending on whether it is disabled upon user request
AC_ARG_ENABLE([libsensors],
            AC_HELP_STRING([--enable-libsensors=auto|yes|no],
                    [Use LM-sensors to read a vast amount of sensors on your mainboards @<:@default=auto@:>@]),
            [],
            [enable_libsensors=auto])

if test x"$enable_libsensors" = x"auto"; then
    AC_CHECK_LIB([sensors], [sensors_get_detected_chips],
    [
        enable_libsensors=yes
    ],
    [
        enable_libsensors=no
    ])
fi

if test x"$enable_libsensors" = x"yes"; then
    AC_DEFINE([HAVE_LIBSENSORS], [1], [Define to 1 if libsensors is found])
    dnl FIXME:  make that dynamic in case of auto
    LIBSENSORS_CFLAGS="-I/usr/include"
    LIBSENSORS_LDFLAGS="-lsensors"
fi

AC_SUBST([LIBSENSORS_CFLAGS])
AC_SUBST([LIBSENSORS_LDFLAGS])
AM_CONDITIONAL([HAVE_LIBSENSORS], [test x$enable_libsensors = x"yes"])


dnl Check for hddtemp depending on whether it is disabled upon user request
AC_ARG_ENABLE([hddtemp],
        [AC_HELP_STRING([--enable-hddtemp=auto|yes|no],
                [Use hddtemp to read your harddisk temperature @<:@default=auto@:>@])],
        [],
        [
        enable_hddtemp=auto
        ])

if test x"$enable_hddtemp" = x"auto"; then
    AC_CHECK_PROG([hddtemp], [hddtemp], [yes], [], [$PATH:/sbin:/usr/sbin:/usr/local/sbin])
    if test x"$hddtemp" = x"yes"; then
        enable_hddtemp=yes
    else
        enable_hddtemp=no
    fi
fi

if test x"$enable_hddtemp" = x"yes"; then

    AC_ARG_WITH([pathhddtemp], [AC_HELP_STRING([--with-pathhddtemp], [Specify path to hddtemp @<:@default=auto@:>@])],
    [
        HDDTEMP=$withval
    ], [
        AC_MSG_CHECKING([for hddtemp path])
        HDDTEMP=([`whereis -b hddtemp | sed 's/.*\ \(\/[a-zA-Z0-9\-\/.]*bin[A-Za-z0-9\-\/.]*hddtemp\).*/\1/'`])
        AC_MSG_RESULT([$HDDTEMP])
    ])

    if test x"$HDDTEMP" = x"hddtemp:"; then
        enable_hddtemp=no
    else
        AC_DEFINE([HAVE_HDDTEMP], [1], [Define to 1 if hddtemp is desired])
        AC_DEFINE_UNQUOTED([PATH_HDDTEMP], ["$HDDTEMP"], [Complete path to hddtemp])
        AC_SUBST([PATH_HDDTEMP])
    fi
fi

AM_CONDITIONAL([HAVE_HDDTEMP], [test x$enable_hddtemp = x"yes"])


dnl Check for netcat for hddtemp to be used
AC_ARG_ENABLE([netcat], [AC_HELP_STRING([--enable-netcat], [Use netcat to read your hddtemp temperature @<:@default=auto@:>@])],
[],
[
    enable_netcat=auto
])

if test x"$enable_netcat" = x"auto"; then
AC_CHECK_PROG([netcat], [netcat], [yes], [], [$PATH:/sbin:/usr/sbin:/usr/local/sbin])
AC_CHECK_PROG([nc], [nc], [yes], [], [$PATH:/sbin:/usr/sbin:/usr/local/sbin])
if test x"$netcat" = x"yes" -o x"$nc" = x"yes"; then
        enable_netcat=yes
    else
        enable_netcat=no
    fi
fi

if test x"$enable_netcat" = x"yes"; then
    AC_ARG_WITH([pathnetcat], [AC_HELP_STRING([--with-pathnetcat], [Specify path to netcat @<:@default=auto@:>@])],
    [
        NETCAT_PATH=$withval
    ], [
        AC_MSG_CHECKING([for netcat path])
        NETCAT_PATH=([`whereis -b netcat | sed 's/.*\ \(\/[a-zA-Z0-9\-\/.]*bin[A-Za-z0-9\-\/.]*netcat\).*/\1/'`])
        if test x"$NETCAT_PATH" = x"netcat:"; then
            NETCAT_PATH=([`whereis -b nc | sed 's/.*\ \(\/[a-zA-Z0-9\-\/.]*bin[A-Za-z0-9\-\/.]*nc\).*/\1/'`])
        fi;

        AC_MSG_RESULT([$NETCAT_PATH])
    ])

    NETCAT_HOST=localhost
    HDDTEMP_PORT=7634

    AC_MSG_CHECKING([for hddtemp being queryable via netcat])
    NETCAT_RUN=([`"$NETCAT_PATH" "$NETCAT_HOST" "$HDDTEMP_PORT" 2> /dev/null`])
    AC_MSG_RESULT([$NETCAT_RUN])
    if test x"$NETCAT_RUN" = x""; then
        enable_netcat=no
        dnl AC_DEFINE([HAVE_NETCAT], [0], [Define to 1 if hddtemp daemon is queried via netcat])
    else
        AC_DEFINE([HAVE_NETCAT], [1], [Define to 1 if hddtemp daemon is queried via netcat])
        AC_DEFINE_UNQUOTED([NETCAT_PATH], [$NETCAT_PATH], [Complete path to netcat])
        AC_SUBST([NETCAT_PATH])
        AC_DEFINE_UNQUOTED([NETCAT_HOST], [$NETCAT_HOST], [Host for netcat])
        AC_SUBST([NETCAT_HOST])
        AC_DEFINE_UNQUOTED([HDDTEMP_PORT], [$HDDTEMP_PORT], [Port for hddtemp with netcat])
        AC_SUBST([HDDTEMP_PORT])
    fi

fi

AM_CONDITIONAL([HAVE__NETCAT], [test x$enable_netcat = x"yes"])


dnl Check for interface for /proc/acpi to be used
AC_ARG_ENABLE([procacpi], [AC_HELP_STRING([--enable-procacpi], [Use /proc/acpi to read your CPU temperature @<:@default=auto@:>@])],
[],
[
    enable_procacpi=auto
])

if test x"$enable_procacpi" = x"auto"; then
    AC_CHECK_FILE([/proc/acpi/info],
    [
        enable_procacpi=yes
    ],
    [
        enable_procacpi=no
    ])
fi

dnl Check for interface for /sys/class/power_supply to be used
AC_ARG_ENABLE([sysfsacpi], [AC_HELP_STRING([--enable-sysfsacpi], [Use /sys/class/power_supply to read your battery value @<:@default=auto@:>@])],
[],
[
    enable_sysfsacpi=auto
])

if test x"$enable_sysfsacpi" = x"auto"; then
    AC_CHECK_FILE([/sys/class/power_supply],
    [
        enable_sysfsacpi=yes
    ],
    [
        enable_sysfsacpi=no
    ])
fi

if test x"$enable_sysfsacpi" = x"yes"; then
    AC_DEFINE([HAVE_SYSFS_ACPI], [1], [Define to 1 if /sys/class/power_supply is found])
    enable_procacpi=yes
fi

if test x"$enable_procacpi" = x"yes"; then
    AC_DEFINE([HAVE_ACPI], [1], [Define to 1 if /proc/acpi is found])
fi


dnl Check for nvidia blahblah to be used
AC_ARG_ENABLE([xnvctrl], 
        AC_HELP_STRING([--enable-xnvctrl], 
           [Use nvctrl to obtain Nvidia GPU temperature value @<:@default=auto@:>@]),
    [],
[
    enable_xnvctrl=auto
])

if test x"$enable_xnvctrl" = x"auto"; then
 AC_CHECK_FILE([/usr/include/NVCtrl],
    [
        enable_xnvctrl=yes
    ],
    [
        enable_xnvctrl=no
    ])
fi

if test x"$enable_xnvctrl" = x"yes"; then
    AC_DEFINE([HAVE_NVIDIA], [1], [Define to 1 if media-video/nvidia-drivers installed])
    NVIDIA_CFLAGS="-I/usr/include/NVCtrl"
    NVIDIA_LIBS="-lX11 -lXext -lXNVCtrl"
    enable_xnvctrl=yes
AC_SUBST([NVIDIA_CFLAGS])
AC_SUBST([NVIDIA_LIBS])
fi


AM_CONDITIONAL([HAVE_ACPI], [test x$enable_procacpi = x"yes"])
AM_CONDITIONAL([HAVE_SYSFS_ACPI], [test x$enable_sysfsacpi = x"yes"])
AM_CONDITIONAL([HAVE_NVIDIA], [test x$enable_xnvctrl = x"yes"])


dnl Check for full debugging
AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug], [Allow full debugging. @<:@default=no@:>@])],
[],
[
    enable_debug=no
])

if test x"$enable_debug" = x"yes"; then
    AC_DEFINE([DEBUG], [1], [Set this to 1 to enable full debugging.])
    AC_DEFINE([DEBUG_TRACE], [1],
        [Set this to 1 to enable full trace debugging.]
    )
    PLATFORM_CFLAGS="-Wall -Werror $PLATFORM_CFLAGS"
fi

AC_SUBST([PLATFORM_CFLAGS])


dnl Get operating system information
KERNEL=`uname -s`
if test "$KERNEL" = "Linux"; then
    AC_DEFINE([HAVE_LINUX], [1], [Set this to 1 if using Linux or newer])
dnl    KERNELVERSION=`uname -r`
dnl    if test $KERNELVERSION -ge 2.6.24; then
dnl        AC_DEFINE([HAVE_LINUX2624], [1], [Set this to 1 if using Linux or newer])
dnl    fi
fi
dnl OS="$KERNEL"
dnl AC_DEFINE([OS], ["$OS"], [Set this to the name of the operating system.])

dnl Substitute in Makefile
dnl AC_SUBST(OS)
dnl where is that crap from?

AC_CHECK_FUNCS([gethostname])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([socket])
AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([malloc])
AC_CHECK_FUNCS([bzero])
AC_CHECK_HEADERS([arpa/inet.h])
AC_CHECK_HEADERS([netinet/in.h])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_HEADERS([sys/ioctl.h])
AC_CHECK_HEADERS([sys/param.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([sys/sockio.h])
AC_HEADER_SYS_WAIT
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIZE_T

AC_CHECK_LIB(kstat, kstat_open, SOLLIBS="-lkstat -lsocket", SOLLIBS="")
AC_CHECK_LIB(nsl, kstat_open, SOLLIBS="$SOLLIBS -linet_ntop", SOLLIBS="$SOLLIBS")
AC_SUBST(SOLLIBS)

AC_CHECK_LIB(m, ceilf, LIBM="-lm", AC_MSG_ERROR(Missing math library))
AC_SUBST(LIBM)

dnl **************************************
dnl *** Substitute version information ***
dnl **************************************
LIBXFCE4SENSORS_VERINFO=libxfce4sensors_verinfo()
AC_SUBST([LIBXFCE4SENSORS_VERINFO])

dnl **************************************
dnl *** Check for Gtk/Glib packages  ***
dnl **************************************
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.6.0])
dnl XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.12.0])


dnl **************************************
dnl *** Check for notification library ***
dnl **************************************
dnl XDT_CHECK_PACKAGE([LIBNOTIFY], [libnotify], [0.4.0])
XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY4],
                           [libnotify],
                           [0.4], [notification],
                           [notification message library < 0.7])

XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY7],
                           [libnotify],
                           [0.7], [notification],
                           [notification message library >= 0.7])

dnl **************************************
dnl *** Check for Xfce packages ***
dnl **************************************
dnl XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.6.0])

dnl configure the panel plugin
XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.4.0])


dnl I18n support
XDT_I18N([ar ast ca cs da de el en_GB es eu fi fr gl hu id it ja ko lt lv nl pl pt_BR pt ru sk sq sv tr ug uk ur_PK ur vi zh_CN zh_TW ])


dnl Check for debugging support
XDT_FEATURE_DEBUG()

dnl *********************************
dnl *** Substitute platform flags ***
dnl *********************************
AC_MSG_CHECKING([PLATFORM_LDFLAGS])
AC_MSG_RESULT([$PLATFORM_LDFLAGS])
AC_SUBST([PLATFORM_LDFLAGS])

AC_OUTPUT([
Makefile
xfce4-sensors-plugin.spec
include/Makefile
lib/Makefile
lib/libxfce4sensors-1.0.pc
panel-plugin/Makefile
src/Makefile
icons/Makefile
po/Makefile.in
])


dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "==============================================================="
echo "Build Configuration"
echo "==============================================================="
dnl echo
dnl echo "Host system:  $OS"
echo
echo "The following sensor interfaces will be built into the plugin:"
if test x"$enable_hddtemp" = x"yes"; then
echo "*  hddtemp: $HDDTEMP (Make sure it is user-executable with UID bit set "
echo "                      and user member of the respective group)"
fi

if test x"$enable_netcat" = x"yes"; then
echo "   netcat for hddtemp: $NETCAT_PATH on $NETCAT_HOST:$HDDTEMP_PORT"
fi

if test x"$enable_libsensors" = x"yes"; then
echo "*  libsensors"
fi
if test x"$enable_procacpi" = x"yes"; then
echo "*  /proc/acpi"
fi
if test x"$enable_sysfsacpi" = x"yes"; then
echo "*  /sys/class/power_supply"
fi
if test x"$enable_xnvctrl" = x"yes"; then
echo "*  NVIDIA X CTRL"
fi
echo
if test x"$LIBNOTIFY4_FOUND" = x"yes"; then
echo "Support for libnotify will be built in."
echo
fi
if test x"$LIBNOTIFY7_FOUND" = x"yes"; then
echo "Support for libnotify >= 0.7 will be built in."
echo
fi
if test x"$enable_debug" = x"yes"; then
echo "Full debug is enabled"
else
echo "Full debug is disabled"
fi
echo
echo "==============================================================="