2006-03-02 Serge Koksharov <gentoosiast dog yandex dot ru>
[fvwm.git] / configure.ac
blobcbd2cdad57c81f3de35f443ac133614617427a5b
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 AC_PREREQ(2.53)
4 AC_INIT(fvwm/fvwm.c)
6 dnl should be "yes" only within the released distribution
7 ISRELEASED=no
8 version=2.5.17
9 VERSIONINFO=""
11 dnl date of the released version (please zero pad the day in the last 2 dates)
12 dnl for example: "4 February 2003", "04 Feb 2003", "2003-02-04"
13 RELDATELONG="20 January 2006"
14 RELDATESHORT="20-Jan-2006"
15 RELDATENUM="2006-01-20"
17 # constant variable settings
18 FVWMNAMEUCASE="FVWM"
19 FVWMNAMELONG="F? Virtual Window Manager"
20 FVWMHOMEPAGE="http://fvwm.org/"
21 FVWMFTP="ftp.fvwm.org"
22 FVWMFTPDIR="/pub/ftp"
23 FVWMALTFTP="metalab.unc.edu"
24 FVWMALTFTPDIR="/pub/Linux/X11/window-managers/"
25 FVWMLIST="fvwm@fvwm.org"
26 FVWMWORKERSLIST="fvwm-workers@fvwm.org"
27 FVWMWORKERSLISTLONG="fvwm workers list <fvwm-workers@fvwm.org>"
28 MANPAGE_PREAMBLE='.\" WARNING: This file was automatically generated.  Edit the .in file instead.'
30 if test x"$ISRELEASED" != xyes; then
31         VERSIONINFO=" (from cvs)"
32         RELDATELONG="(not released yet)"
33         RELDATESHORT="(not released yet)"
34         RELDATENUM="(not released yet)"
35 #       # migo: unfortunately this nice idea can not work, it is not updated.
36 #       # I will think more about this, maybe autoconf-2.50+ has a solution.
37 #       if test -d CVS/ -a -f CVS/Entries && \
38 #               date +%Y-%m-%d -d 'Wed Sep  4 12:36:50 2002' >/dev/null 2>&1
39 #       then
40 #               # this is not the exact date, but better than the current date
41 #               for file in CVS/Entries */CVS/Entries; do
42 #                       changelog_date="`cat $file | grep /ChangeLog/ \
43 #                               | cut -d/ -f4`"
44 #                       test x"$changelog_date" != x && \
45 #                       date +%Y-%m-%d -d "$changelog_date" >>changelog_dates
46 #               done
47 #               changelog_date=`cat changelog_dates | sort -r -u | head -1`
48 #               VERSIONINFO=" (from cvs $changelog_date)"
49 #               rm -f changelog_dates
50 #       fi
53 AC_SUBST(ISRELEASED)
54 AH_TEMPLATE([VERSIONINFO],[Additional version information, like date])
55 AC_DEFINE_UNQUOTED(VERSIONINFO, "$VERSIONINFO")
56 AC_SUBST(VERSIONINFO)
57 AC_SUBST(RELDATELONG)
58 AC_SUBST(RELDATESHORT)
59 AC_SUBST(RELDATENUM)
60 AC_SUBST(FVWMNAMEUCASE)
61 AC_SUBST(FVWMNAMELONG)
62 AC_SUBST(FVWMHOMEPAGE)
63 AC_SUBST(FVWMFTP)
64 AC_SUBST(FVWMFTPDIR)
65 AC_SUBST(FVWMALTFTP)
66 AC_SUBST(FVWMALTFTPDIR)
67 AC_SUBST(FVWMLIST)
68 AC_SUBST(FVWMWORKERSLIST)
69 AC_SUBST(FVWMWORKERSLISTLONG)
70 AC_SUBST(MANPAGE_PREAMBLE)
72 AM_INIT_AUTOMAKE(fvwm, ${version})
73 AM_CONFIG_HEADER(config.h)
75 # installation paths
76 FVWM_MODULESUBDIR=/${PACKAGE}/${VERSION}
77 FVWM_DATASUBDIR=/${PACKAGE}
79 AC_ARG_ENABLE(package-subdirs,
80   [  --disable-package-subdirs  do not create subdirs for modules and data],
81   [if test x"$enableval" = xno; then FVWM_MODULESUBDIR=""; FVWM_DATASUBDIR="";
82   fi], [])
84 FVWM_MODULEDIR='${libexecdir}'"$FVWM_MODULESUBDIR"
85 FVWM_DATADIR='${datadir}'"$FVWM_DATASUBDIR"
86 FVWM_PERLLIBDIR='${datadir}'"$FVWM_DATASUBDIR/perllib"
87 FVWM_CONFDIR='${sysconfdir}'dnl used _only_ to search for system.fvwm2rc
89 AC_SUBST(FVWM_MODULEDIR)
90 AC_SUBST(FVWM_DATADIR)
91 AC_SUBST(FVWM_PERLLIBDIR)
92 AC_SUBST(FVWM_CONFDIR)
94 AH_TEMPLATE([FVWM_CONFIG],
95   [Name of config filenames in FVWM_USERDIR and FVWM_DATADIR])
96 AC_DEFINE(FVWM_CONFIG, "config")
98 AH_TEMPLATE([FVWM2RC],[Suffix for old (to be deprecated) config filenames])
99 AC_DEFINE(FVWM2RC, ".fvwm2rc")
101 # Various configure-time options
103 AC_ARG_ENABLE(dmalloc,
104   [  --enable-dmalloc        enable support for the dmalloc debugging library],
105   [ac_cv_dmalloc="$enableval"],
106   [ac_cv_dmalloc="no"])
108 AC_ARG_ENABLE(efence,
109   [  --enable-efence         enable support for the efence debugging library],
110   [ac_cv_efence="$enableval"],
111   [ac_cv_efence="no"])
113 smr_SWITCH(command-log, command logging, off, FVWM_COMMAND_LOG,, [Produces a log of all executed commands and their times on stderr.])
114 AH_VERBATIM([_FVWM_COMMAND_LOG],
115 [#ifdef FVWM_COMMAND_LOG
116 #   define FVWM_DEBUG_TIME 1
117 #endif])
119 smr_SWITCH(debug-msgs, debugging messages, off, FVWM_DEBUG_MSGS,, [if you would like to see lots of debug messages from fvwm, for debugging
120    purposes, uncomment the next line])
121 AH_VERBATIM([_FVWM_DEBUG_MSGS],
122 [#ifdef FVWM_DEBUG_MSGS
123 #   define DBUG(x,y) fvwm_msg(DBG,x,y)
124 #else
125 #   define DBUG(x,y) /* no messages */
126 #endif])
128 dnl dummy: smr_SWITCH(sm, dummy for test script, on, SESSION)
130 # Need to know where X is, for finding some libraries (e.g. xpm)
131 no_x=""
132 AC_PATH_XTRA
133 if test x"$no_x" = x"yes"; then
134   echo
135   echo "X11 libraries or header files could not be found.  Please make"
136   echo "sure the X11 development package is installed on your system."
137   echo "If it is definitely installed, try setting the include and library"
138   echo "paths with the --x-include and --x-libraries options of configure."
139   echo "Fvwm can not be compiled without the X11 development environment."
140   echo
141   echo "Aborting."
142   echo
143   exit 1
146 # FIXME: default value should be derived from computed path to X
147 # includes.  Actually, this should probably not appear in configure
148 # at all: it is settable at runtime, and only confuses the issue to
149 # have it settable here too.
151 AC_MSG_CHECKING(imagepath)
152 val="/usr/include/X11/bitmaps:/usr/include/X11/pixmaps"
153 AC_ARG_WITH(imagepath,
154 [  --with-imagepath=PATH   colon-delimited search path for images],
155 [ case "$withval" in
156   no)
157     AC_MSG_ERROR([Can not disable image path.])
158     ;;
159   yes)
160     ;;
161   *)
162     val="$withval"
163     ;;
164   esac ])
165 AH_TEMPLATE([FVWM_IMAGEPATH],[Where to search for images.])
166 AC_DEFINE_UNQUOTED(FVWM_IMAGEPATH, "$val")
168 FVWM_IMAGEPATH="$val"
169 AC_SUBST(FVWM_IMAGEPATH)
170 AC_MSG_RESULT($val)
172 # Minimal checks for programs: enough to enable checking for
173 # optional libraries.
174 AC_PROG_CC
175 AC_PROG_CPP
177 # added -Wall for gcc, what about for others?
178 if test "x$GCC" = "xyes"; then
179   CFLAGS="-Wall -Wno-implicit-int $CFLAGS"
182 # Help finding POSIX functions on some systems
183 AC_ISC_POSIX
184 AC_MINIX
186 # catch -Werror and similar options when running configure
187 AC_TRY_COMPILE([#include <stdio.h>],
188 [int i; static j; int *p; char *c;
189   switch (*p = p = *c) { case 0: printf("%Q", c, p); }
190   *c = &i; c = p;
191   while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1));
192   return;], , AC_MSG_ERROR("
193 configure is not able to compile programs with warnings.  Please
194 remove all offending options like -Werror from the CFLAGS and
195 CPPFLAGS variables and run configure again."))
197 # check size of some types
198 ac_save_CFLAGS="$CFLAGS"
199 CFLAGS="$CFLAGS $X_CFLAGS"
200 AC_CHECK_SIZEOF(int)
201 AC_CHECK_SIZEOF(long)
202 AC_CHECK_SIZEOF(Window, , [#include <stdio.h>
203 #include <X11/X.h>])
204 AC_CHECK_SIZEOF(Pixel, , [#include <stdio.h>
205 #include <X11/Intrinsic.h>])
206 AC_CHECK_SIZEOF(void *)
207 CFLAGS="$ac_save_CFLAGS"
208 size_check_failed=""
209 if test "$ac_cv_sizeof_void_p" -gt "$ac_cv_sizeof_long"; then
210   echo "The type void * is bigger than long."
211   size_check_failed=1
213 if test "$ac_cv_sizeof_Window" -gt "$ac_cv_sizeof_long"; then
214   echo "The type Window is bigger than long."
215   size_check_failed=1
217 if test "$ac_cv_sizeof_Pixel" -gt "$ac_cv_sizeof_long"; then
218   echo "The type Pixel is bigger than long."
219   size_check_failed=1
221 if test x"$size_check_failed" = x1; then
222   echo "This is not supported by the module interface yet (make_new_vpacket)."
223   echo "Detected type sizes are: int($ac_cv_sizeof_int), long($ac_cv_sizeof_long), void*($ac_cv_sizeof_void_p), Window($ac_cv_sizeof_Window), Pixel($ac_cv_sizeof_Pixel)"
224   echo "Please report details of your system and this message to ${FVWMWORKERSLIST}."
225   echo
226   exit 1
229 # 'unset' is not portable, but setting to null is not enough to avoid using
230 # the cached value!  For ancient shells "rm config.cache" is a solution.
231 UNSET=true
232 if unset UNSET 2>/dev/null; then UNSET=unset; fi
235 # ********* multibyte
236 # FreeBSD has libxpg4, check this and use if found.
237 AC_CANONICAL_HOST
238 case $host_os in
239 freebsd*)
240         AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
242         ;;
243 esac
245 # *** pkg-config
246 # unfortunately, we need pkg-config for the detection of certain libs:
247 # - certain version of fontconfig (without fontconfig-config
248 AM_CHECK_PKG_CONFIG
250 # ********* session management
251 # Check the availability of SM; we don't have to add any extra libraries,
252 # since -lSM -lICE are in X_PRE_LIBS when they exist.
253 dnl [old check] AC_CHECK_LIB(SM, SmcOpenConnection, AC_DEFINE(SESSION), ,
254 dnl [old check]            [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
256 problem_sm=""
258 AC_ARG_ENABLE(sm,
259   [  --disable-sm            disable session management support],
260   [ if test x"$enableval" = xyes; then
261     with_sm="yes, check"
262   else
263     with_sm="no"
264     problem_sm=": Explicitly disabled"
265   fi ],
266   [ with_sm="not specified, check" ]
269 if test x"$with_sm" != xno; then
270   dnl Uncomment the following and comment out AC_CHECK_LIB to get --with-sm-*
271   dnl $UNSET ac_cv_lib_SM_SmcOpenConnection
272   dnl $UNSET ac_cv_header_X11_SM_SMlib_h
273   dnl smr_CHECK_LIB(sm, SM, adds session management support, SmcOpenConnection,
274   dnl   X11/SM/SMlib.h,
275   dnl   [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS], $X_CFLAGS)
276   dnl test "$sm_LIBS" && AC_DEFINE(SESSION)
278   $UNSET ac_cv_lib_SM_SmcOpenConnection
279   AH_TEMPLATE([SESSION],[Enables session management functionality.])
280   AC_CHECK_LIB(SM, SmcOpenConnection, with_sm=yes; AC_DEFINE(SESSION),
281     with_sm=no; problem_sm=": Failed to detect libSM",
282     [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
284 dnl AC_SUBST(sm_LIBS)
285 dnl AC_SUBST(sm_CFLAGS)
288 # Checking for optional libraries
289 # Default is to use them if found; can be disable using --without
290 # These are put up front so that if they are requested, but
291 # configure fails to find them, we fail early.
294 # ********* shape extension
295 dnl smr_SWITCH(shape, shape extensions, on, SHAPE)
296 AC_ARG_ENABLE(shape,
297   [  --disable-shape         disable shaped window support],
298   [ if test x"$enableval" = xyes; then
299     with_shape="yes, check"
300   else
301     with_shape="no"
302     problem_shape=": Explicitly disabled"
303   fi ],
304   [ with_shape="not specified, check" ]
307 AH_TEMPLATE(SHAPE,
308 [   Define if you want the Shaped window extensions.
309    Shaped window extensions seem to increase the window managers RSS
310    by about 60 Kbytes. They provide for leaving a title-bar on the window
311    without a border.
312    If you don't use shaped window extension, you can either make your
313    shaped windows undecorated, or live with a border and backdrop around
314    all your shaped windows (oclock, xeyes)
316    If you normally use a shaped window (xeyes or oclock), you might as
317    well compile this extension in, since the memory cost is  minimal in
318    this case (The shaped window shared libs will be loaded anyway). If you
319    don't normally use a shaped window, you have to decide for yourself.
321    Note: if it is compiled in, run time detection is used to make sure that
322    the currently running X server supports it.])
323 if test x"$with_shape" != xno; then
324   $UNSET ac_cv_lib_Xext_XShapeQueryExtension
325   AC_CHECK_LIB(Xext, XShapeQueryExtension,
326                with_shape=yes; AC_DEFINE(SHAPE),
327                with_shape=no;
328                problem_shape=": Failed to detect Shape extension",
329                [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
332 # ********* MIT Shared Memory Extension
333 AC_ARG_ENABLE(shm,
334   [  --disable-shm           disable MIT Shared Memory Extension],
335   [ if test x"$enableval" = xyes; then
336     with_shm="yes, check"
337   else
338     with_shm="no"
339     problem_shm=": Explicitly disabled"
340   fi ],
341   [ with_shm="not specified, check" ]
344 AH_TEMPLATE([HAVE_XSHM],[Define if  MIT Shared Memory extension is used.])
345 if test x"$with_shm" != xno; then
346   $UNSET ac_cv_lib_Xext_XShmQueryExtension
347   AC_CHECK_LIB(Xext, XShmQueryExtension,
348                with_shm=yes; AC_DEFINE(HAVE_XSHM),
349                with_shm=no;
350                problem_shm=": Can't detect MIT Shared Memory ext.",
351                [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
354 # ********* xinerama
355 problem_xinerama=""
357 AC_ARG_ENABLE(xinerama,
358   [  --disable-xinerama      disable Xinerama multi screen support],
359   [ if test x"$enableval" = xyes; then
360     with_xinerama="yes, check"
361   else
362     with_xinerama="no"
363     problem_xinerama=": Explicitly disabled"
364   fi ],
365   [ with_xinerama="not specified, check" ]
368 AH_TEMPLATE([HAVE_XINERAMA],[Define if Xinerama library is used.])
369 AH_TEMPLATE([HAVE_SOLARIS_XINERAMA],
370   [Define if Solaris' Xinerama calls are being used.
371   (Solaris 7 11/99 and later)])
372 AH_TEMPLATE([HAVE_SOLARIS_XINERAMA_H],
373   [Define if Solaris' X11/extensions/xinerama.h header is provided.
374   (Solaris 9 and later)])
375 if test x"$with_xinerama" != xno; then
376   $UNSET ac_cv_lib_Xinerama_XineramaIsActive
377   _check_solaris_xinerama=no
378   AC_CHECK_LIB(Xinerama, XineramaIsActive,
379     with_xinerama=yes; Xinerama_LIBS=-lXinerama; AC_DEFINE(HAVE_XINERAMA),
380     _check_solaris_xinerama=yes,
381     [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
382   if test x"$_check_solaris_xinerama" = xyes; then
383     AC_CHECK_LIB(Xext, XineramaGetState,
384       [ AC_DEFINE(HAVE_XINERAMA) AC_DEFINE(HAVE_SOLARIS_XINERAMA)
385       with_xinerama=yes; Xinerama_LIBS=-lXext
386       my_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$X_CPPFLAGS $CPPFLAGS"
387       my_hdr="X11/extensions/xinerama.h"
388       AC_CHECK_HEADER($my_hdr, AC_DEFINE(HAVE_SOLARIS_XINERAMA_H)
389         problem_xinerama=" (Using Solaris Xinerama calls)",
390         problem_xinerama=" (Using Solaris 9 prototypes for missing header)")
391       CPPFLAGS="$my_CPPFLAGS"],
392     with_xinerama=no; Xinerama_LIBS=
393     problem_xinerama=": Failed to detect libXinerama",
394     [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
395   fi
396   $UNSET _check_solaris_xinerama
398 AC_SUBST(Xinerama_LIBS)
399 AC_SUBST(Xinerama_CFLAGS)
401 # ********* xinerama-emulation
402 smr_SWITCH(
403   xinerama-emulation,
404   [Xinerama emulation on one screen (useful only for developers)], off,
405   USE_XINERAMA_EMULATION,,
406   [Define if Xinerama should be emulated on a single screen.])
407 if test x"$enable_xinerama_emulation" = xyes; then
408   with_xinerama_emulation=yes
409 else
410   with_xinerama_emulation=no
413 # ********* xrender
414 problem_xrender=""
415 AC_ARG_ENABLE(xrender,
416   [  --disable-xrender       disable Xrender alpha-blend rendering ],
417   [ if test x"$enableval" = xyes; then
418     with_xrender="yes, check"
419   else
420     with_xrender="no"
421     problem_xrender=": Explicitly disabled"
422   fi ],
423   [ with_xrender="not specified, check" ]
426 AH_TEMPLATE([HAVE_XRENDER],[Define if Xrender library is used.])
427 if test x"$with_xrender" != xno; then
428   $UNSET ac_cv_lib_Xrender_XRenderComposite
429   AC_CHECK_LIB(Xrender, XRenderComposite,
430     with_xrender=yes; Xrender_LIBS=-lXrender;
431     AC_DEFINE(HAVE_XRENDER),
432     with_xrender=no; Xrender_LIBS=
433     problem_xrender=": Failed to detect libXrender",
434     [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
436 AC_SUBST(Xrender_LIBS)
437 AC_SUBST(Xrender_CFLAGS)
439 # ********* xft
440 problem_xft=""
442 AC_ARG_ENABLE(xft,
443   [  --disable-xft           disable Xft anti-aliased font rendering],
444   [ if test x"$enableval" = xyes; then
445     with_xft="yes, check"
446   else
447     with_xft="no"
448     problem_xft=": Explicitly disabled"
449   fi ],
450   [
451     with_xft="not specified, check"
452   ]
455 AH_TEMPLATE([HAVE_XFT],[Define if Xft library is used.])
456 AH_TEMPLATE([HAVE_XFT2],[Define if Xft 2 library is used.])
457 AH_TEMPLATE([HAVE_XFT_UTF8],[Define if Xft library can handle utf8 encoding])
458 if test x"$with_xft" != xno; then
460   # first check for freetype2
461   have_freetype=no
462   AM_CHECK_FT2(6.1.0)
463   if test x"$no_ft" = x; then
464     have_freetype=yes
465   else
466     have_freetype=no
467     problem_xft=": Can't detect freetype2 >= 6.1.0/2.0.6"
468   fi
470   # check for fontconfig for Xft 2
471   have_fontconfig=no
472   if test x"$have_freetype" != xno ; then
473     AM_CHECK_FC(1.0.1)
474     if test x"$no_fc" = x ; then
475       have_fontconfig=yes
476     else
477       have_fontconfig=no
478       problem_xft=": Can't detect fontconfig >= 1.0.1"
479     fi
480   fi
482   # now check for Xft 2
483   with_xft=no
484   if test x"$have_fontconfig" != xno ; then
485     # Xft 2
486     AM_CHECK_XFT(2.0.0)
487     if test x"$no_xft" = x; then
488       with_xft=yes
489       problem_xft=" (version 2)"
490       AC_DEFINE(HAVE_XFT2)
491       AC_DEFINE(HAVE_XFT)
492       AC_DEFINE(HAVE_XFT_UTF8)
493       Xft_LIBS=$XFT_LIBS
494       Xft_CFLAGS=$XFT_CFLAGS
495     else
496       problem_xft=": Can't detect Xft2, detected fontconfig"
497     fi
498   fi
500   # if Xft2 not detected check for Xft1
501   if test x"$have_freetype" != xno -a x"$with_xft" != xyes; then
502     #Xft 1
503     $UNSET ac_cv_lib_XftConfigSubstitute
504     $UNSET ac_cv_lib_Xft_XftFontOpen
505     $UNSET ac_cv_lib_Xft_XftDrawStringUtf8
506     AC_CHECK_LIB(Xft, XftFontOpen,
507       with_xft=yes, with_xft=no,
508       [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS])
509     if test x"$with_xft" = xyes ; then
510       AC_CHECK_LIB(Xft, XftConfigSubstitute, is_xft1=yes, is_xft1=no,
511         [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS])
512       if test x"$is_xft1" = xyes; then
513         Xft_LIBS="-lXft $FT2_LIBS"
514         Xft_CFLAGS="$Xft_CFLAGS $FT2_CFLAGS"
515         problem_xft=" (version 1)"
516         AC_DEFINE(HAVE_XFT)
517       else
518         with_xft=no
519         problem_xft=": Can't detect Xft 1 or fontconfig"
520       fi
521     else
522       problem_xft=": Can't detect Xft 1 or 2 and fontconfig"
523     fi
524     if test x"$with_xft" = xyes; then
525       AC_CHECK_LIB(Xft, XftDrawStringUtf8,
526         AC_DEFINE(HAVE_XFT_UTF8),,
527         [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS])
528     fi
529   fi
532 AC_SUBST(Xft_LIBS)
533 AC_SUBST(Xft_CFLAGS)
535 # ********* xpm
536 problem_xpm=": Xpm library or header not found"
538 $UNSET ac_cv_header_X11_xpm_h
539 $UNSET ac_cv_lib_Xpm_XpmReadFileToXpmImage
540 smr_CHECK_LIB(xpm, Xpm, for coloured or shaped icons,
541     XpmReadFileToXpmImage, X11/xpm.h,
542     [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS], $X_CFLAGS)
544 if test x"$xpm_LIBS" != x; then
545   # Check for proper version of Xpm -- from XEmacs 21.x configure.in
546   AC_MSG_CHECKING([for Xpm 3.4g or better])
547   my_CPPFLAGS="$CPPFLAGS"
548   my_LIBS="$LIBS"
549   CPPFLAGS="$CPPFLAGS $xpm_CFLAGS $X_CFLAGS"
550   LIBS="$LIBS $xpm_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
551   AC_TRY_RUN([#include <X11/xpm.h>
552    int main(int c, char **v) {
553    return c == 1 ? 0 :
554      XpmIncludeVersion != XpmLibraryVersion() ? 1 :
555      XpmIncludeVersion < 30407 ? 2 : 0 ;}],
556     [./conftest dummy_arg; xpm_status=$?;
557      if test x"$xpm_status" = x0; then
558        with_xpm=yes
559        problem_xpm=""
560      else
561        with_xpm=no;
562        if test x"$xpm_status" = x1; then
563          problem_xpm=": Xpm library and header versions don't match"
564        elif test x"$xpm_status" = x2x; then
565          problem_xpm=": Xpm library version is too old"
566        else
567          problem_xpm=": Internal xpm detection logic error"
568        fi
569      fi],
570    [with_xpm=no; problem_xpm=": Xpm test error, see config.log"])
571   AC_MSG_RESULT($with_xpm)
572   CPPFLAGS="$my_CPPFLAGS"
573   LIBS="$my_LIBS"
575   AH_TEMPLATE([XPM],[Define if Xpm library is used.])
576   if test x"$with_xpm" = xyes; then
577     AC_DEFINE(XPM)
578     # FVWMBANNER=FvwmBanner AC_SUBST(FVWMBANNER)
579     # XPMROOT=xpmroot AC_SUBST(XPMROOT)
580     # FVWMSCRIPT=FvwmScript AC_SUBST(FVWMSCRIPT)
581   else
582     xpm_LIBS=
583     xpm_CFLAGS=
584   fi
586 AC_SUBST(xpm_LIBS)
587 AC_SUBST(xpm_CFLAGS)
589 # ********* png
590 problem_png=": png library or header not found"
592 $UNSET ac_cv_header_png_h
593 $UNSET ac_cv_lib_png_png_read_info
594 smr_CHECK_LIB(png, png, for coloured or shaped icons,
595     png_read_info, png.h, -lz -lm,)
597 if test x"$png_LIBS" != x; then
598   # Check for proper version of png
599   AC_MSG_CHECKING([for libpng 1.0.4a or better])
600   my_CPPFLAGS="$CPPFLAGS"
601   my_LIBS="$LIBS"
602   CPPFLAGS="$CPPFLAGS $png_CFLAGS"
603   LIBS="$LIBS $png_LIBS -lz -lm"
604   AC_TRY_RUN([#include <png.h>
605    int main(int c, char **v) {
606    return c == 1 ? 0 : (PNG_LIBPNG_VER < 10005) ? 2 : 0 ;}],
607     [./conftest dummy_arg; png_status=$?;
608      if test x"$png_status" = x0; then
609        with_png=yes;
610      else
611        with_png=no;
612        if test x"$png_status" = x2; then
613          problem_png=": png library version is too old"
614        else
615          problem_png=": Internal png detection logic error"
616        fi
617      fi],
618    [with_png="no"; problem_png=": png test error, see config.log"])
619   AC_MSG_RESULT($with_png)
620   CPPFLAGS="$my_CPPFLAGS"
621   LIBS="$my_LIBS"
624 AH_TEMPLATE([HAVE_PNG],[Define if ppm library is used.])
625 if test x"$with_png" = xyes; then
626   AC_DEFINE(HAVE_PNG)
627   png_LIBS="-lpng -lz"
628   problem_png=""
629 else
630   with_png=no
632 AC_SUBST(png_LIBS)
633 AC_SUBST(png_CFLAGS)
635 # ** needed by the png support
636 AC_C_BIGENDIAN
638 # ********* rplay
639 $UNSET ac_cv_header_rplay_h
640 $UNSET ac_cv_lib_rplay_rplay_create
641 # Add in X_EXTRA_LIBS here to get things like connect().
642 smr_CHECK_LIB(rplay, , adds audio capability, rplay_create, rplay.h,
643               $X_EXTRA_LIBS)
644 AH_TEMPLATE([HAVE_RPLAY],[Define if rplay library is used.])
645 test x"$rplay_LIBS" != x && AC_DEFINE(HAVE_RPLAY)
646 AC_SUBST(rplay_LIBS)
647 AC_SUBST(rplay_CFLAGS)
650 # ********* stroke
651 $UNSET ac_cv_header_stroke_h
652 $UNSET ac_cv_lib_stroke_stroke_init
653 dnl Add in X_LIBS for MOUSE_DROPPINGS?
654 dnl As of 23/Mar/2000 the only libstroke RPM has /usr/X11R6/include/stroke.h
655 AH_TEMPLATE([HAVE_STROKE],[Define if stroke library is used.])
656 smr_CHECK_LIB(stroke, , mouse strokes recognition,
657         stroke_init, stroke.h,
658         [$X_LIBS -lX11], $X_CFLAGS -I/usr/X11R6/include)
659 test x"$stroke_LIBS" != x &&
660 AC_DEFINE(HAVE_STROKE)
661 AH_VERBATIM([_HAVE_STROKE],
662 [#ifdef HAVE_STROKE
663 #    define STROKE_ARG(x) x,
664 #    define STROKE_CODE(x) x
665 #else
666 #    define STROKE_ARG(x)
667 #    define STROKE_CODE(x)
668 #endif])
669 AC_SUBST(stroke_LIBS)
670 AC_SUBST(stroke_CFLAGS)
673 # ********* readline
674 with_readline=no
675 problem_readline=": Both termcap and ncurses disabled"
677 smr_ARG_WITHLIB(termcap, , to accomplish readline)
678 AH_TEMPLATE([HAVE_READLINE],[Define if readline is available.])
679 if test x"$with_termcap" != xno; then
680   # Forget cached values, so user can re-run configure
681   $UNSET ac_cv_header_readline_history_h
682   $UNSET ac_cv_lib_readline_readline
683   AC_MSG_CHECKING([with termcap])
684   smr_CHECK_LIB(readline, , line editing/history, readline, readline/history.h,
685     $termcap_LIBS)
686   if test x"$readline_LIBS" != x; then
687     with_readline=yes
688     readline_LIBS="$readline_LIBS $termcap_LIBS"
689     AC_DEFINE(HAVE_READLINE)
690   fi
692 smr_ARG_WITHLIB(ncurses, , to accomplish readline)
693 if test x"$with_ncurses" != xno -a ! "$readline_LIBS"; then
694   # We couldn't use readline with termcap; try with ncurses?
695   # Doesn't this seem a hacky way to do this??
696   # unset cached values from last check...
697   $UNSET ac_cv_header_readline_history_h
698   $UNSET ac_cv_lib_readline_readline
699   AC_MSG_CHECKING([with ncurses])
700   dnl We can not call smr_CHECK_LIB twice here without having the usage twice.
701   dnl old_LIBS=$LIBS
702   dnl AC_CHECK_LIB(readline, readline, , , $ncurses_LIBS)
703   dnl LIBS=$old_LIBS
704   dnl if test x"$ac_cv_lib_readline_readline" = xyes; then
705   dnl   AC_CHECK_HEADERS(readline/history.h)
706   dnl   if test x"$ac_cv_header_readline_history_h" = xyes; then
707   dnl     with_readline=yes
708   dnl     readline_LIBS="$readline_LIBS $ncurses_LIBS"
709   dnl     AC_DEFINE(HAVE_READLINE)
710   dnl   fi
711   dnl fi
712   smr_CHECK_LIB(readline, , line editing/history, readline, readline/history.h,
713     $ncurses_LIBS)
714   if test x"$readline_LIBS" != x; then
715     with_readline=yes
716     readline_LIBS="$readline_LIBS $ncurses_LIBS"
717     AC_DEFINE(HAVE_READLINE)
718   fi
720 AC_SUBST(readline_LIBS)
721 AC_SUBST(readline_CFLAGS)
724 # Check if Xsetlocale() is available or not.
725 AH_TEMPLATE([X_LOCALE],[Enables to use setlocale() provided by X])
726 AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $X_LIBS -lX11)
728 # Check if Xsetlocale() is available or not.
729 AH_TEMPLATE([HAVE_XOUTPUT_METHOD],[Enable X output method])
730 AC_CHECK_LIB(X11, XOpenOM, AC_DEFINE(HAVE_XOUTPUT_METHOD),, $X_LIBS -lX11)
732 # ******** iconv
733 with_iconv=no
734 with_iconv_type=no
735 with_lib_iconv=no
736 with_sys_iconv=no
737 problem_iconv=": Explicitly disabled"
739 AC_ARG_ENABLE(iconv,
740   [  --disable-iconv         disable support for iconv character conversion],
741   [ac_cv_iconv="$enableval"],
742   [ac_cv_iconv="yes"])
744 AH_TEMPLATE([USE_LIBICONV],
745   [define if we use libiconv (not needed in general: for example iconv is
746   native with recent glibc)])
747 AH_TEMPLATE([HAVE_ICONV],
748   [Define if iconv (in the libc) or libiconv is available])
749 if test x"$ac_cv_iconv" != xno; then
750   # * first check for gnu libiconv
751   $UNSET ac_cv_header_libiconv_h
752   $UNSET ac_cv_lib_libiconv_libiconv_open
753   smr_CHECK_LIB(
754         iconv, , if not found sys iconv is used, libiconv_open, iconv.h)
755   if test x"$iconv_LIBS" != x; then
756      AC_DEFINE(USE_LIBICONV)
757      with_lib_iconv=yes
758   fi
759   AC_SUBST(iconv_LIBS)
760   AC_SUBST(iconv_CFLAGS)
762   # * check for system iconv
764   AC_CHECK_FUNC(iconv_open, with_sys_iconv=yes)
766   if test x"$with_lib_iconv" = xyes -a x"$with_sys_iconv" = xyes; then
767      AC_MSG_WARN([***  Both system iconv and libiconv found: use libiconv])
768      AC_MSG_WARN([***  Use --with-iconv-library=no to use the system iconv])
769   fi
771   # * libiconv found check for libcharset to get the good iconv charset
772   if test x"$with_lib_iconv" = xyes; then
773      CHECK_LIBCHARSET
774   fi
776   test x"$with_lib_iconv" = xyes -o x"$with_sys_iconv" = xyes &&
777          with_iconv=yes && problem_iconv=""
778   test x"$with_lib_iconv" = xyes && with_iconv_type="yes (libiconv)"
779   test x"$with_sys_iconv" = xyes && with_iconv_type="yes (from C library)"
781   if test x"$with_iconv" = xno; then
782     AC_MSG_WARN([*** ])
783     AC_MSG_WARN([*** No iconv() implementation found in C library or libiconv])
784     AC_MSG_WARN([*** Please install libiconv ftp://ftp.gnu.org/pub/gnu/libiconv/])
785     AC_MSG_WARN([*** ])
786   fi
788   if test x"$with_iconv" = xyes; then
789      AC_DEFINE(HAVE_ICONV)
790      ICONV_SECOND_ARG
791   fi
793 AH_VERBATIM([_HAVE_LIBCHARSET],
794 [#ifdef USE_LIBICONV
795 /* define to use locale_charset in the place of nl_langinfog if libiconv
796  * is used */
797 #undef HAVE_LIBCHARSET
798 #endif])
801 # ******** nl_langinfo and CODESET
802 AH_TEMPLATE([HAVE_CODESET],[Have nl_langinfo (CODESET)])
803 AC_MSG_CHECKING([for nl_langinfo (CODESET)])
804 AC_TRY_COMPILE([#include <langinfo.h>
805 #include <locale.h>],
806 [char *codeset = nl_langinfo(CODESET); setlocale(LC_CTYPE, "");],
807    AC_DEFINE(HAVE_CODESET)
808    have_codeset=yes,
809    have_codeset=no)
810 AC_MSG_RESULT($have_codeset)
813 # ********* fribidi
814 AC_ARG_ENABLE(bidi,
815         [  --disable-bidi          disable bi-directional text support],
816         [ if test x"$enableval" = xyes; then
817                 with_bidi="yes, check"
818         else
819                 with_bidi="no"
820                 problem_bidi=": Explicitly disabled"
821         fi ],
822         [ with_bidi="not specified, check" ]
825 if test x"$with_bidi" != xno; then
826         AC_ARG_WITH(fribidi-bindir,
827                 [  --with-fribidi-bindir=DIR  directory of fribidi-config if not in PATH],
828                 FRIBIDI_BINDIR="$withval", FRIBIDI_BINDIR=".")
829         AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config,, [$FRIBIDI_BINDIR:$PATH])
831         if test x"$FRIBIDI_CONFIG" = x; then
832                 with_bidi=no
833                 problem_bidi=": No fribidi-config found in PATH"
834         else
835                 Bidi_CFLAGS=`$FRIBIDI_CONFIG --cflags`
836                 Bidi_LIBS=`$FRIBIDI_CONFIG --libs`
837                 AC_CHECK_LIB(fribidi, fribidi_log2vis,
838                         with_bidi=yes; problem_bidi=,
839                         with_bidi=no; problem_bidi=": No good libs via fribidi-config",
840                         [$Bidi_LIBS $Bidi_CFLAGS])
841         fi
844 if test x"$with_bidi" != xno; then
845         fribidi_in_path=yes
846         ac_save_LIBS="$LIBS"
847         LIBS="$LIBS $Bidi_LIBS"
848         AC_TRY_RUN([#include <stdlib.h>
849 #include <fribidi/fribidi.h>
850 int main()
852         FriBidiChar *logical_unicode_str =
853                 (FriBidiChar *)malloc((4 + 1) * sizeof(FriBidiChar));
854         fribidi_charset_to_unicode(
855                 fribidi_parse_charset("iso8859-8"), "test", 4,
856                 logical_unicode_str);
857         return 0;
859 ], [:], [fribidi_in_path=no])
860         LIBS="$ac_save_LIBS"
861         if test x"$fribidi_in_path" != xyes; then
862                 ac_save_CFLAGS="$CFLAGS"
863                 ac_save_LIBS="$LIBS"
864                 CFLAGS="$CFLAGS $Bidi_CFLAGS"
865                 LIBS="$LIBS $Bidi_LIBS"
866         AC_TRY_RUN([#include <stdlib.h>
867 #include <fribidi/fribidi.h>
868 int main()
870         FriBidiChar *logical_unicode_str =
871                 (FriBidiChar *)malloc((4 + 1) * sizeof(FriBidiChar));
872         fribidi_charset_to_unicode(
873                 fribidi_parse_charset("iso8859-8"), "test", 4,
874                 logical_unicode_str);
875         return 0;
877 ], [:], [with_bidi=no; problem_bidi=": Bad fribidi version, see config.log"])
878                 CFLAGS="$ac_save_CFLAGS"
879                 LIBS="$ac_save_LIBS"
880         fi
881         if test x"$fribidi_in_path" != xno; then
882                 Bidi_CFLAGS=
883                 Bidi_LIBS=-lfribidi
884         fi
887 AH_TEMPLATE([HAVE_BIDI],[Define if fribidi library is used.])
888 AH_TEMPLATE([FRIBIDI_CHARSET_SPELLING],
889   [Support fribidi-0.10.4 and older with "CHARSET" spelling.])
890 if test x"$with_bidi" = xno; then
891         Bidi_CFLAGS=
892         Bidi_LIBS=
893 else
894         AC_DEFINE(HAVE_BIDI)
895         AC_TRY_RUN([#include <fribidi/fribidi.h>
896                 int main(int c, char **v) {
897                         return FRIBIDI_CHARSET_NOT_FOUND * 0;
898                 }
899         ], [AC_DEFINE(FRIBIDI_CHARSET_SPELLING)])
901 AH_VERBATIM([_FRIBIDI_CHARSET_SPELLING],
902 [#ifdef FRIBIDI_CHARSET_SPELLING
903 #  define FRIBIDI_CHAR_SET_NOT_FOUND FRIBIDI_CHARSET_NOT_FOUND
904 #endif])
906 AC_SUBST(Bidi_LIBS)
907 AC_SUBST(Bidi_CFLAGS)
910 # ********* perllib
911 with_perllib="yes"
912 problem_perllib=""
913 FVWM_PERLLIB=perllib
914 AC_ARG_ENABLE(perllib,
915         [  --disable-perllib       disable installing FVWM perl library],
916         [ if test x"$enableval" = xno; then
917                 with_perllib="no"
918                 problem_perllib=": Explicitly disabled"
919                 FVWM_PERLLIB=""
920         fi ],
922 AC_SUBST(FVWM_PERLLIB)
924 # ******* gettext
925 ALL_LINGUAS="ar de fr sv_SE zh_CN"
926 FVWM_DOMAIN="fvwm"
927 FVWMTASKBAR_DOMAIN="FvwmTaskBar"
928 FVWMSCRIPT_DOMAIN="FvwmScript"
929 ALL_DOMAINS="$FVWM_DOMAIN $FVWMTASKBAR_DOMAIN $FVWMSCRIPT_DOMAIN"
931 AC_SUBST(ALL_LINGUAS)
932 AC_SUBST(FVWM_DOMAIN)
933 AC_SUBST(FVWMTASKBAR_DOMAIN)
934 AC_SUBST(FVWMSCRIPT_DOMAIN)
935 AC_SUBST(ALL_DOMAINS)
937 LOCALEDIR='${datadir}'"/locale"
938 with_gettext="yes"
939 problem_gettext=""
941 AC_ARG_ENABLE(nls,
942         [  --disable-nls           do not use Native Language Support],
943         [ if test x"$enableval" = xno; then
944                 with_gettext="no"
945                 problem_gettext=": Explicitly disabled"
946         fi ],
949 AH_TEMPLATE([HAVE_NLS],
950   [Define to 1 if translation of program messages to the user's native
951   language is requested.])
952 if test x"$with_gettext" != xno; then
953   AM_GNU_FGETTEXT
954   if test x"$USE_NLS" = "xyes"; then
955     AC_DEFINE(HAVE_NLS, 1)
956   else
957     with_gettext="no"
958     problem_gettext=": Failed to detected GNU gettext"
959   fi
960 else
961   USE_NLS=no
964 # libs and buil
965 AC_SUBST(intl_LIBS)
966 AC_SUBST(intl_CFLAGS)
967 AC_SUBST(USE_NLS)
968 AC_SUBST(POSUB)
969 AC_SUBST(LOCALEDIR)
970 AC_SUBST(MKINSTALLDIRS)
971 # programs for devel
972 AC_SUBST(XGETTEXT)
973 AC_SUBST(GMSGFMT)
974 AC_SUBST(MSGMERGE)
975 AC_SUBST(MSGFMT)
976 AC_SUBST(MSGUNIQ)
977 #catalogs
978 AC_SUBST(INST_LINGUAS)
979 AC_SUBST(CATALOGS)
980 AC_SUBST(POFILES)
981 AC_SUBST(GMOFILES)
982 AC_SUBST(UPDATEPOFILES)
983 AC_SUBST(DUMMYPOFILES)
984 AC_SUBST(CATOBJEXT)
986 # Check for REQUIRED headers and functions before going any
987 # further.
989 # The module interface uses variadic functions for message passing.
990 AC_CHECK_HEADERS(stdarg.h)
991 AC_CHECK_FUNCS(vfprintf)
992 if test x$ac_cv_header_stdarg_h = xno -o \
993         $ac_cv_func_vfprintf = no; then
994      AC_MSG_ERROR([stdarg.h and vfprintf required])
997 # For reaping children, fvwm needs either waitpid() or wait3()
998 # Some extra modules may need wait4() too
999 AC_CHECK_FUNCS(waitpid)
1000 if test x$ac_cv_func_waitpid = xno; then
1001     AC_CHECK_FUNCS(wait3 wait4)
1002     if test x$ac_cv_func_wait3 = xno; then
1003         AC_MSG_ERROR([Either waitpid or wait3 function is required])
1004     fi
1007 # C89/C99 signal handling
1008 AC_CHECK_FUNCS(sigsetjmp siglongjmp)
1010 # Look harder for a C preprocessor for FvwmCpp
1011 AC_PATH_PROG(FVWM_CPP, cpp, no, $PATH:/lib:/usr/lib:/usr/ccs/lib)
1012 if test x"$FVWM_CPP" = xno; then
1013   FVWM_CPP=
1014   AC_MSG_WARN([cannot locate a C preprocessor: run FvwmCpp with -cppprog])
1016 dnl FIXME: make sure the cpp we found actually works...
1018 # Finish checking for programs.
1019 AC_PROG_INSTALL
1020 AC_PROG_LN_S
1021 AC_PROG_MAKE_SET
1022 AC_PROG_RANLIB
1023 dnl lex+yacc now only needed for FvwmScript developers when syntax is changed
1024 dnl AM_PROG_LEX
1025 dnl AC_PROG_YACC
1027 REQUIRED_PERL_VERSION=5.004
1028 AC_SUBST(REQUIRED_PERL_VERSION)
1030 if test x"$PERL" = x; then
1031         AC_PATH_PROG(PERL, perl)
1033 if test x"$PERL" != x; then
1034         AC_MSG_CHECKING([for perl $REQUIRED_PERL_VERSION or better])
1035         if ("$PERL" -e "require $REQUIRED_PERL_VERSION;") 2>/dev/null; then
1036                 AC_MSG_RESULT(yes)
1037         else
1038                 AC_MSG_RESULT(no)
1039                 AC_MSG_WARN([$PERL not found or too old])
1040         fi
1041 else
1042         AC_MSG_WARN([perl is not found, it is required for some scripts and modules])
1043         AC_MSG_WARN([It is recommended to install perl $REQUIRED_PERL_VERSION or better later])
1044         PERL=/usr/bin/perl
1046 AC_MSG_RESULT([assuming $PERL as perl location])
1047 AC_SUBST(PERL)
1049 # Checks for header files.
1050 AC_HEADER_STDC
1051 AC_HEADER_SYS_WAIT
1052 AC_CHECK_HEADERS(stdlib.h fcntl.h limits.h malloc.h string.h memory.h unistd.h)
1053 AC_CHECK_HEADERS(getopt.h sys/select.h sys/systeminfo.h sys/time.h)
1055 # Checks for typedefs, structures, and compiler characteristics.
1056 AC_C_CONST
1057 AC_C_INLINE
1058 AC_TYPE_OFF_T
1059 AC_TYPE_PID_T
1060 AC_TYPE_SIZE_T
1061 AC_HEADER_TIME
1062 dnl AC_STRUCT_TM
1063 AC_TYPE_SIGNAL
1065 # Checks for library functions.
1066 AC_FUNC_ALLOCA
1067 AC_FUNC_STRFTIME
1068 AC_FUNC_SETPGRP
1069 AC_CHECK_FUNCS(gettimeofday mkfifo putenv setvbuf socket waitpid)
1070 AC_CHECK_FUNCS(strdup strstr strtol memmove memcpy strchr sysconf uname div)
1071 AC_CHECK_FUNCS(sigaction siginterrupt getpwuid)
1072 AC_CHECK_FUNCS(setpgrp setpgid)
1076 pds_CHECK_TYPE(sig_atomic_t, int, [#include <signal.h>], [Specify a type for sig_atomic_t if it's not available.])
1078 if test x$ac_cv_func_setvbuf = xyes; then
1079   AC_FUNC_SETVBUF_REVERSED
1082 AC_FUNC_SELECT
1083 if test x$ac_cv_func_select != xyes; then
1084   AC_MSG_ERROR([select required])
1087 # Check for standard functions that we have replacements for.
1088 AC_REPLACE_FUNCS(gethostname strcasecmp strncasecmp strdup strerror usleep atexit)
1089 dnl dv: this is harmful with autoconf 2.53 and is done automatically anyway
1090 dnl AC_SUBST(LIBOBJS)
1092 # check for mkstemp, see the discution on this subject on the fvwm workers
1093 # list (2001-02-16 and 2001-02-24)
1094 AM_SAFETY_CHECK_MKSTEMP
1096 # If we do not have atexit(), then check for on_exit()
1097 if test x$ac_cv_func_atexit = xno; then
1098   AC_CHECK_FUNCS(on_exit)
1101 # Check for unsetenv function
1102 AC_CHECK_FUNCS(unsetenv)
1105 # ********* GTK, IMLIB, GNOME
1106 # Check the availability of gtk
1107 FVWMGTK=""
1108 MANFVWMGTK=""
1109 AC_ARG_ENABLE(
1110         gtk,
1111         [  --disable-gtk           do not build modules using gtk library],
1112         enable_gtktest="$enableval", enable_gtktest=yes)
1113 if test x"$enable_gtktest" = xyes; then
1114         AM_PATH_GTK(1.1.0,[
1115                 FVWMGTK=FvwmGtk AC_SUBST(FVWMGTK)
1116                 MANFVWMGTK=FvwmGtk.1 AC_SUBST(MANFVWMGTK)
1117         ],)
1118         if test x"$no_gtk" = x; then
1119                 with_gtk=yes
1120                 problem_gtk=""
1121         else
1122                 with_gtk=no
1123                 problem_gtk=": Failed to detect GTK, see config.log"
1124         fi
1125 else
1126         with_gtk=no
1127         problem_gtk=": Explicitly disabled"
1129 AC_SUBST(FVWMGTK)
1130 AC_SUBST(MANFVWMGTK)
1132 # Check the availability of gdk-imlib
1133 AH_TEMPLATE([GDK_IMLIB],[Define if gdk-imlib is used])
1134 AM_PATH_GDK_IMLIB(1.8.0, AC_DEFINE(GDK_IMLIB))
1135 if test x"$no_imlib" = x; then
1136   with_gdkimlib=yes
1137   problem_gdkimlib=""
1138 else
1139   with_gdkimlib=no
1140   problem_gdkimlib=": Failed on gdk-imlib, see config.log"
1143 GNOME_INIT_HOOK
1145 # Unfortunately we have 2 gnome supports: WM hints and gnome libs.
1146 # The $with_gnomehints below refers to the first, not GNOME_INIT_HOOK.
1147 if test x"$enable_gnome_hints" != xno; then
1148   with_gnomehints=yes
1149   problem_gnomehints=""
1150 else
1151   with_gnomehints=no
1152   problem_gnomehints=": Explicitly disabled"
1155 # Define some compatibility macros needed for config.h.
1156 mg_DEFINE_IF_NOT([#include <X11/keysym.h>],
1157   [defined XK_Page_Up && defined XK_Page_Down],
1158   [COMPAT_OLD_KEYSYMDEF], [$X_CFLAGS],
1159   [Old AIX systems (3.2.5) don't define some common keysyms.])
1160 AH_VERBATIM([_COMPAT_OLD_KEYSYMDEF],
1161 [#ifdef COMPAT_OLD_KEYSYMDEF
1162 #  define XK_Page_Up   XK_Prior
1163 #  define XK_Page_Down XK_Next
1164 #endif])
1166 if test x"$with_stroke" = xyes; then
1167   mg_DEFINE_IF_NOT([#include <stroke.h>],
1168     [defined STROKE_MAX_SEQUENCE],
1169     [COMPAT_OLD_LIBSTROKE], [$stroke_CFLAGS],
1170     [Old libstroke <= 0.4 does not use STROKE_ prefix for constants.])
1172 AH_VERBATIM([_COMPAT_OLD_LIBSTROKE],
1173 [#ifdef COMPAT_OLD_LIBSTROKE
1174 /* currently we only use one constant */
1175 #  define STROKE_MAX_SEQUENCE MAX_SEQUENCE
1176 #endif])
1179 # Allow building with dmalloc.  Do this last to avoid screwing up any
1180 # other checks above.
1181 case "$ac_cv_dmalloc" in
1182   yes) AC_CHECK_HEADERS(dmalloc.h)
1183        AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
1184        CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
1185 esac
1188 # Allow building with efence.
1189 case "$ac_cv_efence" in
1190   yes) AC_CHECK_LIB(efence, malloc) ;;
1191 esac
1193 # some explicit definitions for config.h file
1194 AH_VERBATIM([_ZEND_EXPLICIT_DEFINITIONS],
1197  * The next few defines are options that are only changed from their values
1198  * shown here on systems that _don't_ use the configure script.
1199  **/
1201 /* Enable tests for missing too many XEvents.  Usually you want this. */
1202 #define WORRY_ABOUT_MISSED_XEVENTS 1
1204 /* Define if the X11 ConnectionNumber is actually a file descriptor. */
1205 #define HAVE_X11_FD 1
1207 /* Define if fork() has unix semantics.  On VMS, no child process is created
1208    until after a successful exec(). */
1209 #define FORK_CREATES_CHILD 1
1211 /* Suffix for executable filenames; NULL if no extension needed. */
1212 #define EXECUTABLE_EXTENSION NULL
1214 /* Define to remove the extension from executable pathnames before calling
1215    exec(). */
1216 #undef REMOVE_EXECUTABLE_EXTENSION
1218 /* Enables the "MiniIcon" Style option to specify a small pixmap which
1219  * can be used as one of the title-bar buttons, shown in window list,
1220  * utilized by modules, etc.  Requires PIXMAP_BUTTONS to be defined
1221  * (see below). */
1222 /* #undef MINI_ICONS */
1223 /* NOTE: hard coded to 1 */
1224 #if 1
1225 #define FMiniIconsSupported 1
1226 #else
1227 #define FMiniIconsSupported 0
1228 #endif
1230 /* Enables tagged general decoration styles which can be assigned to
1231  * windows using the UseDecor Style option, or dynamically updated
1232  * with ChangeDecor.  To create and destroy "decor" definitions, see
1233  * the man page entries for AddToDecor and DestroyDecor.  There is a
1234  * slight memory penalty for each additionally defined decor. */
1235 /* #undef USEDECOR */
1236 /* NOTE: hard coded to 1 */
1237 #define USEDECOR 1
1239 #if RETSIGTYPE != void
1240 #define SIGNAL_RETURN return 0
1241 #else
1242 #define SIGNAL_RETURN return
1243 #endif
1245 /* Allow GCC extensions to work, if you have GCC. */
1246 #ifndef __attribute__
1247 /* This feature is available in gcc versions 2.5 and later. */
1248 #  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
1249 #    define __attribute__(x)
1250 #  endif
1251 /* The __-protected variants of `format' and `printf' attributes
1252  * are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
1253 #  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
1254 #    define __format__ format
1255 #    define __printf__ printf
1256 #  endif
1257 #endif
1259 #if HAVE_ALLOCA_H
1260 #  include <alloca.h>
1261 #else
1262 #  ifdef _AIX
1263        #pragma alloca
1264 #  else
1265 #    ifndef alloca /* predefined by HP cc +Olibcalls */
1266          char *alloca ();
1267 #    endif
1268 #  endif
1269 #endif
1271 #ifdef HAVE_STRING_H
1272 #  include <string.h>
1273 #endif
1274 #ifdef HAVE_STRINGS_H
1275 #  include <strings.h>
1276 #endif
1277 #ifdef HAVE_MEMORY_H
1278 #  include <memory.h>
1279 #endif
1280 #ifdef HAVE_STDLIB_H
1281 #  include <stdlib.h>
1282 #endif
1283 #ifdef HAVE_MALLOC_H
1284 #  include <malloc.h>
1285 #endif
1286 #ifndef HAVE_STRCHR
1287 #  define strchr(_s,_c)   index((_s),(_c))
1288 #  define strrchr(_s,_c)  rindex((_s),(_c))
1289 #endif
1291 #ifndef HAVE_MEMCPY
1292 #  define memcpy(_d,_s,_l)  bcopy((_s),(_d),(_l))
1293 #endif
1294 #ifndef HAVE_MEMMOVE
1295 #  define memmove(_d,_s,_l) bcopy((_s),(_d),(_l))
1296 #endif
1298 #if HAVE_SYS_TYPES_H
1299 #  include <sys/types.h>
1300 #endif
1302 #if HAVE_UNISTD_H
1303 #  include <unistd.h>
1304 #endif
1306 #ifndef min
1307 #  define min(a,b) (((a)<(b)) ? (a) : (b))
1308 #endif
1309 #ifndef max
1310 #  define max(a,b) (((a)>(b)) ? (a) : (b))
1311 #endif
1312 #ifndef abs
1313 #  define abs(a) (((a)>=0)?(a):-(a))
1314 #endif
1316 #include "libs/defaults.h"
1318 #ifndef FEVENT_C
1319 #include <X11/Xlib.h>
1320 #include "libs/FEvent.h"
1321 #endif])
1324 # mainly for fvwm-config
1325 AC_SUBST(with_bidi)
1326 AC_SUBST(with_gtk)
1327 AC_SUBST(with_gdkimlib)
1328 AC_SUBST(with_gettext)
1329 AC_SUBST(with_gnomelibs)
1330 AC_SUBST(with_iconv)
1331 AC_SUBST(with_perllib)
1332 AC_SUBST(with_png)
1333 AC_SUBST(with_readline)
1334 AC_SUBST(with_rplay)
1335 AC_SUBST(with_shape)
1336 AC_SUBST(with_shm)
1337 AC_SUBST(with_sm)
1338 AC_SUBST(with_stroke)
1339 AC_SUBST(with_xft)
1340 AC_SUBST(with_xinerama)
1341 AC_SUBST(with_xrender)
1342 AC_SUBST(with_xpm)
1344 LOCAL_BUGADDR=${FVWM_BUGADDR-${USER-${LOGNAME-`whoami`}}}
1345 AC_SUBST(LOCAL_BUGADDR)
1347 AC_OUTPUT(
1348         Makefile
1349         libs/Makefile
1350         fvwm/Makefile
1351         modules/Makefile
1353         bin/fvwm-bug.1
1354         bin/fvwm-config.1
1355         bin/fvwm-convert-2.2.1
1356         bin/fvwm-convert-2.4.1
1357         bin/fvwm-convert-2.6.1
1358         bin/fvwm-menu-desktop.1
1359 dnl     bin/fvwm-menu-directory.1
1360 dnl     bin/fvwm-menu-headlines.1
1361 dnl     bin/fvwm-menu-xlock.1
1362 dnl     bin/fvwm-perllib.1
1363         bin/fvwm-root.1
1364         fvwm/fvwm.1
1365         modules/FvwmAnimate/FvwmAnimate.1
1366         modules/FvwmAuto/FvwmAuto.1
1367         modules/FvwmBacker/FvwmBacker.1
1368         modules/FvwmBanner/FvwmBanner.1
1369         modules/FvwmButtons/FvwmButtons.1
1370         modules/FvwmCommand/FvwmCommand.1
1371         modules/FvwmConsole/FvwmConsole.1
1372         modules/FvwmConsole/FvwmConsoleC.pl.1
1373         modules/FvwmCpp/FvwmCpp.1
1374 dnl     modules/FvwmDebug/FvwmDebug.1
1375 dnl     modules/FvwmDebug/FvwmGtkDebug.1
1376 dnl     modules/FvwmDebug/FvwmOldDebug.1
1377         modules/FvwmDragWell/FvwmDragWell.1
1378         modules/FvwmEvent/FvwmEvent.1
1379         modules/FvwmForm/FvwmForm.1
1380         modules/FvwmGtk/FvwmGtk.1
1381         modules/FvwmIconBox/FvwmIconBox.1
1382         modules/FvwmIconMan/FvwmIconMan.1
1383         modules/FvwmIdent/FvwmIdent.1
1384         modules/FvwmM4/FvwmM4.1
1385         modules/FvwmPager/FvwmPager.1
1386 dnl     modules/FvwmPerl/FvwmPerl.1
1387         modules/FvwmProxy/FvwmProxy.1
1388         modules/FvwmRearrange/FvwmRearrange.1
1389         modules/FvwmSave/FvwmSave.1
1390         modules/FvwmSaveDesk/FvwmSaveDesk.1
1391         modules/FvwmScript/FvwmScript.1
1392         modules/FvwmScroll/FvwmScroll.1
1393         modules/FvwmTaskBar/FvwmTaskBar.1
1394         modules/FvwmTheme/FvwmTheme.1
1395         modules/FvwmWharf/FvwmWharf.1
1396         modules/FvwmWinList/FvwmWinList.1
1397 dnl     modules/FvwmWindowMenu/FvwmWindowMenu.1
1399         bin/Makefile
1400         bin/fvwm-config
1401         bin/fvwm-bug
1402         bin/fvwm-perllib
1403         bin/fvwm-menu-xlock
1404         bin/fvwm-menu-directory
1405         bin/fvwm-menu-desktop
1406         bin/fvwm-menu-headlines
1407         bin/fvwm-convert-2.4
1408         bin/fvwm-convert-2.6
1410         utils/Makefile
1411         perllib/Makefile
1412         perllib/General/Makefile
1413         perllib/FVWM/Makefile
1414         perllib/FVWM/Module/Makefile
1415         perllib/FVWM/Tracker/Makefile
1416         perllib/FVWM/Module.pm
1417         rpm/Makefile
1418         rpm/fvwm.spec
1419         debian/Makefile
1420         debian/control
1421         docs/fvwm.lsm
1422         docs/Makefile
1423         sample.fvwmrc/Makefile
1424         tests/Makefile
1425         tests/hints/Makefile
1426         po/Makefile
1428         modules/FvwmAnimate/Makefile
1429         modules/FvwmAuto/Makefile
1430         modules/FvwmBacker/Makefile
1431         modules/FvwmBanner/Makefile
1432         modules/FvwmButtons/Makefile
1433         modules/FvwmCommand/Makefile
1434         modules/FvwmCommand/scripts/Makefile
1435         modules/FvwmConsole/Makefile
1436         modules/FvwmConsole/FvwmConsoleC.pl
1437         modules/FvwmCpp/Makefile
1438         modules/FvwmDebug/Makefile
1439         modules/FvwmDebug/FvwmDebug
1440         modules/FvwmDebug/FvwmGtkDebug
1441         modules/FvwmDragWell/Makefile
1442         modules/FvwmEvent/Makefile
1443         modules/FvwmForm/Makefile
1444         modules/FvwmIconBox/Makefile
1445         modules/FvwmIconMan/Makefile
1446         modules/FvwmIdent/Makefile
1447         modules/FvwmM4/Makefile
1448         modules/FvwmPager/Makefile
1449         modules/FvwmPerl/Makefile
1450         modules/FvwmPerl/FvwmPerl
1451         modules/FvwmProxy/Makefile
1452         modules/FvwmRearrange/Makefile
1453         modules/FvwmSave/Makefile
1454         modules/FvwmSaveDesk/Makefile
1455         modules/FvwmScript/Makefile
1456         modules/FvwmScript/Scripts/Makefile
1457         modules/FvwmScript/Widgets/Makefile
1458         modules/FvwmScroll/Makefile
1459         modules/FvwmTabs/Makefile
1460         modules/FvwmTabs/FvwmTabs
1461         modules/FvwmTaskBar/Makefile
1462         modules/FvwmTheme/Makefile
1463         modules/FvwmWharf/Makefile
1464         modules/FvwmWinList/Makefile
1465         modules/FvwmWindowMenu/Makefile
1466         modules/FvwmWindowMenu/FvwmWindowMenu
1467         modules/FvwmGtk/Makefile
1470 # ---------------------------------------------------------------------------
1471 # Original config.status is patched to make generated scripts executable.
1472 sed 's/> $ac_file/> $ac_file; test x"`head -1 $ac_file | cut -c1-2`" = x"#!" \&\& chmod a+rx $ac_file/' <config.status >config.status-t && \
1473 mv config.status-t config.status
1474 chmod +x config.status
1475 # ---------------------------------------------------------------------------
1477 # ---------------------------------------------------------------------------
1478 cat >config.status-t <<EOF
1479 #! /bin/sh
1481 # Original config.status is patched to satisfy processing *.in with 'make -j'.
1482 # This bug seems to be partially fixed in autoconf-2.50 (not in all places).
1483 UNIQUE_POSTFIX=\$\$
1486 sed 's/conftest/conftest\${UNIQUE_POSTFIX}/g' <config.status >>config.status-t && \
1487 mv config.status-t config.status
1488 chmod +x config.status
1489 # ---------------------------------------------------------------------------
1491 eval my_bindir="`eval echo ${bindir}`"
1492 eval my_mandir="`eval echo ${mandir}`"
1493 eval my_moddir="`eval echo ${FVWM_MODULEDIR}`"; eval my_moddir="$my_moddir"
1494 eval my_datdir="`eval echo ${FVWM_DATADIR}`"
1495 eval my_plldir="`eval echo ${FVWM_PERLLIBDIR}`"
1496 test x"$FVWM_PERLLIB" = x && my_plldir="(Not installed) $my_plldir"
1497 eval my_localedir="`eval echo ${LOCALEDIR}`"
1498 test x"$USE_NLS" = xno && my_localedir="(Not installed) $my_localdir"
1500 case "$with_gtk" in
1501   yes) fvwmgtk_msg="
1502   With GDK image support in FvwmGtk?  $with_gdkimlib$problem_gdkimlib
1503   With GNOME libs support in FvwmGtk? $with_gnomelibs$problem_gnomelibs" ;;
1504   no) fvwmgtk_msg="" ;;
1505 esac
1507 echo "
1508 FVWM Configuration:
1510   Version:     $VERSION$VERSIONINFO
1512   Executables: $my_bindir
1513   Man pages:   $my_mandir
1514   Modules:     $my_moddir
1515   Data files:  $my_datdir
1516   Perl lib:    $my_plldir
1517   Locale msg:  $my_localedir $INST_LINGUAS
1519   With Asian bi-direct. text support? $with_bidi$problem_bidi
1520   With Gettext Native Lang support?   $with_gettext$problem_gettext
1521   With GTK+ required for FvwmGtk?     $with_gtk$problem_gtk$fvwmgtk_msg
1522   With Iconv support?                 $with_iconv_type$problem_iconv
1523   With Mouse strokes (gestures)?      $with_stroke$problem_stroke
1524   With PNG image support?             $with_png$problem_png
1525   With ReadLine sup. in FvwmConsole?  $with_readline$problem_readline
1526   With RPlay support in FvwmEvent?    $with_rplay$problem_rplay
1527   With Shaped window support?         $with_shape$problem_shape
1528   With Shared memory for XImage?      $with_shm$problem_shm
1529   With Session Management support?    $with_sm$problem_sm
1530   With Xinerama multi-head support?   $with_xinerama$problem_xinerama
1531   With Xft anti-alias font support?   $with_xft$problem_xft
1532   With XPM image support?             $with_xpm$problem_xpm
1533   With Xrender image support?         $with_xrender$problem_xrender
1535 See INSTALL.fvwm for the description of what this may mean."
1537 case "$with_xinerama_emulation" in
1538   yes) echo "  Xinerama emulation enabled." ;;
1539 esac
1540 case "$ac_cv_dmalloc" in
1541   yes) echo "  DMALLOC heap debugging library enabled." ;;
1542 esac
1543 case "$ac_cv_efence" in
1544   yes) echo "  EFENCE debugging library enabled." ;;
1545 esac