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.9],[wmaker-dev@googlegroups.com],[WindowMaker],[http://www.windowmaker.org/])
38 AC_CONFIG_MACRO_DIR([m4])
39 AC_CONFIG_HEADERS([config.h])
41 dnl We need the EXTRA_xxx_DEPENDENCIES keyword in Makefiles which have been
42 dnl introduced in the version 1.11.3; because the 1.12 was realeased shortly
43 dnl after, we just ask for it
44 AM_INIT_AUTOMAKE([1.12 silent-rules -Wno-portability])
46 dnl Reference file used by 'configure' to make sure the path to sources is valid
47 AC_CONFIG_SRCDIR([src/WindowMaker.h])
49 dnl Include at the end of 'config.h', this file is generated by top-level Makefile
50 AH_BOTTOM([@%:@include "config-paths.h"])
53 dnl libtool library versioning
54 dnl ==========================
60 dnl 1. Start with version information of ‘0:0:0’ for each libtool library.
61 dnl 2. Update the version information only immediately before a public
62 dnl release of your software. More frequent updates are unnecessary, and
63 dnl only guarantee that the current interface number gets larger faster.
64 dnl 3. If the library source code has changed at all since the last
65 dnl update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
66 dnl 4. If any interfaces have been added, removed, or changed since the
67 dnl last update, increment current, and set revision to 0.
68 dnl 5. If any interfaces have been added since the last public release,
69 dnl then increment age.
70 dnl 6. If any interfaces have been removed or changed since the last
71 dnl public release, then set age to 0.
77 WRASTER_VERSION=$WRASTER_CURRENT:$WRASTER_REVISION:$WRASTER_AGE
78 AC_SUBST(WRASTER_VERSION)
84 WINGS_VERSION=$WINGS_CURRENT:$WINGS_REVISION:$WINGS_AGE
85 AC_SUBST(WINGS_VERSION)
91 WUTIL_VERSION=$WUTIL_CURRENT:$WUTIL_REVISION:$WUTIL_AGE
92 AC_SUBST(WUTIL_VERSION)
95 dnl Checks for programs
96 dnl ===================
100 AC_PROG_GCC_TRADITIONAL
104 dnl Debugging Options
105 dnl =================
106 AC_ARG_ENABLE([debug],
107 [AS_HELP_STRING([--enable-debug], [enable debugging options, @<:@default=no@:>@])],
108 [AS_CASE(["$enableval"],
111 [AC_MSG_ERROR([bad value $enableval for --enable-debug])] )],
113 AS_IF([test "x$debug" = "xyes"],
114 [dnl This flag should have already been detected and added, but if user
115 dnl provided an explicit CFLAGS it may not be the case
116 AS_IF([echo " $CFLAGS " | grep " -g " 2>&1 > /dev/null],
117 [@%:@ Debug symbol already activated],
118 [AX_CFLAGS_GCC_OPTION([-g])])
120 dnl This flag generally makes debugging nightmarish, remove it if present
121 CFLAGS="`echo "$CFLAGS" | sed -e 's/-fomit-frame-pointer *//' `"
123 dnl Enable internal debug code
124 CPPFLAGS="$CPPFLAGS -DDEBUG"
126 dnl When debug is not enabled, the user probably does not wants to keep
127 dnl assertions in the final program
128 CPPFLAGS="$CPPFLAGS -DNDEBUG"
132 AX_CFLAGS_GCC_OPTION([-Wall])
133 AX_CFLAGS_GCC_OPTION([-Wextra -Wno-sign-compare])
135 dnl The use of trampolines cause code that can crash on some secured OS, it is
136 dnl also known to be a source of crash if not used properly, in a more general
137 dnl way it tends to generate binary code that may not be optimal, and it is
138 dnl not compatible with the 'nested-func-to-macro' workaround
139 WM_CFLAGS_CHECK_FIRST([-Wtrampolines],
140 [-Werror=trampolines dnl try to generate an error if possible
141 -Wtrampolines dnl if not, try to fall back to a simple warning
144 AS_IF([test "x$debug" = "xyes"],
145 [dnl When debug is enabled, we try to activate more checks from
146 dnl the compiler. They are on independant check because the
147 dnl macro checks all the options at once, but we may have cases
148 dnl where some options are not supported and we don't want to
149 dnl loose all of them.
151 dnl clang, suggest parenthesis on bit operations that could be
152 dnl misunderstood due to C operator precedence
153 AX_CFLAGS_GCC_OPTION([-Wbitwise-op-parentheses])
155 dnl Points at code that gcc thinks is so complicated that gcc
156 dnl gives up trying to optimize, which probably also means it is
157 dnl too complicated to maintain
158 AX_CFLAGS_GCC_OPTION([-Wdisabled-optimization])
160 dnl Because of C's type promotion, the compiler has to generate
161 dnl less optimal code when a double constant is used in a
163 AX_CFLAGS_GCC_OPTION([-Wdouble-promotion])
165 dnl Floating-point comparison is not a good idea
166 AX_CFLAGS_GCC_OPTION([-Wfloat-equal])
168 dnl clang warns about constants that may have portability issues due
169 dnl to the endianness of the host
170 AX_CFLAGS_GCC_OPTION([-Wfour-char-constants])
172 dnl clang warns about constant that may be too big to be portable
173 AX_CFLAGS_GCC_OPTION([-Wliteral-range])
175 dnl Try to report misuses of '&' versus '&&' and similar
176 AX_CFLAGS_GCC_OPTION([-Wlogical-op])
178 dnl clang, reports cases where the code assumes everyone is an
179 dnl expert in C operator precedence... which is unlikely!
180 AX_CFLAGS_GCC_OPTION([-Wlogical-op-parentheses])
182 dnl Reports declaration of global things that are done inside
183 dnl a local environment, instead of using the appropriate
185 AX_CFLAGS_GCC_OPTION([-Wnested-externs])
187 dnl Warn about constant strings that could pose portability issues
188 AX_CFLAGS_GCC_OPTION([-Woverlength-strings])
190 dnl Use of 'sizeof()' on inappropriate pointer types
191 AX_CFLAGS_GCC_OPTION([-Wpointer-arith])
193 dnl Having more than 1 prototype for a function makes code updates
194 dnl more difficult, so try to avoid it
195 AX_CFLAGS_GCC_OPTION([-Wredundant-decls])
197 dnl clang, detect some misuses of sizeof. We also count in our code
198 dnl on the use of the macro 'wlength' which contains a check if the
199 dnl compiler support C11's static_assert
200 AX_CFLAGS_GCC_OPTION([-Wsizeof-array-argument])
202 dnl Prototype of function must be explicit, no deprecated K&R syntax
203 dnl and no empty argument list which prevents compiler from doing
204 dnl type checking when using the function
205 WM_CFLAGS_GCC_OPTION_STRICTPROTO
207 dnl Proper attributes helps the compiler to produce better code
208 WM_CFLAGS_CHECK_FIRST([format attribute suggest],
209 [-Wsuggest-attribute=format dnl new gcc syntax
210 -Wmissing-format-attribute dnl old gcc syntax, clang
212 WM_CFLAGS_CHECK_FIRST([no-return attribute suggest],
213 [-Wsuggest-attribute=noreturn dnl gcc syntax
214 -Wmissing-noreturn dnl clang syntax
217 dnl GCC provides a couple of checks to detect incorrect macro uses
218 AX_CFLAGS_GCC_OPTION([-Wundef])
219 WM_CFLAGS_GCC_OPTION_UNUSEDMACROS
221 dnl clang reports stuff marked unused but which is actually used
222 AX_CFLAGS_GCC_OPTION([-Wused-but-marked-unused])
224 dnl When debug not enabled, we try to avoid some non-necessary
225 dnl messages from the compiler
227 dnl To support legacy X servers, we have sometime to use
228 dnl functions marked as deprecated. We do not wish our users
229 dnl to be worried about it
230 AX_CFLAGS_GCC_OPTION([-Wno-deprecated])
231 AX_CFLAGS_GCC_OPTION([-Wno-deprecated-declarations])
235 dnl Support for Nested Functions by the compiler
236 dnl ============================================
237 WM_PROG_CC_NESTEDFUNC
242 dnl they are used by util/wmiv
246 dnl Tracking on what is detected for final status
247 dnl =============================================
254 dnl Platform-specific Makefile setup
255 dnl ================================
257 [*-*-linux*|*-*-cygwin*|*-gnu*], [WM_OSDEP="linux" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"],
258 [*-*-freebsd*|*-k*bsd-gnu*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -DFREEBSD"],
259 [*-*-netbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DNETBSD"],
260 [*-*-openbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DOPENBSD"],
261 [*-*-dragonfly*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DDRAGONFLYBSD"],
262 [*-apple-darwin*], [WM_OSDEP="darwin"],
263 [*-*-solaris*], [WM_OSDEP="stub"], dnl solaris.c when done
265 AM_CONDITIONAL([WM_OSDEP_LINUX], [test "x$WM_OSDEP" = "xlinux"])
266 AM_CONDITIONAL([WM_OSDEP_BSD], [test "x$WM_OSDEP" = "xbsd"])
267 AM_CONDITIONAL([WM_OSDEP_DARWIN], [test "x$WM_OSDEP" = "xdarwin"])
268 AM_CONDITIONAL([WM_OSDEP_GENERIC], [test "x$WM_OSDEP" = "xstub"])
274 dnl move this earlier in the script... anyone know why this is handled
275 dnl in such a bizarre way?
277 test "x$prefix" = xNONE && prefix=$ac_default_prefix
278 dnl Let make expand exec_prefix.
279 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
282 _bindir=`eval echo $bindir`
283 _bindir=`eval echo $_bindir`
284 _libdir=`eval echo $libdir`
285 _libdir=`eval echo $_libdir`
287 dnl ===============================================
288 dnl Specify paths to look for libraries and headers
289 dnl ===============================================
290 AC_ARG_WITH(libs-from, AS_HELP_STRING([--with-libs-from], [pass compiler flags to look for libraries]),
291 [lib_search_path="$withval"], [lib_search_path='-L${libdir}'])
293 AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags to look for header files]),
294 [inc_search_path="$withval"], [inc_search_path='-I${includedir}'])
297 dnl Features Configuration
298 dnl ======================
299 AC_ARG_ENABLE([animations],
300 [AS_HELP_STRING([--disable-animations], [disable permanently animations @<:@default=enabled@:>@])],
301 [AS_CASE(["$enableval"],
303 [AC_MSG_ERROR([bad value $enableval for --enable-animations])])],
304 [enable_animations="yes"])
305 AS_IF([test "x$enable_animations" = "xno"],
306 [unsupported="$unsupported Animations"],
307 [AC_DEFINE([USE_ANIMATIONS], [1], [Defined when user did not request to disable animations])
308 supported_core="$supported_core Animations"])
311 AC_ARG_ENABLE([mwm-hints],
312 [AS_HELP_STRING([--disable-mwm-hints], [disable support for Motif WM hints @<:@default=enabled@:>@])],
313 [AS_CASE(["$enableval"],
315 [AC_MSG_ERROR([bad value $enableval for --enable-mwm-hints])])],
316 [enable_mwm_hints="yes"])
317 AS_IF([test "x$enable_mwm_hints" = "xno"],
318 [unsupported="$unsupported MWMHints"],
319 [AC_DEFINE([USE_MWM_HINTS], [1], [Defined when used did not request to disable Motif WM hints])
320 supported_core="$supported_core MWMHints"])
321 AM_CONDITIONAL([USE_MWM_HINTS], [test "x$enable_mwm_hints" != "xno"])
326 AC_ARG_ENABLE([boehm-gc],
327 [AS_HELP_STRING([--enable-boehm-gc], [use Boehm GC instead of the default libc malloc() [default=no]])],
328 [AS_CASE(["$enableval"],
329 [yes], [with_boehm_gc=yes],
330 [no], [with_boehm_gc=no],
331 [AC_MSG_ERROR([bad value $enableval for --enable-boehm-gc])] )],
333 AS_IF([test "x$with_boehm_gc" = "xyes"],
334 AC_SEARCH_LIBS([GC_malloc], [gc],
335 [AC_DEFINE(USE_BOEHM_GC, 1, [Define if Boehm GC is to be used])],
336 [AC_MSG_FAILURE([--enable-boehm-gc specified but test for libgc failed])]))
341 AC_ARG_ENABLE([lcov],
342 [AS_HELP_STRING([--enable-lcov[=output-directory]], [enable coverage data generation using LCOV (GCC only) [default=no]])],
346 AS_IF([test "x$enable_lcov" != "xno"],
347 [AX_CFLAGS_GCC_OPTION(-fprofile-arcs -ftest-coverage)
348 AS_IF([test "x$enable_lcov" = "xyes"],
349 [lcov_output_directory="coverage-report"],
350 [lcov_output_directory="${enable_lcov}/coverage-report"])
351 AC_SUBST(lcov_output_directory)])
353 AM_CONDITIONAL([USE_LCOV], [test "x$enable_lcov" != "xno"])
356 dnl ============================
357 dnl Checks for library functions
358 dnl ============================
361 WM_FUNC_SECURE_GETENV
362 AC_CHECK_FUNCS(gethostname select poll strcasecmp strncasecmp \
363 setsid mallinfo mkstemp sysconf)
364 AC_SEARCH_LIBS([strerror], [cposix])
366 dnl nanosleep is generally available in standard libc, although not always the
367 dnl case. One known example is Solaris which needs -lrt
368 AC_SEARCH_LIBS([nanosleep], [rt], [],
369 [AC_MSG_ERROR([function 'nanosleep' not found, please report to wmaker-dev@googlegroups.com])])
371 dnl the flag 'O_NOFOLLOW' for 'open' is used in WINGs
372 WM_FUNC_OPEN_NOFOLLOW
375 dnl Check for strlcat/strlcpy
376 dnl =========================
377 AC_ARG_WITH([libbsd],
378 [AS_HELP_STRING([--without-libbsd], [do not use libbsd for strlcat and strlcpy [default=check]])],
379 [AS_IF([test "x$with_libbsd" != "xno"],
386 AC_SEARCH_LIBS([strlcat],[$with_libbsd],
387 [AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcat is available])],
391 AC_SEARCH_LIBS([strlcpy],[$with_libbsd],
392 [AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcpy is available])],
399 AS_IF([test "x$ac_cv_search_strlcat" = "x-lbsd" -o "x$ac_cv_search_strlcpy" = "x-lbsd"],
401 AC_CHECK_HEADERS([bsd/string.h])]
406 dnl Check for OpenBSD kernel memory interface - kvm(3)
407 dnl ==================================================
408 AS_IF([test "x$WM_OSDEP" = "xbsd"],
409 AC_SEARCH_LIBS([kvm_openfiles], [kvm]) )
412 dnl Check for inotify
413 dnl =================
414 dnl It is used by WindowMaker to reload automatically the configuration when the
415 dnl user changed it using WPref or wdwrite
416 AC_CHECK_HEADERS([sys/inotify.h],
417 [AC_DEFINE([HAVE_INOTIFY], [1], [Check for inotify])])
422 dnl It is used by WUtil to log the wwarning, werror and wfatal
423 AC_CHECK_HEADERS([syslog.h], [AC_DEFINE([HAVE_SYSLOG], [1], [Check for syslog])])
426 dnl Checks for header files
427 dnl =======================
430 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h libintl.h poll.h malloc.h ctype.h \
434 dnl Checks for typedefs, structures, and compiler characteristics
435 dnl =============================================================
447 AS_IF([test -z "$PKG_CONFIG"],[AC_MSG_ERROR([pkg-config is required.])])
451 dnl Internationalization
452 dnl ====================
453 dnl Detect the language for translations to be installed and check
454 dnl that the gettext environment works
457 WM_I18N_MENUTEXTDOMAIN
458 WM_LIBRARY_CONSTRUCTORS
460 dnl ===========================================
461 dnl Stuff that uses X
462 dnl ===========================================
466 AS_IF([test "x$no_x" = "xyes"],
467 [AC_MSG_ERROR([The path for the X11 files not found!
468 Make sure you have X and its headers and libraries (the -devel packages
469 in Linux) installed.])])
471 X_LIBRARY_PATH=$x_libraries
474 XLIBS="-lX11 $X_EXTRA_LIBS"
476 lib_search_path="$lib_search_path $XLFLAGS"
477 inc_search_path="$inc_search_path $XCFLAGS"
479 AC_SUBST(X_LIBRARY_PATH)
482 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
483 dnl by MANOME Tomonori
484 dnl ===========================================
489 dnl Check whether XInternAtoms() exist
490 dnl ==================================
491 AC_CHECK_LIB([X11], [XInternAtoms],
492 [AC_DEFINE([HAVE_XINTERNATOMS], [1],
493 [define if your X server has XInternAtoms() (set by configure)])],
494 [], [$XLFLAGS $XLIBS])
497 dnl Check whether XConvertCase() exist
498 dnl ==================================
499 AC_CHECK_LIB([X11], [XConvertCase],
500 [AC_DEFINE([HAVE_XCONVERTCASE], [1],
501 [define if your X server has XConvertCase() (set by configure)])],
502 [], [$XLFLAGS $XLIBS])
505 dnl XKB keyboard language status
506 dnl ============================
507 AC_ARG_ENABLE([modelock],
508 [AS_HELP_STRING([--enable-modelock], [XKB keyboard language status support])],
509 [AS_CASE([$enableval],
511 [AC_MSG_ERROR([bad value '$enableval' for --enable-modelock])])],
512 [enable_modelock=no])
513 AS_IF([test "x$enable_modelock" = "xyes"],
514 [AC_DEFINE([XKB_MODELOCK], [1], [whether XKB language MODELOCK should be enabled]) ])
517 dnl XDND Drag-nd-Drop support
518 dnl =========================
519 AC_ARG_ENABLE([xdnd],
520 [AS_HELP_STRING([--disable-xdnd], [disable support for Drag-and-Drop on the dock @<:@default=enabled@:>@])],
521 [AS_CASE(["$enableval"],
523 [AC_MSG_ERROR([bad value $enableval for --disable-xdnd]) ]) ],
525 AS_IF([test "x$enable_xdnd" = "xyes"],
526 [supported_core="$supported_core XDnD"
527 AC_DEFINE([USE_DOCK_XDND], [1], [whether Drag-and-Drop on the dock should be enabled])],
528 [unsupported="$unsupported XDnd"])
529 AM_CONDITIONAL([USE_DOCK_XDND], [test "x$enable_xdnd" != "xno"])
532 dnl Support for ICCCM 2.0 Window Manager replacement
533 dnl ================================================
534 AC_ARG_ENABLE([wmreplace],
535 [AS_HELP_STRING([--enable-wmreplace], [support for ICCCM window manager replacement])],
536 [AS_CASE([$enableval],
538 [AC_MSG_ERROR([bad value '$enableval' for --enable-wmreplace])])],
539 [enable_wmreplace=no])
540 AS_IF([test "x$enable_wmreplace" = "xyes"],
541 [AC_DEFINE([USE_ICCCM_WMREPLACE], [1],
542 [define to support ICCCM protocol for window manager replacement])
543 supported_xext="$supported_xext WMReplace"])
548 AC_ARG_ENABLE([shape],
549 [AS_HELP_STRING([--disable-shape], [disable shaped window extension support])],
550 [AS_CASE(["$enableval"],
552 [AC_MSG_ERROR([bad value $enableval for --enable-shape]) ]) ],
560 [AS_HELP_STRING([--disable-shm], [disable usage of MIT-SHM extension])],
561 [AS_CASE(["$enableval"],
563 [AC_MSG_ERROR([bad value $enableval for --enable-shm]) ]) ],
568 dnl X Misceleanous Utility
569 dnl ======================
570 dnl the libXmu is used in WRaster
576 AC_ARG_ENABLE([xinerama],
577 [AS_HELP_STRING([--enable-xinerama], [enable Xinerama extension support])],
578 [AS_CASE(["$enableval"],
580 [AC_MSG_ERROR([bad value $enableval for --enable-xinerama]) ]) ],
581 [enable_xinerama=auto])
582 WM_XEXT_CHECK_XINERAMA
587 AC_ARG_ENABLE([randr],
588 [AS_HELP_STRING([--enable-randr], [enable RandR extension support (NOT recommended, buggy)])],
589 [AS_CASE(["$enableval"],
591 [AC_MSG_ERROR([bad value $enableval for --enable-randr]) ]) ],
598 dnl libWINGS uses math functions, check whether usage requires linking
605 dnl libWINGS uses FcPatternDel from libfontconfig
606 AC_MSG_CHECKING([for fontconfig library])
607 FCLIBS=`$PKG_CONFIG fontconfig --libs`
608 if test "x$FCLIBS" = "x" ; then
609 AC_MSG_RESULT([not found])
611 AC_MSG_RESULT([found])
616 dnl Xft2 antialiased font support
617 dnl =============================
622 if test "x$PKG_CONFIG" != x -a "`$PKG_CONFIG xft; echo $?`" = 0; then
623 XFTCONFIG="$PKG_CONFIG xft"
626 AC_CHECK_PROG(XFTCONFIG, xft-config, xft-config)
629 AC_MSG_CHECKING([for the Xft2 library])
631 if test "x$XFTCONFIG" != x; then
632 XFTLIBS=`$XFTCONFIG --libs`
633 XFTFLAGS=`$XFTCONFIG --cflags`
634 AC_MSG_RESULT([found])
636 AC_MSG_RESULT([not found])
638 echo "ERROR!!! libXft2 is not installed or could not be found."
639 echo " Xft2 is a requirement for building Window Maker."
640 echo " Please install it (along with fontconfig) before continuing."
649 dnl The macro below will use $XFTFLAGS (defined above) to find Xft.h
651 WM_CHECK_XFT_VERSION($minXFT, goodxft=yes, goodxft=no)
653 if test "$goodxft" = no; then
655 echo "ERROR!!! libXft on this system is an old version."
656 echo " Please consider upgrading to at least version ${minXFT}."
667 AC_ARG_ENABLE(pango, AS_HELP_STRING([--enable-pango], [enable Pango text layout support]),
668 pango=$enableval, pango=no)
672 if test "$pango" = yes; then
673 PANGOLIBS=`$PKG_CONFIG pangoxft --libs`
674 PANGOFLAGS=`$PKG_CONFIG pangoxft --cflags`
675 if test "x$PANGOLIBS" = "x" ; then
676 AC_MSG_RESULT([not found])
678 AC_DEFINE(USE_PANGO, 1, [Define if Pango is to be used])
679 AC_MSG_RESULT([found])
682 inc_search_path="$inc_search_path $PANGOFLAGS"
685 dnl ==============================================
686 dnl Graphic Format Libraries
687 dnl ==============================================
692 [AS_HELP_STRING([--disable-xpm], [disable use of XPM pixmaps through libXpm])],
693 [AS_CASE(["$enableval"],
695 [AC_MSG_ERROR([bad value $enableval for --enable-xpm])] )],
705 AC_SUBST(X_EXTRA_LIBS)
707 dnl ===============================================
708 dnl End of stuff that uses X
709 dnl ===============================================
714 AS_IF([test "x$LIBEXIF" != "x"],
715 [AC_DEFINE(HAVE_EXIF, 1, [Define if EXIF can be used])])
721 [AS_HELP_STRING([--disable-png], [disable PNG support through libpng])],
722 [AS_CASE(["$enableval"],
724 [AC_MSG_ERROR([bad value $enableval for --enable-png])] )],
731 AC_ARG_ENABLE([jpeg],
732 [AS_HELP_STRING([--disable-jpeg], [disable JPEG support through libjpeg])],
733 [AS_CASE(["$enableval"],
735 [AC_MSG_ERROR([bad value $enableval for --enable-jpeg])] )],
743 [AS_HELP_STRING([--disable-gif], [disable GIF support through libgif or libungif])],
744 [AS_CASE(["$enableval"],
746 [AC_MSG_ERROR([bad value $enableval for --enable-gif])] )],
753 AC_ARG_ENABLE([tiff],
754 [AS_HELP_STRING([--disable-tiff], [disable use of TIFF images through libtiff])],
755 [AS_CASE(["$enableval"],
757 [AC_MSG_ERROR([bad value $enableval for --enable-tiff])] )],
764 AC_ARG_ENABLE([webp],
765 [AS_HELP_STRING([--disable-webp], [disable WEBP support through libwebp])],
766 [AS_CASE(["$enableval"],
768 [AC_MSG_ERROR([bad value $enableval for --enable-webp])] )],
775 AC_ARG_ENABLE([magick],
776 [AS_HELP_STRING([--disable-magick], [disable MAGICK support through libMagickWand])],
777 [AS_CASE(["$enableval"],
779 [AC_MSG_ERROR([bad value $enableval for --enable-magick])] )],
780 [enable_magick=auto])
781 WM_IMGFMT_CHECK_MAGICK
786 # The PPM format is always enabled because we have built-in support for the format
787 # We are not using any external library like libppm
788 supported_gfx="$supported_gfx builtin-PPM"
791 # Choice of the default format for icons
792 AS_IF([test "x$enable_tiff" != "xno"],
797 LIBRARY_SEARCH_PATH="$lib_search_path"
798 HEADER_SEARCH_PATH="$inc_search_path"
800 AC_SUBST(LIBRARY_SEARCH_PATH)
801 AC_SUBST(HEADER_SEARCH_PATH)
806 AM_CONDITIONAL([ICON_EXT_XPM], [test "x$ICONEXT" = "xxpm"])
807 AM_CONDITIONAL([ICON_EXT_TIFF], [test "x$ICONEXT" = "xtiff"])
810 dnl ==============================================
811 dnl End of Graphic Format Libraries
812 dnl ==============================================
816 dnl stdlib.h is checked here, because of conflict in jpeglib.h
817 AC_CHECK_HEADERS(stdlib.h)
820 dnl Support for PIXMAPDIR option
821 dnl ============================
822 AC_ARG_WITH([pixmapdir],
823 [AS_HELP_STRING([--with-pixmapdir=PATH], [specify where pixmaps are located [DATADIR/pixmaps]])],
825 [yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-pixmapdir, expected a path]) ],
826 [/*], [], dnl Absolute path, ok
827 [\$*], [], dnl Assumes it starts with a reference to $prefix or a similar variable, ok
828 [AC_MSG_ERROR([bad path '$withval' for pixmapdir, expecting an absolute path])])],
831 AS_IF([test "x$with_pixmapdir" != "x"],
832 [pixmapdir="$with_pixmapdir"],
833 [pixmapdir='${datadir}/pixmaps'])
834 AC_SUBST([pixmapdir])dnl
837 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
838 dnl ==============================================
839 AC_ARG_WITH([gnustepdir],
840 [AS_HELP_STRING([--with-gnustepdir=PATH], [specify the directory for GNUstep applications])],
842 [yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-gnustepdir, expected a path]) ],
843 [/*], [], dnl Absolute path, ok
844 [\$*], [], dnl Assumes it starts with a reference to $prefix or a similar variable, ok
845 [AC_MSG_ERROR([bad path '$withval' for gnustepdir, expecting an absolute path])])],
846 [dnl If no command-line option was given, we use $GNUSTEP_LOCAL_ROOT if it was set
847 with_gnustepdir="$GNUSTEP_LOCAL_ROOT"])
849 AS_IF([test "x$with_gnustepdir" = "x"],
850 [dnl No path specified, use default
851 wprefs_base_dir=${prefix}
852 wprefs_datadir="${datadir}/WPrefs"
853 wprefs_bindir="${bindir}"],
854 [dnl User specified base path
855 wprefs_base_dir="$with_gnustepdir/Applications"
856 wprefs_datadir="$wprefs_base_dir/WPrefs.app"
857 wprefs_bindir="$wprefs_base_dir/WPrefs.app"])
858 AC_SUBST([wprefs_datadir])dnl
859 AC_SUBST([wprefs_bindir])dnl
861 dnl Support for DEFSDATADIR option
862 dnl ============================
863 AC_ARG_WITH([defsdatadir],
864 [AS_HELP_STRING([--with-defsdatadir=PATH], [specify where global defaults are located [SYSCONFDIR/WindowMaker]])],
866 [yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-defsdatadir, expected a path]) ],
867 [/*], [], dnl Absolute path, ok
868 [\$*], [], dnl Assumes it starts with a reference to $prefix or a similar variable, ok
869 [AC_MSG_ERROR([bad path '$withval' for defsdatadir, expecting an absolute path])])],
870 [with_defsdatadir=""])
872 AS_IF([test "x$with_defsdatadir" != "x"],
873 [defsdatadir="$with_defsdatadir"],
874 [defsdatadir='${sysconfdir}/WindowMaker'])
875 AC_SUBST([defsdatadir])dnl
877 dnl Enable User Defined Menu thing
878 dnl ==============================
879 AC_ARG_ENABLE([usermenu],
880 [AS_HELP_STRING([--enable-usermenu], [user defined menus for applications])],
881 [AS_CASE([$enableval],
883 [AC_MSG_ERROR([bad value '$enableval' for --enable-usermenu])])],
884 [enable_usermenu=no])
885 AS_IF([test "x$enable_usermenu" = "xyes"],
886 [AC_DEFINE([USER_MENU], [1],
887 [define if you want user defined menus for applications])])
890 dnl Support for removing non-public symbols from a library
891 dnl ======================================================
895 dnl Add the post-poned compilation options
896 dnl ======================================
897 WM_CFLAGS_GCC_OPTION_POSTPONED
900 AC_SUBST(lib_search_path)
901 AC_SUBST(inc_search_path)
904 dnl Spit out the configuration
905 dnl ==========================
910 wrlib/Makefile wrlib/po/Makefile
914 WINGs/Makefile WINGs/WINGs/Makefile WINGs/po/Makefile
915 WINGs/Documentation/Makefile WINGs/Resources/Makefile WINGs/Extras/Makefile
916 WINGs/Examples/Makefile WINGs/Tests/Makefile
918 dnl Window Maker's core
919 src/Makefile src/wconfig.h po/Makefile
920 doc/Makefile doc/build/Makefile
921 doc/sk/Makefile doc/cs/Makefile doc/ru/Makefile
922 WindowMaker/Makefile WindowMaker/Backgrounds/Makefile
923 WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile
924 WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile
925 WindowMaker/Styles/Makefile WindowMaker/Themes/Makefile
928 WPrefs.app/Makefile WPrefs.app/po/Makefile
929 WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile
931 dnl Command-line utilities
932 util/Makefile util/po/Makefile
934 dnl Misceleanous stuff
942 dnl Provide a summary of the config
943 dnl ===============================
945 echo "Window Maker was configured as follows:"
947 echo "Installation path prefix : $prefix"
948 echo "Installation path for binaries : $_bindir"
949 echo "Installation path for libraries : $_libdir"
950 echo "Installation path for WPrefs.app : $wprefs_base_dir" | sed -e 's|\${prefix}|'"$prefix|"
951 echo "Supported core features: :$supported_core"
952 echo "Supported X extensions: :$supported_xext"
953 echo "Supported graphic format libraries :$supported_gfx"
954 echo "Unsupported features :$unsupported"
955 echo "Antialiased text support in WINGs : $xft"
956 echo "Pango text layout support in WINGs : $pango"
957 echo "Translated languages to support :$supported_locales"
958 AS_IF([test "x$debug" = "xyes"],
959 [AS_ECHO(["Debug enabled: CFLAGS = $CFLAGS"]) ])
962 AS_IF([test "x$wm_cv_prog_cc_nestedfunc" != "xyes"],
963 [AC_MSG_WARN([[Your compiler does not support Nested Function, work-around enabled]])])
965 AS_IF([test "x$supported_locales" = "x"],
966 [AC_MSG_WARN([[No language from \$LINGUAS are supported]])])
968 AS_IF([test "x$enable_jpeg" = xno], [dnl
969 AS_ECHO(["WARNING WARNING WARNING WARNING WARNING WARNING WARNING"])
971 AS_ECHO(["JPEG support will not be included because the JPEG library is"])
972 AS_ECHO(["not installed correctly or was not found. Background images"])
973 AS_ECHO(["from themes will not display as they usually are JPEG files."])
975 AS_ECHO(["To fix, download and install the jpeg library and/or make sure you"])
976 AS_ECHO(["installed all jpeg related packages, SPECIALLY the development packages"])
977 AS_ECHO(["like jpeg-dev (if you use some prepackaged version of libjpeg)."])
979 AS_ECHO(["WARNING WARNING WARNING WARNING WARNING WARNING WARNING"])dnl
982 AS_IF([test "x$LINGUAS" != "x"],
983 [AS_IF([test "X$wm_cv_library_constructors" = "Xlegacy"],
984 [AC_MSG_WARN([I18N is enabled, but library constructor attribute is not supported])
985 AS_ECHO([" If you have translation problems in lib WRaster, yet you know that the translation"])
986 AS_ECHO([" file (po) is valid, this could be a cause."])
992 dnl This is for Emacs. I'm lazy, I know... (nicolai)
993 dnl ================================================
995 dnl compile-command: "autoconf"