~ubuntu-branches/debian/sid/openbox/sid

« back to all changes in this revision

Viewing changes to m4/x11.m4

  • Committer: Bazaar Package Importer
  • Author(s): Nico Golde, Nico Golde, Eugenio Paolantonio
  • Date: 2011-10-03 22:59:30 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20111003225930-tdvyax5tx63dyoez
Tags: 3.5.0-1
[Nico Golde]
* New upstream release (Closes: #638783).
  - Fix crashes in the menu code (Closes: #563891).
* Add Brazilian translation to openbox.desktop,
  thanks Sérgio Cipolla (Closes: #627912).
* Remove 06_fix_swap_byte_order.patch, applied upstream.
* Bump debhelper dependency to >= 7.0.50~ due to override.
* Remove CHANGELOG from openbox.docs to prevent double installation.
* Add 02_fix_freedesktop_compliance.dpatch desktop file to
  /usr/share/applications.

[Eugenio Paolantonio]
* debian/patches:
  - Disabled 03_place_windows_in_quadrants.patch
  - Updated 01_rc.xml.patch and 06_fix_swap_byte_order.patch
  - Removed 04_fix_ftbfs_no-add-needed.patch and 20_24bits_support.patch
* debian/control:
  - Added myself to the Uploaders.
  - Build-Depends: removed libxau-dev, libxft-dev and python-xdg;
    added libimlib2-dev
  - openbox Suggests: added python-xdg
  - libobrender21 renamed to libobrender27
  - libobparser21 renamed to libobt0
* debian/rules:
  - Rewrote using a simpler debhelper syntax
  - Moved the install pass to openbox.install
* debian/*.{install,links,dirs}:
  - Updated.
* debian/openbox.xsession:
  - Removed. Openbox now ships it by default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
  # Store these
12
12
  OLDLIBS=$LIBS
13
13
  OLDCPPFLAGS=$CPPFLAGS
14
 
     
 
14
 
15
15
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
16
16
  X_LIBS="$X_PRE_LIBS $X_LIBS -lX11"
17
17
  LIBS="$LIBS $X_LIBS"
29
29
  CPPFLAGS=$OLDCPPFLAGS
30
30
])
31
31
 
32
 
 
33
 
AC_DEFUN([XFT_ERROR],
34
 
[
35
 
  if test "$XFT_MIN"; then
36
 
    AC_MSG_ERROR([$PACKAGE requires the Xft font library >= $XFT_MIN.
37
 
                  See http://www.fontconfig.org/
38
 
])
39
 
  else
40
 
    AC_MSG_ERROR([$PACKAGE requires the Xft font library.
41
 
                  See http://www.fontconfig.org/
42
 
])
43
 
  fi
44
 
])
45
 
 
46
 
# XFT_DEVEL([required-version])
47
 
#
48
 
# Check for the XFT development package.
49
 
# You can use the optional argument to check for a library of at least the
50
 
# given version.
51
 
# It provides the $(PYTHON_CFLAGS) $(PYTHON_LIBS) output variables.
52
 
AC_DEFUN([XFT_DEVEL],
53
 
[
54
 
  AC_REQUIRE([X11_DEVEL])
55
 
  
56
 
  if test "$1"; then
57
 
    XFT_MIN="$1"
58
 
    XFT_MIN_MAJOR=${XFT_MIN%.*.*}
59
 
    XFT_MIN_MINOR=${XFT_MIN%.*}
60
 
    XFT_MIN_MINOR=${XFT_MIN_MINOR#*.}
61
 
    XFT_MIN_REVISION=${XFT_MIN#*.*.}
62
 
    XFT_MIN="$XFT_MIN_MAJOR.$XFT_MIN_MINOR.$XFT_MIN_REVISION"
63
 
  else
64
 
    XFT_MIN=""
65
 
  fi
66
 
 
67
 
  if test -z "$XFT_MIN"; then
68
 
    AC_MSG_CHECKING([for Xft])
69
 
    if ! pkg-config xft; then
70
 
      AC_MSG_RESULT([no])
71
 
      XFT_ERROR
72
 
    fi
73
 
  else
74
 
    AC_MSG_CHECKING([for Xft version >= $XFT_MIN])
75
 
    if ! pkg-config --atleast-version $XFT_MIN xft; then
76
 
      AC_MSG_RESULT([no])
77
 
      XFT_ERROR
78
 
    fi
79
 
  fi
80
 
  AC_MSG_RESULT([yes])
81
 
 
82
 
 
83
 
  # Store these
84
 
  OLDLIBS=$LIBS
85
 
  OLDCPPFLAGS=$CPPFLAGS
86
 
 
87
 
  XFT_CFLAGS="`pkg-config --cflags xft`"
88
 
  XFT_LIBS="`pkg-config --libs xft`"
89
 
 
90
 
  # Set these for checking with the tests below. They'll be restored after
91
 
  LIBS="$LIBS $XFT_LIBS"
92
 
  CPPFLAGS="$XFT_CFLAGS $CPPFLAGS"
93
 
 
94
 
  AC_CHECK_LIB([Xft], [XftGetVersion], # this was not defined in < 2.0
95
 
    if test "$XFT_MIN"; then
96
 
      AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft >= $XFT_MIN])
97
 
      AC_TRY_COMPILE(
98
 
      [
99
 
        #include <X11/Xlib.h>
100
 
        #include <X11/Xft/Xft.h>
101
 
      ],
102
 
      [
103
 
        #if !defined(XFT_MAJOR)
104
 
        # error Xft.h is too old
105
 
        #endif
106
 
        #if XFT_MAJOR < $XFT_MIN_MAJOR
107
 
        # error Xft.h is too old
108
 
        #endif
109
 
        #if XFT_MAJOR == $XFT_MIN_MAJOR
110
 
        # if XFT_MINOR < $XFT_MIN_MINOR
111
 
        #  error Xft.h is too old
112
 
        # endif
113
 
        #endif
114
 
        #if XFT_MAJOR == $XFT_MIN_MAJOR
115
 
        # if XFT_MAJOR == $XFT_MIN_MINOR
116
 
        #  if XFT_REVISION < $XFT_MIN_REVISION
117
 
        #   error Xft.h is too old
118
 
        #  endif
119
 
        # endif
120
 
        #endif
121
 
      
122
 
        int i = XFT_MAJOR;
123
 
        XftFont foo;
124
 
      ],
125
 
      [
126
 
        AC_MSG_RESULT([yes])
127
 
      ],
128
 
      [
129
 
        AC_MSG_RESULT([no])
130
 
        XFT_ERROR
131
 
      ])
132
 
    else
133
 
      AC_MSG_CHECKING([for X11/Xft/Xft.h])
134
 
      AC_TRY_COMPILE(
135
 
      [
136
 
        #include <X11/Xlib.h>
137
 
        #include <X11/Xft/Xft.h>
138
 
      ],
139
 
      [
140
 
        int i = XFT_MAJOR; /* make sure were using Xft 2, not 1 */
141
 
        XftFont foo;
142
 
      ],
143
 
      [
144
 
        AC_MSG_RESULT([yes])
145
 
      ],
146
 
      [
147
 
        AC_MSG_RESULT([no])
148
 
        XFT_ERROR
149
 
      ])
150
 
    fi
151
 
 
152
 
    AC_MSG_CHECKING([if we can compile with Xft])
153
 
    AC_TRY_LINK(
154
 
    [
155
 
      #include <X11/Xlib.h>
156
 
      #include <X11/Xft/Xft.h>
157
 
    ],
158
 
    [
159
 
      int i = XFT_MAJOR;
160
 
      XftFont foo
161
 
    ],
162
 
    [
163
 
      AC_MSG_RESULT([yes])
164
 
    ],
165
 
    [ 
166
 
      AC_MSG_RESULT([no])
167
 
      AC_MSG_ERROR([Unable to compile with the Xft font library.
168
 
])
169
 
    ])
170
 
  )
