egl: First attempt at cleaning up the EGL native backend
[profile/ivi/clutter.git] / configure.ac
1 # clutter package version number, (as distinct from shared library version)
2 # An odd micro number indicates in-progress development from Git
3 # An even micro number indicates a released version
4 #
5 # Making a point release:
6 # - increase clutter_micro_version to the next even number
7 # - increase clutter_interface_age to the next even number
8 # After the release:
9 # - increase clutter_micro_version to the next odd number
10 # - increase clutter_interface_version to the next odd number
11 m4_define([clutter_major_version], [1])
12 m4_define([clutter_minor_version], [9])
13 m4_define([clutter_micro_version], [1])
14
15 # • for stable releases: increase the interface age by 1 for each release;
16 #   if the API changes, set to 0. interface_age and binary_age are used to
17 #   create the soname of the shared object:
18 #
19 #  (<minor> * 100 + <micro>) - <interface_age>
20 #
21 # this allows using the same soname for different micro-releases in case
22 # no API was added or deprecated. for instance:
23 #
24 #   clutter 1.2.0  -> 100 * 2 + 0  = 200, interface age = 0 -> 200
25 #   clutter 1.2.2  -> 100 * 2 + 2  = 202, interface age = 2 -> 200
26 #   clutter 1.2.4  -> 100 * 2 + 4  = 204, interface age = 4 -> 200
27 #   [ API addition, deprecation ]
28 #   clutter 1.2.6  -> 100 * 2 + 6  = 206, interface age = 0 -> 206
29 #   clutter 1.2.8  -> 100 * 2 + 8  = 208, interface age = 2 -> 206
30 #   clutter 1.2.10 -> 100 * 2 + 10 = 210, interface age = 4 -> 206
31 #   ...
32 #
33 # • for development releases: keep clutter_interface_age to 0
34 m4_define([clutter_interface_age], [0])
35
36 m4_define([clutter_binary_age], [m4_eval(100 * clutter_minor_version + clutter_micro_version)])
37
38 m4_define([clutter_release_status],
39           [m4_if(m4_eval(clutter_micro_version % 2), [1], [git],
40                  [m4_if(m4_eval(clutter_minor_version % 2), [1], [snapshot],
41                                                                  [release])])])
42
43 m4_define([clutter_version], [clutter_major_version.clutter_minor_version.clutter_micro_version])
44
45 # change this only when breaking the API
46 m4_define([clutter_api_version], [1.0])
47
48 AC_PREREQ([2.63])
49
50 AC_INIT([clutter],
51         [clutter_version],
52         [http://bugzilla.gnome.org/enter_bug.cgi?product=clutter],
53         [clutter],
54         [http://www.clutter-project.org])
55
56 AC_CONFIG_SRCDIR([clutter/clutter.h])
57 AC_CONFIG_HEADERS([config.h])
58 AC_CONFIG_AUX_DIR([build])
59 AC_CONFIG_MACRO_DIR([build/autotools])
60
61 AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip dist-xz tar-ustar])
62 AM_SILENT_RULES([yes])
63
64 AC_SUBST([CLUTTER_MAJOR_VERSION],  [clutter_major_version])
65 AC_SUBST([CLUTTER_MINOR_VERSION],  [clutter_minor_version])
66 AC_SUBST([CLUTTER_MICRO_VERSION],  [clutter_micro_version])
67 AC_SUBST([CLUTTER_VERSION],        [clutter_version])
68 AC_SUBST([CLUTTER_API_VERSION],    [clutter_api_version])
69 AC_SUBST([CLUTTER_API_VERSION_AM], [$CLUTTER_MAJOR_VERSION\_0])
70 AC_SUBST([CLUTTER_RELEASE_STATUS], [clutter_release_status])
71
72 m4_define([lt_current],  [m4_eval(100 * clutter_minor_version + clutter_micro_version - clutter_interface_age)])
73 m4_define([lt_revision], [clutter_interface_age])
74 m4_define([lt_age],      [m4_eval(clutter_binary_age - clutter_interface_age)])
75 CLUTTER_LT_CURRENT=lt_current
76 CLUTTER_LT_REV=lt_revision
77 CLUTTER_LT_AGE=lt_age
78 CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE"
79 CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION"
80 AC_SUBST([CLUTTER_LT_CURRENT],  [lt_current])
81 AC_SUBST([CLUTTER_LT_REVISION], [lt_revision])
82 AC_SUBST([CLUTTER_LT_VERSION],  [$CLUTTER_LT_VERSION])
83
84 AC_PROG_SED
85
86 AC_CANONICAL_HOST
87
88 platform_win32=no
89 platform_quartz=no
90 platform_linux=no
91
92 AC_MSG_CHECKING([if building for some Win32 platform])
93 AS_CASE([$host],
94         [*-*-mingw*|*-*-cygwin*],
95         [
96           CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined"
97           platform_win32=yes
98         ],
99
100         []
101 )
102 AC_MSG_RESULT([$platform_win32])
103
104 AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
105
106 AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
107 AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
108
109 AC_CHECK_HEADER([GL/glx.h], [platform_glx=yes], [platform_glx=no])
110 AC_CHECK_LIB([GL], [glXCreateContext], [platform_glx=yes], [platform_glx=no])
111 AM_CONDITIONAL(OS_GLX, [test "$platform_glx" = "yes"])
112
113 AC_SUBST(CLUTTER_LT_LDFLAGS)
114
115 dnl ========================================================================
116
117 # Checks for programs.
118 AM_PROG_CC_C_O
119
120 # require libtool >= 2.2
121 LT_PREREQ([2.2.6])
122 LT_INIT([disable-static])
123
124 # Checks for header files.
125 AC_HEADER_STDC
126
127 # required versions for dependencies
128 m4_define([glib_req_version],           [2.31.0])
129 m4_define([cogl_req_version],           [1.9.1])
130 m4_define([json_glib_req_version],      [0.12.0])
131 m4_define([atk_req_version],            [2.1.5])
132 m4_define([cairo_req_version],          [1.10])
133 m4_define([pango_req_version],          [1.20])
134 m4_define([gi_req_version],             [0.9.5])
135 m4_define([uprof_req_version],          [0.3])
136 m4_define([gtk_doc_req_version],        [1.15])
137 m4_define([xfixes_req_version],         [3])
138 m4_define([xcomposite_req_version],     [0.4])
139
140 AC_SUBST([GLIB_REQ_VERSION],       [glib_req_version])
141 AC_SUBST([COGL_REQ_VERSION],       [cogl_req_version])
142 AC_SUBST([JSON_GLIB_REQ_VERSION],  [json_glib_req_version])
143 AC_SUBST([ATK_REQ_VERSION],        [atk_req_version])
144 AC_SUBST([CAIRO_REQ_VERSION],      [cairo_req_version])
145 AC_SUBST([PANGO_REQ_VERSION],      [pango_req_version])
146 AC_SUBST([GI_REQ_VERSION],         [gi_req_version])
147 AC_SUBST([UPROF_REQ_VERSION],      [uprof_req_version])
148 AC_SUBST([GTK_DOC_REQ_VERSION],    [gtk_doc_req_version])
149 AC_SUBST([XFIXES_REQ_VERSION],     [xfixes_req_version])
150 AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
151
152 # Checks for typedefs, structures, and compiler characteristics.
153 AM_PATH_GLIB_2_0([glib_req_version],
154                  [],
155                  [AC_MSG_ERROR([glib-2.0 is required])],
156                  [gobject gthread gmodule-no-export])
157
158 # Check for -Bsymbolic-functions to avoid intra-library PLT jumps
159 AC_ARG_ENABLE([Bsymbolic],
160               [AS_HELP_STRING([--disable-Bsymbolic],
161                               [Avoid linking with -Bsymbolic])],
162               [],
163               [
164                 saved_LDFLAGS="${LDFLAGS}"
165                 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
166                 LDFLAGS=-Wl,-Bsymbolic-functions
167                 AC_TRY_LINK([], [int main (void) { return 0; }],
168                             [
169                               AC_MSG_RESULT([yes])
170                               enable_Bsymbolic=yes
171                             ],
172                             [
173                               AC_MSG_RESULT([no])
174                               enable_Bsymbolic=no
175                             ])
176                 LDFLAGS="${saved_LDFLAGS}"
177               ])
178
179 AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
180 AC_SUBST(CLUTTER_LINK_FLAGS)
181
182 dnl ========================================================================
183
184 # defaults
185 AS_IF([test "x$platform_win32" = "xyes"],  [CLUTTER_FLAVOUR=win32],
186       [test "x$platform_quartz" = "xyes"], [CLUTTER_FLAVOUR=osx],
187       [CLUTTER_FLAVOUR=glx])
188
189 FLAVOUR_LIBS=""
190 FLAVOUR_CFLAGS=""
191 CLUTTER_BACKENDS=""
192
193 experimental_backend=no
194
195 # base dependencies for core
196 CLUTTER_BASE_PC_FILES="cogl-1.0 >= $COGL_REQ_VERSION cairo-gobject >= $CAIRO_REQ_VERSION atk >= $ATK_REQ_VERSION pangocairo >= $PANGO_REQ_VERSION cogl-pango-1.0 json-glib-1.0 >= $JSON_GLIB_REQ_VERSION"
197
198 # backend specific pkg-config files
199 BACKEND_PC_FILES=""
200
201 dnl === Clutter windowing system backend ======================================
202
203 AC_ARG_ENABLE([x11],
204               [AS_HELP_STRING([--enable-x11=@<:@yes/no@:>@], [Enable the X11 backend (default=no)])],
205               [],
206               [enable_x11=maybe])
207 AC_ARG_ENABLE([win32],
208               [AS_HELP_STRING([--enable-win32=@<:@yes/no@:>@], [Enable the Windows backend (default=no)])],
209               [],
210               [enable_win32=maybe])
211 AC_ARG_ENABLE([osx],
212               [AS_HELP_STRING([--enable-osx=@<:@yes/no@:>@], [Enable the OS X backend (default=no)])],
213               [],
214               [enable_osx=maybe])
215 AC_ARG_ENABLE([gdk],
216               [AS_HELP_STRING([--enable-gdk=@<:@yes/no@:>@], [Enable the GDK backend (default=no)])],
217               [],
218               [enable_gdk=maybe])
219 AC_ARG_ENABLE([wayland],
220               [AS_HELP_STRING([--enable-wayland=@<:@yes/no@:>@], [Enable the Wayland client backend (default=no)])],
221               [],
222               [enable_wayland=maybe])
223 AC_ARG_ENABLE([egl],
224               [AS_HELP_STRING([--enable-egl=@<:@yes/no@:>@], [Enable the EGL framebuffer backend (default=no)])],
225               [],
226               [enable_egl=maybe])
227
228 dnl Define default values
229 AS_IF([test "x$platform_glx" = "xyes"], [enable_x11=yes])
230 AS_IF([test "x$platform_win32" = "xyes"], [enable_win32=yes])
231 AS_IF([test "x$platform_quartz" = "xyes"], [enable_osx=yes])
232
233 dnl Per-backend rules
234 AS_IF([test "x$enable_x11" = "xyes"],
235       [
236         CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
237
238         SUPPORT_X11=1
239         SUPPORT_GLX=1
240         SUPPORT_COGL=1
241
242         # Mesa 7.3 added a GL pkg-config file, finally, but if a pkg-config
243         # file isn't found just add -lGL and hope for the best.
244         PKG_CHECK_EXISTS([gl],
245                          [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"],
246                          [FLAVOUR_LIBS="$FLAVOUR_LIBS -lGL"])
247
248         # We might fall back to DRM for sync-to-vblank on GLX
249         PKG_CHECK_EXISTS([libdrm],
250                          [
251                            AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
252                            BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
253                          ],
254                          [])
255
256         # we use fontconfig API and pango-fc when the fontconfig
257         # configuration changes
258         PKG_CHECK_EXISTS([pangoft2],
259                          [
260                            AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
261                            BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
262                          ],
263                          [])
264
265         AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
266       ])
267
268 AS_IF([test "x$enable_gdk" = "xyes"],
269       [
270         CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk"
271
272         SUPPORT_GDK=1
273         SUPPORT_COGL=1
274
275         BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
276         PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
277       ])
278
279 AS_IF([test "x$enable_wayland" = "xyes"],
280       [
281         CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland"
282
283         experimental_backend="yes"
284
285         SUPPORT_WAYLAND=1
286         SUPPORT_EVDEV=1
287
288         PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
289         PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
290         PKG_CHECK_EXISTS([wayland-client xkbcommon],
291                          [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"],
292                          [])
293
294         AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
295       ])
296
297 AS_IF([test "x$enable_egl" = "xyes"],
298       [
299         CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
300
301         SUPPORT_EGL=1
302         SUPPORT_COGL=1
303
304         # if Mesa has support for egl, we can use it as well
305         PKG_CHECK_EXISTS([egl],
306                          [
307                            BACKEND_PC_FILES="$BACKEND_PC_FILES egl"
308                          ],
309                          [])
310
311         AC_ARG_WITH([tslib],
312                     [AS_HELP_STRING([--with-tslib=@<:@yes/no@:>@], [Use TSLib for events])],
313                     [],
314                     [with_tslib=yes])
315
316         AC_ARG_WITH([evdev],
317                     [AS_HELP_STRING([--with-evdev=@<:@yes/no@:>@], [Use evdev for events])],
318                     [],
319                     [with_evdev=yes])
320
321         AC_ARG_WITH([gdl],
322                     [AS_HELP_STRING([--with-gdl=@<:@yes/no@:>@], [Use libgdl for CE3100/CE4100 support])],
323                     [],
324                     [with_gdl=no])
325
326         AS_IF([test "x$with_tslib" = "xyes"],
327               [
328                 PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
329                 AS_IF([test "x$have_tslib" = "xyes"],
330                       [
331                         AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])
332                         SUPPORT_TSLIB=1
333                       ])
334               ],
335               [have_tslib=no])
336
337         AS_IF([test "x$with_evdev" = "xyes"],
338               [
339                 PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon], [have_evdev=yes], [have_evdev=no])
340                 AS_IF([test "x$have_evdev" = "xyes"],
341                       [
342                         AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
343                         SUPPORT_EVDEV=1
344                       ])
345               ],
346               [have_evdev=no])
347
348         AS_IF([test "x$with_gdl" = "xyes"],
349               [
350                 have_gdl=no
351
352                 AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
353
354                 AS_IF([test "x$have_gdl" = "xno"],
355                       [
356                         AC_CHECK_HEADERS([CE4100/libgdl.h],
357                                          [
358                                            FLAVOUR_CFLAGS="-I/usr/include/CE4100"
359                                            have_gdl=yes
360                                            CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
361                                          ])
362                       ])
363
364                 AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
365
366                 AS_IF([test "x$have_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
367
368                 FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl"
369
370                 SUPPORT_EGL_PLATFORM_GDL=1
371
372                 AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])
373               ],
374               [have_gdl=no])
375
376         FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
377         FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
378
379         AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
380
381         AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
382       ])
383
384 AS_IF([test "x$enable_osx" = "xyes"],
385       [
386         CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx"
387
388         AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
389
390         FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
391
392         SUPPORT_OSX=1
393       ])
394
395 AS_IF([test "x$enable_win32" = "xyes"],
396       [
397         CLUTTER_BACKENDS="$CLUTTER_BACKENDS win32"
398
399         AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
400
401         FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
402         FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
403
404         AC_CHECK_TOOL(WINDRES, [windres], [AC_MSG_ERROR([*** windres is required])])
405
406         SUPPORT_WIN32=1
407       ])
408
409 AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
410       [
411         AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
412       ])
413
414 # conditionals for use in automake files...
415 AM_CONDITIONAL(SUPPORT_GLX,     [test "x$SUPPORT_GLX" = "x1"])
416 AM_CONDITIONAL(SUPPORT_X11,     [test "x$SUPPORT_X11" = "x1"])
417 AM_CONDITIONAL(SUPPORT_GDK,     [test "x$SUPPORT_GDK" = "x1"])
418 AM_CONDITIONAL(SUPPORT_EGL,     [test "x$SUPPORT_EGL" = "x1"])
419 AM_CONDITIONAL(SUPPORT_OSX,     [test "x$SUPPORT_OSX" = "x1"])
420 AM_CONDITIONAL(SUPPORT_WIN32,   [test "x$SUPPORT_WIN32" = "x1"])
421 AM_CONDITIONAL(SUPPORT_CEX100,  [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
422 AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])
423 AM_CONDITIONAL(SUPPORT_STUB,    [test "x$SUPPORT_WIN32" = "x1" -o \
424                                       "x$SUPPORT_OSX" = "x1" -o \
425                                       "x$SUPPORT_WAYLAND" = "x1"])
426
427 AM_CONDITIONAL(USE_COGL,  [test "x$SUPPORT_COGL" = "x1"])
428 AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
429 AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
430 AM_CONDITIONAL(USE_GLD,   [test "x$have_gdl" = "xyes"])
431
432 dnl Instead of using AM_CFLAGS to ensure
433 dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
434 dnl and cogl code we use a define in config.h instead. This helps ensure
435 dnl other tools such as glib-mkenums and gir-scanner don't end up
436 dnl using the define also.
437 AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
438
439 dnl strip leading spaces
440 CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
441 AC_SUBST(CLUTTER_BACKENDS)
442
443 dnl === Clutter configuration =================================================
444
445 CLUTTER_CONFIG_DEFINES=
446
447 # windowing systems
448 AS_IF([test "x$SUPPORT_X11" = "x1"],
449       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
450 #define CLUTTER_WINDOWING_X11 1"])
451 AS_IF([test "x$SUPPORT_GDK" = "x1"],
452       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
453 #define CLUTTER_WINDOWING_GDK 1"])
454 AS_IF([test "x$SUPPORT_GLX" = "x1"],
455       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
456 #define CLUTTER_WINDOWING_GLX 1"])
457 AS_IF([test "x$SUPPORT_EGL" = "x1"],
458       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
459 #define CLUTTER_WINDOWING_EGL 1"])
460 AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
461       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
462 #define CLUTTER_WINDOWING_WAYLAND 1"])
463 AS_IF([test "x$SUPPORT_OSX" = "x1"],
464       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
465 #define CLUTTER_WINDOWING_OSX 1"])
466 AS_IF([test "x$SUPPORT_WIN32" = "x1"],
467       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
468 #define CLUTTER_WINDOWING_WIN32 1"])
469 AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
470       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
471 #define CLUTTER_WINDOWING_CEX100 1"])
472 AS_IF([test "x$SUPPORT_EVDEV" = "x1"],
473       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
474 #define CLUTTER_WINDOWING_EVDEV 1"])
475 AS_IF([test "x$SUPPORT_TSLIB" = "x1"],
476       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
477 #define CLUTTER_WINDOWING_TSLIB 1"])
478
479 AC_SUBST([CLUTTER_CONFIG_DEFINES])
480
481 dnl === Clutter substitutions kept for backwards compatibility ================
482 AC_SUBST([CLUTTER_WINSYS],       [deprecated])
483 AC_SUBST([CLUTTER_WINSYS_BASE],  [deprecated])
484 AC_SUBST([CLUTTER_STAGE_TYPE],   [deprecated])
485 AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
486 AC_SUBST([CLUTTER_FLAVOUR],      [deprecated])
487 AC_SUBST([CLUTTER_COGL],         [deprecated])
488 AC_SUBST([COGL_DRIVER],          [deprecated])
489
490 dnl === Image loading backend =================================================
491 IMAGE_PC_FILES=""
492
493 dnl === X11 checks, only for X11-based backends ===============================
494 X11_PC_FILES=""
495 x11_tests=no
496
497 AS_IF([test "x$SUPPORT_X11" = "x1"],
498       [
499         # base X11 includes and libraries
500         AC_MSG_CHECKING([for X11])
501
502         # start with pkg-config
503         PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
504         AS_IF([test "x$have_x11" = "xyes"],
505               [
506                 X11_PC_FILES="x11"
507
508                 # we actually need to ask for CFLAGS and LIBS
509                 X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
510                 X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
511
512                 AC_MSG_RESULT([found])
513               ],
514               [
515                 # no pkg-config, let's go old school
516                 AC_PATH_X
517
518                 AS_IF([test "x$no_x" = "xyes"],
519                       [AC_MSG_ERROR([No X11 Libraries found])],
520                       [
521                         AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
522                               [X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])
523
524                         AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
525                               [X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])
526
527                         AC_MSG_RESULT([found])
528                       ]
529                 )
530               ]
531         )
532
533         # XEXT (required)
534         AC_MSG_CHECKING([for XEXT extension])
535         PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
536         AS_IF([test "x$have_xext" = "xyes"],
537               [
538                 AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])
539
540                 X11_LIBS="$X11_LIBS -lXext"
541                 X11_PC_FILES="$X11_PC_FILES xext"
542
543                 AC_MSG_RESULT([found])
544               ],
545               [AC_MSG_ERROR([Not found])]
546         )
547
548         # XFIXES (required)
549         AC_MSG_CHECKING([for XFIXES extension >= $XFIXES_REQ_VERSION])
550         PKG_CHECK_EXISTS([xfixes >= $XFIXES_REQ_VERSION], [have_xfixes=yes], [have_xfixes=no])
551         AS_IF([test "x$have_xfixes" = "xyes"],
552               [
553                 AC_DEFINE(HAVE_XFIXES, [1], [Define to 1 if we have the XFIXES X extension])
554
555                 X11_LIBS="$X11_LIBS -lXfixes"
556                 X11_PC_FILES="$X11_PC_FILES xfixes >= $XFIXES_REQ_VERSION"
557
558                 AC_MSG_RESULT([found])
559               ],
560               [AC_MSG_ERROR([Not found])]
561         )
562
563         # XDAMAGE (required)
564         AC_MSG_CHECKING([for XDAMAGE extension])
565         PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
566         AS_IF([test "x$have_xdamage" = "xyes"],
567               [
568                 AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
569
570                 X11_LIBS="$X11_LIBS -lXdamage"
571                 X11_PC_FILES="$X11_PC_FILES xdamage"
572
573                 AC_MSG_RESULT([found])
574               ],
575               [AC_MSG_ERROR([not found])]
576         )
577
578         # XCOMPOSITE (optional)
579         AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
580         PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
581         AS_IF([test "x$have_xcomposite" = "xyes"],
582               [
583                 AC_DEFINE(HAVE_XCOMPOSITE, [1], [Define to 1 if we have the XCOMPOSITE X extension])
584
585                 X11_LIBS="$X11_LIBS -lXcomposite"
586                 X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
587
588                 AC_MSG_RESULT([found])
589               ],
590               [AC_MSG_ERROR([not found])]
591         )
592
593         # X Generic Extensions (optional)
594         clutter_save_CPPFLAGS="$CPPFLAGS"
595         CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
596
597         clutter_save_LIBS="$LIBS"
598         LIBS="$LIBS $X11_LIBS"
599
600         have_xge=no
601         AC_CHECK_FUNC([XGetEventData],
602                       [
603                         AC_DEFINE([HAVE_XGE], [1], [Define to 1 if X Generic Extensions is available])
604                         have_xge=yes
605                       ])
606
607         CPPFLAGS="$clutter_save_CPPFLAGS"
608         LIBS="$clutter_save_LIBS"
609
610         # XI (optional)
611         AC_ARG_ENABLE([xinput],
612                       [AS_HELP_STRING([--enable-xinput], [Use the XI X extension])],
613                       [],
614                       [enable_xinput=yes])
615
616         AS_IF([test "x$enable_xinput" = "xyes"],
617               [
618                 PKG_CHECK_EXISTS([xi], [have_xinput=yes], [have_xinput=no])
619               ],
620               [
621                 have_xinput=no
622               ])
623
624         AS_CASE([$have_xinput],
625
626                 [yes],
627                 [
628                   AC_CHECK_HEADERS([X11/extensions/XInput2.h],
629                                    [
630                                      have_xinput2=yes
631                                      AC_DEFINE([HAVE_XINPUT_2],
632                                                [1],
633                                                [Define to 1 if XI2 is available])
634                                    ],
635                                    [
636                                      have_xinput2=no
637                                      AC_DEFINE([HAVE_XINPUT],
638                                                [1],
639                                                [Define to 1 if XInput is available])
640                                    ])
641
642                   X11_LIBS="$X11_LIBS $XINPUT_LIBS"
643                   X11_PC_FILES="$X11_PC_FILES xi"
644                 ],
645
646                 [no],
647                 [have_xinput2=no],
648
649                 [*],
650                 [AC_MSG_ERROR([Invalid argument for --enable-xinput])]
651         )
652
653         # XKB
654         clutter_save_CPPFLAGS="$CPPFLAGS"
655         CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
656
657         clutter_save_LIBS="$LIBS"
658         LIBS="$LIBS $X11_LIBS"
659
660         have_xkb=no
661         AC_CHECK_FUNC([XkbQueryExtension],
662                       [
663                         AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
664                         have_xkb=yes
665                       ])
666
667         CPPFLAGS="$clutter_save_CPPFLAGS"
668         LIBS="$clutter_save_LIBS"
669
670         x11_tests=yes
671         BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
672         FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
673         FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
674       ]
675 )
676
677 AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
678 AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
679
680 dnl === Enable debug level ====================================================
681
682 m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
683 AC_ARG_ENABLE([debug],
684               [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
685                               [Control Clutter debugging level @<:@default=]debug_default[@:>@])],
686               [],
687               [enable_debug=debug_default])
688
689 AS_CASE([$enable_debug],
690
691         [yes],
692         [
693           test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
694           CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
695         ],
696
697         [minimum],
698         [CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"],
699
700         [no],
701         [CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
702
703         [AC_MSG_ERROR([Unknown argument for --enable-debug])]
704 )
705
706 AC_SUBST(CLUTTER_DEBUG_CFLAGS)
707
708 dnl === Enable deprecation guards ==================================================
709
710 m4_define([deprecated_default],
711           [m4_if(m4_eval(clutter_minor_version % 2),
712                  [1],
713                  [no],
714                  [yes])])
715
716 AC_ARG_ENABLE([deprecated],
717               [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
718                               [Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
719               [],
720               [enable_deprecated=deprecated_default])
721
722 AS_CASE([$enable_deprecated],
723
724         [no],
725         [
726           CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED -DCLUTTER_DISABLE_DEPRECATED"
727         ],
728
729         [yes],
730         [
731           CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS -DCLUTTER_DISABLE_DEPRECATION_WARNINGS"
732         ],
733
734         [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
735 )
736
737 AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
738
739
740 dnl === Conformance test suite ================================================
741
742 AC_ARG_ENABLE([conformance],
743               [AS_HELP_STRING([--enable-conformance=@<:@no/yes@:>@],
744                               [Build conformance test suite @<:@default=yes@:>@])],
745               [],
746               [enable_conformance=yes])
747
748 AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"])
749
750 dnl === Profiling =============================================================
751
752 m4_define([profile_default], [no])
753 AC_ARG_ENABLE(profile,
754               AS_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
755                              [Turn on profiling support. yes; All profiling probe points are compiled in and may be runtime enabled. no; No profiling support will built into clutter.  @<:@default=no@:>@]),
756               [],
757               [enable_profile=profile_default])
758
759 AS_CASE([$enable_profile],
760
761         [yes],
762         [
763           AS_IF([test "x$GCC" = "xyes"],
764                 [
765                   PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.3])
766                   CLUTTER_PROFILE_CFLAGS="-DCLUTTER_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
767                   CLUTTER_PROFILE_LDFLAGS="$PROFILE_DEP_LIBS"
768
769                   AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
770                 ],
771                 [
772                   AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
773                 ])
774         ],
775
776         [no],
777         [
778           CLUTTER_PROFILE_CFLAGS=""
779           CLUTTER_PROFILE_LDFLAGS=""
780         ],
781
782         [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
783 )
784 AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
785 AC_SUBST(CLUTTER_PROFILE_CFLAGS)
786 AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
787
788 dnl === Coverage report =======================================================
789
790 AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])
791
792 AC_MSG_CHECKING([whether to build with gcov testing])
793
794 AC_ARG_ENABLE([gcov],
795               [AS_HELP_STRING([--enable-gcov],
796                               [Whether to enable coverage testing (requires gcc
797 and gcov)])],
798               [],
799               [enable_gcov=no])
800
801 AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
802       [
803         AS_IF([test "x$enable_conformance" = "xno"],
804               [AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
805               [AC_MSG_RESULT([yes])]
806         )
807
808         GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
809         GCOV_LDFLAGS="-lgcov"
810       ],
811       [AC_MSG_RESULT([no])]
812 )
813
814 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
815 AC_SUBST([GCOV_CFLAGS])
816 AC_SUBST([GCOV_LDFLAGS])
817
818 dnl === Enable strict compiler flags ==========================================
819
820 # use strict compiler flags only when building from git; the rules for
821 # distcheck will take care of turning this on when making a release
822 m4_define([maintainer_flags_default], [m4_if(m4_eval(clutter_micro_version % 2), [1], [yes], [no])])
823 AC_ARG_ENABLE([maintainer-flags],
824               [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
825                               [Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
826               [],
827               [enable_maintainer_flags=maintainer_flags_default])
828
829 MAINTAINER_COMPILER_FLAGS="-Wall -Wshadow -Wcast-align -Wuninitialized
830                            -Wno-strict-aliasing -Wempty-body -Wformat
831                            -Wformat-security -Winit-self
832                            -Wdeclaration-after-statement -Wvla
833                            -Wpointer-arith"
834
835 AS_CASE([$enable_maintainer_flags],
836         [yes],
837         [
838           AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
839         ],
840
841         [no],
842         [
843         ],
844
845         [error],
846         [
847           MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
848           AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
849         ],
850
851         [*],
852         [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
853 )
854
855 # strip leading spaces
856 MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#*  }
857 AC_SUBST(MAINTAINER_CFLAGS)
858
859 dnl === Dependencies, compiler flags and linker libraries =====================
860 # strip leading space
861 BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
862
863 CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $IMAGE_PC_FILES $BACKEND_PC_FILES"
864 PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
865 AC_SUBST(CLUTTER_REQUIRES)
866
867 CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
868 CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
869 AC_SUBST(CLUTTER_CFLAGS)
870 AC_SUBST(CLUTTER_LIBS)
871
872
873 dnl === GObject-Introspection check ===========================================
874
875 GOBJECT_INTROSPECTION_CHECK([gi_req_version])
876
877 dnl === GTK Doc check =========================================================
878
879 GTK_DOC_CHECK([gtk_doc_req_version], [--flavour no-tmpl])
880
881 # we don't want to build the documentation from a Git clone unless we
882 # explicitly tell configure to do so; this allows avoiding to recurse into
883 # the documentation directory when building Clutter inside Poky for a
884 # target device that doesn't have gtk-doc installed. for reference
885 # see: http://bugzilla.openedhand.com/show_bug.cgi?id=1047
886 #
887 # we use autogen.sh as it exists only inside the Git clones, and it
888 # is not packaged into tarballs.
889 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])
890
891 # prefixes for fixing gtk-doc references
892 CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
893 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
894 PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
895 COGL_PREFIX="`$PKG_CONFIG --variable=prefix cogl-1.0`"
896 ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
897 AC_SUBST(CAIRO_PREFIX)
898 AC_SUBST(GLIB_PREFIX)
899 AC_SUBST(PANGO_PREFIX)
900 AC_SUBST(COGL_PREFIX)
901 AC_SUBST(ATK_PREFIX)
902
903 dnl === Manual ================================================================
904
905 AC_ARG_ENABLE([docs],
906               [AS_HELP_STRING([--enable-docs=@<:@no/yes@:>@],
907                               [Build optional documentation; requires xsltproc and jw.])],
908               [enable_docs=$enableval],
909               [enable_docs=no])
910
911 enable_pdfs=no
912 AS_IF([test "x$enable_docs" = "xyes"],
913       [
914         AC_PATH_PROG(JW, [jw], [no])
915         AS_IF([test "x$JW" = "xno"],
916               [
917                 AC_MSG_WARN([jw not found; pdf generation has been disabled])
918               ],
919               [enable_pdfs=yes])
920
921         AC_PATH_PROG(XSLTPROC, [xsltproc], [no])
922         AS_IF([test "x$XSLTPROC" = "xno"],
923               [
924                 AC_MSG_ERROR([xsltproc not found])
925               ])
926       ]
927 )
928
929 AM_CONDITIONAL(ENABLE_DOCS, [test "x$enable_docs" = "xyes"])
930 AM_CONDITIONAL(ENABLE_PDFS, [test "x$enable_pdfs" = "xyes"])
931
932 dnl === I18N ==================================================================
933
934 AM_GNU_GETTEXT_VERSION([0.17])
935 AM_GNU_GETTEXT([external])
936
937 GETTEXT_PACKAGE="clutter-1.0"
938 AC_SUBST(GETTEXT_PACKAGE)
939 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
940                    ["$GETTEXT_PACKAGE"],
941                    [The prefix for our gettext translation domains.])
942 AS_ALL_LINGUAS
943
944 dnl ===========================================================================
945
946 AC_CONFIG_FILES([
947         Makefile
948
949         README
950
951         build/Makefile
952         build/autotools/Makefile
953         build/mingw/Makefile
954
955         clutter/Makefile
956         clutter/clutter-config.h
957         clutter/clutter-version.h
958         clutter/clutter-$CLUTTER_API_VERSION.pc:clutter/clutter.pc.in
959
960         clutter/cally/cally-$CLUTTER_API_VERSION.pc:clutter/cally/cally.pc.in
961
962         clutter/egl/clutter-cex100.h
963
964         tests/Makefile
965         tests/accessibility/Makefile
966         tests/conform/Makefile
967         tests/conform/test-launcher.sh
968         tests/data/Makefile
969         tests/interactive/Makefile
970         tests/interactive/wrapper.sh
971         tests/micro-bench/Makefile
972         tests/performance/Makefile
973
974         doc/Makefile
975         doc/reference/Makefile
976         doc/reference/clutter/Makefile
977         doc/reference/clutter/clutter-docs.xml
978         doc/reference/cally/Makefile
979         doc/reference/cally/cally-docs.xml
980         doc/common/Makefile
981         doc/cookbook/Makefile
982         doc/cookbook/clutter-cookbook.xml
983         doc/cookbook/examples/Makefile
984
985         po/Makefile.in
986 ])
987
988 AC_OUTPUT
989
990 dnl === Summary ===============================================================
991
992 echo ""
993 echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
994
995 # Global flags
996 echo ""
997 echo " • Global:"
998 echo "        Prefix: ${prefix}"
999 echo "        Libdir: ${libdir}"
1000 echo "        Sysconfdir: ${sysconfdir}"
1001
1002 # Compiler/Debug related flags
1003 echo ""
1004 echo " • Compiler options:"
1005 echo "        Clutter debug level: ${enable_debug}"
1006 echo "        Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
1007 echo "        Profiling enabled: ${enable_profile}"
1008 echo "        Enable coverage tests: ${enable_gcov}"
1009 echo "        Enable deprecated symbols: ${enable_deprecated}"
1010
1011 # Documentation
1012 echo ""
1013 echo " • Documentation:"
1014 echo "        Build API Reference: ${enable_gtk_doc}"
1015 echo "        Build Additional Documentation: ${enable_docs} (Generate PDF: ${enable_pdfs})"
1016
1017 # Miscellaneous
1018 echo ""
1019 echo " • Extra:"
1020 echo "        Build introspection data: ${enable_introspection}"
1021 echo "        Build conformance test suite: ${enable_conformance}"
1022 echo "        Build X11-specific tests: ${x11_tests}"
1023
1024 # Clutter backend related flags
1025 echo ""
1026 echo " • Clutter Backends:"
1027
1028 if test "x$experimental_backend" = "xno"; then
1029 echo "        Windowing systems: ${CLUTTER_BACKENDS}"
1030 else
1031 echo "        Windowing systems: ${CLUTTER_BACKENDS} (WARNING: Experimental backends enabled)"
1032 fi
1033
1034 if test "x$SUPPORT_X11" = "x1"; then
1035 echo ""
1036 echo "        Enable XComposite: ${have_xcomposite}"
1037 echo "        Enable XInput: ${have_xinput}"
1038 echo "        Enable Xge: ${have_xge}"
1039 echo "        Enable XI2: ${have_xinput2}"
1040 echo "        Enable XKB: ${have_xkb}"
1041 fi
1042
1043 if test "x$SUPPORT_EGL" = "x1"; then
1044 echo ""
1045 echo "        Enable TSLib: ${have_tslib}"
1046 echo "        Enable evdev: ${have_evdev}"
1047 echo "        Enable GDL: ${have_gdl}"
1048 fi
1049
1050 echo ""
1051
1052 # General warning about experimental features
1053 if test "x$experimental_backend" = "xyes"; then
1054 echo ""
1055 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1056 echo " *WARNING*"
1057 echo ""
1058 echo "  The stability of your build might be affected by one or more"
1059 echo "  experimental backends or experimental and unsupported features"
1060 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1061 echo ""
1062 fi