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 dnl configure/build bundled libraries
33 dnl ===================================
34 AC_CONFIG_SUBDIRS(libPropList)
37 AM_CONFIG_HEADER(src/config.h)
40 dnl Checks for host/os name
41 dnl =======================
45 dnl Checks for programs.
46 dnl ===================
49 dnl AC_PROG_MAKE_SET -- already done by AM_INIT_AUTOMAKE
51 dnl AC_PROG_INSTALL -- already done by AM_INIT_AUTOMAKE
53 AC_PROG_GCC_TRADITIONAL
59 dnl move this earlier in the script... anyone know why this is handled
60 dnl in such a bizarre way?
62 test "x$prefix" = xNONE && prefix=$ac_default_prefix
63 dnl Let make expand exec_prefix.
64 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
67 dnl Checks for library functions.
68 dnl ============================
74 AC_CHECK_FUNCS(gethostname select poll strerror strncasecmp setpgid atexit)
76 if test "x$CPP_PATH" = x; then
77 AC_PATH_PROG(CPP_PATH, cpp, notfound,
78 [/lib /usr/bin /bin /usr/lib /usr/ccs/lib $PATH])
82 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
83 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
84 dnl standard locations
86 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
87 if test "$GCC" = "yes"; then
88 CPP_PATH="gcc -E -x c"
90 if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
91 CPP_PATH="$CPP_PATH -B"
93 echo "cpp, the C preprocessor was not found in your system."
94 echo "Create a symbolic link from it to /lib/cpp and rerun configure"
99 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
103 dnl Checks for header files.
104 dnl =======================
107 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
108 libintl.h sys/select.h poll.h)
112 dnl Checks for typedefs, structures, and compiler characteristics.
113 dnl ==============================================================
132 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
133 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
136 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
138 if test "$XGETTEXT" != ""; then
139 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
140 echo "xgettext isn't GNU version"
145 if test "$LINGUAS" != ""; then
146 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
149 # if test "$LINGUAS" = ""; then
150 # ling=` (cd src/po; /bin/ls *.po) `
152 # lcode=`basename $l .po`
153 # LINGUAS="$LINGUAS $lcode"
156 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
160 echo "xgettext and libintl.a don't both exist; will not build i18n support"
170 dnl The Tower of Babel
171 dnl ==================
173 dnl List of supported locales
174 dnl -------------------------
175 supported_locales="cs de es fr gl it ja ko nl no pt ru se tr fi hr el pl ro dk"
176 supported_wprefs_locales="pt hr fr ko ja cs"
178 for lang in $LINGUAS; do
180 for l in $supported_locales; do
181 if test "$l" = "$lang"; then
186 if test "$ok" = 1; then
187 MOFILES="$MOFILES $lang.mo"
189 echo "Locale $lang is not supported."
192 for l in $supported_wprefs_locales; do
193 if test "$l" = "$lang"; then
198 if test "$ok" = 1; then
199 WPMOFILES="$WPMOFILES $lang.mo"
204 dnl Kanji Characters support
205 dnl ========================
208 [ --enable-kanji multibyte character support (kanji, Korean etc.)],,
211 if test "$enable_kanji" = yes; then
214 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
222 dnl XKB keyboard language status
223 dnl ============================
224 AC_ARG_ENABLE(modelock,
225 [ --enable-modelock XKB keyboard language status support],
226 X_CFLAGS="$X_CFLAGS -DXKB_MODELOCK",)
230 dnl Added by Oliver - Support for NLSDIR option, Hi Oliver!
231 dnl ===========================================
233 [ --with-nlsdir=PATH specify where the locale stuff should go ])
235 if test "x$NLSDIR" = "x"; then
236 if test "x$with_nlsdir" != "x"; then
239 NLSDIR=`eval echo $prefix/lib/locale`
243 AC_DEFINE_UNQUOTED(NLSDIR, "$NLSDIR")
252 dnl Support for various hint things
253 dnl ===============================
257 [ --enable-gnome enable stuff needed for GNOME ],
258 [if test x$enableval = xyes; then
259 AC_DEFINE(GNOME_STUFF)
265 [ --enable-kde enable support for KDE window manager (kwm) hints ],
266 [if test x$enableval = xyes; then
272 AC_ARG_ENABLE(openlook,
273 [ --enable-openlook enable support for OPEN LOOK(tm) (olwm) hints ],
274 [if test x$enableval = xyes; then
275 AC_DEFINE(OLWM_HINTS)
281 dnl Disable some stuff that are duplicated in kde
282 dnl ---------------------------------------------
284 [ --enable-lite disable stuff duplicated in KDE/GNOME ],
285 [if test x$enableval = xyes; then
293 dnl ===========================================
294 dnl Stuff that uses X
295 dnl ===========================================
303 XLIBS="$X_EXTRA_LIBS -lX11"
305 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
306 dnl by MANOME Tomonori
307 dnl ===========================================
309 AC_ARG_ENABLE(locale,
310 [ --disable-locale disable use of X locale support],
313 if test "$use_locale" = yes; then
314 AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $XLFLAGS $XLIBS)
322 [ --disable-shape disable shaped window extension support],
323 shape=$enableval, shape=yes)
327 if test "$shape" = yes; then
328 AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
330 AC_DEFINE(SHAPE)], shape=no, $XLFLAGS $XLIBS)
338 [ --disable-shm disable usage of MIT-SHM extension],
339 shm=$enableval, shm=yes)
341 if test "$shm" = yes; then
342 AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
344 if test "$ok" = yes; then
345 AC_CHECK_FUNC(shmget, ok=yes, ok=no)
348 if test "$ok" = yes; then
349 if test "$added_xext" = no; then
350 XLIBS="-lXext $XLIBS"
357 dnl R6 Style Session Management Support
358 dnl ===================================
366 dnl ==============================================
367 dnl Graphic Format Libraries
368 dnl ==============================================
372 dnl Specify paths to look for graphic format libraries
373 dnl ==================================================
375 AC_ARG_WITH(gfx-libs,
376 [ --with-gfx-libs pass compiler flags to look for gfx libraries],
377 [GFXLFLAGS=$withval], [GFXLFLAGS=""])
379 AC_ARG_WITH(gfx-incs,
380 [ --with-gfx-incs pass compiler flags to look for gfx header files],
381 [GFXFLAGS="$withval" GFX_INC_PATH=$withval],
382 [GFXFLAGS="" GFX_INC_PATH=""])
391 [ --disable-xpm disable use of XPM pixmaps through libXpm],
392 xpm=$enableval, xpm=yes)
394 if test "$xpm" = yes; then
395 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
396 my_libok=yes, my_libok=no,
397 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
399 if test "$my_libok" = yes; then
400 my_old_cppflags=$CPPFLAGS
401 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
402 AC_CHECK_HEADER(X11/xpm.h,
403 [GFXLIBS="$GFXLIBS -lXpm"
405 AC_DEFINE(USE_XPM)], supported_gfx="XPM (builtin)")
406 CPPFLAGS=$my_old_cppflags
416 AC_SUBST(X_EXTRA_LIBS)
418 dnl ===============================================
419 dnl End of stuff that uses X
420 dnl ===============================================
427 [ --disable-png disable PNG support through libpng],
428 png=$enableval, png=yes, png=no)
431 if test "$png" = yes ; then
432 AC_CHECK_LIB(png, png_get_valid, my_libok=yes, my_libok=no,
433 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS -lz -lm)
435 if test "$my_libok" = yes; then
436 my_old_cppflags=$CPPFLAGS
437 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
438 AC_CHECK_HEADER(png.h,
439 [GFXLIBS="$GFXLIBS -lpng -lz"
440 supported_gfx="$supported_gfx PNG"
441 AC_DEFINE(USE_PNG)], )
442 CPPFLAGS=$my_old_cppflags
451 [ --disable-jpeg disable JPEG support through libjpeg],
452 jpeg=$enableval, jpeg=yes, jpeg=no)
454 if test "$jpeg" = yes; then
455 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, my_libok=yes, my_libok=no,
456 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS)
458 if test "$my_libok" = yes; then
459 my_old_cppflags=$CPPFLAGS
460 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
461 AC_TRY_CPP(jpeglib.h,
462 [GFXLIBS="$GFXLIBS -ljpeg"
463 supported_gfx="$supported_gfx JPEG"
464 AC_DEFINE(USE_JPEG)], jpeg_not_found=yes)
465 CPPFLAGS=$my_old_cppflags
473 dnl giflib uses dangerous function naming... (namespace clashing)
477 [ --disable-gif disable GIF support through libgif or libungif],
478 gif=$enableval, gif=yes, gif=no)
480 if test "$gif" = yes; then
482 AC_CHECK_LIB(ungif, DGifOpenFileName,
483 [my_libok=yes my_libname=ungif],
484 [retry=yes my_libok=no],
485 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
487 dnl libungif is the same thing as libgif for all practical purposes.
489 if test "$retry" = yes; then
490 AC_CHECK_LIB(gif, DGifOpenFileName,
491 [my_libok=yes my_libname=gif],
493 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
496 if test "$my_libok" = yes; then
497 my_old_cppflags=$CPPFLAGS
498 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
499 AC_CHECK_HEADER(gif_lib.h,
500 [GFXLIBS="$GFXLIBS -l$my_libname"
501 supported_gfx="$supported_gfx GIF"
502 AC_DEFINE(USE_GIF)], )
503 CPPFLAGS=$my_old_cppflags
512 [ --disable-tiff disable use of TIFF images through libtiff],
513 tif=$enableval, tif=yes, tif=no)
516 # TIFF can optionally have JPEG and/or zlib support. Must find out
517 # when they are supported so that correct library flags are passed during
518 # detection and linkage
521 # By default use xpm icons if tiff is not found.
525 if test "$tif" = yes; then
527 AC_CHECK_LIB(tiff, TIFFGetVersion,
528 [my_libok=yes my_libname="-ltiff"], my_libok=no,
529 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lm])
533 unset ac_cv_lib_tiff_TIFFGetVersion
534 if test "$my_libok" = no; then
535 AC_CHECK_LIB(tiff, TIFFGetVersion,
536 [my_libok=yes my_libname="-ltiff -lz"], my_libok=no,
537 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lz -lm])
540 if test "$my_libok" = no; then
541 AC_CHECK_LIB(tiff34, TIFFGetVersion,
542 [my_libok=yes my_libname="-ltiff34"], my_libok=no,
543 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lm])
546 if test "$my_libok" = yes; then
547 my_old_cppflags=$CPPFLAGS
548 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
549 AC_CHECK_HEADER(tiffio.h,
550 [GFXLIBS="$my_libname $GFXLIBS"
552 supported_gfx="$supported_gfx TIFF"
553 AC_DEFINE(USE_TIFF)], )
554 CPPFLAGS=$my_old_cppflags
566 dnl ==============================================
567 dnl End of Graphic Format Libraries
568 dnl ==============================================
574 [ --enable-debug enable debugging ],, enable_debug=no)
576 if test "$enable_debug" = yes; then
578 # Efence makes things too slow. Add it by hand in the Makefiles
579 # if it is really needed.
580 # AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
585 dnl Sound support - Dan
586 dnl =============================================
589 [ --disable-sound disable sound support ],
590 sound=$enableval, sound=yes)
591 if test "$sound" = yes; then
596 # AC_PREFIX_PROGRAM(wmaker)
598 dnl Support for PIXMAPDIR option
599 dnl ============================
600 AC_ARG_WITH(pixmapdir,
601 [ --with-pixmapdir=PATH specify where pixmaps are located [DATADIR/pixmaps]])
603 if test "x$with_pixmapdir" != "x"; then
604 pixmapdir=$with_pixmapdir
606 pixmapdir=`eval echo ${datadir}/pixmaps`
609 AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir")
611 pkgdatadir=`eval echo $datadir`
612 AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker")
615 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
616 dnl ==============================================
620 AC_ARG_WITH(appspath,
621 [ --with-appspath=PATH specify the directory for GNUstep applications], appspath=$withval )
623 if test "x$appspath" = "x"; then
624 gnustepdir='$(prefix)/GNUstep'
626 if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
627 gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
628 gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
631 with_appspath=$gnustepdir/Apps
634 wprefsdir=$with_appspath/WPrefs.app
640 dnl Enable single appicon per wm instance+class combo -cls
641 dnl =====================================================
642 AC_ARG_ENABLE(single-icon,
643 [ --enable-single-icon use single application icon per WM_INSTANCE+WM_CLASS
645 if test "$enableval" = yes; then
646 AC_DEFINE(REDUCE_APPICONS)
652 dnl Nicolai: Program tests for Documentation Section
653 dnl =================================================
655 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
656 dnl if test "x$MAKEINFO" != "x" ; then
657 dnl DOCTYPES="$DOCTYPES info_doc"
659 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
660 dnl if test "x$TEX" != "x" ; then
661 dnl DOCTYPES="$DOCTYPES dvi_doc"
663 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
664 dnl if test "x$DVIPS" != "x" ; then
665 dnl DOCTYPES="$DOCTYPES ps_doc"
667 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
668 dnl if test "x$PERL" != "x" ; then
669 dnl DOCTYPES="$DOCTYPES html_doc"
671 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
672 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
674 dnl AC_SUBST(DOCTYPES)
676 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \
677 WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \
678 wrlib/Makefile doc/Makefile WindowMaker/Makefile \
679 WindowMaker/Backgrounds/Makefile WindowMaker/Defaults/Makefile \
680 WindowMaker/IconSets/Makefile WindowMaker/Icons/Makefile \
681 WindowMaker/Pixmaps/Makefile WindowMaker/Styles/Makefile \
682 WindowMaker/Themes/Makefile \
683 WindowMaker/Themes/Night.themed/Makefile \
684 WindowMaker/Themes/Checker.themed/Makefile \
685 WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
686 WPrefs.app/po/Makefile )
691 dnl Output some helpfull data for compiling WINGs apps
692 dnl ==================================================
695 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
696 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
697 dnl | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
699 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
702 cat <<EOF >get-wraster-flags
708 WFLAGS="-I\$prefix/include $XCFLAGS"
709 WLIBS="-L\$exec_prefix/lib $XLFLAGS -lwraster $GFXLIBS $XLIBS -lm"
711 usage="Usage: get-wraster-flags #lp#--libs#rp# #lp#--incs#rp#"
713 if test \$# -eq 0; then
714 echo "\${usage}" 1>&2
718 while test \$# -gt 0; do
727 echo "\${usage}" 1>&2
737 sed 's/#lp#/[/g' get-wraster-flags | sed 's/#rp#/]/g' > wrlib/get-wraster-flags
739 chmod 755 wrlib/get-wraster-flags
740 rm -f get-wraster-flags
744 dnl Spit out the configuration
745 dnl ==========================
747 supported_gfx="$supported_gfx PPM (built-in)"
749 if test "x$MOFILES" = "x"; then
756 echo "Window Maker was configured as follows:"
758 echo "Installation path prefix: $prefix"
759 echo "Installation path prefix for binaries: $exec_prefix" | sed -e 's|\${prefix}|'"$prefix|"
760 echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
761 echo "Graphic format libraries: $supported_gfx"
762 echo "Sound support: $sound"
763 echo "Translated message files to install: $mof"
764 if test "x$MOFILES" != "x"; then
765 echo "Installation path of translated messages: $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
769 if test "$jpeg_not_found" = yes; then
770 echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
772 echo "JPEG support will not be included because the JPEG library is"
773 echo "not installed correctly or was not found. Background images"
774 echo "from themes will not display as they usually are JPEG files."
776 echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
780 dnl This is for Emacs. I'm lazy, I know... (nicolai)
781 dnl ================================================
783 dnl compile-command: "autoconf"