source: trunk/third/metacity/configure.in @ 18717

Revision 18717, 11.9 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18716, which included commits to RCS files with non-trunk default branches.
Line 
1AC_PREREQ(2.50)
2AC_INIT(src/display.c)
3
4AM_CONFIG_HEADER(config.h)
5
6# 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987
7# releases on a branch add a 4th version like 2.4.21.1
8AM_INIT_AUTOMAKE(metacity, 2.4.21)
9
10# Honor aclocal flags
11ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
12
13GETTEXT_PACKAGE=metacity
14AC_SUBST(GETTEXT_PACKAGE)
15AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Name of default gettext domain])
16
17AM_MAINTAINER_MODE
18
19AC_PROG_INTLTOOL([0.21])
20AC_PROG_CC
21AC_ISC_POSIX
22AC_HEADER_STDC
23AM_PROG_LIBTOOL
24
25changequote(,)dnl
26if test "x$GCC" = "xyes"; then
27  case " $CFLAGS " in
28  *[\ \ ]-Wall[\ \      ]*) ;;
29  *) CFLAGS="$CFLAGS -Wall" ;;
30  esac
31
32#  case " $CFLAGS " in
33#  *[\ \        ]-Wshadow[\ \   ]*) ;;
34#  *) CFLAGS="$CFLAGS -Wshadow" ;;
35#  esac
36
37  case " $CFLAGS " in
38  *[\ \ ]-Wchar-subscripts[\ \  ]*) ;;
39  *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
40  esac
41
42  case " $CFLAGS " in
43  *[\ \ ]-Wmissing-declarations[\ \     ]*) ;;
44  *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
45  esac
46
47  case " $CFLAGS " in
48  *[\ \ ]-Wmissing-prototypes[\ \       ]*) ;;
49  *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
50  esac
51
52  case " $CFLAGS " in
53  *[\ \ ]-Wnested-externs[\ \   ]*) ;;
54  *) CFLAGS="$CFLAGS -Wnested-externs" ;;
55  esac
56
57  case " $CFLAGS " in
58  *[\ \ ]-Wpointer-arith[\ \    ]*) ;;
59  *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
60  esac
61
62  case " $CFLAGS " in
63  *[\ \ ]-Wcast-align[\ \       ]*) ;;
64  *) CFLAGS="$CFLAGS -Wcast-align" ;;
65  esac
66
67  case " $CFLAGS " in
68  *[\ \ ]-Wsign-compare[\ \     ]*) ;;
69  *) CFLAGS="$CFLAGS -Wsign-compare" ;;
70  esac
71
72  if test "x$enable_ansi" = "xyes"; then
73    case " $CFLAGS " in
74    *[\ \       ]-ansi[\ \      ]*) ;;
75    *) CFLAGS="$CFLAGS -ansi" ;;
76    esac
77
78    case " $CFLAGS " in
79    *[\ \       ]-pedantic[\ \  ]*) ;;
80    *) CFLAGS="$CFLAGS -pedantic" ;;
81    esac
82  fi
83fi
84changequote([,])dnl
85
86METACITY_PC_MODULES='gtk+-2.0 >= 2.0.0'
87
88AC_ARG_ENABLE(config-dialog,      [  --enable-config-dialog      enable the config dialog that you need with GNOME 2.0 (obsolete with GNOME 2.2)],,enable_config_dialog=no)
89
90AM_CONDITIONAL(BUILD_CONFIG_DIALOG, test x$enable_config_dialog = xyes)
91if test x$enable_config_dialog = xyes; then
92    AC_DEFINE(BUILD_CONFIG_DIALOG,1,[Build configuration dialog])
93fi
94
95AC_ARG_ENABLE(gconf,              [  --disable-gconf             disable gconf usage, for embedded/size-sensitive non-GNOME builds],,enable_gconf=yes)
96
97if test x$enable_gconf = xyes; then
98    AC_DEFINE(HAVE_GCONF,1,[Build with gconf support])
99    METACITY_PC_MODULES="$METACITY_PC_MODULES gconf-2.0 >= 1.2.0"
100fi
101
102AC_ARG_ENABLE(verbose-mode,       [  --disable-verbose             disable metacity's ability to do verbose logging, for embedded/size-sensitive custom builds],,enable_verbose_mode=yes)
103
104if test x$enable_verbose_mode = xyes; then
105    AC_DEFINE(WITH_VERBOSE_MODE,1,[Build with verbose mode support])
106fi
107
108AC_ARG_ENABLE(sm,       [  --disable-sm             disable metacity's session management support, for embedded/size-sensitive custom non-GNOME builds],,enable_sm=auto)
109
110AC_ARG_ENABLE(startup-notification,   [  --disable-startup-notification             disable metacity's startup notification support, for embedded/size-sensitive custom non-GNOME builds],,enable_startup_notification=auto)
111
112AC_ARG_ENABLE(xsync,       [  --disable-xsync             disable metacity's use of the XSync extension],,enable_xsync=auto)
113
114AC_ARG_ENABLE(shape,       [  --disable-shape             disable metacity's use of the shaped window extension],,enable_shape=auto)
115
116## try definining HAVE_BACKTRACE
117AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
118
119ALL_LINGUAS="am az bg ca cs da de el es fi fr gl he hu it ja ko lv mk ms no pl pt pt_BR ro ru sl sk sv tr uk vi zh_CN zh_TW"
120AM_GLIB_GNU_GETTEXT
121
122## here we get the flags we'll actually use
123PKG_CHECK_MODULES(METACITY_MESSAGE, gtk+-2.0 >= 2.0.0)
124PKG_CHECK_MODULES(METACITY_WINDOW_DEMO, gtk+-2.0 >= 2.0.0)
125
126if test x$enable_config_dialog = xyes; then
127   PKG_CHECK_MODULES(METACITY_PROPS, gtk+-2.0 >= 2.0.0 gconf-2.0 >= 1.1.9 libglade-2.0)
128fi
129
130STARTUP_NOTIFICATION_VERSION=0.4
131AC_MSG_CHECKING([Startup notification library >= $STARTUP_NOTIFICATION_VERSION])
132if $PKG_CONFIG --atleast-version $STARTUP_NOTIFICATION_VERSION libstartup-notification-1.0; then
133   have_startup_notification=yes
134else
135   have_startup_notification=no
136fi
137AC_MSG_RESULT($have_startup_notification)
138
139if test x$enable_startup_notification = xyes; then
140   have_startup_notification=yes
141   echo "startup-notification support forced on"
142elif test x$enable_startup_notification = xauto; then
143   true
144else
145   have_startup_notification=no
146fi
147
148if test x$have_startup_notification = xyes; then
149  echo "Building with libstartup-notification"
150  METACITY_PC_MODULES="$METACITY_PC_MODULES libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION"
151  AC_DEFINE(HAVE_STARTUP_NOTIFICATION, , [Building with startup notification support])
152else
153  echo "Building without libstartup-notification"
154fi
155
156PKG_CHECK_MODULES(METACITY, $METACITY_PC_MODULES)
157
158if $PKG_CONFIG --atleast-version 2.2.0 gtk+-2.0; then
159   AC_DEFINE(HAVE_GTK_MULTIHEAD,,[gtk+ with multihead support found])
160   with_multihead=yes
161else
162   with_multihead=no
163fi
164
165AC_PATH_XTRA
166
167ALL_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
168
169# Check for Xinerama extension (Solaris impl or Xfree impl)
170metacity_save_cppflags="$CPPFLAGS"
171CPPFLAGS="$CPPFLAGS $X_CFLAGS"
172
173use_solaris_xinerama=no
174use_xfree_xinerama=no
175case "$host" in
176    *-*-solaris*)
177        # Check for solaris
178        use_solaris_xinerama=yes
179        AC_CHECK_LIB(Xext, XineramaGetInfo,
180                     use_solaris_xinerama=yes, use_solaris_xinerama=no,
181                     $ALL_X_LIBS)
182        if test "x$use_solaris_xinerama" = "xyes"; then
183            AC_CHECK_HEADER(X11/extensions/xinerama.h,
184                            if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
185                                X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
186                            fi
187                            AC_DEFINE(HAVE_SOLARIS_XINERAMA, , [Have Solaris-style Xinerama])
188                            AC_DEFINE(HAVE_XINERAMA, , [Have some version of Xinerama]),
189                            use_solaris_xinerama=no,
190                            [#include <X11/Xlib.h>])
191        fi     
192        AC_MSG_CHECKING(for Xinerama support on Solaris)
193        AC_MSG_RESULT($use_solaris_xinerama);
194        ;;
195    *)
196        # Check for XFree
197        use_xfree_xinerama=yes
198        AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
199            [AC_CHECK_HEADER(X11/extensions/Xinerama.h,
200                             X_EXTRA_LIBS="-lXinerama $X_EXTRA_LIBS"   
201                             if test -z "`echo $ALL_X_LIBS | grep "\-lXext" 2> /dev/null`"; then
202                                 X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS"
203                             fi
204                             AC_DEFINE(HAVE_XFREE_XINERAMA, , [Have XFree86-style Xinerama])
205                             AC_DEFINE(HAVE_XINERAMA,, [Have some version of Xinerama]),
206                             use_xfree_xinerama=no,
207                             [#include <X11/Xlib.h>])],
208            use_xfree_xinerama=no, -lXext $ALL_X_LIBS)
209        AC_MSG_CHECKING(for Xinerama support on XFree86)
210        AC_MSG_RESULT($use_xfree_xinerama);
211        ;;
212esac
213
214CPPFLAGS="$metacity_save_cppflags"
215
216SHAPE_LIBS=
217found_shape=no
218AC_CHECK_LIB(Xext, XShapeQueryExtension,
219               [AC_CHECK_HEADER(X11/extensions/shape.h,
220                                SHAPE_LIBS=-lXext found_shape=yes)],
221               , $ALL_X_LIBS)
222
223if test x$enable_shape = xno; then
224   found_shape=no
225fi
226
227if test x$enable_shape = xyes; then
228   if test "$found_shape" = "no"; then
229      AC_MSG_ERROR([--enable-shape forced and Shape not found])
230      exit 1
231   fi
232fi
233
234if test "x$found_shape" = "xyes"; then
235   AC_DEFINE(HAVE_SHAPE, , [Have the shape extension library])
236fi
237
238RANDR_LIBS=
239found_randr=no
240AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
241               [AC_CHECK_HEADER(X11/extensions/Xrandr.h,
242                                RANDR_LIBS=-lXrandr found_randr=yes,,
243                                [#include <X11/Xlib.h>])],
244               , -lXrender $ALL_X_LIBS)
245
246if test "x$found_randr" = "xyes"; then
247   AC_DEFINE(HAVE_RANDR, , [Have the Xrandr extension library])
248fi
249
250XSYNC_LIBS=
251found_xsync=no
252AC_CHECK_LIB(Xext, XSyncQueryExtension,
253               [AC_CHECK_HEADER(X11/extensions/sync.h,
254                                found_xsync=yes,,
255                                [#include <X11/Xlib.h>])],
256               , $ALL_X_LIBS)
257
258if test x$enable_xsync = xno; then
259   found_xsync=no
260fi
261
262if test x$enable_xsync = xyes; then
263   if test "$found_xsync" = "no"; then
264      AC_MSG_ERROR([--enable-xsync forced and XSync not found])
265      exit 1
266   fi
267fi
268
269if test "x$found_xsync" = "xyes"; then
270   XSYNC_LIBS=-lXext
271   AC_DEFINE(HAVE_XSYNC, , [Have the Xsync extension library])
272fi
273
274METACITY_LIBS="$XSYNC_LIBS $RANDR_LIBS $SHAPE_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_LIBS"
275METACITY_MESSAGE_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_MESSAGE_LIBS"
276METACITY_WINDOW_DEMO_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_WINDOW_DEMO_LIBS"
277METACITY_PROPS_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $METACITY_PROPS_LIBS"
278
279found_sm=no
280case "$METACITY_LIBS" in
281 *-lSM*)
282    found_sm=yes
283    ;;
284 *)
285  AC_CHECK_LIB(SM, SmcSaveYourselfDone,
286               [AC_CHECK_HEADERS(X11/SM/SMlib.h,
287                                METACITY_LIBS="-lSM -lICE $METACITY_LIBS" found_sm=no)],
288               , $METACITY_LIBS)
289    ;;
290esac
291
292if test x$enable_sm = xno; then
293   found_sm=no
294fi
295
296if test x$enable_sm = xyes; then
297   if test "$found_sm" = "no"; then
298      AC_MSG_ERROR([--enable-sm forced and -lSM not found])
299      exit 1
300   fi
301fi
302
303if test "$found_sm" = "yes"; then
304   AC_DEFINE(HAVE_SM, , [Building with SM support])
305fi
306
307AM_CONDITIONAL(HAVE_SM, test "$found_sm" = "yes")
308
309HOST_ALIAS=$host_alias
310AC_SUBST(HOST_ALIAS)
311
312AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
313
314if test x"$GDK_PIXBUF_CSOURCE" = xno; then
315  AC_MSG_ERROR([gdk-pixbuf-csource executable not found in your path - should be installed with GTK])
316fi
317
318AC_SUBST(GDK_PIXBUF_CSOURCE)
319
320## hack to work with old GTK versions for now
321save_LDFLAGS=$LDFLAGS
322LDFLAGS="$METACITY_LIBS $LDFLAGS"
323AC_CHECK_FUNCS(gdk_pixbuf_new_from_stream)
324LDFLAGS=$save_LDFLAGS
325
326if test x$enable_gconf = xyes; then
327   AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
328   if test x"$GCONFTOOL" = xno; then
329     AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
330   fi
331
332   AM_GCONF_SOURCE_2
333fi
334
335AC_OUTPUT([
336Makefile
337doc/Makefile
338src/Makefile
339src/wm-tester/Makefile
340src/libmetacity-private.pc
341src/tools/Makefile
342src/themes/Makefile
343po/Makefile.in
344metacity.spec
345])
346
347if test x$enable_gconf = xno; then
348        echo "*** WARNING WARNING WARNING WARNING WARNING"
349        echo "*** Building without GConf"
350        echo "*** This means there's no way to change prefs except"
351        echo "*** hacking source code, at least for now."
352        echo "*** Also, some prefs may have broken defaults."
353        echo "*** Patches needed for a simple no-gconf config file."
354        echo "*** This is intended for embedded systems etc., not for normal use."
355fi
356
357if test x$enable_verbose_mode = xno; then
358        echo "*** WARNING WARNING WARNING WARNING WARNING"
359        echo "*** Building without verbose mode"
360        echo "*** This means there's no way to debug metacity problems."
361        echo "*** Please build normal desktop versions of metacity"
362        echo "*** with verbose mode enabled so users can use it when they report bugs."
363fi
364
365dnl ==========================================================================
366echo "
367metacity-$VERSION:
368
369        prefix:                   ${prefix}
370        source code location:     ${srcdir}
371        compiler:                 ${CC}
372
373        GConf:                    ${enable_gconf}
374        XFree86 Xinerama:         ${use_xfree_xinerama}
375        Solaris Xinerama:         ${use_solaris_xinerama}
376        Multihead:                ${with_multihead}
377        Startup notification:     ${have_startup_notification}
378        Session management:       ${found_sm}
379        Shape extension:          ${found_shape}
380        Resize-and-rotate:        ${found_randr}
381        Xsync:                    ${found_xsync}
382        Deprecated config dialog: ${enable_config_dialog}
383"
Note: See TracBrowser for help on using the repository browser.