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
|
AC_INIT([gnome-session], [2.11.90],
[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-session])
AC_CONFIG_SRCDIR([gnome-session])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_PROG_INTLTOOL
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AM_PROG_LIBTOOL
AC_PATH_PROGS(PATH_TO_XRDB, "xrdb")
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
GNOME_COMPILE_WARNINGS(yes)
AC_ARG_ENABLE(deprecations,
[AC_HELP_STRING([--enable-deprecations],
[warn about deprecated usages [default=no]])],,
[enable_deprecations=no])
if test "x$enable_deprecations" = "xyes"; then
DISABLE_DEPRECATED_CFLAGS="\
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGNOME_DISABLE_DEPRECATED"
AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
fi
dnl If you add a version number here, you *must* add an AC_SUBST line for
dnl it too, or it will never make it into the spec file!
ESOUND_REQUIRED=0.2.26
LIBGNOMEUI_REQUIRED=2.2.0
GTK_REQUIRED=2.3.1
AC_SUBST(ESOUND_REQUIRED)
AC_SUBST(LIBGNOMEUI_REQUIRED)
dnl pkg-config dependency checks
dnl We first check for esound and audiofile (which has conditional
dnl support built in)
ESOUND_MODULE="esound >= $ESOUND_REQUIRED"
PKG_CHECK_MODULES(SOUND_TEST, $ESOUND_MODULE, [
AC_DEFINE(HAVE_ESD, 1, [Define if you have the ESound Daemon])
],[
ESOUND_MODULE=""
])
PKG_CHECK_MODULES(GNOME_SESSION, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED $ESOUND_MODULE)
dnl gconf checks
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
if test x"$GCONFTOOL" = xno; then
AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
fi
AM_GCONF_SOURCE_2
# gconf-sanity-check
GCONF_SERVERDIR=`$PKG_CONFIG --variable=gconf_serverdir gconf-2.0`
old_path=$PATH
if test x"$GCONF_SERVERDIR" != x; then
PATH=$GCONF_SERVERDIR:$PATH
fi
AC_PATH_PROG(GCONF_SANITY_CHECK, gconf-sanity-check-2, no)
if test x"$GCONF_SANITY_CHECK" = xno; then
AC_MSG_ERROR([gconf-sanity-check-2 executable not found in your path - should be installed with GConf])
fi
AC_SUBST(GCONF_SANITY_CHECK)
PATH=$old_path
AC_PATH_PROG(GNOME_KEYRING_DAEMON, gnome-keyring-daemon, no)
if test x"$GNOME_KEYRING_DAEMON" = xno; then
AC_MSG_ERROR([gnome-keyring-daemon executable not found in your path - should be installed with gnome-keyring])
fi
AC_SUBST(GNOME_KEYRING_DAEMON)
# esd
ESDSERVERDIR=`$PKG_CONFIG --variable=esd_serverdir esound`
old_path=$PATH
if test x"$ESDSERVERDIR" != x; then
PATH=$ESDSERVERDIR:$PATH
fi
AC_PATH_PROG(ESD_SERVER, esd, no)
if test x"$ESD_SERVER" = xno; then
AC_MSG_ERROR([esd executable not found in your path - should be installed with ESound])
fi
AC_SUBST(ESD_SERVER)
PATH=$old_path
dnl X development libraries check
#
# If Pango included the shared library dependencies from X11 in
# the pkg-config output, then we use that (to avoid duplicates).
# but if they were omitted to avoid binary compatibility problems
# then we need to repeat the checks.
#
if $PKG_CONFIG --exists pangoxft ; then
PANGO_PACKAGES="pangox pangoxft"
else
PANGO_PACKAGES="pangox"
fi
x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
case x_libs in
*-lX11*) pango_omitted_x_deps=no ;;
*) pango_omitted_x_deps=yes ;;
esac
if test $pango_omitted_x_deps = yes ; then
AC_PATH_XTRA
if test x$no_x = xyes ; then
AC_MSG_ERROR([X development libraries not found])
else
X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
fi
fi
AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
[AC_CHECK_HEADER(X11/extensions/Xrandr.h,
X_LIBS="-lXrandr -lXrender $X_LIBS"
AC_DEFINE(HAVE_RANDR, 1, [Have the Xrandr extension library]),
:, [#include <X11/Xlib.h>])], : ,
-lXrandr -lXrender $X_LIBS)
AC_SUBST(X_LIBS)
dnl -----------------------------------------------------------
dnl ------------------
dnl | Language Support |---------------------------------------
dnl ------------------
GETTEXT_PACKAGE=gnome-session-2.0
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
[The gettext translation domain])
AC_SUBST(GETTEXT_PACKAGE)
ALL_LINGUAS="af am ar az be bg bn bs ca cs cy da de el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy id is it ja kn ko lt lv mi mk ml mn mr ms nb ne nl nn no nso pa pl pt pt_BR ro ru rw sk sl sq sr sr@Latn sv ta th tk tr uk vi wa xh zh_CN zh_TW zu"
AM_GLIB_GNU_GETTEXT
dnl -----------------------------------------------------------
dnl -------------------------------
dnl | Headers |--------------------------
dnl -------------------------------
AC_HEADER_STDC
AC_CHECK_HEADERS(syslog.h tcpd.h sys/param.h)
dnl -----------------------------------------------------------
dnl ---------------
dnl | gnome-session |------------------------------------------
dnl ---------------
dnl
AC_MSG_CHECKING([Whether libgnomeui was built with session management])
case "$GNOME_SESSION_LIBS" in
*-lSM*)
GNOME_HAVE_SM=yes
;;
*)
GNOME_HAVE_SM=no
;;
esac
AC_MSG_RESULT($GNOME_HAVE_SM)
if test "$GNOME_HAVE_SM" = no ; then
AC_MSG_WARN([Session management support not built into libgnomeui; gnome-session will not be built])
fi
AM_CONDITIONAL(SESSION, test "$GNOME_HAVE_SM" = yes)
dnl -----------------------------------------------------------
dnl -------------------
dnl | Use TCP Wrappers? |--------------------------------------
dnl -------------------
AC_MSG_CHECKING(whether to use TCP wrappers)
LIBWRAP_PATH=""
for I in $LDFLAGS $LIBS -L/usr/lib -L/usr/local/lib; do
case "$I" in
-L*)
THEFILE="`echo $I | sed -e 's,^-L,,'`"
echo "From $I, checking in dir $THEFILE for libwrap.a" 1>&5
if test -f $THEFILE/libwrap.a; then
LIBWRAP_PATH="$THEFILE"
echo "Found in $LIBWRAP_PATH" 1>&5
break
fi
esac
done
if test -n "$LIBWRAP_PATH"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
if test -n "$LIBWRAP_PATH"; then
nm $LIBWRAP_PATH/libwrap.* | grep 'T setenv' && LIBWRAP_PATH=""
if test -z "$LIBWRAP_PATH"; then
echo "*********************************************************"
echo " You have a broken TCP wrappers library (setenv included)"
echo " Please get the latest TCP wrappers package from your OS"
echo " vendor, or recompile TCP wrappers to not include a"
echo " setenv() implementation."
echo
echo "Not using TCP wrappers after all."
echo "*********************************************************"
fi
fi
dnl We need the header files too!
if test "$ac_cv_header_syslog_h" != yes || test "$ac_cv_header_tcpd_h" != yes; then
echo "Resetting $LIBWRAP_PATH because syslog is $ac_cv_header_syslog_h and tcpd is $ac_cv_header_tcpd_h" 1>&5
LIBWRAP_PATH=""
fi
dnl find out if we need -lnsl or whatever
LIBWRAP_NSL=
if test -n "$LIBWRAP_PATH"; then
AC_MSG_CHECKING(whether -lwrap requires -lnsl)
ORIG_LIBS="$LIBS"
LIBS="-L$LIBWRAP_PATH -lwrap $LIBS"
AC_TRY_LINK([
extern int hosts_access;
int allow_severity, deny_severity;
], [return hosts_access;], ,[
dnl try with -lnsl
OLD_LIBS="$LIBS"
LIBS="$LIBS -lnsl"
AC_TRY_LINK([
extern int hosts_access;
int allow_severity, deny_severity;
], [return hosts_access;], LIBWRAP_NSL="-lnsl",
LIBWRAP_PATH="")
LIBS="$OLD_LIBS"
])
LIBS="$ORIG_LIBS"
if test -n "$LIB_NSL"; then
AC_MSG_RESULT(yes)
LIBS="$LIBS $LIB_NSL"
else
AC_MSG_RESULT(no)
fi
fi
LIBWRAP_LIBS=
if test -n "$LIBWRAP_PATH"; then
LIBWRAP_LIBS="-L$LIBWRAP_PATH -lwrap $LIBWRAP_NSL"
AC_DEFINE(HAVE_HOSTS_ACCESS, 1,
[Define to true if host_access exists])
fi
AC_SUBST(LIBWRAP_LIBS)
dnl -----------------------------------------------------------
dnl -------------------------
dnl | Choose a Window Manager |--------------------------------
dnl -------------------------
AC_ARG_WITH(window-manager,
AC_HELP_STRING([--with-window-manager=NAME],
[Specify default window manager]),
[WINDOW_MANAGER="$with_window_manager"],
[dnl gnome-wm is a shell script that starts the WM.
WINDOW_MANAGER=gnome-wm])
AC_SUBST(WINDOW_MANAGER)
dnl -----------------------------------------------------------
dnl --------------------------------------------------------
dnl | Solaris does not have IceListenForWellKnownConnections |-
dnl --------------------------------------------------------
oLIBS="$LIBS"
LIBS="$GNOME_SESSION_LIBS"
AC_CHECK_FUNCS(_IceTransNoListen)
LIBS="$oLIBS"
dnl -----------------------------------------------------------
AC_CHECK_FUNCS(usleep)
dnl ====================================================================
dnl Code for checking whether IPv6 is enabled on the system....
dnl ====================================================================
AC_MSG_CHECKING([whether to enable ipv6])
AC_ARG_ENABLE(ipv6,
AC_HELP_STRING([-enable-ipv6], [enable IPv6 extensions]),,
[enable_ipv6=yes])
if test $enable_ipv6 = yes; then
dnl ====================================================================
dnl Code for checking presence of AF_INET6 on the system....
dnl ====================================================================
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>], [
socket(AF_INET6, SOCK_STREAM, 0)
],
have_ipv6=yes,
have_ipv6=no
)
AC_MSG_RESULT($have_ipv6)
dnl =================================================================
dnl Now we would check for specific function like getaddrinfo.
dnl =================================================================
have_getaddrinfo=no
if test $have_ipv6=yes; then
AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes)
if test $have_getaddrinfo != yes; then
# getaddrinfo is not in the default libraries. See if it's in some other.
for lib in bsd socket inet; do
AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes; break])
done
fi
if test $have_getaddrinfo=yes; then
AC_DEFINE(ENABLE_IPV6, 1, [Define if IPV6 is supported])
fi
fi
fi
dnl ==============================================================================
dnl End of IPv6 checks
dnl ==============================================================================
dnl Don't use AC_PROG_AWK since we need the full pathname.
AC_PATH_PROGS(AWK, mawk gawk nawk awk, )
AC_PATH_PROGS(PERL, perl5 perl)
dnl define a MAINT-like variable REBUILD which is set if Perl
dnl and awk are found, so autogenerated sources can be rebuilt
AC_ARG_ENABLE(rebuilds,
AC_HELP_STRING([--disable-rebuilds],
[disable all source autogeneration rules]),,
[enable_rebuilds=yes])
REBUILD=\#
if test "x$enable_rebuilds" = "xyes" && \
test -n "$PERL" && \
$PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 && \
test -n "$AWK" ; then
REBUILD=
fi
AC_SUBST(REBUILD)
AC_ARG_WITH(rsh-command,
AC_HELP_STRING([--with-rsh-command=COMMAND],
[Specify the command for executing a remote shell]),
[RSH_COMMAND="$with_rsh_command"],
[AC_PATH_PROG(RSH_COMMAND, rsh)
if test x$RSH_COMMAND = x ; then
AC_MSG_WARN([The rsh command was not found.])
fi
])
AC_SUBST(RSH_COMMAND)
AC_CONFIG_FILES([
Makefile
gnome-session.spec
gnome-session/Makefile
man/default.session.5
man/gnome-session.1
po/Makefile.in
man/Makefile
])
AC_OUTPUT([
gnome-session/session-properties.desktop.in
])
|