1 dnl ============================================================================
3 dnl Window Maker autoconf input
5 AC_COPYRIGHT([Copyright (c) 2001-2015 The Window Maker Team])
7 dnl ============================================================================
9 dnl This program is free software; you can redistribute it and/or modify
10 dnl it under the terms of the GNU General Public License as published by
11 dnl the Free Software Foundation; either version 2 of the License, or
12 dnl (at your option) any later version.
14 dnl This program is distributed in the hope that it will be useful,
15 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
16 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 dnl GNU General Public License for more details.
19 dnl You should have received a copy of the GNU General Public License along
20 dnl with this program; see the file COPYING.
22 dnl ============================================================================
24 dnl Process with: ./autogen.sh
27 dnl Due to a bug in Autoconf 2.68 (apparently a regression), we need at least
28 dnl version 2.68b which includes this patch:
29 dnl http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=2b0d95faef68d7ed7c08b0edb9ff1c38728376fa
31 dnl Because the 2.69 was released only a few month later, let's just ask for it
35 dnl Configuration for Autoconf and Automake
36 dnl =======================================
37 AC_INIT([WindowMaker],[0.95.6],[wmaker-dev@lists.windowmaker.org],[WindowMaker],[http://www.windowmaker.org/])
38 AC_CONFIG_MACRO_DIR([m4])
39 AC_CONFIG_HEADERS([config.h])
40 AM_INIT_AUTOMAKE([1.11 silent-rules])
42 dnl Reference file used by 'configure' to make sure the path to sources is valid
43 AC_CONFIG_SRCDIR([src/WindowMaker.h])
45 dnl Include at the end of 'config.h', this file is generated by top-level Makefile
46 AH_BOTTOM([@%:@include "config-paths.h"])
49 dnl libtool library versioning
50 dnl ==========================
56 dnl 1. Start with version information of ‘0:0:0’ for each libtool library.
57 dnl 2. Update the version information only immediately before a public
58 dnl release of your software. More frequent updates are unnecessary, and
59 dnl only guarantee that the current interface number gets larger faster.
60 dnl 3. If the library source code has changed at all since the last
61 dnl update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
62 dnl 4. If any interfaces have been added, removed, or changed since the
63 dnl last update, increment current, and set revision to 0.
64 dnl 5. If any interfaces have been added since the last public release,
65 dnl then increment age.
66 dnl 6. If any interfaces have been removed or changed since the last
67 dnl public release, then set age to 0.
73 WRASTER_VERSION=$WRASTER_CURRENT:$WRASTER_REVISION:$WRASTER_AGE
74 AC_SUBST(WRASTER_VERSION)
80 WINGS_VERSION=$WINGS_CURRENT:$WINGS_REVISION:$WINGS_AGE
81 AC_SUBST(WINGS_VERSION)
87 WUTIL_VERSION=$WUTIL_CURRENT:$WUTIL_REVISION:$WUTIL_AGE
88 AC_SUBST(WUTIL_VERSION)
91 dnl Checks for programs
92 dnl ===================
96 AC_PROG_GCC_TRADITIONAL
100 dnl Debugging Options
101 dnl =================
102 AC_ARG_ENABLE([debug],
103 [AS_HELP_STRING([--enable-debug], [enable debugging options, @<:@default=no@:>@])],
104 [AS_CASE(["$enableval"],
107 [AC_MSG_ERROR([bad value $enableval for --enable-debug])] )],
109 AS_IF([test "x$debug" = "xyes"],
110 [dnl This flag should have already been detected and added, but if user
111 dnl provided an explicit CFLAGS it may not be the case
112 AS_IF([echo " $CFLAGS " | grep " -g " 2>&1 > /dev/null],
113 [@%:@ Debug symbol already activated],
114 [AX_CFLAGS_GCC_OPTION([-g])])
116 dnl This flag generally makes debugging nightmarish, remove it if present
117 CFLAGS="`echo "$CFLAGS" | sed -e 's/-fomit-frame-pointer *//' `"
119 dnl Enable internal debug code
120 CPPFLAGS="$CPPFLAGS -DDEBUG"
122 dnl When debug is not enabled, the user probably does not wants to keep
123 dnl assertions in the final program
124 CPPFLAGS="$CPPFLAGS -DNDEBUG"
128 AX_CFLAGS_GCC_OPTION([-Wall])
129 AX_CFLAGS_GCC_OPTION([-Wextra -Wno-sign-compare])
131 dnl The use of trampolines cause code that can crash on some secured OS, it is
132 dnl also known to be a source of crash if not used properly, in a more general
133 dnl way it tends to generate binary code that may not be optimal, and it is
134 dnl not compatible with the 'nested-func-to-macro' workaround
135 WM_CFLAGS_CHECK_FIRST([-Wtrampolines],
136 [-Werror=trampolines dnl try to generate an error if possible
137 -Wtrampolines dnl if not, try to fall back to a simple warning
140 AS_IF([test "x$debug" = "xyes"],
141 [dnl When debug is enabled, we try to activate more checks from
142 dnl the compiler. They are on independant check because the
143 dnl macro checks all the options at once, but we may have cases
144 dnl where some options are not supported and we don't want to
145 dnl loose all of them.
147 dnl clang, suggest parenthesis on bit operations that could be
148 dnl misunderstood due to C operator precedence
149 AX_CFLAGS_GCC_OPTION([-Wbitwise-op-parentheses])
151 dnl Points at code that gcc thinks is so complicated that gcc
152 dnl gives up trying to optimize, which probably also means it is
153 dnl too complicated to maintain
154 AX_CFLAGS_GCC_OPTION([-Wdisabled-optimization])
156 dnl Because of C's type promotion, the compiler has to generate
157 dnl less optimal code when a double constant is used in a
159 AX_CFLAGS_GCC_OPTION([-Wdouble-promotion])
161 dnl Floating-point comparison is not a good idea
162 AX_CFLAGS_GCC_OPTION([-Wfloat-equal])
164 dnl clang warns about constants that may have portability issues due
165 dnl to the endianness of the host
166 AX_CFLAGS_GCC_OPTION([-Wfour-char-constants])
168 dnl clang warns about constant that may be too big to be portable
169 AX_CFLAGS_GCC_OPTION([-Wliteral-range])
171 dnl Try to report misuses of '&' versus '&&' and similar
172 AX_CFLAGS_GCC_OPTION([-Wlogical-op])
174 dnl clang, reports cases where the code assumes everyone is an
175 dnl expert in C operator precedence... which is unlikely!
176 AX_CFLAGS_GCC_OPTION([-Wlogical-op-parentheses])
178 dnl Reports declaration of global things that are done inside
179 dnl a local environment, instead of using the appropriate
181 AX_CFLAGS_GCC_OPTION([-Wnested-externs])
183 dnl Warn about constant strings that could pose portability issues
184 AX_CFLAGS_GCC_OPTION([-Woverlength-strings])
186 dnl Use of 'sizeof()' on inappropriate pointer types
187 AX_CFLAGS_GCC_OPTION([-Wpointer-arith])
189 dnl Having more than 1 prototype for a function makes code updates
190 dnl more difficult, so try to avoid it
191 AX_CFLAGS_GCC_OPTION([-Wredundant-decls])
193 dnl clang, detect some misuses of sizeof. We also count in our code
194 dnl on the use of the macro 'wlength' which contains a check if the
195 dnl compiler support C11's static_assert
196 AX_CFLAGS_GCC_OPTION([-Wsizeof-array-argument])
198 dnl Prototype of function must be explicit, no deprecated K&R syntax
199 dnl and no empty argument list which prevents compiler from doing
200 dnl type checking when using the function
201 WM_CFLAGS_GCC_OPTION_STRICTPROTO
203 dnl Proper attributes helps the compiler to produce better code
204 WM_CFLAGS_CHECK_FIRST([format attribute suggest],
205 [-Wsuggest-attribute=format dnl new gcc syntax
206 -Wmissing-format-attribute dnl old gcc syntax, clang
208 WM_CFLAGS_CHECK_FIRST([no-return attribute suggest],
209 [-Wsuggest-attribute=noreturn dnl gcc syntax
210 -Wmissing-noreturn dnl clang syntax
213 dnl GCC provides a couple of checks to detect incorrect macro uses
214 AX_CFLAGS_GCC_OPTION([-Wundef])
215 WM_CFLAGS_GCC_OPTION_UNUSEDMACROS
217 dnl clang reports stuff marked unused but which is actually used
218 AX_CFLAGS_GCC_OPTION([-Wused-but-marked-unused])
220 dnl When debug not enabled, we try to avoid some non-necessary
221 dnl messages from the compiler
223 dnl To support legacy X servers, we have sometime to use
224 dnl functions marked as deprecated. We do not wish our users
225 dnl to be worried about it
226 AX_CFLAGS_GCC_OPTION([-Wno-deprecated])
227 AX_CFLAGS_GCC_OPTION([-Wno-deprecated-declarations])
231 dnl Support for Nested Functions by the compiler
232 dnl ============================================
233 WM_PROG_CC_NESTEDFUNC
238 dnl they are used by util/wmiv
242 dnl Tracking on what is detected for final status
243 dnl =============================================
250 dnl Platform-specific Makefile setup
251 dnl ================================
253 [*-*-linux*|*-*-cygwin*|*-gnu*], [WM_OSDEP="linux" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"],
254 [*-*-freebsd*|*-k*bsd-gnu*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -DFREEBSD"],
255 [*-*-netbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DNETBSD"],
256 [*-*-openbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DOPENBSD"],
257 [*-*-dragonfly*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DDRAGONFLYBSD"],
258 [*-apple-darwin*], [WM_OSDEP="darwin"],
259 [*-*-solaris*], [WM_OSDEP="stub"], dnl solaris.c when done
261 AM_CONDITIONAL([WM_OSDEP_LINUX], [test "x$WM_OSDEP" = "xlinux"])
262 AM_CONDITIONAL([WM_OSDEP_BSD], [test "x$WM_OSDEP" = "xbsd"])
263 AM_CONDITIONAL([WM_OSDEP_DARWIN], [test "x$WM_OSDEP" = "xdarwin"])
264 AM_CONDITIONAL([WM_OSDEP_GENERIC], [test "x$WM_OSDEP" = "xstub"])
270 dnl move this earlier in the script... anyone know why this is handled
271 dnl in such a bizarre way?
273 test "x$prefix" = xNONE && prefix=$ac_default_prefix
274 dnl Let make expand exec_prefix.
275 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
278 _bindir=`eval echo $bindir`
279 _bindir=`eval echo $_bindir`
281 lib_search_path='-L${libdir}'
283 inc_search_path='-I${includedir}'
285 dnl ===============================================
286 dnl Specify paths to look for libraries and headers
287 dnl ===============================================
288 AC_ARG_WITH(libs-from, AS_HELP_STRING([--with-libs-from], [pass compiler flags to look for libraries]),
289 [lib_search_path="$withval $lib_search_path"])
291 AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags to look for header files]),
292 [inc_search_path="$withval $inc_search_path"])
295 dnl Features Configuration
296 dnl ======================
297 AC_ARG_ENABLE([animations],
298 [AS_HELP_STRING([--disable-animations], [disable permanently animations @<:@default=enabled@:>@])],
299 [AS_CASE(["$enableval"],
301 [AC_MSG_ERROR([bad value $enableval for --enable-animations])])],
302 [enable_animations="yes"])
303 AS_IF([test "x$enable_animations" = "xno"],
304 [unsupported="$unsupported Animations"],
305 [AC_DEFINE([USE_ANIMATIONS], [1], [Defined when user did not request to disable animations])
306 supported_core="$supported_core Animations"])
309 AC_ARG_ENABLE([mwm-hints],
310 [AS_HELP_STRING([--disable-mwm-hints], [disable support for Motif WM hints @<:@default=enabled@:>@])],
311 [AS_CASE(["$enableval"],
313 [AC_MSG_ERROR([bad value $enableval for --enable-mwm-hints])])],
314 [enable_mwm_hints="yes"])
315 AS_IF([test "x$enable_mwm_hints" = "xno"],
316 [unsupported="$unsupported MWMHints"],
317 [AC_DEFINE([USE_MWM_HINTS], [1], [Defined when used did not request to disable Motif WM hints])
318 supported_core="$supported_core MWMHints"])
319 AM_CONDITIONAL([USE_MWM_HINTS], [test "x$enable_mwm_hints" != "xno"])
324 AC_ARG_ENABLE([boehm-gc],
325 [AS_HELP_STRING([--enable-boehm-gc], [use Boehm GC instead of the default libc malloc() [default=no]])],
326 [AS_CASE(["$enableval"],
327 [yes], [with_boehm_gc=yes],
328 [no], [with_boehm_gc=no],
329 [AC_MSG_ERROR([bad value $enableval for --enable-boehm-gc])] )],
331 AS_IF([test "x$with_boehm_gc" = "xyes"],
332 AC_SEARCH_LIBS([GC_malloc], [gc],
333 [AC_DEFINE(USE_BOEHM_GC, 1, [Define if Boehm GC is to be used])],
334 [AC_MSG_FAILURE([--enable-boehm-gc specified but test for libgc failed])]))
339 AC_ARG_ENABLE([lcov],
340 [AS_HELP_STRING([--enable-lcov[=output-directory]], [enable coverage data generation using LCOV (GCC only) [default=no]])],
344 AS_IF([test "x$enable_lcov" != "xno"],
345 [AX_CFLAGS_GCC_OPTION(-fprofile-arcs -ftest-coverage)
346 AS_IF([test "x$enable_lcov" = "xyes"],
347 [lcov_output_directory="coverage-report"],
348 [lcov_output_directory="${enable_lcov}/coverage-report"])
349 AC_SUBST(lcov_output_directory)])
351 AM_CONDITIONAL([USE_LCOV], [test "x$enable_lcov" != "xno"])
354 dnl ============================
355 dnl Checks for library functions
356 dnl ============================
359 WM_FUNC_SECURE_GETENV
360 AC_CHECK_FUNCS(gethostname select poll strcasecmp strncasecmp \
361 setsid mallinfo mkstemp sysconf)
362 AC_SEARCH_LIBS([strerror], [cposix])
364 dnl nanosleep is generally available in standard libc, although not always the
365 dnl case. One known example is Solaris which needs -lrt
366 AC_SEARCH_LIBS([nanosleep], [rt], [],
367 [AC_MSG_ERROR([function 'nanosleep' not found, please report to wmaker-dev@lists.windowmaker.org])])
369 dnl the flag 'O_NOFOLLOW' for 'open' is used in WINGs
370 WM_FUNC_OPEN_NOFOLLOW
373 dnl Check for strlcat/strlcpy
374 dnl =========================
375 AC_ARG_WITH([libbsd],
376 [AS_HELP_STRING([--without-libbsd], [do not use libbsd for strlcat and strlcpy [default=check]])],
377 [AS_IF([test "x$with_libbsd" != "xno"],
384 AC_SEARCH_LIBS([strlcat],[$with_libbsd],
385 [AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcat is available])],
389 AC_SEARCH_LIBS([strlcpy],[$with_libbsd],
390 [AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcpy is available])],
397 AS_IF([test "x$ac_cv_search_strlcat" = "x-lbsd" -o "x$ac_cv_search_strlcpy" = "x-lbsd"],
399 AC_CHECK_HEADERS([bsd/string.h])]
404 dnl Check for OpenBSD kernel memory interface - kvm(3)
405 dnl ==================================================
406 AS_IF([test "x$WM_OSDEP" = "xbsd"],
407 AC_SEARCH_LIBS([kvm_openfiles], [kvm]) )
410 dnl Check for inotify
411 dnl =================
412 dnl It is used by WindowMaker to reload automatically the configuration when the
413 dnl user changed it using WPref or wdwrite
414 AC_CHECK_HEADERS([sys/inotify.h],
415 [AC_DEFINE([HAVE_INOTIFY], [1], [Check for inotify])])
420 dnl It is used by WUtil to log the wwarning, werror and wfatal
421 AC_CHECK_HEADERS([syslog.h], [AC_DEFINE([HAVE_SYSLOG], [1], [Check for syslog])])
424 dnl Checks for header files
425 dnl =======================
428 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h libintl.h poll.h malloc.h ctype.h \
432 dnl Checks for typedefs, structures, and compiler characteristics
433 dnl =============================================================
444 AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config])
448 dnl Internationalization
449 dnl ====================
450 dnl Detect the language for translations to be installed and check
451 dnl that the gettext environment works
454 WM_I18N_MENUTEXTDOMAIN
456 dnl 2014/12/29: The option is deprecated, we should keep this message for at
457 dnl least 2 years to ensure users see it and update their build scripts
458 AC_ARG_WITH([nlsdir], [],
459 [AC_MSG_ERROR([option '--with-nlsdir' is deprecated, please use autoconf's standard '--localedir' instead])])
462 dnl ===========================================
463 dnl Stuff that uses X
464 dnl ===========================================
468 AS_IF([test "x$no_x" = "xyes"],
469 [AC_MSG_ERROR([The path for the X11 files not found!
470 Make sure you have X and it's headers and libraries (the -devel packages
471 in Linux) installed.])])
473 X_LIBRARY_PATH=$x_libraries
476 XLIBS="-lX11 $X_EXTRA_LIBS"
478 lib_search_path="$lib_search_path $XLFLAGS"
479 inc_search_path="$inc_search_path $XCFLAGS"
481 AC_SUBST(X_LIBRARY_PATH)
484 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
485 dnl by MANOME Tomonori
486 dnl ===========================================
491 dnl Check whether XInternAtoms() exist
492 dnl ==================================
493 AC_CHECK_LIB([X11], [XInternAtoms],
494 [AC_DEFINE([HAVE_XINTERNATOMS], [1],
495 [define if your X server has XInternAtoms() (set by configure)])],
496 [], [$XLFLAGS $XLIBS])
499 dnl Check whether XConvertCase() exist
500 dnl ==================================
501 AC_CHECK_LIB([X11], [XConvertCase],
502 [AC_DEFINE([HAVE_XCONVERTCASE], [1],
503 [define if your X server has XConvertCase() (set by configure)])],
504 [], [$XLFLAGS $XLIBS])
507 dnl XKB keyboard language status
508 dnl ============================
509 AC_ARG_ENABLE([modelock],
510 [AS_HELP_STRING([--enable-modelock], [XKB keyboard language status support])],
511 [AS_CASE([$enableval],
513 [AC_MSG_ERROR([bad value '$enableval' for --enable-modelock])])],
514 [enable_modelock=no])
515 AS_IF([test "x$enable_modelock" = "xyes"],
516 [AC_DEFINE([XKB_MODELOCK], [1], [whether XKB language MODELOCK should be enabled]) ])
519 dnl XDND Drag-nd-Drop support
520 dnl =========================
521 AC_ARG_ENABLE([xdnd],
522 [AS_HELP_STRING([--disable-xdnd], [disable support for Drag-and-Drop on the dock @<:@default=enabled@:>@])],
523 [AS_CASE(["$enableval"],
525 [AC_MSG_ERROR([bad value $enableval for --disable-xdnd]) ]) ],
527 AS_IF([test "x$enable_xdnd" = "xyes"],
528 [supported_core="$supported_core XDnD"
529 AC_DEFINE([USE_DOCK_XDND], [1], [whether Drag-and-Drop on the dock should be enabled])],
530 [unsupported="$unsupported XDnd"])
531 AM_CONDITIONAL([USE_DOCK_XDND], [test "x$enable_dock_xdnd" != "xno"])
534 dnl Support for ICCCM 2.0 Window Manager replacement
535 dnl ================================================
536 AC_ARG_ENABLE([wmreplace],
537 [AS_HELP_STRING([--enable-wmreplace], [support for ICCCM window manager replacement])],
538 [AS_CASE([$enableval],
540 [AC_MSG_ERROR([bad value '$enableval' for --enable-wmreplace])])],
541 [enable_wmreplace=no])
542 AS_IF([test "x$enable_wmreplace" = "xyes"],
543 [AC_DEFINE([USE_ICCCM_WMREPLACE], [1],
544 [define to support ICCCM protocol for window manager replacement])
545 supported_xext="$supported_xext WMReplace"])
550 AC_ARG_ENABLE([shape],
551 [AS_HELP_STRING([--disable-shape], [disable shaped window extension support])],
552 [AS_CASE(["$enableval"],
554 [AC_MSG_ERROR([bad value $enableval for --enable-shape]) ]) ],
562 [AS_HELP_STRING([--disable-shm], [disable usage of MIT-SHM extension])],
563 [AS_CASE(["$enableval"],
565 [AC_MSG_ERROR([bad value $enableval for --enable-shm]) ]) ],
570 dnl X Misceleanous Utility
571 dnl ======================
572 dnl the libXmu is used in WRaster
578 AC_ARG_ENABLE([xinerama],
579 [AS_HELP_STRING([--enable-xinerama], [enable Xinerama extension support])],
580 [AS_CASE(["$enableval"],
582 [AC_MSG_ERROR([bad value $enableval for --enable-xinerama]) ]) ],
583 [enable_xinerama=auto])
584 WM_XEXT_CHECK_XINERAMA
589 AC_ARG_ENABLE([randr],
590 [AS_HELP_STRING([--enable-randr], [enable RandR extension support (NOT recommended, buggy)])],
591 [AS_CASE(["$enableval"],
593 [AC_MSG_ERROR([bad value $enableval for --enable-randr]) ]) ],
600 dnl libWINGS uses math functions, check whether usage requires linking
607 dnl libWINGS uses FcPatternDel from libfontconfig
608 AC_MSG_CHECKING([for fontconfig library])
609 FCLIBS=`$PKGCONFIG fontconfig --libs`
610 if test "x$FCLIBS" = "x" ; then
611 AC_MSG_RESULT([not found])
613 AC_MSG_RESULT([found])
618 dnl Xft2 antialiased font support
619 dnl =============================
624 if test "x$PKGCONFIG" != x -a "`$PKGCONFIG xft; echo $?`" = 0; then
625 XFTCONFIG="$PKGCONFIG xft"
628 AC_CHECK_PROG(XFTCONFIG, xft-config, xft-config)
631 AC_MSG_CHECKING([for the Xft2 library])
633 if test "x$XFTCONFIG" != x; then
634 XFTLIBS=`$XFTCONFIG --libs`
635 XFTFLAGS=`$XFTCONFIG --cflags`
636 AC_MSG_RESULT([found])
638 AC_MSG_RESULT([not found])
640 echo "ERROR!!! libXft2 is not installed or could not be found."
641 echo " Xft2 is a requirement for building Window Maker."
642 echo " Please install it (along with fontconfig) before continuing."
651 dnl The macro below will use $XFTFLAGS (defined above) to find Xft.h
653 WM_CHECK_XFT_VERSION($minXFT, goodxft=yes, goodxft=no)
655 if test "$goodxft" = no; then
657 echo "ERROR!!! libXft on this system is an old version."
658 echo " Please consider upgrading to at least version ${minXFT}."
669 AC_ARG_ENABLE(pango, AS_HELP_STRING([--enable-pango], [enable Pango text layout support]),
670 pango=$enableval, pango=no)
674 if test "$pango" = yes; then
675 PANGOLIBS=`$PKGCONFIG pangoxft --libs`
676 PANGOFLAGS=`$PKGCONFIG pangoxft --cflags`
677 if test "x$PANGOLIBS" = "x" ; then
678 AC_MSG_RESULT([not found])
680 AC_DEFINE(USE_PANGO, 1, [Define if Pango is to be used])
681 AC_MSG_RESULT([found])
684 inc_search_path="$inc_search_path $PANGOFLAGS"
687 dnl ==============================================
688 dnl Graphic Format Libraries
689 dnl ==============================================
694 [AS_HELP_STRING([--disable-xpm], [disable use of XPM pixmaps through libXpm])],
695 [AS_CASE(["$enableval"],
697 [AC_MSG_ERROR([bad value $enableval for --enable-xpm])] )],
707 AC_SUBST(X_EXTRA_LIBS)
709 dnl ===============================================
710 dnl End of stuff that uses X
711 dnl ===============================================
716 AS_IF([test "x$LIBEXIF" != "x"],
717 [AC_DEFINE(HAVE_EXIF, 1, [Define if EXIF can be used])])
723 [AS_HELP_STRING([--disable-png], [disable PNG support through libpng])],
724 [AS_CASE(["$enableval"],
726 [AC_MSG_ERROR([bad value $enableval for --enable-png])] )],
733 AC_ARG_ENABLE([jpeg],
734 [AS_HELP_STRING([--disable-jpeg], [disable JPEG support through libjpeg])],
735 [AS_CASE(["$enableval"],
737 [AC_MSG_ERROR([bad value $enableval for --enable-jpeg])] )],
745 [AS_HELP_STRING([--disable-gif], [disable GIF support through libgif or libungif])],
746 [AS_CASE(["$enableval"],
748 [AC_MSG_ERROR([bad value $enableval for --enable-gif])] )],
755 AC_ARG_ENABLE([tiff],
756 [AS_HELP_STRING([--disable-tiff], [disable use of TIFF images through libtiff])],
757 [AS_CASE(["$enableval"],
759 [AC_MSG_ERROR([bad value $enableval for --enable-tiff])] )],
766 AC_ARG_ENABLE([webp],
767 [AS_HELP_STRING([--disable-webp], [disable WEBP support through libwebp])],
768 [AS_CASE(["$enableval"],
770 [AC_MSG_ERROR([bad value $enableval for --enable-webp])] )],
777 AC_ARG_ENABLE([magick],
778 [AS_HELP_STRING([--disable-magick], [disable MAGICK support through libMagickWand])],
779 [AS_CASE(["$enableval"],
781 [AC_MSG_ERROR([bad value $enableval for --enable-magick])] )],
782 [enable_magick=auto])
783 WM_IMGFMT_CHECK_MAGICK
788 # The PPM format is always enabled because we have built-in support for the format
789 # We are not using any external library like libppm
790 supported_gfx="$supported_gfx builtin-PPM"
793 # Choice of the default format for icons
794 AS_IF([test "x$enable_tiff" != "xno"],
799 LIBRARY_SEARCH_PATH="$lib_search_path"
800 HEADER_SEARCH_PATH="$inc_search_path"
802 AC_SUBST(LIBRARY_SEARCH_PATH)
803 AC_SUBST(HEADER_SEARCH_PATH)
808 AM_CONDITIONAL([ICON_EXT_XPM], [test "x$ICONEXT" = "xxpm"])
809 AM_CONDITIONAL([ICON_EXT_TIFF], [test "x$ICONEXT" = "xtiff"])
812 dnl ==============================================
813 dnl End of Graphic Format Libraries
814 dnl ==============================================
818 dnl stdlib.h is checked here, because of conflict in jpeglib.h
819 AC_CHECK_HEADERS(stdlib.h)
822 dnl Support for PIXMAPDIR option
823 dnl ============================
824 AC_ARG_WITH([pixmapdir],
825 [AS_HELP_STRING([--with-pixmapdir=PATH], [specify where pixmaps are located [DATADIR/pixmaps]])],
827 [yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-pixmapdir, expected a path]) ],
828 [/*], [], dnl Absolute path, ok
829 [\$*], [], dnl Assumes it starts with a reference to $prefix or a similar variable, ok
830 [AC_MSG_ERROR([bad path '$withval' for pixmapdir, expecting an absolute path])])],
833 AS_IF([test "x$with_pixmapdir" != "x"],
834 [pixmapdir="$with_pixmapdir"],
835 [pixmapdir='${datadir}/pixmaps'])
836 AC_SUBST([pixmapdir])dnl
839 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
840 dnl ==============================================
841 AC_ARG_WITH([gnustepdir],
842 [AS_HELP_STRING([--with-gnustepdir=PATH], [specify the directory for GNUstep applications])],
844 [yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-gnustepdir, expected a path]) ],
845 [/*], [], dnl Absolute path, ok
846 [\$*], [], dnl Assumes it starts with a reference to $prefix or a similar variable, ok
847 [AC_MSG_ERROR([bad path '$withval' for gnustepdir, expecting an absolute path])])],
848 [dnl If no command-line option was given, we use $GNUSTEP_LOCAL_ROOT if it was set
849 with_gnustepdir="$GNUSTEP_LOCAL_ROOT"])
851 AS_IF([test "x$with_gnustepdir" = "x"],
852 [dnl No path specified, use default
853 wprefs_base_dir=${prefix}
854 wprefs_datadir="${datadir}/WPrefs"
855 wprefs_bindir="${bindir}"],
856 [dnl User specified base path
857 wprefs_base_dir="$with_gnustepdir/Applications"
858 wprefs_datadir="$wprefs_base_dir/WPrefs.app"
859 wprefs_bindir="$wprefs_base_dir/WPrefs.app"])
860 AC_SUBST([wprefs_datadir])dnl
861 AC_SUBST([wprefs_bindir])dnl
864 dnl Enable User Defined Menu thing
865 dnl ==============================
866 AC_ARG_ENABLE([usermenu],
867 [AS_HELP_STRING([--enable-usermenu], [user defined menus for applications])],
868 [AS_CASE([$enableval],
870 [AC_MSG_ERROR([bad value '$enableval' for --enable-usermenu])])],
871 [enable_usermenu=no])
872 AS_IF([test "x$enable_usermenu" = "xyes"],
873 [AC_DEFINE([USER_MENU], [1],
874 [define if you want user defined menus for applications])])
877 dnl Support for removing non-public symbols from a library
878 dnl ======================================================
882 dnl Add the post-poned compilation options
883 dnl ======================================
884 WM_CFLAGS_GCC_OPTION_POSTPONED
887 AC_SUBST(lib_search_path)
888 AC_SUBST(inc_search_path)
891 dnl Spit out the configuration
892 dnl ==========================
901 WINGs/Makefile WINGs/WINGs/Makefile WINGs/po/Makefile
902 WINGs/Documentation/Makefile WINGs/Resources/Makefile WINGs/Extras/Makefile
903 WINGs/Examples/Makefile WINGs/Tests/Makefile
905 dnl Window Maker's core
906 src/Makefile src/wconfig.h po/Makefile
907 doc/Makefile doc/build/Makefile
908 doc/sk/Makefile doc/cs/Makefile doc/ru/Makefile
909 WindowMaker/Makefile WindowMaker/Backgrounds/Makefile
910 WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile
911 WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile
912 WindowMaker/Styles/Makefile WindowMaker/Themes/Makefile
915 WPrefs.app/Makefile WPrefs.app/po/Makefile
916 WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile
918 dnl Command-line utilities
919 util/Makefile util/po/Makefile
921 dnl Misceleanous stuff
929 dnl Provide a summary of the config
930 dnl ===============================
932 echo "Window Maker was configured as follows:"
934 echo "Installation path prefix : $prefix"
935 echo "Installation path for binaries : $_bindir"
936 echo "Installation path for libraries : $libdir"
937 echo "Installation path for WPrefs.app : $wprefs_base_dir" | sed -e 's|\${prefix}|'"$prefix|"
938 echo "Supported core features: :$supported_core"
939 echo "Supported X extensions: :$supported_xext"
940 echo "Supported graphic format libraries :$supported_gfx"
941 echo "Unsupported features :$unsupported"
942 echo "Antialiased text support in WINGs : $xft"
943 echo "Pango text layout support in WINGs : $pango"
944 echo "Translated languages to support :$supported_locales"
945 AS_IF([test "x$debug" = "xyes"],
946 [AS_ECHO(["Debug enabled: CFLAGS = $CFLAGS"]) ])
949 AS_IF([test "x$wm_cv_prog_cc_nestedfunc" != "xyes"],
950 [AC_MSG_WARN([[Your compiler does not support Nested Function, work-around enabled]])])
952 AS_IF([test "x$supported_locales" = "x"],
953 [AC_MSG_WARN([[No language from \$LINGUAS are supported]])])
955 AS_IF([test "x$enable_jpeg" = xno], [dnl
956 AS_ECHO(["WARNING WARNING WARNING WARNING WARNING WARNING WARNING"])
958 AS_ECHO(["JPEG support will not be included because the JPEG library is"])
959 AS_ECHO(["not installed correctly or was not found. Background images"])
960 AS_ECHO(["from themes will not display as they usually are JPEG files."])
962 AS_ECHO(["To fix, download and install the jpeg library and/or make sure you"])
963 AS_ECHO(["installed all jpeg related packages, SPECIALLY the development packages"])
964 AS_ECHO(["like jpeg-dev (if you use some prepackaged version of libjpeg)."])
966 AS_ECHO(["WARNING WARNING WARNING WARNING WARNING WARNING WARNING"])dnl
970 dnl This is for Emacs. I'm lazy, I know... (nicolai)
971 dnl ================================================
973 dnl compile-command: "autoconf"