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