2 dnl Window Maker autoconf input.
4 dnl Process with: aclocal; autoconf; automake
7 dnl Shared library generation stuff taken from configure script from zlib
11 AC_INIT(src/WindowMaker.h)
13 AM_INIT_AUTOMAKE(WindowMaker, 0.51.0)
17 # by Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
18 # Turn around -rpath problem with libtool 1.0c
19 # This define should be improbable enough to not conflict with anything
22 AC_MSG_RESULT([Fixing libtool for -rpath problems.])
23 sed < libtool > libtool-2 \
24 's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
32 AM_CONFIG_HEADER(src/config.h)
35 dnl Checks for host/os name
36 dnl =======================
40 dnl Checks for programs.
41 dnl ===================
44 dnl AC_PROG_MAKE_SET -- already done by AM_INIT_AUTOMAKE
46 dnl AC_PROG_INSTALL -- already done by AM_INIT_AUTOMAKE
48 AC_PROG_GCC_TRADITIONAL
54 dnl move this earlier in the script... anyone know why this is handled
55 dnl in such a bizarre way?
57 test "x$prefix" = xNONE && prefix=$ac_default_prefix
58 dnl Let make expand exec_prefix.
59 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
62 dnl Checks for library functions.
63 dnl ============================
69 AC_CHECK_FUNCS(gethostname select poll strerror strncasecmp setpgid atexit)
71 if test "x$CPP_PATH" = x; then
72 AC_PATH_PROG(CPP_PATH, cpp, notfound,
73 [/lib /usr/bin /bin /usr/lib /usr/ccs/lib $PATH])
77 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
78 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
79 dnl standard locations
81 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
82 if test "$GCC" = "yes"; then
83 CPP_PATH="gcc -E -x c"
85 if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
86 CPP_PATH="$CPP_PATH -B"
88 echo "cpp, the C preprocessor was not found in your system."
89 echo "Create a symbolic link from it to /lib/cpp and rerun configure"
94 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
98 dnl Checks for header files.
99 dnl =======================
102 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
103 libintl.h sys/select.h poll.h)
107 dnl Checks for typedefs, structures, and compiler characteristics.
108 dnl ==============================================================
127 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
128 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
131 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
133 if test "$XGETTEXT" != ""; then
134 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
135 echo "xgettext isn't GNU version"
140 if test "$LINGUAS" != ""; then
141 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
144 # if test "$LINGUAS" = ""; then
145 # ling=` (cd src/po; /bin/ls *.po) `
147 # lcode=`basename $l .po`
148 # LINGUAS="$LINGUAS $lcode"
151 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
155 echo "xgettext and libintl.a don't both exist; will not build i18n support"
165 dnl The Tower of Babel
166 dnl ==================
168 dnl List of supported locales
169 dnl -------------------------
170 supported_locales="cs de es fr gl it ja ko nl no pt ru se tr fi hr el pl ro dk"
171 supported_wprefs_locales="pt hr fr ko ja cs"
173 for lang in $LINGUAS; do
175 for l in $supported_locales; do
176 if test "$l" = "$lang"; then
181 if test "$ok" = 1; then
182 MOFILES="$MOFILES $lang.mo"
184 echo "Locale $lang is not supported."
187 for l in $supported_wprefs_locales; do
188 if test "$l" = "$lang"; then
193 if test "$ok" = 1; then
194 WPMOFILES="$WPMOFILES $lang.mo"
199 dnl Kanji Characters support
200 dnl ========================
203 [ --enable-kanji multibyte character support (kanji, Korean etc.)],,
206 if test "$enable_kanji" = yes; then
209 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
217 dnl XKB keyboard language status
218 dnl ============================
219 AC_ARG_ENABLE(modelock,
220 [ --enable-modelock XKB keyboard language status support],
221 X_CFLAGS="$X_CFLAGS -DXKB_MODELOCK",)
225 dnl Added by Oliver - Support for NLSDIR option, Hi Oliver!
226 dnl ===========================================
228 [ --with-nlsdir=PATH specify where the locale stuff should go ])
230 if test "x$NLSDIR" = "x"; then
231 if test "x$with_nlsdir" != "x"; then
234 NLSDIR=`eval echo $prefix/lib/locale`
238 AC_DEFINE_UNQUOTED(NLSDIR, "$NLSDIR")
247 dnl Support for various hint things
248 dnl ===============================
252 [ --enable-gnome enable stuff needed for GNOME ],
253 [if test x$enableval = xyes; then
254 AC_DEFINE(GNOME_STUFF)
260 [ --enable-kde enable support for KDE window manager (kwm) hints ],
261 [if test x$enableval = xyes; then
267 AC_ARG_ENABLE(openlook,
268 [ --enable-openlook enable support for OPEN LOOK(tm) (olwm) hints ],
269 [if test x$enableval = xyes; then
270 AC_DEFINE(OLWM_HINTS)
276 dnl Disable some stuff that are duplicated in kde
277 dnl ---------------------------------------------
279 [ --enable-lite disable stuff duplicated in KDE/GNOME ],
280 [if test x$enableval = xyes; then
288 dnl ===========================================
289 dnl Stuff that uses X
290 dnl ===========================================
298 XLIBS="$X_EXTRA_LIBS -lX11"
300 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
301 dnl by MANOME Tomonori
302 dnl ===========================================
304 AC_ARG_ENABLE(locale,
305 [ --disable-locale disable use of X locale support],
308 if test "$use_locale" = yes; then
309 AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $XLFLAGS $XLIBS)
317 [ --disable-shape disable shaped window extension support],
318 shape=$enableval, shape=yes)
322 if test "$shape" = yes; then
323 AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
325 AC_DEFINE(SHAPE)], shape=no, $XLFLAGS $XLIBS)
333 [ --disable-shm disable usage of MIT-SHM extension],
334 shm=$enableval, shm=yes)
336 if test "$shm" = yes; then
337 AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
339 if test "$ok" = yes; then
340 AC_CHECK_FUNC(shmget, ok=yes, ok=no)
343 if test "$ok" = yes; then
344 if test "$added_xext" = no; then
345 XLIBS="-lXext $XLIBS"
352 dnl R6 Style Session Management Support
353 dnl ===================================
361 dnl ==============================================
362 dnl Graphic Format Libraries
363 dnl ==============================================
367 dnl Specify paths to look for graphic format libraries
368 dnl ==================================================
370 AC_ARG_WITH(gfx-libs,
371 [ --with-gfx-libs pass compiler flags to look for gfx libraries],
372 [GFXLFLAGS=$withval], [GFXLFLAGS=""])
374 AC_ARG_WITH(gfx-incs,
375 [ --with-gfx-incs pass compiler flags to look for gfx header files],
376 [GFXFLAGS="$withval" GFX_INC_PATH=$withval],
377 [GFXFLAGS="" GFX_INC_PATH=""])
386 [ --disable-xpm disable use of XPM pixmaps through libXpm],
387 xpm=$enableval, xpm=yes)
389 if test "$xpm" = yes; then
390 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
391 my_libok=yes, my_libok=no,
392 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
394 if test "$my_libok" = yes; then
395 my_old_cppflags=$CPPFLAGS
396 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
397 AC_CHECK_HEADER(X11/xpm.h,
398 [GFXLIBS="$GFXLIBS -lXpm"
400 AC_DEFINE(USE_XPM)], supported_gfx="XPM (builtin)")
401 CPPFLAGS=$my_old_cppflags
411 AC_SUBST(X_EXTRA_LIBS)
413 dnl ===============================================
414 dnl End of stuff that uses X
415 dnl ===============================================
422 [ --disable-png disable PNG support through libpng],
423 png=$enableval, png=yes, png=no)
426 if test "$png" = yes ; then
427 AC_CHECK_LIB(png, png_get_valid, my_libok=yes, my_libok=no,
428 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS -lz -lm)
430 if test "$my_libok" = yes; then
431 my_old_cppflags=$CPPFLAGS
432 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
433 AC_CHECK_HEADER(png.h,
434 [GFXLIBS="$GFXLIBS -lpng -lz"
435 supported_gfx="$supported_gfx PNG"
436 AC_DEFINE(USE_PNG)], )
437 CPPFLAGS=$my_old_cppflags
446 [ --disable-jpeg disable JPEG support through libjpeg],
447 jpeg=$enableval, jpeg=yes, jpeg=no)
449 if test "$jpeg" = yes; then
450 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, my_libok=yes, my_libok=no,
451 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS)
453 if test "$my_libok" = yes; then
454 my_old_cppflags=$CPPFLAGS
455 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
456 AC_TRY_CPP(jpeglib.h,
457 [GFXLIBS="$GFXLIBS -ljpeg"
458 supported_gfx="$supported_gfx JPEG"
459 AC_DEFINE(USE_JPEG)], jpeg_not_found=yes)
460 CPPFLAGS=$my_old_cppflags
468 dnl giflib uses dangerous function naming... (namespace clashing)
472 [ --disable-gif disable GIF support through libgif or libungif],
473 gif=$enableval, gif=yes, gif=no)
475 if test "$gif" = yes; then
477 AC_CHECK_LIB(ungif, DGifOpenFileName,
478 [my_libok=yes my_libname=ungif],
479 [retry=yes my_libok=no],
480 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
482 dnl libungif is the same thing as libgif for all practical purposes.
484 if test "$retry" = yes; then
485 AC_CHECK_LIB(gif, DGifOpenFileName,
486 [my_libok=yes my_libname=gif],
488 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
491 if test "$my_libok" = yes; then
492 my_old_cppflags=$CPPFLAGS
493 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
494 AC_CHECK_HEADER(gif_lib.h,
495 [GFXLIBS="$GFXLIBS -l$my_libname"
496 supported_gfx="$supported_gfx GIF"
497 AC_DEFINE(USE_GIF)], )
498 CPPFLAGS=$my_old_cppflags
507 [ --disable-tiff disable use of TIFF images through libtiff],
508 tif=$enableval, tif=yes, tif=no)
511 # TIFF can optionally have JPEG and/or zlib support. Must find out
512 # when they are supported so that correct library flags are passed during
513 # detection and linkage
516 # By default use xpm icons if tiff is not found.
520 if test "$tif" = yes; then
522 AC_CHECK_LIB(tiff, TIFFGetVersion,
523 [my_libok=yes my_libname="-ltiff"], my_libok=no,
524 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lm])
528 unset ac_cv_lib_tiff_TIFFGetVersion
529 if test "$my_libok" = no; then
530 AC_CHECK_LIB(tiff, TIFFGetVersion,
531 [my_libok=yes my_libname="-ltiff -lz"], my_libok=no,
532 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lz -lm])
535 if test "$my_libok" = no; then
536 AC_CHECK_LIB(tiff34, TIFFGetVersion,
537 [my_libok=yes my_libname="-ltiff34"], my_libok=no,
538 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lm])
541 if test "$my_libok" = yes; then
542 my_old_cppflags=$CPPFLAGS
543 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
544 AC_CHECK_HEADER(tiffio.h,
545 [GFXLIBS="$my_libname $GFXLIBS"
547 supported_gfx="$supported_gfx TIFF"
548 AC_DEFINE(USE_TIFF)], )
549 CPPFLAGS=$my_old_cppflags
561 dnl ==============================================
562 dnl End of Graphic Format Libraries
563 dnl ==============================================
569 [ --enable-debug enable debugging ],, enable_debug=no)
571 if test "$enable_debug" = yes; then
573 # Efence makes things too slow. Add it by hand in the Makefiles
574 # if it is really needed.
575 # AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
580 dnl Sound support - Dan
581 dnl =============================================
584 [ --disable-sound disable sound support ],
585 sound=$enableval, sound=yes)
586 if test "$sound" = yes; then
591 # AC_PREFIX_PROGRAM(wmaker)
593 dnl Support for PIXMAPDIR option
594 dnl ============================
595 AC_ARG_WITH(pixmapdir,
596 [ --with-pixmapdir=PATH specify where pixmaps are located [DATADIR/pixmaps]])
598 if test "x$with_pixmapdir" != "x"; then
599 pixmapdir=$with_pixmapdir
601 pixmapdir=`eval echo ${datadir}/pixmaps`
604 AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir")
606 pkgdatadir=`eval echo $datadir`
607 AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker")
610 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
611 dnl ==============================================
615 AC_ARG_WITH(appspath,
616 [ --with-appspath=PATH specify the directory for GNUstep applications], appspath=$withval )
618 if test "x$appspath" = "x"; then
619 gnustepdir='$(prefix)/GNUstep'
621 if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
622 gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
623 gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
626 with_appspath=$gnustepdir/Apps
629 wprefsdir=$with_appspath/WPrefs.app
635 dnl Enable single appicon per wm instance+class combo -cls
636 dnl =====================================================
637 AC_ARG_ENABLE(single-icon,
638 [ --enable-single-icon use single application icon per WM_INSTANCE+WM_CLASS
640 if test "$enableval" = yes; then
641 AC_DEFINE(REDUCE_APPICONS)
647 dnl Nicolai: Program tests for Documentation Section
648 dnl =================================================
650 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
651 dnl if test "x$MAKEINFO" != "x" ; then
652 dnl DOCTYPES="$DOCTYPES info_doc"
654 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
655 dnl if test "x$TEX" != "x" ; then
656 dnl DOCTYPES="$DOCTYPES dvi_doc"
658 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
659 dnl if test "x$DVIPS" != "x" ; then
660 dnl DOCTYPES="$DOCTYPES ps_doc"
662 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
663 dnl if test "x$PERL" != "x" ; then
664 dnl DOCTYPES="$DOCTYPES html_doc"
666 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
667 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
669 dnl AC_SUBST(DOCTYPES)
671 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \
672 WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \
673 wrlib/Makefile doc/Makefile WindowMaker/Makefile \
674 WindowMaker/Backgrounds/Makefile WindowMaker/Defaults/Makefile \
675 WindowMaker/IconSets/Makefile WindowMaker/Icons/Makefile \
676 WindowMaker/Pixmaps/Makefile WindowMaker/Styles/Makefile \
677 WindowMaker/Themes/Makefile \
678 WindowMaker/Themes/Night.themed/Makefile \
679 WindowMaker/Themes/Checker.themed/Makefile \
680 WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
681 WPrefs.app/po/Makefile )
686 dnl Output some helpfull data for compiling WINGs apps
687 dnl ==================================================
690 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
691 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
692 dnl | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
694 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
697 cat <<EOF >get-wraster-flags
703 WCFLAGS="-I\$prefix/include $XCFLAGS $GFXFLAGS"
704 WLFLAGS="-L\$exec_prefix/lib $XLFLAGS $GFXLFLAGS"
705 WLIBS="-lwraster $GFXLIBS $XLIBS -lm"
707 usage="Usage: get-wraster-flags #lp#--cflags#rp# #lp#--lflags#rp# #lp#--libs#rp#"
709 if test \$# -eq 0; then
710 echo "\${usage}" 1>&2
714 while test \$# -gt 0; do
726 echo "\${usage}" 1>&2
736 sed 's/#lp#/[/g' get-wraster-flags | sed 's/#rp#/]/g' > wrlib/get-wraster-flags
738 chmod 755 wrlib/get-wraster-flags
739 rm -f get-wraster-flags
743 dnl Spit out the configuration
744 dnl ==========================
746 supported_gfx="$supported_gfx PPM (built-in)"
748 if test "x$MOFILES" = "x"; then
755 echo "Window Maker was configured as follows:"
757 echo "Installation path prefix: $prefix"
758 echo "Installation path prefix for binaries: $exec_prefix" | sed -e 's|\${prefix}|'"$prefix|"
759 echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
760 echo "Graphic format libraries: $supported_gfx"
761 echo "Sound support: $sound"
762 echo "Translated message files to install: $mof"
763 if test "x$MOFILES" != "x"; then
764 echo "Installation path of translated messages: $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
768 if test "$jpeg_not_found" = yes; then
769 echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
771 echo "JPEG support will not be included because the JPEG library is"
772 echo "not installed correctly or was not found. Background images"
773 echo "from themes will not display as they usually are JPEG files."
775 echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
779 dnl This is for Emacs. I'm lazy, I know... (nicolai)
780 dnl ================================================
782 dnl compile-command: "autoconf"