171
 
 
172
 
  # Restore the old values. Use XFT_CFLAGS and XFT_LIBS in the Makefiles
173
 
  LIBS=$OLDLIBS
174
 
  CPPFLAGS=$OLDCPPFLAGS
175
 
 
176
 
  AC_SUBST([XFT_CFLAGS])
177
 
  AC_SUBST([XFT_LIBS])
178
 
])
179
 
 
180
 
 
181
32
# X11_EXT_XKB()
182
33
#
183
34
# Check for the presence of the "Xkb" X Window System extension.
187
38
[
188
39
  AC_REQUIRE([X11_DEVEL])
189
40
 
190
 
  # Store these
191
 
  OLDLIBS=$LIBS
192
 
  OLDCPPFLAGS=$CPPFLAGS
193
 
     
194
 
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
195
 
  LIBS="$LIBS $X_LIBS"
196
 
 
197
 
  AC_CHECK_LIB([X11], [XkbBell],
198
 
    AC_MSG_CHECKING([for X11/XKBlib.h])
199
 
    AC_TRY_LINK(
200
 
    [
201
 
      #include <X11/Xlib.h>
202
 
      #include <X11/Xutil.h>
203
 
      #include <X11/XKBlib.h>
204
 
    ],
205
 
    [
206
 
      Display *d;
207
 
      Window w;
208
 
      XkbBell(d, w, 0, 0);
209
 
    ],
210
 
    [
211
 
      AC_MSG_RESULT([yes])
212
 
      XKB="yes"
213
 
      AC_DEFINE([XKB], [1], [Found the XKB extension])
214
 
 
215
 
      XKB_CFLAGS=""
216
 
      XKB_LIBS=""
217
 
      AC_SUBST(XKB_CFLAGS)
218
 
      AC_SUBST(XKB_LIBS)
219
 
    ],
220
 
    [ 
221
 
      AC_MSG_RESULT([no])
222
 
      XKB="no"
223
 
    ])
224
 
  )
225
 
 
226
 
  LIBS=$OLDLIBS
227
 
  CPPFLAGS=$OLDCPPFLAGS
 
41
  AC_ARG_ENABLE([xkb],
 
42
  AC_HELP_STRING(
 
43
  [--disable-xkb],
 
44
  [build without support for xkb extension [default=enabled]]),
 
45
  [USE=$enableval], [USE="yes"])
 
46
 
 
47
  if test "$USE" = "yes"; then
 
48
    # Store these
 
49
    OLDLIBS=$LIBS
 
50
    OLDCPPFLAGS=$CPPFLAGS
 
51
 
 
52
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
53
    LIBS="$LIBS $X_LIBS"
 
54
 
 
55
    AC_CHECK_LIB([X11], [XkbBell],
 
56
      AC_MSG_CHECKING([for X11/XKBlib.h])
 
57
      AC_TRY_LINK(
 
58
      [
 
59
        #include <X11/Xlib.h>
 
60
        #include <X11/Xutil.h>
 
61
        #include <X11/XKBlib.h>
 
62
      ],
 
63
      [
 
64
        Display *d;
 
65
        Window w;
 
66
        XkbBell(d, w, 0, 0);
 
67
      ],
 
68
      [
 
69
        AC_MSG_RESULT([yes])
 
70
        XKB="yes"
 
71
        AC_DEFINE([XKB], [1], [Found the XKB extension])
 
72
 
 
73
        XKB_CFLAGS=""
 
74
        XKB_LIBS=""
 
75
        AC_SUBST(XKB_CFLAGS)
 
76
        AC_SUBST(XKB_LIBS)
 
77
      ],
 
78
      [
 
79
        AC_MSG_RESULT([no])
 
80
        XKB="no"
 
81
      ])
 
82
    )
 
83
 
 
84
    LIBS=$OLDLIBS
 
85
    CPPFLAGS=$OLDCPPFLAGS
 
86
  fi
228
87
 
229
88
  AC_MSG_CHECKING([for the Xkb extension])
230
89
  if test "$XKB" = "yes"; then
243
102
[
244
103
  AC_REQUIRE([X11_DEVEL])
245
104
 
246
 
  # Store these
247
 
  OLDLIBS=$LIBS
248
 
  OLDCPPFLAGS=$CPPFLAGS
249
 
     
250
 
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
251
 
  LIBS="$LIBS $X_LIBS -lXext -lXrender -lXrandr"
252
 
 
253
 
  AC_CHECK_LIB([Xrandr], [XRRSelectInput],
254
 
    AC_MSG_CHECKING([for X11/extensions/Xrandr.h])
255
 
    AC_TRY_LINK(
256
 
    [
257
 
      #include <X11/Xlib.h>
258
 
      #include <X11/extensions/Xrandr.h>
259
 
    ],
260
 
    [
261
 
      Display *d;
262
 
      Drawable r;
263
 
      int i;
264
 
      XRRQueryExtension(d, &i, &i);
265
 
      XRRGetScreenInfo(d, r);
266
 
    ],
267
 
    [
268
 
      AC_MSG_RESULT([yes])
269
 
      XRANDR="yes"
270
 
      AC_DEFINE([XRANDR], [1], [Found the XRandR extension])
271
 
 
272
 
      XRANDR_CFLAGS=""
273
 
      XRANDR_LIBS="-lXext -lXrender -lXrandr"
274
 
      AC_SUBST(XRANDR_CFLAGS)
275
 
      AC_SUBST(XRANDR_LIBS)
276
 
    ],
277
 
    [ 
278
 
      AC_MSG_RESULT([no])
279
 
      XRANDR="no"
280
 
    ])
281
 
  )
282
 
 
283
 
  LIBS=$OLDLIBS
284
 
  CPPFLAGS=$OLDCPPFLAGS
 
105
  AC_ARG_ENABLE([xrandr],
 
106
  AC_HELP_STRING(
 
107
  [--disable-xrandr],
 
108
  [build without support for xrandr extension [default=enabled]]),
 
109
  [USE=$enableval], [USE="yes"])
 
110
 
 
111
  if test "$USE" = "yes"; then
 
112
    # Store these
 
113
    OLDLIBS=$LIBS
 
114
    OLDCPPFLAGS=$CPPFLAGS
 
115
 
 
116
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
117
    LIBS="$LIBS $X_LIBS -lXext -lXrender -lXrandr"
 
118
 
 
119
    AC_CHECK_LIB([Xrandr], [XRRSelectInput],
 
120
      AC_MSG_CHECKING([for X11/extensions/Xrandr.h])
 
121
      AC_TRY_LINK(
 
122
      [
 
123
        #include <X11/Xlib.h>
 
124
        #include <X11/extensions/Xrandr.h>
 
125
      ],
 
126
      [
 
127
        Display *d;
 
128
        Drawable r;
 
129
        int i;
 
130
        XRRQueryExtension(d, &i, &i);
 
131
        XRRGetScreenInfo(d, r);
 
132
      ],
 
133
      [
 
134
        AC_MSG_RESULT([yes])
 
135
        XRANDR="yes"
 
136
        AC_DEFINE([XRANDR], [1], [Found the XRandR extension])
 
137
 
 
138
        XRANDR_CFLAGS=""
 
139
        XRANDR_LIBS="-lXext -lXrender -lXrandr"
 
140
        AC_SUBST(XRANDR_CFLAGS)
 
141
        AC_SUBST(XRANDR_LIBS)
 
142
      ],
 
143
      [
 
144
        AC_MSG_RESULT([no])
 
145
        XRANDR="no"
 
146
      ])
 
147
    )
 
148
 
 
149
    LIBS=$OLDLIBS
 
150
    CPPFLAGS=$OLDCPPFLAGS
 
151
  fi
285
152
 
286
153
  AC_MSG_CHECKING([for the XRandR extension])
287
154
  if test "$XRANDR" = "yes"; then
300
167
[
301
168
  AC_REQUIRE([X11_DEVEL])
302
169
 
303
 
  # Store these
304
 
  OLDLIBS=$LIBS
305
 
  OLDCPPFLAGS=$CPPFLAGS
306
 
     
307
 
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
308
 
  LIBS="$LIBS $X_LIBS"
309
 
 
310
 
  AC_CHECK_LIB([Xext], [XShapeCombineShape],
311
 
    AC_MSG_CHECKING([for X11/extensions/shape.h])
312
 
    AC_TRY_LINK(
313
 
    [
314
 
      #include <X11/Xlib.h>
315
 
      #include <X11/Xutil.h>
316
 
      #include <X11/extensions/shape.h>
317
 
    ],
318
 
    [
319
 
      long foo = ShapeSet;
320
 
    ],
321
 
    [
322
 
      AC_MSG_RESULT([yes])
323
 
      SHAPE="yes"
324
 
      AC_DEFINE([SHAPE], [1], [Found the XShape extension])
325
 
 
326
 
      XSHAPE_CFLAGS=""
327
 
      XSHAPE_LIBS="-lXext"
328
 
      AC_SUBST(XSHAPE_CFLAGS)
329
 
      AC_SUBST(XSHAPE_LIBS)
330
 
    ],
331
 
    [ 
332
 
      AC_MSG_RESULT([no])
333
 
      SHAPE="no"
334
 
    ])
335
 
  )
336
 
 
337
 
  LIBS=$OLDLIBS
338
 
  CPPFLAGS=$OLDCPPFLAGS
339
 
 
 
170
  AC_ARG_ENABLE([xshape],
 
171
  AC_HELP_STRING(
 
172
  [--disable-xshape],
 
173
  [build without support for xshape extension [default=enabled]]),
 
174
  [USE=$enableval], [USE="yes"])
 
175
 
 
176
  if test "$USE" = "yes"; then
 
177
    # Store these
 
178
    OLDLIBS=$LIBS
 
179
    OLDCPPFLAGS=$CPPFLAGS
 
180
 
 
181
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
182
    LIBS="$LIBS $X_LIBS"
 
183
 
 
184
    AC_CHECK_LIB([Xext], [XShapeCombineShape],
 
185
      AC_MSG_CHECKING([for X11/extensions/shape.h])
 
186
      AC_TRY_LINK(
 
187
      [
 
188
        #include <X11/Xlib.h>
 
189
        #include <X11/Xutil.h>
 
190
        #include <X11/extensions/shape.h>
 
191
      ],
 
192
      [
 
193
        long foo = ShapeSet;
 
194
      ],
 
195
      [
 
196
        AC_MSG_RESULT([yes])
 
197
        SHAPE="yes"
 
198
        AC_DEFINE([SHAPE], [1], [Found the XShape extension])
 
199
 
 
200
        XSHAPE_CFLAGS=""
 
201
        XSHAPE_LIBS="-lXext"
 
202
        AC_SUBST(XSHAPE_CFLAGS)
 
203
        AC_SUBST(XSHAPE_LIBS)
 
204
      ],
 
205
      [
 
206
        AC_MSG_RESULT([no])
 
207
        SHAPE="no"
 
208
      ])
 
209
    )
 
210
 
 
211
    LIBS=$OLDLIBS
 
212
    CPPFLAGS=$OLDCPPFLAGS
 
213
  fi
 
214
 
340
215
  AC_MSG_CHECKING([for the Shape extension])
341
216
  if test "$SHAPE" = "yes"; then
342
217
    AC_MSG_RESULT([yes])
355
230
[
356
231
  AC_REQUIRE([X11_DEVEL])
357
232
 
358
 
  # Store these
359
 
  OLDLIBS=$LIBS
360
 
  OLDCPPFLAGS=$CPPFLAGS
361
 
     
362
 
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
363
 
  LIBS="$LIBS $X_LIBS -lXext"
364
 
 
365
 
  AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
366
 
  [
367
 
    AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
368
 
    AC_TRY_LINK(
369
 
    [
370
 
      #include <X11/Xlib.h>
371
 
      #include <X11/extensions/Xinerama.h>
372
 
    ],
373
 
    [
374
 
      XineramaScreenInfo foo;
375
 
    ],
376
 
    [
377
 
      AC_MSG_RESULT([yes])
378
 
      XINERAMA="yes"
379
 
      AC_DEFINE([XINERAMA], [1], [Enable support of the Xinerama extension])
380
 
      XINERAMA_LIBS="-lXext -lXinerama"
381
 
      AC_SUBST(XINERAMA_LIBS)
382
 
    ],
383
 
    [
384
 
      AC_MSG_RESULT([no])
385
 
      XINERAMA="no"
 
233
  AC_ARG_ENABLE([xinerama],
 
234
  AC_HELP_STRING(
 
235
  [--disable-xinerama],
 
236
  [build without support for xinerama [default=enabled]]),
 
237
  [USE=$enableval], [USE="yes"])
 
238
 
 
239
  if test "$USE" = "yes"; then
 
240
    # Store these
 
241
    OLDLIBS=$LIBS
 
242
    OLDCPPFLAGS=$CPPFLAGS
 
243
 
 
244
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
245
    LIBS="$LIBS $X_LIBS -lXext"
 
246
 
 
247
    AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
 
248
    [
 
249
      AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
 
250
      AC_TRY_LINK(
 
251
      [
 
252
        #include <X11/Xlib.h>
 
253
        #include <X11/extensions/Xinerama.h>
 
254
      ],
 
255
      [
 
256
        XineramaScreenInfo foo;
 
257
      ],
 
258
      [
 
259
        AC_MSG_RESULT([yes])
 
260
        XINERAMA="yes"
 
261
        AC_DEFINE([XINERAMA], [1], [Enable support of the Xinerama extension])
 
262
        XINERAMA_LIBS="-lXext -lXinerama"
 
263
        AC_SUBST(XINERAMA_LIBS)
 
264
      ],
 
265
      [
 
266
        AC_MSG_RESULT([no])
 
267
        XINERAMA="no"
 
268
      ])
386
269
    ])
387
 
  ])
388
270
 
389
 
  LIBS=$OLDLIBS
390
 
  CPPFLAGS=$OLDCPPFLAGS
 
271
    LIBS=$OLDLIBS
 
272
    CPPFLAGS=$OLDCPPFLAGS
 
273
  fi
391
274
 
392
275
  AC_MSG_CHECKING([for the Xinerama extension])
393
276
  if test "$XINERAMA" = "yes"; then
406
289
[
407
290
  AC_REQUIRE([X11_DEVEL])
408
291
 
409
 
  # Store these
410
 
  OLDLIBS=$LIBS
411
 
  OLDCPPFLAGS=$CPPFLAGS
412
 
     
413
 
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
414
 
  LIBS="$LIBS $X_LIBS"
415
 
 
416
 
  AC_CHECK_LIB([Xext], [XSyncInitialize],
417
 
    AC_MSG_CHECKING([for X11/extensions/sync.h])
418
 
    AC_TRY_LINK(
419
 
    [
420
 
      #include <X11/Xlib.h>
421
 
      #include <X11/Xutil.h>
422
 
      #include <X11/extensions/sync.h>
423
 
    ],
424
 
    [
425
 
      XSyncValueType foo;
426
 
    ],
427
 
    [
428
 
      AC_MSG_RESULT([yes])
429
 
      SYNC="yes"
430
 
      AC_DEFINE([SYNC], [1], [Found the XSync extension])
431
 
 
432
 
      XSYNC_CFLAGS=""
433
 
      XSYNC_LIBS="-lXext"
434
 
      AC_SUBST(XSYNC_CFLAGS)
435
 
      AC_SUBST(XSYNC_LIBS)
436
 
    ],
437
 
    [ 
438
 
      AC_MSG_RESULT([no])
439
 
      SYNC="no"
440
 
    ])
441
 
  )
442
 
 
443
 
  LIBS=$OLDLIBS
444
 
  CPPFLAGS=$OLDCPPFLAGS
445
 
 
 
292
  AC_ARG_ENABLE([xsync],
 
293
  AC_HELP_STRING(
 
294
  [--disable-xsync],
 
295
  [build without support for xsync extension [default=enabled]]),
 
296
  [USE=$enableval], [USE="yes"])
 
297
 
 
298
  if test "$USE" = "yes"; then
 
299
    # Store these
 
300
    OLDLIBS=$LIBS
 
301
    OLDCPPFLAGS=$CPPFLAGS
 
302
 
 
303
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
304
    LIBS="$LIBS $X_LIBS"
 
305
 
 
306
    AC_CHECK_LIB([Xext], [XSyncInitialize],
 
307
      AC_MSG_CHECKING([for X11/extensions/sync.h])
 
308
      AC_TRY_LINK(
 
309
      [
 
310
        #include <X11/Xlib.h>
 
311
        #include <X11/Xutil.h>
 
312
        #include <X11/extensions/sync.h>
 
313
      ],
 
314
      [
 
315
        XSyncValueType foo;
 
316
      ],
 
317
      [
 
318
        AC_MSG_RESULT([yes])
 
319
        SYNC="yes"
 
320
        AC_DEFINE([SYNC], [1], [Found the XSync extension])
 
321
 
 
322
        XSYNC_CFLAGS=""
 
323
        XSYNC_LIBS="-lXext"
 
324
        AC_SUBST(XSYNC_CFLAGS)
 
325
        AC_SUBST(XSYNC_LIBS)
 
326
      ],
 
327
      [
 
328
        AC_MSG_RESULT([no])
 
329
        SYNC="no"
 
330
      ])
 
331
    )
 
332
 
 
333
    LIBS=$OLDLIBS
 
334
    CPPFLAGS=$OLDCPPFLAGS
 
335
  fi
 
336
 
446
337
  AC_MSG_CHECKING([for the Sync extension])
447
338
  if test "$SYNC" = "yes"; then
448
339
    AC_MSG_RESULT([yes])
451
342
  fi
452
343
])
453
344
 
 
345
# X11_EXT_AUTH()
 
346
#
 
347
# Check for the presence of the "Xau" X Window System extension.
 
348
# Defines "AUTH, sets the $(AUTH) variable to "yes", and sets the $(LIBS)
 
349
# appropriately if the extension is present.
 
350
AC_DEFUN([X11_EXT_AUTH],
 
351
[
 
352
  AC_REQUIRE([X11_DEVEL])
 
353
 
 
354
  # Store these
 
355
  OLDLIBS=$LIBS
 
356
  OLDCPPFLAGS=$CPPFLAGS
 
357
 
 
358
  CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 
359
  LIBS="$LIBS $X_LIBS"
 
360
 
 
361
  AC_CHECK_LIB([Xau], [XauReadAuth],
 
362
    AC_MSG_CHECKING([for X11/Xauth.h])
 
363
    AC_TRY_LINK(
 
364
    [
 
365
      #include <X11/Xlib.h>
 
366
      #include <X11/Xutil.h>
 
367
      #include <X11/Xauth.h>
 
368
    ],
 
369
    [
 
370
    ],
 
371
    [
 
372
      AC_MSG_RESULT([yes])
 
373
      AUTH="yes"
 
374
      AC_DEFINE([AUTH], [1], [Found the Xauth extension])
 
375
 
 
376
      XAUTH_CFLAGS=""
 
377
      XAUTH_LIBS="-lXau"
 
378
      AC_SUBST(XAUTH_CFLAGS)
 
379
      AC_SUBST(XAUTH_LIBS)
 
380
    ],
 
381
    [
 
382
      AC_MSG_RESULT([no])
 
383
      AUTH="no"
 
384
    ])
 
385
  )
 
386
 
 
387
  LIBS=$OLDLIBS
 
388
  CPPFLAGS=$OLDCPPFLAGS
 
389
 
 
390
  AC_MSG_CHECKING([for the Xauth extension])
 
391
  if test "$AUTH" = "yes"; then
 
392
    AC_MSG_RESULT([yes])
 
393
  else
 
394
    AC_MSG_RESULT([no])
 
395
  fi
 
396
])
 
397
 
454
398
# X11_SM()
455
399
#
456
400
# Check for the presence of SMlib for session management.
461
405
 
462
406
  AC_ARG_ENABLE([session-management],
463
407
  AC_HELP_STRING(
464
 
  [--disable-session-management], [build without support for session managers [[default=enabled]]]),
 
408
  [--disable-session-management],
 
409
  [build without support for session managers [default=enabled]]),
465
410
  [SM=$enableval], [SM="yes"])
466
 
  
 
411
 
467
412
  if test "$SM" = "yes"; then
468
413
    # Store these
469
414
    OLDLIBS=$LIBS
470
415
    OLDCPPFLAGS=$CPPFLAGS
471
 
     
 
416
 
472
417
    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
473
418
    LIBS="$LIBS $X_LIBS"
474
419
 
484
429
        SM="yes"
485
430
      ])
486
431
    ])
 
432
 
 
433
    LIBS=$OLDLIBS
 
434
    CPPFLAGS=$OLDCPPFLAGS
487
435
  fi
488
436
 
489
 
  LIBS=$OLDLIBS
490
 
  CPPFLAGS=$OLDCPPFLAGS
491
 
 
492
437
  AC_MSG_CHECKING([for session management support])
493
438
  if test "$SM" = "yes"; then
494
439
    AC_MSG_RESULT([yes])