File: configure.in

package info (click to toggle)
xfce4-sensors-plugin 0.10.99.5~svn-r4998-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,032 kB
  • ctags: 307
  • sloc: sh: 9,815; ansic: 3,174; makefile: 100
file content (232 lines) | stat: -rw-r--r-- 6,339 bytes parent folder | download
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
dnl configure.in.in
dnl
dnl xfce4-sensors-plugin - Sensors plugin for xfce4-panel
dnl
dnl 2003,2004 Benedikt Meurer <benny@xfce.org>
dnl 2007 Benedikt Meurer <benny@xfce.org>, Fabian Nowak <timystery@arcor.de>
dnl

m4_define([plugin_version],[0.10.99.5])

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

PLUGIN_VERSION=plugin_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
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_INTLTOOL

dnl ****************************
dnl *** Intltool-update hack ***
dnl ****************************
AC_CONFIG_COMMANDS([intltool-update],
    [(sed -e 's/^\("desktop.*".*\)/\1\n"rc(?:\\\\.in)+|"\./' intltool-update > intltool-update-tmp &&
      mv intltool-update-tmp intltool-update && chmod 755 intltool-update)])

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 "$hddtemp" = "yes"; then
        enable_hddtemp=yes
    else
        enable_hddtemp=no
    fi
fi

if test x"$enable_hddtemp" = x"yes"; then
    AC_DEFINE([HAVE_HDDTEMP], [1], [Define to 1 if hddtemp is desired])

    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])
    ])

    AC_DEFINE_UNQUOTED([PATH_HDDTEMP], ["$HDDTEMP"], [Complete path to hddtemp])
    AC_SUBST([PATH_HDDTEMP])
fi

AM_CONDITIONAL([HAVE_HDDTEMP], [test x$enable_hddtemp = 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=yes@:>@])],
[],
[
    enable_procacpi=auto
])

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

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

AM_CONDITIONAL([HAVE_ACPI], [test x$enable_procacpi = 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])
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)

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

dnl I18n support
XDT_I18N([ca cs da de el en_GB eu fr gl hu id ja ko lt lv pl pt_BR pt_PT ru sq ur vi zh_TW])

dnl Check for debugging support
XDT_FEATURE_DEBUG()

AC_OUTPUT([
Makefile
xfce4-sensors-plugin.spec
panel-plugin/Makefile
icons/Makefile
po/Makefile.in
])


dnl ***************************
dnl *** Print configuration ***
dnl ***************************
echo
echo "==============================================================="
echo "Build Configuration"
echo "==============================================================="
echo
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"
fi
if test x"$enable_libsensors" = x"yes"; then
echo "*  libsensors"
fi
if test x"$enable_procacpi" = x"yes"; then
echo "*  /proc/acpi"
fi
echo
if test x"$enable_debug" = x"yes"; then
echo "Full debug is enabled"
else
echo "Full debug is disabled"
fi
echo
echo "==============================================================="