wmaker: rewrote the update of _NET_WORKAREA property
[wmaker-crm.git] / configure.ac
blobad4bef6121e6c12990bd13be801747d69e0b39a4
1 dnl
2 dnl Window Maker autoconf input.
3 dnl
4 dnl Process with:
5 dnl               aclocal
6 dnl               autoheader
7 dnl               autoconf
8 dnl               libtoolize --force --automake
9 dnl               automake -a --gnu --include-deps
10 dnl
13 dnl Due to a bug in Autoconf 2.68 (apparently a regression), we need at least
14 dnl version 2.68b which includes this patch:
15 dnl   http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=2b0d95faef68d7ed7c08b0edb9ff1c38728376fa
16 dnl
17 dnl Because the 2.69 was released only a few month later, let's just ask for it
18 AC_PREREQ([2.69])
21 AC_INIT(WindowMaker, 0.95.6, , WindowMaker, http://www.windowmaker.org/)
22 AC_CONFIG_SRCDIR(src/WindowMaker.h)
23 AC_CONFIG_MACRO_DIR([m4])
24 AC_CONFIG_HEADERS(config.h)
25 AM_INIT_AUTOMAKE([1.11 silent-rules])
27 AH_BOTTOM([#include "config-paths.h"])
29 dnl libtool library versioning
30 dnl =======================
31 dnl
32 dnl current
33 dnl revision
34 dnl age
35 dnl
36 dnl 1. Start with version information of ‘0:0:0’ for each libtool library.
37 dnl 2. Update the version information only immediately before a public
38 dnl release of your software. More frequent updates are unnecessary, and
39 dnl only guarantee that the current interface number gets larger faster.
40 dnl 3. If the library source code has changed at all since the last
41 dnl update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
42 dnl 4. If any interfaces have been added, removed, or changed since the
43 dnl last update, increment current, and set revision to 0.
44 dnl 5. If any interfaces have been added since the last public release,
45 dnl then increment age.
46 dnl 6. If any interfaces have been removed or changed since the last
47 dnl public release, then set age to 0.
48 dnl
49 dnl libwraster
50 WRASTER_CURRENT=5
51 WRASTER_REVISION=0
52 WRASTER_AGE=0
53 WRASTER_VERSION=$WRASTER_CURRENT:$WRASTER_REVISION:$WRASTER_AGE
54 AC_SUBST(WRASTER_VERSION)
55 dnl
56 dnl libWINGs
57 WINGS_CURRENT=4
58 WINGS_REVISION=0
59 WINGS_AGE=1
60 WINGS_VERSION=$WINGS_CURRENT:$WINGS_REVISION:$WINGS_AGE
61 AC_SUBST(WINGS_VERSION)
62 dnl
63 dnl libWUtil
64 WUTIL_CURRENT=5
65 WUTIL_REVISION=0
66 WUTIL_AGE=0
67 WUTIL_VERSION=$WUTIL_CURRENT:$WUTIL_REVISION:$WUTIL_AGE
68 AC_SUBST(WUTIL_VERSION)
71 dnl Checks for host/os name
72 dnl =======================
73 dnl AC_CANONICAL_HOST -- already done by AC_PROG_LIBTOOL
75 dnl Checks for programs.
76 dnl ===================
77 AC_PROG_CC
78 WM_PROG_CC_C11
79 AC_PROG_LN_S
80 AC_PROG_GCC_TRADITIONAL
81 AC_PROG_LIBTOOL
84 dnl Debugging Options
85 dnl =================
86 AC_ARG_ENABLE(debug,
87     [AS_HELP_STRING([--enable-debug], [enable debugging options, @<:@default=no@:>@])],
88     [AS_CASE(["$enableval"],
89         [yes], [debug=yes],
90         [no],  [debug=no],
91         [AC_MSG_ERROR([bad value $enableval for --enable-debug])] )],
92     [debug=no])
93 AS_IF([test "x$debug" = "xyes"],
94     [dnl This flag should have already been detected and added, but if user
95      dnl provided an explicit CFLAGS it may not be the case
96      AS_IF([echo " $CFLAGS " | grep " -g " 2>&1 > /dev/null],
97            [@%:@ Debug symbol already activated],
98            [AX_CFLAGS_GCC_OPTION([-g])])
99      dnl
100      dnl This flag generally makes debugging nightmarish, remove it if present
101      CFLAGS="`echo "$CFLAGS" | sed -e 's/-fomit-frame-pointer *//' `"
102      dnl
103      dnl Enable internal debug code
104      CPPFLAGS="$CPPFLAGS -DDEBUG"
105 ],  [dnl
106      dnl When debug is not enabled, the user probably does not wants to keep
107      dnl assertions in the final program
108      CPPFLAGS="$CPPFLAGS -DNDEBUG"
112 AX_CFLAGS_GCC_OPTION(-Wall)
113 AX_CFLAGS_GCC_OPTION(-Wextra -Wno-sign-compare)
115 dnl The use of trampolines cause code that can crash on some secured OS, it is
116 dnl also known to be a source of crash if not used properly, in a more general
117 dnl way it tends to generate binary code that may not be optimal, and it is
118 dnl not compatible with the 'nested-func-to-macro' workaround
119 WM_CFLAGS_CHECK_FIRST([-Wtrampolines],
120          [-Werror=trampolines  dnl try to generate an error if possible
121           -Wtrampolines        dnl if not, try to fall back to a simple warning
122          ])
124 AS_IF([test "x$debug" = "xyes"],
125     [dnl When debug is enabled, we try to activate more checks from
126      dnl the compiler. They are on independant check because the
127      dnl macro checks all the options at once, but we may have cases
128      dnl where some options are not supported and we don't want to
129      dnl loose all of them.
130      dnl
131      dnl clang, suggest parenthesis on bit operations that could be
132      dnl misunderstood due to C operator precedence
133      AX_CFLAGS_GCC_OPTION([-Wbitwise-op-parentheses])
134      dnl
135      dnl Points at code that gcc thinks is so complicated that gcc
136      dnl gives up trying to optimize, which probably also means it is
137      dnl too complicated to maintain
138      AX_CFLAGS_GCC_OPTION([-Wdisabled-optimization])
139      dnl
140      dnl Floating-point comparison is not a good idea
141      AX_CFLAGS_GCC_OPTION([-Wfloat-equal])
142      dnl
143      dnl clang warns about constants that may have portability issues due
144      dnl to the endianness of the host
145      AX_CFLAGS_GCC_OPTION([-Wfour-char-constants])
146      dnl
147      dnl clang warns about constant that may be too big to be portable
148      AX_CFLAGS_GCC_OPTION([-Wliteral-range])
149      dnl
150      dnl Try to report misuses of '&' versus '&&' and similar
151      AX_CFLAGS_GCC_OPTION([-Wlogical-op])
152      dnl
153      dnl clang, reports cases where the code assumes everyone is an
154      dnl expert in C operator precedence... which is unlikely!
155      AX_CFLAGS_GCC_OPTION([-Wlogical-op-parentheses])
156      dnl
157      dnl Reports declaration of global things that are done inside
158      dnl a local environment, instead of using the appropriate
159      dnl header
160      AX_CFLAGS_GCC_OPTION([-Wnested-externs])
161      dnl
162      dnl Warn about constant strings that could pose portability issues
163      AX_CFLAGS_GCC_OPTION([-Woverlength-strings])
164      dnl
165      dnl Use of 'sizeof()' on inappropriate pointer types
166      AX_CFLAGS_GCC_OPTION([-Wpointer-arith])
167      dnl
168      dnl Having more than 1 prototype for a function makes code updates
169      dnl more difficult, so try to avoid it
170      AX_CFLAGS_GCC_OPTION([-Wredundant-decls])
171      dnl
172      dnl clang, detect some misuses of sizeof. We also count in our code
173      dnl on the use of the macro 'wlength' which contains a check if the
174      dnl compiler support C11's static_assert
175      AX_CFLAGS_GCC_OPTION([-Wsizeof-array-argument])
176      dnl
177      dnl Prototype of function must be explicit, no deprecated K&R syntax
178      dnl and no empty argument list which prevents compiler from doing
179      dnl type checking when using the function
180      WM_CFLAGS_GCC_OPTION_STRICTPROTO
181      dnl
182      dnl Proper attributes helps the compiler to produce better code
183      WM_CFLAGS_CHECK_FIRST([format attribute suggest],
184          [-Wsuggest-attribute=format  dnl new gcc syntax
185           -Wmissing-format-attribute  dnl old gcc syntax, clang
186          ])
187      WM_CFLAGS_CHECK_FIRST([no-return attribute suggest],
188          [-Wsuggest-attribute=noreturn  dnl gcc syntax
189           -Wmissing-noreturn            dnl clang syntax
190          ])
191      dnl
192      dnl GCC provides a couple of checks to detect incorrect macro uses
193      AX_CFLAGS_GCC_OPTION([-Wundef])
194      WM_CFLAGS_GCC_OPTION_UNUSEDMACROS
195      dnl
196      dnl clang reports stuff marked unused but which is actually used
197      AX_CFLAGS_GCC_OPTION([-Wused-but-marked-unused])
198 ], [dnl
199      dnl When debug not enabled, we try to avoid some non-necessary
200      dnl messages from the compiler
201      dnl
202      dnl To support legacy X servers, we have sometime to use
203      dnl functions marked as deprecated. We do not wish our users
204      dnl to be worried about it
205      AX_CFLAGS_GCC_OPTION([-Wno-deprecated])
206      AX_CFLAGS_GCC_OPTION([-Wno-deprecated-declarations])
210 dnl Support for Nested Functions by the compiler
211 dnl ============================================
212 WM_PROG_CC_NESTEDFUNC
215 dnl Posix thread
216 dnl =================
217 AX_PTHREAD
220 dnl Tracking on what is detected for final status
221 dnl =============================================
222 unsupported=""
223 supported_xext=""
224 supported_gfx=""
227 dnl Platform-specific Makefile setup
228 dnl ================================
229 AS_CASE(["$host"],
230     [*-*-linux*|*-*-cygwin*|*-gnu*], [WM_OSDEP="linux" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"],
231     [*-*-freebsd*|*-k*bsd-gnu*],     [WM_OSDEP="bsd"   ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -DFREEBSD"],
232     [*-*-netbsd*],                   [WM_OSDEP="bsd"   ; CPPFLAGS="$CPPFLAGS -DNETBSD"],
233     [*-*-openbsd*],                  [WM_OSDEP="bsd"   ; CPPFLAGS="$CPPFLAGS -DOPENBSD"],
234     [*-*-dragonfly*],                [WM_OSDEP="bsd"   ; CPPFLAGS="$CPPFLAGS -DDRAGONFLYBSD"],
235     [*-apple-darwin*],               [WM_OSDEP="darwin"],
236     [*-*-solaris*],                  [WM_OSDEP="stub"],  dnl  solaris.c when done
237     [WM_OSDEP="stub"])
238 AM_CONDITIONAL([WM_OSDEP_LINUX],   [test "x$WM_OSDEP" = "xlinux"])
239 AM_CONDITIONAL([WM_OSDEP_BSD],     [test "x$WM_OSDEP" = "xbsd"])
240 AM_CONDITIONAL([WM_OSDEP_DARWIN],  [test "x$WM_OSDEP" = "xdarwin"])
241 AM_CONDITIONAL([WM_OSDEP_GENERIC], [test "x$WM_OSDEP" = "xstub"])
244 dnl the prefix
245 dnl ==========
247 dnl move this earlier in the script... anyone know why this is handled
248 dnl in such a bizarre way?
250 test "x$prefix" = xNONE && prefix=$ac_default_prefix
251 dnl Let make expand exec_prefix.
252 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
255 _bindir=`eval echo $bindir`
256 _bindir=`eval echo $_bindir`
258 lib_search_path='-L${libdir}'
260 inc_search_path='-I${includedir}'
262 dnl ===============================================
263 dnl Specify paths to look for libraries and headers
264 dnl ===============================================
265 AC_ARG_WITH(libs-from, AS_HELP_STRING([--with-libs-from], [pass compiler flags to look for libraries]),
266         [lib_search_path="$withval $lib_search_path"])
268 AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags to look for header files]),
269         [inc_search_path="$withval $inc_search_path"])
272 dnl Boehm GC
273 dnl ========
274 AC_ARG_ENABLE([boehm-gc],
275     [AS_HELP_STRING([--enable-boehm-gc], [use Boehm GC instead of the default libc malloc() [default=no]])],
276     [AS_CASE(["$enableval"],
277         [yes], [with_boehm_gc=yes],
278         [no],  [with_boehm_gc=no],
279         [AC_MSG_ERROR([bad value $enableval for --enable-boehm-gc])] )],
280     [with_boehm_gc=no])
281 AS_IF([test "x$with_boehm_gc" = "xyes"],
282     AC_SEARCH_LIBS([GC_malloc], [gc],
283         [AC_DEFINE(USE_BOEHM_GC, 1, [Define if Boehm GC is to be used])],
284         [AC_MSG_FAILURE([--enable-boehm-gc specified but test for libgc failed])]))
287 dnl LCOV
288 dnl ====
289 AC_ARG_ENABLE([lcov],
290     [AS_HELP_STRING([--enable-lcov[=output-directory]], [enable coverage data generation using LCOV (GCC only) [default=no]])],
291     [],
292     [enable_lcov=no])
294 AS_IF([test "x$enable_lcov" != "xno"],
295     [AX_CFLAGS_GCC_OPTION(-fprofile-arcs -ftest-coverage)
296     AS_IF([test "x$enable_lcov" = "xyes"],
297         [lcov_output_directory="coverage-report"],
298         [lcov_output_directory="${enable_lcov}/coverage-report"])
299     AC_SUBST(lcov_output_directory)])
301 AM_CONDITIONAL([USE_LCOV], [test "x$enable_lcov" != "xno"])
304 dnl ============================
305 dnl Checks for library functions
306 dnl ============================
307 dnl not used anywhere
308 AC_FUNC_MEMCMP
309 AC_FUNC_VPRINTF
310 WM_FUNC_SECURE_GETENV
311 AC_CHECK_FUNCS(gethostname select poll strcasecmp strncasecmp \
312                setsid mallinfo mkstemp sysconf)
313 AC_SEARCH_LIBS([strerror], [cposix])
315 dnl nanosleep is generally available in standard libc, although not always the
316 dnl case. One known example is Solaris which needs -lrt
317 AC_SEARCH_LIBS([nanosleep], [rt], [],
318     [AC_MSG_ERROR([function 'nanosleep' not found, please report to wmaker-dev@lists.windowmaker.org])])
321 dnl Check for strlcat/strlcpy
322 dnl =========================
323 AC_ARG_WITH([libbsd],
324   [AS_HELP_STRING([--without-libbsd], [do not use libbsd for strlcat and strlcpy [default=check]])],
325   [AS_IF([test "x$with_libbsd" != "xno"],
326     [with_libbsd=bsd]
327     [with_libbsd=]
328   )],
329   [with_libbsd=bsd])
331 tmp_libs=$LIBS
332 AC_SEARCH_LIBS([strlcat],[$with_libbsd],
333   [AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcat is available])],
334   [],
335   []
337 AC_SEARCH_LIBS([strlcpy],[$with_libbsd],
338   [AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcpy is available])],
339   [],
340   []
342 LIBS=$tmp_libs
344 LIBBSD=
345 AS_IF([test "x$ac_cv_search_strlcat" = "x-lbsd" -o "x$ac_cv_search_strlcpy" = "x-lbsd"],
346   [LIBBSD=-lbsd
347    AC_CHECK_HEADERS([bsd/string.h])]
349 AC_SUBST(LIBBSD)
351 dnl Check for OpenBSD kernel memory interface - kvm(3)
352 dnl ==================================================
353 AS_IF([test "x$WM_OSDEP" = "xbsd"],
354   AC_SEARCH_LIBS([kvm_openfiles], [kvm]) )
356 dnl Check for inotify
357 dnl =================
358 AC_CHECK_HEADERS(sys/inotify.h, AC_DEFINE(HAVE_INOTIFY, 1, Check for inotify))
361 dnl Check for syslog 
362 dnl =================
363 AC_CHECK_HEADERS([syslog.h], [AC_DEFINE([HAVE_SYSLOG], [1], [Check for syslog])])
366 dnl Checks for header files.
367 dnl =======================
368 AC_HEADER_SYS_WAIT
369 AC_HEADER_TIME
370 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h libintl.h poll.h malloc.h ctype.h \
371                  string.h strings.h)
374 dnl Checks for typedefs, structures, and compiler characteristics.
375 dnl ==============================================================
376 AC_DECL_SYS_SIGLIST
377 AC_C_CONST
378 AC_C_INLINE
379 WM_C_NORETURN
380 AC_TYPE_SIZE_T
381 AC_TYPE_PID_T
382 AC_TYPE_SIGNAL
385 dnl pkg-config
386 dnl ==========
387 dnl AC_ARG_VAR(PKGCONFIG, [pkg-config command])
388 AC_CHECK_PROG(PKGCONFIG, pkg-config, pkg-config) 
390 dnl gettext
391 dnl =======
393 dnl AM_GNU_GETTEXT
395 INTLIBS=""
397 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"], 
398         AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
399                          INTLIBS="" ))
401 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
403 if test "$XGETTEXT" != ""; then 
404     if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
405         echo "xgettext isn't GNU version"
406         XGETTEXT=""
407     fi
410 if test "$LINGUAS" != ""; then
411     if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
412         AC_DEFINE(I18N, 1, [Internationalization (I18N) support (set by configure)])
413         PO=""
414         echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
415     else
416         LINGUAS=""
417         PO=""
418         echo "xgettext and libintl.a don't both exist; will not build i18n support"
419     fi
420 else
421         INTLIBS=""
422         MOFILES=""
423         WPMOFILES=""
424         UTILMOFILES=""
425         PO=""
429 dnl The Tower of Babel
430 dnl ==================
432 dnl List of supported locales
433 dnl =========================
434 supported_locales="be bg bs ca cs da de el es et fi fr gl hr hu hy it ja ko ms nl no pl pt ro ru sk sv tr zh_CN zh_TW"
435 supported_wprefs_locales="bg ca cs de es et fi fr hr hu it ja ko nl pt ru sk zh_CN zh_TW"
436 supported_wings_locales="bg ca cs de fr hu nl sk"
437 supported_util_locales="de es fr nl pt"
439 for lang in $LINGUAS; do
440         ok=0
441         for l in $supported_locales; do
442                 if test "$l" = "$lang"; then
443                         ok=1
444                         break
445                 fi
446         done
447         if test "$ok" = 1; then
448                 MOFILES="$MOFILES $lang.mo"
449         else
450                 echo "Locale $lang is not supported."
451         fi
452         ok=0
453         for l in $supported_wprefs_locales; do
454                 if test "$l" = "$lang"; then
455                         ok=1
456                         break
457                 fi
458         done
459         if test "$ok" = 1; then
460                 WPMOFILES="$WPMOFILES $lang.mo"
461         fi
462         ok=0
463         for l in $supported_util_locales; do
464                 if test "$l" = "$lang"; then
465                         ok=1
466                         break
467                 fi
468         done
469         if test "$ok" = 1; then
470                 UTILMOFILES="$UTILMOFILES $lang.mo"
471         fi
472         ok=0
473         for l in $supported_wings_locales; do
474                 if test "$l" = "$lang"; then
475                         ok=1
476                         break
477                 fi
478         done
479         if test "$ok" = 1; then
480                 WINGSMOFILES="$WINGSMOFILES $lang.mo"
481         fi
482 done
485 dnl Added by Oliver - Support for NLSDIR option
486 dnl ===========================================
487 AC_ARG_WITH(nlsdir, AS_HELP_STRING([--with-nlsdir=PATH], [specify where the locale stuff should go]))
489 if test "x$NLSDIR" = "x"; then
490         if test "x$with_nlsdir" != "x"; then
491                 NLSDIR=$with_nlsdir
492         else
493                 NLSDIR='$(prefix)/lib/locale'
494         fi
497 menutextdomain=
498 AC_ARG_WITH(menu-textdomain, AS_HELP_STRING([--with-menu-textdomain=DOMAIN], [specify gettext domain used for menu translations]),
499         [if test "x$withval" != "xno"; then
500          menutextdomain=$withval
501          fi])
502 AC_SUBST(menutextdomain)
504 AC_SUBST(INTLIBS)
505 AC_SUBST(NLSDIR)
506 AC_SUBST(MOFILES)
507 AC_SUBST(WPMOFILES)
508 AC_SUBST(UTILMOFILES)
509 AC_SUBST(WINGSMOFILES)
510 AC_SUBST(supported_locales)
512 dnl ===========================================
513 dnl             Stuff that uses X
514 dnl ===========================================
516 AC_PATH_XTRA
518 if test $no_x; then
519     AC_MSG_ERROR([The path for the X11 files not found!
520 Make sure you have X and it's headers and libraries (the -devel packages
521 in Linux) installed.])
524 X_LIBRARY_PATH=$x_libraries
525 XCFLAGS="$X_CFLAGS"
526 XLFLAGS="$X_LIBS"
527 XLIBS="-lX11 $X_EXTRA_LIBS"
529 lib_search_path="$lib_search_path $XLFLAGS"
530 inc_search_path="$inc_search_path $XCFLAGS"
532 AC_SUBST(X_LIBRARY_PATH)
534 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
535 dnl by MANOME Tomonori 
536 dnl ===========================================
537 use_locale=yes
538 AC_ARG_ENABLE(locale, AS_HELP_STRING([--disable-locale], [disable use of X locale support]),
539               use_locale=no)
541 if test "$use_locale" = yes; then
542         AC_CHECK_LIB(X11, _Xsetlocale,
543                 AC_DEFINE(X_LOCALE, 1, [define if you want support for X window's X_LOCALE (set by configure)]),,
544                 $XLFLAGS $XLIBS)
547 dnl Check whether XInternAtoms() exist
548 dnl ==================================
549 AC_CHECK_LIB(X11, XInternAtoms, 
550              AC_DEFINE(HAVE_XINTERNATOMS, 1, [define if your X server has XInternAtoms() (set by configure)]),,
551              $XLFLAGS $XLIBS)
553 dnl Check whether XConvertCase() exist
554 dnl ==================================
555 AC_CHECK_LIB(X11, XConvertCase, 
556              AC_DEFINE(HAVE_XCONVERTCASE, 1, [define if your X server has XConvertCase() (set by configure)]),,
557              $XLFLAGS $XLIBS)
559 dnl XKB keyboard language status
560 dnl ============================
561 AC_ARG_ENABLE(modelock, AS_HELP_STRING([--enable-modelock], [XKB keyboard language status support]),
562                 AC_DEFINE(XKB_MODELOCK, 1, [whether XKB language MODELOCK should be enabled]))
564 dnl XDND Drag-nd-Drop support
565 dnl ============================
566 AC_ARG_ENABLE([xdnd],
567     [AS_HELP_STRING([--disable-xdnd], [disable Drag-nd-Drop support])],
568     [AS_CASE(["$enableval"],
569         [yes|no], [],
570         [AC_MSG_ERROR([bad value $enableval for --disable-xdnd]) ]) ],
571     [enable_xdnd=yes
572   supported_xext="$supported_xext XDnD"
573   AC_DEFINE(XDND, 1, [whether Drag-nd-Drop support should be enabled])
576 dnl XShape support
577 dnl ==============
578 AC_ARG_ENABLE([shape],
579     [AS_HELP_STRING([--disable-shape], [disable shaped window extension support])],
580     [AS_CASE(["$enableval"],
581         [yes|no], [],
582         [AC_MSG_ERROR([bad value $enableval for --enable-shape]) ]) ],
583     [enable_shape=auto])
584 WM_XEXT_CHECK_XSHAPE
586 dnl MIT-SHM support
587 dnl ===============
588 AC_ARG_ENABLE([shm],
589     [AS_HELP_STRING([--disable-shm], [disable usage of MIT-SHM extension])],
590     [AS_CASE(["$enableval"],
591         [yes|no], [],
592         [AC_MSG_ERROR([bad value $enableval for --enable-shm]) ]) ],
593     [enable_shm=auto])
594 WM_XEXT_CHECK_XSHM
596 dnl X Misceleanous Utility
597 dnl ======================
598 # the libXmu is used in WRaster
599 WM_EXT_CHECK_XMU
601 dnl XINERAMA support
602 dnl ================
603 AC_ARG_ENABLE([xinerama],
604     [AS_HELP_STRING([--enable-xinerama], [enable Xinerama extension support])],
605     [AS_CASE(["$enableval"],
606         [yes|no], [],
607         [AC_MSG_ERROR([bad value $enableval for --enable-xinerama]) ]) ],
608     [enable_xinerama=auto])
609 WM_XEXT_CHECK_XINERAMA
611 dnl RandR support
612 dnl ==============
613 AC_ARG_ENABLE([randr],
614     [AS_HELP_STRING([--enable-randr], [enable RandR extension support (NOT recommended, buggy)])],
615     [AS_CASE(["$enableval"],
616         [yes|no], [],
617         [AC_MSG_ERROR([bad value $enableval for --enable-randr]) ]) ],
618     [enable_randr=no])
619 WM_XEXT_CHECK_XRANDR
622 dnl libWINGS uses math functions, check whether usage requires linking
623 dnl against libm
625 WM_CHECK_LIBM
628 dnl libWINGS uses FcPatternDel from libfontconfig
630 AC_MSG_CHECKING([for fontconfig library])
631 FCLIBS=`$PKGCONFIG fontconfig --libs`
632 if test "x$FCLIBS" = "x" ; then
633         AC_MSG_RESULT([not found])
634 else
635         AC_MSG_RESULT([found])
637 AC_SUBST(FCLIBS)
640 dnl Xft2 antialiased font support
641 dnl =============================
643 xft=yes
644 XFTLIBS=""
646 if test "x$PKGCONFIG" != x -a "`$PKGCONFIG xft; echo $?`" = 0; then
647         XFTCONFIG="$PKGCONFIG xft"
648         pkgconfig_xft=yes
649 else
650         AC_CHECK_PROG(XFTCONFIG, xft-config, xft-config)
653 AC_MSG_CHECKING([for the Xft2 library])
655 if test "x$XFTCONFIG" != x; then
656         XFTLIBS=`$XFTCONFIG --libs`
657         XFTFLAGS=`$XFTCONFIG --cflags`
658         AC_MSG_RESULT([found])
659 else
660         AC_MSG_RESULT([not found])
661         echo
662         echo "ERROR!!! libXft2 is not installed or could not be found."
663         echo "         Xft2 is a requirement for building Window Maker."
664         echo "         Please install it (along with fontconfig) before continuing."
665         echo
666         exit 1
669 minXFT="2.1.0"
670 goodxft="no"
673 dnl The macro below will use $XFTFLAGS (defined above) to find Xft.h
675 WM_CHECK_XFT_VERSION($minXFT, goodxft=yes, goodxft=no)
677 if test "$goodxft" = no; then
678         echo
679         echo "ERROR!!! libXft on this system is an old version."
680         echo "         Please consider upgrading to at least version ${minXFT}."
681         echo
682         exit 1
685 AC_SUBST(XFTFLAGS)
686 AC_SUBST(XFTLIBS)
688 dnl PANGO support
689 dnl =============
690 pango=no
691 AC_ARG_ENABLE(pango, AS_HELP_STRING([--enable-pango], [enable Pango text layout support]),
692                 pango=$enableval, pango=no)
694 PANGOFLAGS=
695 PANGOLIBS=
696 if test "$pango" = yes; then
697         PANGOLIBS=`$PKGCONFIG pangoxft --libs`
698         PANGOFLAGS=`$PKGCONFIG pangoxft --cflags`
699         if test "x$PANGOLIBS" = "x" ; then
700                 AC_MSG_RESULT([not found])
701         else
702                 AC_DEFINE(USE_PANGO, 1, [Define if Pango is to be used])
703                 AC_MSG_RESULT([found])
704         fi
706 inc_search_path="$inc_search_path $PANGOFLAGS"
707 AC_SUBST(PANGOLIBS)
709 dnl ==============================================
710 dnl         Graphic Format Libraries
711 dnl ==============================================
713 dnl XPM Support
714 dnl ===========
715 AC_ARG_ENABLE([xpm],
716     [AS_HELP_STRING([--disable-xpm], [disable use of XPM pixmaps through libXpm])],
717     [AS_CASE(["$enableval"],
718         [yes|no], [],
719         [AC_MSG_ERROR([bad value $enableval for --enable-xpm])] )],
720     [enable_xpm=auto])
721 WM_IMGFMT_CHECK_XPM
724 # for wmlib
725 AC_SUBST(XCFLAGS)
726 # for test
727 AC_SUBST(XLFLAGS)
728 AC_SUBST(XLIBS)
729 AC_SUBST(X_EXTRA_LIBS)
731 dnl ===============================================
732 dnl             End of stuff that uses X
733 dnl ===============================================
735 dnl EXIF Support
736 dnl ===========
737 WM_CHECK_LIBEXIF
738 AS_IF([test "x$LIBEXIF" != "x"],
739         [AC_DEFINE(HAVE_EXIF, 1, [Define if EXIF can be used])])
741 dnl PNG Support
742 dnl ===========
743 AC_ARG_ENABLE([png],
744     [AS_HELP_STRING([--disable-png], [disable PNG support through libpng])],
745     [AS_CASE(["$enableval"],
746         [yes|no], [],
747         [AC_MSG_ERROR([bad value $enableval for --enable-png])] )],
748     [enable_png=auto])
749 WM_IMGFMT_CHECK_PNG
752 dnl JPEG Support
753 dnl ============
754 AC_ARG_ENABLE([jpeg],
755     [AS_HELP_STRING([--disable-jpeg], [disable JPEG support through libjpeg])],
756     [AS_CASE(["$enableval"],
757         [yes|no], [],
758         [AC_MSG_ERROR([bad value $enableval for --enable-jpeg])] )],
759     [enable_jpeg=auto])
760 WM_IMGFMT_CHECK_JPEG
763 dnl GIF Support
764 dnl ============
765 AC_ARG_ENABLE(gif,
766     [AS_HELP_STRING([--disable-gif], [disable GIF support through libgif or libungif])],
767     [AS_CASE(["$enableval"],
768         [yes|no], [],
769         [AC_MSG_ERROR([bad value $enableval for --enable-gif])] )],
770     [enable_gif=auto])
771 WM_IMGFMT_CHECK_GIF
774 dnl TIFF Support
775 dnl ============
776 AC_ARG_ENABLE([tiff],
777     [AS_HELP_STRING([--disable-tiff], [disable use of TIFF images through libtiff])],
778     [AS_CASE(["$enableval"],
779         [yes|no], [],
780         [AC_MSG_ERROR([bad value $enableval for --enable-tiff])] )],
781     [enable_tiff=auto])
782 WM_IMGFMT_CHECK_TIFF
785 dnl WEBP Support
786 dnl ===========
787 AC_ARG_ENABLE([webp],
788     [AS_HELP_STRING([--disable-webp], [disable WEBP support through libwebp])],
789     [AS_CASE(["$enableval"],
790         [yes|no], [],
791         [AC_MSG_ERROR([bad value $enableval for --enable-webp])] )],
792     [enable_webp=auto])
793 WM_IMGFMT_CHECK_WEBP
796 dnl MAGICK Support
797 dnl ===========
798 AC_ARG_ENABLE([magick],
799     [AS_HELP_STRING([--disable-magick], [disable MAGICK support through libMagickWand])],
800     [AS_CASE(["$enableval"],
801         [yes|no], [],
802         [AC_MSG_ERROR([bad value $enableval for --enable-magick])] )],
803     [enable_magick=auto])
804 WM_IMGFMT_CHECK_MAGICK
807 dnl PPM Support
808 dnl ===========
809 # The PPM format is always enabled because we have built-in support for the format
810 # We are not using any external library like libppm
811 supported_gfx="$supported_gfx builtin-PPM"
814 # Choice of the default format for icons
815 AS_IF([test "x$enable_tiff" != "xno"],
816     [ICONEXT="tiff"],
817     [ICONEXT="xpm"])
820 LIBRARY_SEARCH_PATH="$lib_search_path"
821 HEADER_SEARCH_PATH="$inc_search_path"
823 AC_SUBST(LIBRARY_SEARCH_PATH)
824 AC_SUBST(HEADER_SEARCH_PATH)
827 AC_SUBST(GFXLIBS)
828 AC_SUBST(ICONEXT)
829 AM_CONDITIONAL([ICON_EXT_XPM],  [test "x$ICONEXT" = "xxpm"])
830 AM_CONDITIONAL([ICON_EXT_TIFF], [test "x$ICONEXT" = "xtiff"])
833 dnl ==============================================
834 dnl         End of Graphic Format Libraries
835 dnl ==============================================
839 dnl stdlib.h is checked here, because of conflict in jpeglib.h
840 AC_CHECK_HEADERS(stdlib.h)
842 # AC_PREFIX_PROGRAM(wmaker)
844 dnl Support for PIXMAPDIR option
845 dnl ============================
846 AC_ARG_WITH(pixmapdir, AS_HELP_STRING([--with-pixmapdir=PATH], [specify where pixmaps are located [DATADIR/pixmaps]]))
848 if test "x$with_pixmapdir" != "x"; then
849         pixmapdir=$with_pixmapdir
850 else
851         pixmapdir='${datadir}/pixmaps'
853 AC_SUBST(pixmapdir)
856 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
857 dnl ==============================================
859 AC_ARG_WITH(gnustepdir, AS_HELP_STRING([--with-gnustepdir=PATH], [specify the directory for GNUstep applications]))
861 if test "x`echo $with_gnustepdir | grep ^/`" != "x"; then
862     appspath=$with_gnustepdir
865 if test "x$appspath$GNUSTEP_LOCAL_ROOT" = "x"; then
866     wprefs_base_dir=${prefix}
867     wprefs_datadir="${datadir}/WPrefs"
868     wprefs_bindir="${bindir}"
869 else
870     gnustepdir=$appspath
872     if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
873         gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
874         gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
875     fi
877     wprefs_base_dir=$gnustepdir/Applications
878     wprefs_datadir=$wprefs_base_dir/WPrefs.app
879     wprefs_bindir=$wprefs_base_dir/WPrefs.app
882 AC_SUBST(wprefs_datadir)
883 AC_SUBST(wprefs_bindir)
886 dnl Enable User Defined Menu thing
887 dnl ==============================
888 AC_ARG_ENABLE(usermenu, AS_HELP_STRING([--enable-usermenu], [user defined menus for applications]),
889 if test "$enableval" = yes; then
890         AC_DEFINE(USER_MENU, 1, [define if you want user defined menus for applications])
894 gl_LD_VERSION_SCRIPT
897 dnl Add the post-poned compilation options
898 dnl ======================================
899 WM_CFLAGS_GCC_OPTION_POSTPONED
902 AC_OUTPUT(Makefile po/Makefile util/Makefile util/po/Makefile test/Makefile \
903         WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/Makefile \
904         WINGs/Examples/Makefile WINGs/Resources/Makefile WINGs/Tests/Makefile \
905         WINGs/Extras/Makefile WINGs/po/Makefile \
906         wmlib/Makefile wrlib/Makefile wrlib/tests/Makefile \
907         src/Makefile src/wconfig.h \
908         doc/Makefile doc/sk/Makefile doc/cs/Makefile \
909         doc/ru/Makefile \
910         WindowMaker/Makefile WindowMaker/Backgrounds/Makefile \
911         WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile \
912         WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile \
913         WindowMaker/Styles/Makefile WindowMaker/Themes/Makefile \
914         WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
915         WPrefs.app/po/Makefile )
918 dnl Output some helpful data for compiling wraster and WINGs/WUtil apps
919 dnl ===================================================================
921 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
922 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
923 dnl     | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
925 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
926 dnl parsed by m4
928 AC_SUBST(lib_search_path)
929 AC_SUBST(inc_search_path)
932 dnl Spit out the configuration
933 dnl ==========================
935 if test "x$MOFILES" = "x"; then
936         mof=None
937 else
938         mof=`echo $MOFILES`
941 if test "x$MOFILES" = "x"; then
942         languages=None
943 else
944         languages=`echo $MOFILES | sed 's/.mo//g'`
947 echo
948 echo "Window Maker was configured as follows:"
949 echo
950 echo "Installation path prefix            : $prefix"
951 echo "Installation path for binaries      : $_bindir"
952 echo "Installation path for libraries     : $libdir"
953 echo "Installation path for WPrefs.app    : $wprefs_base_dir" | sed -e 's|\${prefix}|'"$prefix|"
954 echo "Supported X extensions:             :$supported_xext"
955 echo "Supported graphic format libraries  :$supported_gfx"
956 echo "Unsupported features                :$unsupported"
957 echo "Antialiased text support in WINGs   : $xft"
958 echo "Pango text layout support in WINGs  : $pango"
959 echo "Translated message files to install : $mof"
960 dnl echo "Supported languages beside English  : $languages"
961 if test "x$MOFILES" != "x"; then
962         echo "Installation path for translations  : $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
964 AS_IF([test "x$debug" = "xyes"],
965     [AS_ECHO(["Debug enabled: CFLAGS = $CFLAGS"]) ])
966 echo
968 AS_IF([test "x$wm_cv_prog_cc_nestedfunc" != "xyes"],
969     [AC_MSG_WARN([[Your compiler does not support Nested Function, work-around enabled]])])
971 dnl WM_PRINT_REDCRAP_BUG_STATUS
973 AS_IF([test "x$enable_jpeg" = xno], [dnl
974     AS_ECHO(["WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"])
975     AS_ECHO([])
976     AS_ECHO(["JPEG support will not be included because the JPEG library is"])
977     AS_ECHO(["not installed correctly or was not found. Background images"])
978     AS_ECHO(["from themes will not display as they usually are JPEG files."])
979     AS_ECHO([])
980     AS_ECHO(["To fix, download and install the jpeg library and/or make sure you"])
981     AS_ECHO(["installed all jpeg related packages, SPECIALLY the development packages"])
982     AS_ECHO(["like jpeg-dev (if you use some prepackaged version of libjpeg)."])
983     AS_ECHO([])
984     AS_ECHO(["WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"])dnl
988 dnl This is for Emacs.  I'm lazy, I know... (nicolai)
989 dnl ================================================
990 dnl Local Variables:
991 dnl compile-command: "autoconf"
992 dnl End: