1 dnl Process this file with autoconf to produce a configure script.
5 AM_INIT_AUTOMAKE(fvwm, 2.5.0)
6 AM_CONFIG_HEADER(config.h)
8 FVWM_MODULESUBDIR=/${PACKAGE}/${VERSION}
9 FVWM_DATASUBDIR=/${PACKAGE}
11 AC_ARG_ENABLE(package-subdirs,
12 [ --disable-package-subdirs do not create subdirs for modules and data],
13 [if test $enableval = no; then FVWM_MODULESUBDIR=""; FVWM_DATASUBDIR=""; fi],
16 FVWM_MODULEDIR='${libexecdir}'$FVWM_MODULESUBDIR
17 FVWM_DATADIR='${datadir}'$FVWM_DATASUBDIR
18 FVWM_CONFDIR='${sysconfdir}'dnl used _only_ to search for system.fvwm2rc
20 AC_SUBST(FVWM_MODULEDIR)
21 AC_SUBST(FVWM_DATADIR)
22 AC_SUBST(FVWM_CONFDIR)
25 dnl Various configure-time options
28 AC_ARG_ENABLE(dmalloc,
29 [ --enable-dmalloc enable support for the dmalloc debugging library],
30 [ac_cv_dmalloc="$enableval"],
34 [ --enable-efence enable support for the efence debugging library],
35 [ac_cv_efence="$enableval"],
38 smr_SWITCH(command-log, command logging, off, FVWM_COMMAND_LOG)
39 smr_SWITCH(debug-msgs, debugging messages, off, FVWM_DEBUG_MSGS)
40 smr_SWITCH(multibyte, multibyte character support (experimental), off, I18N_MB)
41 dnl dummy: smr_SWITCH(sm, dummy for test script, on, SESSION)
44 [ --enable-kanji obsolete, please use --enable-multibyte instead],
45 [AC_MSG_ERROR(--enable-kanji is obsolete; use --enable-multibyte instead.)],
48 dnl FIXME: default value should be derived from computed path to X
49 dnl includes. Actually, this should probably not appear in configure
50 dnl at all: it is settable at runtime, and only confuses the issue to
51 dnl have it settable here too.
53 AC_MSG_CHECKING(imagepath)
54 val="/usr/include/X11/bitmaps:/usr/include/X11/pixmaps"
55 AC_ARG_WITH(imagepath,
56 [ --with-imagepath=PATH colon-delimited search path for images],
59 AC_MSG_ERROR(Can not disable image path.)
67 AC_DEFINE_UNQUOTED(FVWM_IMAGEPATH, "$val")
69 AC_SUBST(FVWM_IMAGEPATH)
72 dnl Minimal checks for programs: enough to enable checking for
73 dnl optional libraries.
77 dnl Help finding POSIX functions on some systems
81 dnl Need to know where X is, for finding some libraries (e.g. xpm)
84 if test "$no_x" = "yes"; then
86 echo "X11 libraries or header files could not be found. Please make"
87 echo "sure the X11 development package is installed on your system."
88 echo "If it is definitely installed, try setting the include and library"
89 echo "paths with the --x-include and --x-libraries options of configure."
90 echo "Fvwm can not be compiled without the X11 development environment"
97 dnl 'unset' is not portable, but setting to null is not enough to avoid using
98 dnl the cached value! For ancient shells "rm config.cache" is a solution.
100 if unset UNSET 2>/dev/null; then UNSET=unset; fi
103 dnl ********* GNOME window manager hints
104 dnl Note, no gnome headers or libs are needed for FVWM to be GNOME compliant.
105 smr_SWITCH(gnome-hints, GNOME window manager hints, on, GNOME)
106 dnl AM_CONDITIONAL(GNOME, test "x$enable_gnome_hints" != "xno")
109 dnl ********* session management
110 dnl Check the availability of SM; we don't have to add any extra libraries,
111 dnl since -lSM -lICE are in X_PRE_LIBS when they exist.
112 dnl [old check] AC_CHECK_LIB(SM, SmcOpenConnection, AC_DEFINE(SESSION), ,
113 dnl [old check] [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
118 [ --disable-sm disable session management support],
119 [ if test "$enableval" = yes; then
123 problem_sm=": Explicitly disabled"
125 [ with_sm="not specified, check" ]
128 if test "$with_sm" != "no"; then
129 dnl Uncomment the following and comment out AC_CHECK_LIB to get --with-sm-*
130 dnl $UNSET ac_cv_lib_SM_SmcOpenConnection
131 dnl $UNSET ac_cv_header_X11_SM_SMlib_h
132 dnl smr_CHECK_LIB(sm, SM, adds session management support, SmcOpenConnection,
134 dnl [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS], $X_CFLAGS)
135 dnl test "$sm_LIBS" && AC_DEFINE(SESSION)
137 $UNSET ac_cv_lib_SM_SmcOpenConnection
138 AC_CHECK_LIB(SM, SmcOpenConnection, with_sm=yes; AC_DEFINE(SESSION),
139 with_sm=no; problem_sm=": Failed to detect libSM",
140 [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
142 dnl AC_SUBST(sm_LIBS)
143 dnl AC_SUBST(sm_CFLAGS)
146 dnl Checking for optional libraries
147 dnl Default is to use them if found; can be disable using --without
148 dnl These are put up front so that if they are requested, but
149 dnl configure fails to find them, we fail early.
152 dnl ********* shape extension
153 dnl smr_SWITCH(shape, shape extensions, on, SHAPE)
155 [ --disable-shape disable shaped window support],
156 [ if test "$enableval" = yes; then
157 with_shape="yes, check"
160 problem_shape=": Explicitly disabled"
162 [ with_shape="not specified, check" ]
165 if test "$with_shape" != "no"; then
166 $UNSET ac_cv_lib_Xext_XShapeQueryExtension
167 AC_CHECK_LIB(Xext, XShapeQueryExtension,
168 with_shape=yes; AC_DEFINE(SHAPE),
170 problem_shape=": Failed to detect Shape extension",
171 [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS])
175 dnl ********* xinerama
178 AC_ARG_ENABLE(xinerama,
179 [ --disable-xinerama disable Xinerama multi screen support],
180 [ if test "$enableval" = yes; then
181 with_xinerama="yes, check"
184 problem_xinerama=": Explicitly disabled"
186 [ with_xinerama="not specified, check" ]
189 if test "$with_xinerama" != "no"; then
190 $UNSET ac_cv_lib_Xinerama_XineramaIsActive
191 AC_CHECK_LIB(Xinerama, XineramaIsActive,
192 with_xinerama=yes; Xinerama_LIBS=-lXinerama; AC_DEFINE(HAVE_XINERAMA),
193 with_xinerama=no; Xinerama_LIBS=
194 problem_xinerama=": Failed to detect libXinerama",
195 [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS])
197 AC_SUBST(Xinerama_LIBS)
198 AC_SUBST(Xinerama_CFLAGS)
201 dnl ********* xinerama-emulation
202 smr_SWITCH(xinerama-emulation, Xinerama emulation on one screen, off,
203 USE_XINERAMA_EMULATION)
204 if test "$enable_xinerama_emulation" = yes; then
205 with_xinerama_emulation=yes
207 with_xinerama_emulation=no
212 problem_xpm=": Xpm library or header not found!"
214 $UNSET ac_cv_header_X11_xpm_h
215 $UNSET ac_cv_lib_Xpm_XpmReadFileToXpmImage
216 smr_CHECK_LIB(xpm, Xpm, for coloured or shaped icons,
217 XpmReadFileToXpmImage, X11/xpm.h,
218 [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS], $X_CFLAGS)
220 if test "$xpm_LIBS"; then
221 dnl Check for proper version of Xpm -- from XEmacs 21.x configure.in
223 AC_MSG_CHECKING(for Xpm 3.4g or better)
224 my_CPPFLAGS="$CPPFLAGS"
226 CPPFLAGS="$CPPFLAGS $xpm_CFLAGS $X_CFLAGS"
227 LIBS="$LIBS $xpm_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
228 AC_TRY_RUN([#include <X11/xpm.h>
229 int main(int c, char **v) {
231 XpmIncludeVersion != XpmLibraryVersion() ? 1 :
232 XpmIncludeVersion < 30407 ? 2 : 0 ;}],
233 [./conftest dummy_arg; xpm_status=$?;
234 if test "$xpm_status" = "0"; then
238 if test "$xpm_status" = "1"; then
239 problem_xpm=": Xpm library and header versions don't match!"
240 elif test "$xpm_status" = "2"; then
241 problem_xpm=": Xpm library version is too old!"
243 problem_xpm=": Internal xpm detection logic error!"
247 AC_MSG_RESULT($with_xpm)
248 CPPFLAGS="$my_CPPFLAGS"
251 if test "$with_xpm" = yes; then
253 FVWMBANNER=FvwmBanner AC_SUBST(FVWMBANNER)
254 XPMROOT=xpmroot AC_SUBST(XPMROOT)
255 FVWMSCRIPT=FvwmScript AC_SUBST(FVWMSCRIPT)
266 $UNSET ac_cv_header_rplay_h
267 $UNSET ac_cv_lib_rplay_rplay_create
268 dnl Add in X_EXTRA_LIBS here to get things like connect().
269 smr_CHECK_LIB(rplay, , adds audio capability, rplay_create, rplay.h,
271 test "$rplay_LIBS" && AC_DEFINE(HAVE_RPLAY)
273 AC_SUBST(rplay_CFLAGS)
277 $UNSET ac_cv_header_stroke_h
278 $UNSET ac_cv_lib_stroke_stroke_init
279 dnl Add in X_LIBS for MOUSE_DROPPINGS?
280 dnl As of 23/Mar/2000 the only libstroke RPM has /usr/X11R6/include/stroke.h
281 smr_CHECK_LIB(stroke, , mouse strokes recognition, stroke_init, stroke.h,
282 $X_LIBS, $X_CFLAGS -I/usr/X11R6/include)
283 test "$stroke_LIBS" && AC_DEFINE(HAVE_STROKE)
284 AC_SUBST(stroke_LIBS)
285 AC_SUBST(stroke_CFLAGS)
288 dnl ********* readline
290 problem_readline=": Both termcap and ncurses disabled"
292 smr_ARG_WITHLIB(termcap, , to accomplish readline)
293 if test "$with_termcap" != "no"; then
294 dnl Forget cached values, so user can re-run configure
295 $UNSET ac_cv_header_readline_history_h
296 $UNSET ac_cv_lib_readline_readline
297 AC_MSG_CHECKING([with termcap])
298 smr_CHECK_LIB(readline, , line editing/history, readline, readline/history.h,
300 if test "$readline_LIBS"; then
302 readline_LIBS="$readline_LIBS $termcap_LIBS"
303 AC_DEFINE(HAVE_READLINE)
306 smr_ARG_WITHLIB(ncurses, , to accomplish readline)
307 if test "$with_ncurses" != "no" -a ! "$readline_LIBS"; then
308 # We couldn't use readline with termcap; try with ncurses?
309 dnl Doesn't this seem a hacky way to do this??
310 dnl unset cached values from last check...
311 $UNSET ac_cv_header_readline_history_h
312 $UNSET ac_cv_lib_readline_readline
313 AC_MSG_CHECKING([with ncurses])
314 dnl We can't call smr_CHECK_LIB twice here without having the usage twice...
316 dnl AC_CHECK_LIB(readline, readline, , , $ncurses_LIBS)
318 dnl if test "$ac_cv_lib_readline_readline" = yes; then
319 dnl AC_CHECK_HEADERS(readline/history.h)
320 dnl if test "$ac_cv_header_readline_history_h" = yes; then
321 dnl with_readline=yes
322 dnl readline_LIBS="$readline_LIBS $ncurses_LIBS"
323 dnl AC_DEFINE(HAVE_READLINE)
326 smr_CHECK_LIB(readline, , line editing/history, readline, readline/history.h,
328 if test "$readline_LIBS"; then
330 readline_LIBS="$readline_LIBS $ncurses_LIBS"
331 AC_DEFINE(HAVE_READLINE)
334 AC_SUBST(readline_LIBS)
335 AC_SUBST(readline_CFLAGS)
338 dnl ********* multibyte
340 problem_multibyte=": This is the suggested default"
342 dnl FreeBSD has libxpg4, check this and use if found.
343 if test "$enable_multibyte" = yes; then
349 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
354 dnl Check if Xsetlocale() is available or not.
355 AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $X_LIBS -lX11)
358 dnl Check for REQUIRED headers and functions before going any
361 dnl The module interface uses variadic functions for message passing.
362 AC_CHECK_HEADERS(stdarg.h)
363 AC_CHECK_FUNCS(vfprintf)
364 if test $ac_cv_header_stdarg_h = no -o \
365 $ac_cv_func_vfprintf = no; then
366 AC_MSG_ERROR(stdarg.h and vfprintf required.)
369 dnl For reaping children, fvwm needs either waitpid() or wait3()
370 dnl Some extra modules may need wait4() too
371 AC_CHECK_FUNCS(waitpid)
372 if test $ac_cv_func_waitpid = no; then
373 AC_CHECK_FUNCS(wait3 wait4)
374 if test $ac_cv_func_wait3 = no; then
375 AC_MSG_ERROR(Either waitpid or wait3 function is required)
379 dnl Make the C++ compiler optional, for it is only used in
380 dnl modules, not for the main code.
382 dnl Actually, we don't use it at _all_ anymore, since the only module
383 dnl that used it has been removed. It causes problems so we'll comment
384 dnl it out for now. Hopefully by the time we need it again autoconf
385 dnl will handle it better :-/
388 dnl [ --without-cxx disable probing for C++ compiler])
390 dnl if test "$with_cxx" != no; then
391 dnl if test "$with_cxx" -a "$with_cxx" != yes; then
393 dnl # disable the cached value before probing
394 dnl $UNSET ac_cv_prog_CXX
395 dnl AC_CHECK_PROGS(CXX, $CCC)
397 dnl AC_MSG_ERROR(C++ compiler given by --with-cxx not found)
399 dnl AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++)
401 dnl if test "$CXX"; then
402 dnl AC_MSG_RESULT(Using $CXX to compile C++ programs)
408 dnl Look harder for a C preprocessor for FvwmCpp
409 AC_PATH_PROG(FVWM_CPP, cpp, no, $PATH:/lib:/usr/lib:/usr/ccs/lib)
410 if test "$FVWM_CPP" = no; then
412 AC_MSG_WARN([cannot locate a C preprocessor: run FvwmCpp with -cppprog])
414 dnl FIXME: make sure the cpp we found actually works...
416 dnl Finish checking for programs.
421 dnl lex+yacc now only needed for FvwmScript developers when syntax is changed
424 AC_PATH_PROG(PERL, perl)
426 dnl We need at least perl 5.002 for FvwmConsoleC.pl and fvwm-menu-headlines.
427 if test ! -z "$PERL"; then
428 AC_MSG_CHECKING(for perl 5.002 or better)
429 if ("$PERL" -e "require 5.002;") 2>/dev/null; then
433 AC_MSG_WARN($PERL not found or too old)
436 AC_MSG_WARN(perl not found; you can't run some extra scripts)
440 dnl Checks for header files.
443 AC_CHECK_HEADERS(stdlib.h fcntl.h limits.h malloc.h string.h memory.h unistd.h)
444 AC_CHECK_HEADERS(getopt.h sys/select.h sys/systeminfo.h)
446 dnl Checks for typedefs, structures, and compiler characteristics.
455 dnl Checks for library functions.
459 AC_CHECK_FUNCS(gettimeofday mkfifo putenv setvbuf socket waitpid)
460 AC_CHECK_FUNCS(strdup strstr strtol memmove memcpy strchr sysconf uname div)
461 AC_CHECK_FUNCS(sigaction siginterrupt getpwuid)
463 pds_CHECK_TYPE(sig_atomic_t, int, [#include <signal.h>])
465 if test $ac_cv_func_setvbuf = yes; then
466 AC_FUNC_SETVBUF_REVERSED
470 if test $ac_cv_func_select != yes; then
471 AC_MSG_ERROR(select required.)
474 dnl Check for standard functions that we have replacements for.
475 AC_REPLACE_FUNCS(gethostname strcasecmp strncasecmp strdup strerror usleep atexit)
478 dnl If we do not have atexit(), then check for on_exit()
479 if test $ac_cv_func_atexit = no; then
480 AC_CHECK_FUNCS(on_exit)
484 dnl ********* GTK, IMLIB, GNOME
485 dnl Check the availability of gtk
486 AM_PATH_GTK(1.1.0,[FVWMGTK=FvwmGtk AC_SUBST(FVWMGTK)],)
487 if test "x$no_gtk" = x; then
492 problem_gtk=": Failed to detect GTK, see config.log"
495 dnl Check the availability of gdk-imlib
496 AM_PATH_GDK_IMLIB(1.8.0, AC_DEFINE(GDK_IMLIB),)
497 if test "x$no_imlib" = x; then
502 problem_gdkimlib=": Failed on gdk-imlib, see config.log"
507 dnl Unfortunately we have 2 gnome supports: WM hints and gnome libs.
508 dnl The $with_gnomehints below refers to the first, not GNOME_INIT_HOOK.
509 if test "x$enable_gnome_hints" != "xno"; then
511 problem_gnomehints=""
514 problem_gnomehints=": Explicitly disabled"
518 dnl Define some compatibility macros needed for acconfig.h.
519 mg_DEFINE_IF_NOT([#include <X11/keysym.h>],
520 [defined XK_Page_Up && defined XK_Page_Down],
521 [COMPAT_OLD_KEYSYMDEF], [$X_CFLAGS])
523 if test "$with_stroke" = yes; then
524 mg_DEFINE_IF_NOT([#include <stroke.h>],
525 [defined STROKE_MAX_SEQUENCE],
526 [COMPAT_OLD_LIBSTROKE], [$stroke_CFLAGS])
530 dnl Allow building with dmalloc. Do this last to avoid screwing up any
531 dnl other checks above.
533 case "$ac_cv_dmalloc" in
534 yes) AC_CHECK_HEADERS(dmalloc.h)
535 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
536 CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
540 dnl Allow building with efence.
542 case "$ac_cv_efence" in
543 yes) AC_CHECK_LIB(efence, malloc) ;;
547 # mainly for fvwm-config
548 AC_SUBST(with_gnomehints)
550 AC_SUBST(with_gdkimlib)
551 AC_SUBST(with_gnomelibs)
552 AC_SUBST(with_multibyte)
553 AC_SUBST(with_readline)
557 AC_SUBST(with_stroke)
558 AC_SUBST(with_xinerama)
561 AC_OUTPUT(Makefile libs/Makefile fvwm/Makefile modules/Makefile
562 utils/Makefile utils/fvwm-config
563 utils/fvwm-menu-xlock utils/fvwm-menu-directory
564 utils/fvwm-menu-desktop utils/fvwm-menu-headlines
566 rpm/Makefile rpm/fvwm.spec docs/fvwm.lsm
567 docs/Makefile sample.fvwmrc/Makefile tests/Makefile
569 modules/FvwmAnimate/Makefile
570 modules/FvwmAuto/Makefile
571 modules/FvwmBacker/Makefile
572 modules/FvwmBanner/Makefile
573 modules/FvwmButtons/Makefile
574 modules/FvwmCommand/Makefile
575 modules/FvwmCommand/scripts/Makefile
576 modules/FvwmConsole/Makefile
577 modules/FvwmConsole/FvwmConsoleC.pl
578 modules/FvwmCpp/Makefile
579 modules/FvwmDebug/Makefile
580 modules/FvwmDragWell/Makefile
581 modules/FvwmEvent/Makefile
582 modules/FvwmForm/Makefile
583 modules/FvwmIconBox/Makefile
584 modules/FvwmIconMan/Makefile
585 modules/FvwmIdent/Makefile
586 modules/FvwmM4/Makefile
587 modules/FvwmPager/Makefile
588 modules/FvwmRearrange/Makefile
589 modules/FvwmSave/Makefile
590 modules/FvwmSaveDesk/Makefile
591 modules/FvwmScript/Makefile
592 modules/FvwmScript/Scripts/Makefile
593 modules/FvwmScript/Widgets/Makefile
594 modules/FvwmScroll/Makefile
595 modules/FvwmTaskBar/Makefile
596 modules/FvwmTheme/Makefile
597 modules/FvwmWharf/Makefile
598 modules/FvwmWinList/Makefile
599 modules/FvwmGtk/Makefile
602 # ---------------------------------------------------------------------------
603 cat >config.status-t <<EOF
606 # Original config.status is patched to satisfy processing *.in with 'make -j'.
607 # This bug seems to be fixed in autoconf-2.50.
611 sed 's/conftest/conftest\${UNIQUE_POSTFIX}/g' <config.status >>config.status-t && \
612 mv config.status-t config.status
613 chmod +x config.status
614 # ---------------------------------------------------------------------------
616 eval my_bindir="`eval echo ${bindir}`"
617 eval my_mandir="`eval echo ${mandir}`"
618 eval my_moddir="`eval echo ${FVWM_MODULEDIR}`"; eval my_moddir="$my_moddir"
619 eval my_datdir="`eval echo ${FVWM_DATADIR}`"
623 With GDK Imlib support in FvwmGtk? $with_gdkimlib$problem_gdkimlib
624 With GNOME support in FvwmGtk? $with_gnomelibs$problem_gnomelibs" ;;
625 no) fvwmgtk_msg="" ;;
633 Executables: $my_bindir
634 Man pages: $my_mandir
636 Data files: $my_datdir
638 With GNOME Window Manager hints? $with_gnomehints$problem_gnomehints
639 With GTK support for FvwmGtk? $with_gtk$problem_gtk$fvwmgtk_msg
640 With Multibyte support? $with_multibyte$problem_multibyte
641 With ReadLine sup. in FvwmConsole? $with_readline$problem_readline
642 With RPlay support in FvwmEvent? $with_rplay$problem_rplay
643 With Shaped window support? $with_shape$problem_shape
644 With Session Management support? $with_sm$problem_sm
645 With Stroke support? $with_stroke$problem_stroke
646 With Xinerama support? $with_xinerama$problem_xinerama
647 With XPM support? $with_xpm$problem_xpm
649 case "$with_xinerama_emulation" in
650 yes) echo " Xinerama emulation enabled." ;;
652 case "$ac_cv_dmalloc" in
653 yes) echo " DMALLOC heap debugging library enabled." ;;
655 case "$ac_cv_efence" in
656 yes) echo " EFENCE debugging library enabled." ;;