2 dnl Window Maker autoconf input.
8 dnl libtoolize --force --automake
9 dnl automake -a --gnu --include-deps
13 dnl Due to a bug in Autoconf 2.68 (apparently a regression), we need at least
14 dnl version 2.68b which includes this patch:
15 dnl http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=2b0d95faef68d7ed7c08b0edb9ff1c38728376fa
17 dnl Because the 2.69 was released only a few month later, let's just ask for it
21 AC_INIT(WindowMaker, 0.95.6, , WindowMaker, http://www.windowmaker.org/)
22 AC_CONFIG_SRCDIR(src/WindowMaker.h)
23 AC_CONFIG_MACRO_DIR([m4])
24 AC_CONFIG_HEADERS(config.h)
25 AM_INIT_AUTOMAKE([1.11 silent-rules])
27 AH_BOTTOM([#include "config-paths.h"])
29 dnl libtool library versioning
30 dnl =======================
36 dnl 1. Start with version information of ‘0:0:0’ for each libtool library.
37 dnl 2. Update the version information only immediately before a public
38 dnl release of your software. More frequent updates are unnecessary, and
39 dnl only guarantee that the current interface number gets larger faster.
40 dnl 3. If the library source code has changed at all since the last
41 dnl update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
42 dnl 4. If any interfaces have been added, removed, or changed since the
43 dnl last update, increment current, and set revision to 0.
44 dnl 5. If any interfaces have been added since the last public release,
45 dnl then increment age.
46 dnl 6. If any interfaces have been removed or changed since the last
47 dnl public release, then set age to 0.
53 WRASTER_VERSION=$WRASTER_CURRENT:$WRASTER_REVISION:$WRASTER_AGE
54 AC_SUBST(WRASTER_VERSION)
60 WINGS_VERSION=$WINGS_CURRENT:$WINGS_REVISION:$WINGS_AGE
61 AC_SUBST(WINGS_VERSION)
67 WUTIL_VERSION=$WUTIL_CURRENT:$WUTIL_REVISION:$WUTIL_AGE
68 AC_SUBST(WUTIL_VERSION)
71 dnl Checks for host/os name
72 dnl =======================
73 dnl AC_CANONICAL_HOST -- already done by AC_PROG_LIBTOOL
75 dnl Checks for programs.
76 dnl ===================
80 AC_PROG_GCC_TRADITIONAL
87 [AS_HELP_STRING([--enable-debug], [enable debugging options, @<:@default=no@:>@])],
88 [AS_CASE(["$enableval"],
91 [AC_MSG_ERROR([bad value $enableval for --enable-debug])] )],
93 AS_IF([test "x$debug" = "xyes"],
94 [dnl This flag should have already been detected and added, but if user
95 dnl provided an explicit CFLAGS it may not be the case
96 AS_IF([echo " $CFLAGS " | grep " -g " 2>&1 > /dev/null],
97 [@%:@ Debug symbol already activated],
98 [AX_CFLAGS_GCC_OPTION([-g])])
100 dnl This flag generally makes debugging nightmarish, remove it if present
101 CFLAGS="`echo "$CFLAGS" | sed -e 's/-fomit-frame-pointer *//' `"
103 dnl Enable internal debug code
104 CPPFLAGS="$CPPFLAGS -DDEBUG"
106 dnl When debug is not enabled, the user probably does not wants to keep
107 dnl assertions in the final program
108 CPPFLAGS="$CPPFLAGS -DNDEBUG"
112 AX_CFLAGS_GCC_OPTION(-Wall)
113 AX_CFLAGS_GCC_OPTION(-Wextra -Wno-sign-compare)
115 dnl The use of trampolines cause code that can crash on some secured OS, it is
116 dnl also known to be a source of crash if not used properly, in a more general
117 dnl way it tends to generate binary code that may not be optimal, and it is
118 dnl not compatible with the 'nested-func-to-macro' workaround
119 WM_CFLAGS_CHECK_FIRST([-Wtrampolines],
120 [-Werror=trampolines dnl try to generate an error if possible
121 -Wtrampolines dnl if not, try to fall back to a simple warning
124 AS_IF([test "x$debug" = "xyes"],
125 [dnl When debug is enabled, we try to activate more checks from
126 dnl the compiler. They are on independant check because the
127 dnl macro checks all the options at once, but we may have cases
128 dnl where some options are not supported and we don't want to
129 dnl loose all of them.
131 dnl clang, suggest parenthesis on bit operations that could be
132 dnl misunderstood due to C operator precedence
133 AX_CFLAGS_GCC_OPTION([-Wbitwise-op-parentheses])
135 dnl Points at code that gcc thinks is so complicated that gcc
136 dnl gives up trying to optimize, which probably also means it is
137 dnl too complicated to maintain
138 AX_CFLAGS_GCC_OPTION([-Wdisabled-optimization])
140 dnl Floating-point comparison is not a good idea
141 AX_CFLAGS_GCC_OPTION([-Wfloat-equal])
143 dnl clang warns about constants that may have portability issues due
144 dnl to the endianness of the host
145 AX_CFLAGS_GCC_OPTION([-Wfour-char-constants])
147 dnl clang warns about constant that may be too big to be portable
148 AX_CFLAGS_GCC_OPTION([-Wliteral-range])
150 dnl Try to report misuses of '&' versus '&&' and similar
151 AX_CFLAGS_GCC_OPTION([-Wlogical-op])
153 dnl clang, reports cases where the code assumes everyone is an
154 dnl expert in C operator precedence... which is unlikely!
155 AX_CFLAGS_GCC_OPTION([-Wlogical-op-parentheses])
157 dnl Reports declaration of global things that are done inside
158 dnl a local environment, instead of using the appropriate
160 AX_CFLAGS_GCC_OPTION([-Wnested-externs])
162 dnl Warn about constant strings that could pose portability issues
163 AX_CFLAGS_GCC_OPTION([-Woverlength-strings])
165 dnl Use of 'sizeof()' on inappropriate pointer types
166 AX_CFLAGS_GCC_OPTION([-Wpointer-arith])
168 dnl Having more than 1 prototype for a function makes code updates
169 dnl more difficult, so try to avoid it
170 AX_CFLAGS_GCC_OPTION([-Wredundant-decls])
172 dnl clang, detect some misuses of sizeof. We also count in our code
173 dnl on the use of the macro 'wlength' which contains a check if the
174 dnl compiler support C11's static_assert
175 AX_CFLAGS_GCC_OPTION([-Wsizeof-array-argument])
177 dnl Prototype of function must be explicit, no deprecated K&R syntax
178 dnl and no empty argument list which prevents compiler from doing
179 dnl type checking when using the function
180 WM_CFLAGS_GCC_OPTION_STRICTPROTO
182 dnl Proper attributes helps the compiler to produce better code
183 WM_CFLAGS_CHECK_FIRST([format attribute suggest],
184 [-Wsuggest-attribute=format dnl new gcc syntax
185 -Wmissing-format-attribute dnl old gcc syntax, clang
187 WM_CFLAGS_CHECK_FIRST([no-return attribute suggest],
188 [-Wsuggest-attribute=noreturn dnl gcc syntax
189 -Wmissing-noreturn dnl clang syntax
192 dnl GCC provides a couple of checks to detect incorrect macro uses
193 AX_CFLAGS_GCC_OPTION([-Wundef])
194 WM_CFLAGS_GCC_OPTION_UNUSEDMACROS
196 dnl clang reports stuff marked unused but which is actually used
197 AX_CFLAGS_GCC_OPTION([-Wused-but-marked-unused])
199 dnl When debug not enabled, we try to avoid some non-necessary
200 dnl messages from the compiler
202 dnl To support legacy X servers, we have sometime to use
203 dnl functions marked as deprecated. We do not wish our users
204 dnl to be worried about it
205 AX_CFLAGS_GCC_OPTION([-Wno-deprecated])
206 AX_CFLAGS_GCC_OPTION([-Wno-deprecated-declarations])
210 dnl Support for Nested Functions by the compiler
211 dnl ============================================
212 WM_PROG_CC_NESTEDFUNC
216 dnl =================
220 dnl Tracking on what is detected for final status
221 dnl =============================================
227 dnl Platform-specific Makefile setup
228 dnl ================================
230 [*-*-linux*|*-*-cygwin*|*-gnu*], [WM_OSDEP="linux" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"],
231 [*-*-freebsd*|*-k*bsd-gnu*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -DFREEBSD"],
232 [*-*-netbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DNETBSD"],
233 [*-*-openbsd*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DOPENBSD"],
234 [*-*-dragonfly*], [WM_OSDEP="bsd" ; CPPFLAGS="$CPPFLAGS -DDRAGONFLYBSD"],
235 [*-apple-darwin*], [WM_OSDEP="darwin"],
236 [*-*-solaris*], [WM_OSDEP="stub"], dnl solaris.c when done
238 AM_CONDITIONAL([WM_OSDEP_LINUX], [test "x$WM_OSDEP" = "xlinux"])
239 AM_CONDITIONAL([WM_OSDEP_BSD], [test "x$WM_OSDEP" = "xbsd"])
240 AM_CONDITIONAL([WM_OSDEP_DARWIN], [test "x$WM_OSDEP" = "xdarwin"])
241 AM_CONDITIONAL([WM_OSDEP_GENERIC], [test "x$WM_OSDEP" = "xstub"])
247 dnl move this earlier in the script... anyone know why this is handled
248 dnl in such a bizarre way?
250 test "x$prefix" = xNONE && prefix=$ac_default_prefix
251 dnl Let make expand exec_prefix.
252 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
255 _bindir=`eval echo $bindir`
256 _bindir=`eval echo $_bindir`
258 lib_search_path='-L${libdir}'
260 inc_search_path='-I${includedir}'
262 dnl ===============================================
263 dnl Specify paths to look for libraries and headers
264 dnl ===============================================
265 AC_ARG_WITH(libs-from, AS_HELP_STRING([--with-libs-from], [pass compiler flags to look for libraries]),
266 [lib_search_path="$withval $lib_search_path"])
268 AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags to look for header files]),
269 [inc_search_path="$withval $inc_search_path"])
274 AC_ARG_ENABLE([boehm-gc],
275 [AS_HELP_STRING([--enable-boehm-gc], [use Boehm GC instead of the default libc malloc() [default=no]])],
276 [AS_CASE(["$enableval"],
277 [yes], [with_boehm_gc=yes],
278 [no], [with_boehm_gc=no],
279 [AC_MSG_ERROR([bad value $enableval for --enable-boehm-gc])] )],
281 AS_IF([test "x$with_boehm_gc" = "xyes"],
282 AC_SEARCH_LIBS([GC_malloc], [gc],
283 [AC_DEFINE(USE_BOEHM_GC, 1, [Define if Boehm GC is to be used])],
284 [AC_MSG_FAILURE([--enable-boehm-gc specified but test for libgc failed])]))
289 AC_ARG_ENABLE([lcov],
290 [AS_HELP_STRING([--enable-lcov[=output-directory]], [enable coverage data generation using LCOV (GCC only) [default=no]])],
294 AS_IF([test "x$enable_lcov" != "xno"],
295 [AX_CFLAGS_GCC_OPTION(-fprofile-arcs -ftest-coverage)
296 AS_IF([test "x$enable_lcov" = "xyes"],
297 [lcov_output_directory="coverage-report"],
298 [lcov_output_directory="${enable_lcov}/coverage-report"])
299 AC_SUBST(lcov_output_directory)])
301 AM_CONDITIONAL([USE_LCOV], [test "x$enable_lcov" != "xno"])
304 dnl ============================
305 dnl Checks for library functions
306 dnl ============================
307 dnl not used anywhere
310 WM_FUNC_SECURE_GETENV
311 AC_CHECK_FUNCS(gethostname select poll strcasecmp strncasecmp \
312 setsid mallinfo mkstemp sysconf)
313 AC_SEARCH_LIBS([strerror], [cposix])
315 dnl nanosleep is generally available in standard libc, although not always the
316 dnl case. One known example is Solaris which needs -lrt
317 AC_SEARCH_LIBS([nanosleep], [rt], [],
318 [AC_MSG_ERROR([function 'nanosleep' not found, please report to wmaker-dev@lists.windowmaker.org])])
320 dnl the flag 'O_NOFOLLOW' for 'open' is used in WINGs
321 WM_FUNC_OPEN_NOFOLLOW
324 dnl Check for strlcat/strlcpy
325 dnl =========================
326 AC_ARG_WITH([libbsd],
327 [AS_HELP_STRING([--without-libbsd], [do not use libbsd for strlcat and strlcpy [default=check]])],
328 [AS_IF([test "x$with_libbsd" != "xno"],
335 AC_SEARCH_LIBS([strlcat],[$with_libbsd],
336 [AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcat is available])],
340 AC_SEARCH_LIBS([strlcpy],[$with_libbsd],
341 [AC_DEFINE(HAVE_STRLCAT, 1, [Define if strlcpy is available])],
348 AS_IF([test "x$ac_cv_search_strlcat" = "x-lbsd" -o "x$ac_cv_search_strlcpy" = "x-lbsd"],
350 AC_CHECK_HEADERS([bsd/string.h])]
354 dnl Check for OpenBSD kernel memory interface - kvm(3)
355 dnl ==================================================
356 AS_IF([test "x$WM_OSDEP" = "xbsd"],
357 AC_SEARCH_LIBS([kvm_openfiles], [kvm]) )
359 dnl Check for inotify
360 dnl =================
361 AC_CHECK_HEADERS(sys/inotify.h, AC_DEFINE(HAVE_INOTIFY, 1, Check for inotify))
365 dnl =================
366 AC_CHECK_HEADERS([syslog.h], [AC_DEFINE([HAVE_SYSLOG], [1], [Check for syslog])])
369 dnl Checks for header files.
370 dnl =======================
373 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h libintl.h poll.h malloc.h ctype.h \
377 dnl Checks for typedefs, structures, and compiler characteristics.
378 dnl ==============================================================
390 dnl AC_ARG_VAR(PKGCONFIG, [pkg-config command])
391 AC_CHECK_PROG(PKGCONFIG, pkg-config, pkg-config)
400 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
401 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
404 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
406 if test "$XGETTEXT" != ""; then
407 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
408 echo "xgettext isn't GNU version"
413 if test "$LINGUAS" != ""; then
414 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
415 AC_DEFINE(I18N, 1, [Internationalization (I18N) support (set by configure)])
417 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
421 echo "xgettext and libintl.a don't both exist; will not build i18n support"
432 dnl The Tower of Babel
433 dnl ==================
435 dnl List of supported locales
436 dnl =========================
437 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"
438 supported_wprefs_locales="bg ca cs de es et fi fr hr hu it ja ko nl pt ru sk zh_CN zh_TW"
439 supported_wings_locales="bg ca cs de fr hu nl sk"
440 supported_util_locales="de es fr nl pt"
442 for lang in $LINGUAS; do
444 for l in $supported_locales; do
445 if test "$l" = "$lang"; then
450 if test "$ok" = 1; then
451 MOFILES="$MOFILES $lang.mo"
453 echo "Locale $lang is not supported."
456 for l in $supported_wprefs_locales; do
457 if test "$l" = "$lang"; then
462 if test "$ok" = 1; then
463 WPMOFILES="$WPMOFILES $lang.mo"
466 for l in $supported_util_locales; do
467 if test "$l" = "$lang"; then
472 if test "$ok" = 1; then
473 UTILMOFILES="$UTILMOFILES $lang.mo"
476 for l in $supported_wings_locales; do
477 if test "$l" = "$lang"; then
482 if test "$ok" = 1; then
483 WINGSMOFILES="$WINGSMOFILES $lang.mo"
488 dnl Added by Oliver - Support for NLSDIR option
489 dnl ===========================================
490 AC_ARG_WITH(nlsdir, AS_HELP_STRING([--with-nlsdir=PATH], [specify where the locale stuff should go]))
492 if test "x$NLSDIR" = "x"; then
493 if test "x$with_nlsdir" != "x"; then
496 NLSDIR='$(prefix)/lib/locale'
501 AC_ARG_WITH(menu-textdomain, AS_HELP_STRING([--with-menu-textdomain=DOMAIN], [specify gettext domain used for menu translations]),
502 [if test "x$withval" != "xno"; then
503 menutextdomain=$withval
505 AC_SUBST(menutextdomain)
511 AC_SUBST(UTILMOFILES)
512 AC_SUBST(WINGSMOFILES)
513 AC_SUBST(supported_locales)
515 dnl ===========================================
516 dnl Stuff that uses X
517 dnl ===========================================
522 AC_MSG_ERROR([The path for the X11 files not found!
523 Make sure you have X and it's headers and libraries (the -devel packages
524 in Linux) installed.])
527 X_LIBRARY_PATH=$x_libraries
530 XLIBS="-lX11 $X_EXTRA_LIBS"
532 lib_search_path="$lib_search_path $XLFLAGS"
533 inc_search_path="$inc_search_path $XCFLAGS"
535 AC_SUBST(X_LIBRARY_PATH)
537 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
538 dnl by MANOME Tomonori
539 dnl ===========================================
541 AC_ARG_ENABLE(locale, AS_HELP_STRING([--disable-locale], [disable use of X locale support]),
544 if test "$use_locale" = yes; then
545 AC_CHECK_LIB(X11, _Xsetlocale,
546 AC_DEFINE(X_LOCALE, 1, [define if you want support for X window's X_LOCALE (set by configure)]),,
550 dnl Check whether XInternAtoms() exist
551 dnl ==================================
552 AC_CHECK_LIB(X11, XInternAtoms,
553 AC_DEFINE(HAVE_XINTERNATOMS, 1, [define if your X server has XInternAtoms() (set by configure)]),,
556 dnl Check whether XConvertCase() exist
557 dnl ==================================
558 AC_CHECK_LIB(X11, XConvertCase,
559 AC_DEFINE(HAVE_XCONVERTCASE, 1, [define if your X server has XConvertCase() (set by configure)]),,
562 dnl XKB keyboard language status
563 dnl ============================
564 AC_ARG_ENABLE(modelock, AS_HELP_STRING([--enable-modelock], [XKB keyboard language status support]),
565 AC_DEFINE(XKB_MODELOCK, 1, [whether XKB language MODELOCK should be enabled]))
567 dnl XDND Drag-nd-Drop support
568 dnl ============================
569 AC_ARG_ENABLE([xdnd],
570 [AS_HELP_STRING([--disable-xdnd], [disable Drag-nd-Drop support])],
571 [AS_CASE(["$enableval"],
573 [AC_MSG_ERROR([bad value $enableval for --disable-xdnd]) ]) ],
575 supported_xext="$supported_xext XDnD"
576 AC_DEFINE(XDND, 1, [whether Drag-nd-Drop support should be enabled])
581 AC_ARG_ENABLE([shape],
582 [AS_HELP_STRING([--disable-shape], [disable shaped window extension support])],
583 [AS_CASE(["$enableval"],
585 [AC_MSG_ERROR([bad value $enableval for --enable-shape]) ]) ],
592 [AS_HELP_STRING([--disable-shm], [disable usage of MIT-SHM extension])],
593 [AS_CASE(["$enableval"],
595 [AC_MSG_ERROR([bad value $enableval for --enable-shm]) ]) ],
599 dnl X Misceleanous Utility
600 dnl ======================
601 # the libXmu is used in WRaster
606 AC_ARG_ENABLE([xinerama],
607 [AS_HELP_STRING([--enable-xinerama], [enable Xinerama extension support])],
608 [AS_CASE(["$enableval"],
610 [AC_MSG_ERROR([bad value $enableval for --enable-xinerama]) ]) ],
611 [enable_xinerama=auto])
612 WM_XEXT_CHECK_XINERAMA
616 AC_ARG_ENABLE([randr],
617 [AS_HELP_STRING([--enable-randr], [enable RandR extension support (NOT recommended, buggy)])],
618 [AS_CASE(["$enableval"],
620 [AC_MSG_ERROR([bad value $enableval for --enable-randr]) ]) ],
625 dnl libWINGS uses math functions, check whether usage requires linking
631 dnl libWINGS uses FcPatternDel from libfontconfig
633 AC_MSG_CHECKING([for fontconfig library])
634 FCLIBS=`$PKGCONFIG fontconfig --libs`
635 if test "x$FCLIBS" = "x" ; then
636 AC_MSG_RESULT([not found])
638 AC_MSG_RESULT([found])
643 dnl Xft2 antialiased font support
644 dnl =============================
649 if test "x$PKGCONFIG" != x -a "`$PKGCONFIG xft; echo $?`" = 0; then
650 XFTCONFIG="$PKGCONFIG xft"
653 AC_CHECK_PROG(XFTCONFIG, xft-config, xft-config)
656 AC_MSG_CHECKING([for the Xft2 library])
658 if test "x$XFTCONFIG" != x; then
659 XFTLIBS=`$XFTCONFIG --libs`
660 XFTFLAGS=`$XFTCONFIG --cflags`
661 AC_MSG_RESULT([found])
663 AC_MSG_RESULT([not found])
665 echo "ERROR!!! libXft2 is not installed or could not be found."
666 echo " Xft2 is a requirement for building Window Maker."
667 echo " Please install it (along with fontconfig) before continuing."
676 dnl The macro below will use $XFTFLAGS (defined above) to find Xft.h
678 WM_CHECK_XFT_VERSION($minXFT, goodxft=yes, goodxft=no)
680 if test "$goodxft" = no; then
682 echo "ERROR!!! libXft on this system is an old version."
683 echo " Please consider upgrading to at least version ${minXFT}."
694 AC_ARG_ENABLE(pango, AS_HELP_STRING([--enable-pango], [enable Pango text layout support]),
695 pango=$enableval, pango=no)
699 if test "$pango" = yes; then
700 PANGOLIBS=`$PKGCONFIG pangoxft --libs`
701 PANGOFLAGS=`$PKGCONFIG pangoxft --cflags`
702 if test "x$PANGOLIBS" = "x" ; then
703 AC_MSG_RESULT([not found])
705 AC_DEFINE(USE_PANGO, 1, [Define if Pango is to be used])
706 AC_MSG_RESULT([found])
709 inc_search_path="$inc_search_path $PANGOFLAGS"
712 dnl ==============================================
713 dnl Graphic Format Libraries
714 dnl ==============================================
719 [AS_HELP_STRING([--disable-xpm], [disable use of XPM pixmaps through libXpm])],
720 [AS_CASE(["$enableval"],
722 [AC_MSG_ERROR([bad value $enableval for --enable-xpm])] )],
732 AC_SUBST(X_EXTRA_LIBS)
734 dnl ===============================================
735 dnl End of stuff that uses X
736 dnl ===============================================
741 AS_IF([test "x$LIBEXIF" != "x"],
742 [AC_DEFINE(HAVE_EXIF, 1, [Define if EXIF can be used])])
747 [AS_HELP_STRING([--disable-png], [disable PNG support through libpng])],
748 [AS_CASE(["$enableval"],
750 [AC_MSG_ERROR([bad value $enableval for --enable-png])] )],
757 AC_ARG_ENABLE([jpeg],
758 [AS_HELP_STRING([--disable-jpeg], [disable JPEG support through libjpeg])],
759 [AS_CASE(["$enableval"],
761 [AC_MSG_ERROR([bad value $enableval for --enable-jpeg])] )],
769 [AS_HELP_STRING([--disable-gif], [disable GIF support through libgif or libungif])],
770 [AS_CASE(["$enableval"],
772 [AC_MSG_ERROR([bad value $enableval for --enable-gif])] )],
779 AC_ARG_ENABLE([tiff],
780 [AS_HELP_STRING([--disable-tiff], [disable use of TIFF images through libtiff])],
781 [AS_CASE(["$enableval"],
783 [AC_MSG_ERROR([bad value $enableval for --enable-tiff])] )],
790 AC_ARG_ENABLE([webp],
791 [AS_HELP_STRING([--disable-webp], [disable WEBP support through libwebp])],
792 [AS_CASE(["$enableval"],
794 [AC_MSG_ERROR([bad value $enableval for --enable-webp])] )],
801 AC_ARG_ENABLE([magick],
802 [AS_HELP_STRING([--disable-magick], [disable MAGICK support through libMagickWand])],
803 [AS_CASE(["$enableval"],
805 [AC_MSG_ERROR([bad value $enableval for --enable-magick])] )],
806 [enable_magick=auto])
807 WM_IMGFMT_CHECK_MAGICK
812 # The PPM format is always enabled because we have built-in support for the format
813 # We are not using any external library like libppm
814 supported_gfx="$supported_gfx builtin-PPM"
817 # Choice of the default format for icons
818 AS_IF([test "x$enable_tiff" != "xno"],
823 LIBRARY_SEARCH_PATH="$lib_search_path"
824 HEADER_SEARCH_PATH="$inc_search_path"
826 AC_SUBST(LIBRARY_SEARCH_PATH)
827 AC_SUBST(HEADER_SEARCH_PATH)
832 AM_CONDITIONAL([ICON_EXT_XPM], [test "x$ICONEXT" = "xxpm"])
833 AM_CONDITIONAL([ICON_EXT_TIFF], [test "x$ICONEXT" = "xtiff"])
836 dnl ==============================================
837 dnl End of Graphic Format Libraries
838 dnl ==============================================
842 dnl stdlib.h is checked here, because of conflict in jpeglib.h
843 AC_CHECK_HEADERS(stdlib.h)
845 # AC_PREFIX_PROGRAM(wmaker)
847 dnl Support for PIXMAPDIR option
848 dnl ============================
849 AC_ARG_WITH(pixmapdir, AS_HELP_STRING([--with-pixmapdir=PATH], [specify where pixmaps are located [DATADIR/pixmaps]]))
851 if test "x$with_pixmapdir" != "x"; then
852 pixmapdir=$with_pixmapdir
854 pixmapdir='${datadir}/pixmaps'
859 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
860 dnl ==============================================
862 AC_ARG_WITH(gnustepdir, AS_HELP_STRING([--with-gnustepdir=PATH], [specify the directory for GNUstep applications]))
864 if test "x`echo $with_gnustepdir | grep ^/`" != "x"; then
865 appspath=$with_gnustepdir
868 if test "x$appspath$GNUSTEP_LOCAL_ROOT" = "x"; then
869 wprefs_base_dir=${prefix}
870 wprefs_datadir="${datadir}/WPrefs"
871 wprefs_bindir="${bindir}"
875 if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
876 gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
877 gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
880 wprefs_base_dir=$gnustepdir/Applications
881 wprefs_datadir=$wprefs_base_dir/WPrefs.app
882 wprefs_bindir=$wprefs_base_dir/WPrefs.app
885 AC_SUBST(wprefs_datadir)
886 AC_SUBST(wprefs_bindir)
889 dnl Enable User Defined Menu thing
890 dnl ==============================
891 AC_ARG_ENABLE(usermenu, AS_HELP_STRING([--enable-usermenu], [user defined menus for applications]),
892 if test "$enableval" = yes; then
893 AC_DEFINE(USER_MENU, 1, [define if you want user defined menus for applications])
900 dnl Add the post-poned compilation options
901 dnl ======================================
902 WM_CFLAGS_GCC_OPTION_POSTPONED
905 AC_OUTPUT(Makefile po/Makefile util/Makefile util/po/Makefile test/Makefile \
906 WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/Makefile \
907 WINGs/Examples/Makefile WINGs/Resources/Makefile WINGs/Tests/Makefile \
908 WINGs/Extras/Makefile WINGs/po/Makefile \
909 wmlib/Makefile wrlib/Makefile wrlib/tests/Makefile \
910 src/Makefile src/wconfig.h \
911 doc/Makefile doc/sk/Makefile doc/cs/Makefile \
913 WindowMaker/Makefile WindowMaker/Backgrounds/Makefile \
914 WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile \
915 WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile \
916 WindowMaker/Styles/Makefile WindowMaker/Themes/Makefile \
917 WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
918 WPrefs.app/po/Makefile )
921 dnl Output some helpful data for compiling wraster and WINGs/WUtil apps
922 dnl ===================================================================
924 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
925 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
926 dnl | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
928 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
931 AC_SUBST(lib_search_path)
932 AC_SUBST(inc_search_path)
935 dnl Spit out the configuration
936 dnl ==========================
938 if test "x$MOFILES" = "x"; then
944 if test "x$MOFILES" = "x"; then
947 languages=`echo $MOFILES | sed 's/.mo//g'`
951 echo "Window Maker was configured as follows:"
953 echo "Installation path prefix : $prefix"
954 echo "Installation path for binaries : $_bindir"
955 echo "Installation path for libraries : $libdir"
956 echo "Installation path for WPrefs.app : $wprefs_base_dir" | sed -e 's|\${prefix}|'"$prefix|"
957 echo "Supported X extensions: :$supported_xext"
958 echo "Supported graphic format libraries :$supported_gfx"
959 echo "Unsupported features :$unsupported"
960 echo "Antialiased text support in WINGs : $xft"
961 echo "Pango text layout support in WINGs : $pango"
962 echo "Translated message files to install : $mof"
963 dnl echo "Supported languages beside English : $languages"
964 if test "x$MOFILES" != "x"; then
965 echo "Installation path for translations : $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
967 AS_IF([test "x$debug" = "xyes"],
968 [AS_ECHO(["Debug enabled: CFLAGS = $CFLAGS"]) ])
971 AS_IF([test "x$wm_cv_prog_cc_nestedfunc" != "xyes"],
972 [AC_MSG_WARN([[Your compiler does not support Nested Function, work-around enabled]])])
974 dnl WM_PRINT_REDCRAP_BUG_STATUS
976 AS_IF([test "x$enable_jpeg" = xno], [dnl
977 AS_ECHO(["WARNING WARNING WARNING WARNING WARNING WARNING WARNING"])
979 AS_ECHO(["JPEG support will not be included because the JPEG library is"])
980 AS_ECHO(["not installed correctly or was not found. Background images"])
981 AS_ECHO(["from themes will not display as they usually are JPEG files."])
983 AS_ECHO(["To fix, download and install the jpeg library and/or make sure you"])
984 AS_ECHO(["installed all jpeg related packages, SPECIALLY the development packages"])
985 AS_ECHO(["like jpeg-dev (if you use some prepackaged version of libjpeg)."])
987 AS_ECHO(["WARNING WARNING WARNING WARNING WARNING WARNING WARNING"])dnl
991 dnl This is for Emacs. I'm lazy, I know... (nicolai)
992 dnl ================================================
994 dnl compile-command: "autoconf"