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.50.0)
18 dnl configure/build bundled libraries
19 dnl ===================================
20 AC_CONFIG_SUBDIRS(libPropList)
23 AM_CONFIG_HEADER(src/config.h)
26 dnl Checks for host/os name
27 dnl =======================
31 dnl Checks for programs.
32 dnl ===================
39 AC_PROG_GCC_TRADITIONAL
42 dnl Checks for library functions.
43 dnl ============================
49 AC_CHECK_FUNCS(gethostname gettimeofday select poll strerror strncasecmp setpgid)
51 if test "$ac_cv_func_gettimeofday" != yes; then
52 echo "The gettimeofday() system call is not available in your system"
53 echo "but it is required by Window Maker. Sorry."
57 if test "x$CPP_PATH" = x; then
58 AC_PATH_PROG(CPP_PATH, cpp, notfound,
59 /lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib:$PATH)
63 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
64 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
65 dnl standard locations
67 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
68 if test "$GCC" = "yes"; then
69 CPP_PATH="gcc -E -x c"
71 if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
72 CPP_PATH="$CPP_PATH -B"
74 echo "cpp, the C preprocessor was not found in your system."
75 echo "Create a symbolic link from it to /lib/cpp and rerun configure"
80 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
93 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
94 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
97 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
99 if test "$XGETTEXT" != ""; then
100 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
101 echo "xgettext isn't GNU version"
106 if test "$LINGUAS" != ""; then
107 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
110 # if test "$LINGUAS" = ""; then
111 # ling=` (cd src/po; /bin/ls *.po) `
113 # lcode=`basename $l .po`
114 # LINGUAS="$LINGUAS $lcode"
117 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
122 echo "xgettext and libintl.a don't both exist; will not build i18n support"
132 dnl The Tower of Babel
133 dnl ==================
135 dnl List of supported locales
136 dnl -------------------------
137 supported_locales="cs de es fr gl it ja ko nl no pt ru se tr fi hr el pl ro"
138 supported_wprefs_locales="pt hr fr ko ja"
140 for lang in $LINGUAS; do
142 for l in $supported_locales; do
143 if test "$l" = "$lang"; then
148 if test "$ok" = 1; then
149 MOFILES="$MOFILES $lang.mo"
151 echo "Locale $lang is not supported."
154 for l in $supported_wprefs_locales; do
155 if test "$l" = "$lang"; then
160 if test "$ok" = 1; then
161 WPMOFILES="$WPMOFILES $lang.mo"
166 dnl Kanji Characters support
167 dnl ========================
170 [ --enable-kanji multibyte character support (kanji, Korean etc.)],,
173 if test "$enable_kanji" = yes; then
174 I18N_MB="#define I18N_MB"
177 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
182 I18N_MB="#undef I18N_MB"
187 dnl XKB keyboard language status
188 dnl ============================
189 AC_ARG_ENABLE(modelock,
190 [ --enable-modelock XKB keyboard language status support],
191 X_CFLAGS="$X_CFLAGS -DXKB_MODELOCK",)
195 dnl Added by Oliver - Support for NLSDIR option, Hi Oliver!
196 dnl ===========================================
198 [ --with-nlsdir=PATH specify where the locale stuff should go ])
200 if test "x$NLSDIR" = "x"; then
201 if test "x$with_nlsdir" != "x"; then
204 NLSDIR='$(prefix)/lib/locale'
217 dnl Support for various hint things
218 dnl ===============================
222 [ --enable-gnome enable stuff needed for GNOME ],
223 [if test x$enableval = xyes; then
224 AC_DEFINE(GNOME_STUFF)
230 [ --enable-kde enable support for KDE window manager (kwm) hints ],
231 [if test x$enableval = xyes; then
238 dnl Disable some stuff that are duplicated in kde
239 dnl ---------------------------------------------
242 [ --enable-lite disable stuff duplicated in KDE/GNOME ],
243 [if test x$enableval = xyes; then
249 dnl ===========================================
250 dnl Stuff that uses X
251 dnl ===========================================
259 XLIBS="$X_EXTRA_LIBS -lX11"
261 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
262 dnl by MANOME Tomonori
263 dnl ===========================================
264 AC_CHECK_LIB(X11, _Xsetlocale, [X_LOCALE="-DX_LOCALE"],, $XLFLAGS $XLIBS)
272 [ --disable-shape disable shaped window extension support],
273 shape=$enableval, shape=yes)
277 if test "$shape" = yes; then
278 AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
279 added_xext=yes SHAPE=-DSHAPE], shape=no, $XLFLAGS $XLIBS)
289 [ --disable-shm disable usage of MIT-SHM extension],
290 shm=$enableval, shm=yes)
292 if test "$shm" = yes; then
293 AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
295 if test "$ok" = yes; then
296 AC_CHECK_FUNC(shmget, ok=yes, ok=no)
299 if test "$ok" = yes; then
300 if test "$added_xext" = no; then
301 XLIBS="-lXext $XLIBS"
310 dnl R6 Style Session Management Support
311 dnl ===================================
319 dnl ==============================================
320 dnl Graphic Format Libraries
321 dnl ==============================================
325 dnl Specify paths to look for graphic format libraries
326 dnl ==================================================
328 AC_ARG_WITH(gfx-libs,
329 [ --with-gfx-libs pass compiler flags to look for gfx libraries],
330 [GFXLFLAGS=$withval], [GFXLFLAGS=""])
332 AC_ARG_WITH(gfx-incs,
333 [ --with-gfx-incs pass compiler flags to look for gfx header files],
334 [GFXFLAGS="$withval" GFX_INC_PATH=$withval],
335 [GFXFLAGS="" GFX_INC_PATH=""])
344 [ --disable-xpm disable use of XPM pixmaps through libXpm],
345 xpm=$enableval, xpm=yes)
347 if test "$xpm" = yes; then
348 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
349 my_libok=yes, my_libok=no,
350 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
352 if test "$my_libok" = yes; then
353 my_old_cppflags=$CPPFLAGS
354 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
355 AC_CHECK_HEADER(X11/xpm.h,
356 [GFXFLAGS="$GFXFLAGS -DUSE_XPM" GFXLIBS="$GFXLIBS -lXpm"
357 supported_gfx="XPM"], supported_gfx="XPM (builtin)")
358 CPPFLAGS=$my_old_cppflags
368 AC_SUBST(X_EXTRA_LIBS)
370 dnl ===============================================
371 dnl End of stuff that uses X
372 dnl ===============================================
379 [ --disable-png disable PNG support through libpng],
380 png=$enableval, png=yes, png=no)
383 if test "$png" = yes ; then
384 AC_CHECK_LIB(png, png_get_valid, my_libok=yes, my_libok=no,
385 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS -lz -lm)
387 if test "$my_libok" = yes; then
388 my_old_cppflags=$CPPFLAGS
389 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
390 AC_CHECK_HEADER(png.h,
391 [GFXLIBS="$GFXLIBS -lpng -lz" GFXFLAGS="$GFXFLAGS -DUSE_PNG"
392 supported_gfx="$supported_gfx PNG"], )
393 CPPFLAGS=$my_old_cppflags
402 [ --disable-jpeg disable JPEG support through libjpeg],
403 jpeg=$enableval, jpeg=yes, jpeg=no)
405 if test "$jpeg" = yes; then
406 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, my_libok=yes, my_libok=no,
407 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS)
409 if test "$my_libok" = yes; then
410 my_old_cppflags=$CPPFLAGS
411 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
412 AC_TRY_CPP(jpeglib.h,
413 [GFXLIBS="$GFXLIBS -ljpeg" GFXFLAGS="$GFXFLAGS -DUSE_JPEG"
414 supported_gfx="$supported_gfx JPEG"], jpeg_not_found=yes)
415 CPPFLAGS=$my_old_cppflags
423 dnl giflib uses dangerous function naming... (namespace clashing)
427 [ --disable-gif disable GIF support through libgif or libungif],
428 gif=$enableval, gif=yes, gif=no)
430 if test "$gif" = yes; then
432 AC_CHECK_LIB(ungif, DGifOpenFileName,
433 [my_libok=yes my_libname=ungif],
434 [retry=yes my_libok=no],
435 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
437 dnl libungif is the same thing as libgif for all practical purposes.
439 if test "$retry" = yes; then
440 AC_CHECK_LIB(gif, DGifOpenFileName,
441 [my_libok=yes my_libname=gif],
443 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
446 if test "$my_libok" = yes; then
447 my_old_cppflags=$CPPFLAGS
448 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
449 AC_CHECK_HEADER(gif_lib.h,
450 [GFXLIBS="$GFXLIBS -l$my_libname" GFXFLAGS="$GFXFLAGS -DUSE_GIF"
451 supported_gfx="$supported_gfx GIF"], )
452 CPPFLAGS=$my_old_cppflags
461 [ --disable-tiff disable use of TIFF images through libtiff],
462 tif=$enableval, tif=yes, tif=no)
465 # TIFF can optionally have JPEG and/or zlib support. Must find out
466 # when they are supported so that correct library flags are passed during
467 # detection and linkage
470 # By default use xpm icons if tiff is not found.
474 if test "$tif" = yes; then
476 AC_CHECK_LIB(tiff, TIFFGetVersion,
477 [my_libok=yes my_libname="-ltiff"], my_libok=no,
478 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lm])
482 unset ac_cv_lib_tiff_TIFFGetVersion
483 if test "$my_libok" = no; then
484 AC_CHECK_LIB(tiff, TIFFGetVersion,
485 [my_libok=yes my_libname="-ltiff -lz"], my_libok=no,
486 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lz -lm])
489 if test "$my_libok" = no; then
490 AC_CHECK_LIB(tiff34, TIFFGetVersion,
491 [my_libok=yes my_libname="-ltiff34"], my_libok=no,
492 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lm])
495 if test "$my_libok" = yes; then
496 my_old_cppflags=$CPPFLAGS
497 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
498 AC_CHECK_HEADER(tiffio.h,
499 [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="$my_libname $GFXLIBS"
500 ICONEXT="tiff" supported_gfx="$supported_gfx TIFF"], )
501 CPPFLAGS=$my_old_cppflags
513 dnl ==============================================
514 dnl End of Graphic Format Libraries
515 dnl ==============================================
521 [ --enable-debug enable debugging ],, enable_debug=no)
523 if test "$enable_debug" = yes; then
525 # Efence makes things too slow. Add it by hand in the Makefiles
526 # if it is really needed.
527 # AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
532 dnl Sound support - Dan
533 dnl =============================================
536 [ --disable-sound disable sound support ],
537 sound=$enableval, sound=yes)
538 if test "$sound" = yes; then
539 SOUND="#define WMSOUND"
541 SOUND="#undef WMSOUND"
546 # AC_PREFIX_PROGRAM(wmaker)
548 if test "${prefix}" = "NONE"; then
551 if test "${exec_prefix}" = "NONE"; then
552 exec_prefix='$(prefix)'
555 dnl Support for PIXMAPDIR option
556 dnl ============================
557 AC_ARG_WITH(pixmapdir,
558 [ --with-pixmapdir=PATH specify where pixmaps are located [DATADIR/pixmaps]])
560 if test "x$with_pixmapdir" != "x"; then
561 pixmapdir=$with_pixmapdir
563 pixmapdir='$(datadir)/pixmaps'
569 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
570 dnl ==============================================
574 AC_ARG_WITH(appspath,
575 [ --with-appspath=PATH specify the path of the GNUstep applications
576 directory], appspath=$withval )
578 if test "x$appspath" = "x"; then
579 gnustepdir='$(prefix)/GNUstep'
581 if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
582 gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
583 gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
586 with_appspath=$gnustepdir/Apps
589 wprefsdir=$with_appspath/WPrefs.app
595 dnl Enable single appicon per wm instance+class combo -cls
596 dnl =====================================================
597 AC_ARG_ENABLE(single-icon,
598 [ --enable-single-icon use single application icon per WM_INSTANCE+WM_CLASS
600 if test "$enableval" = yes; then
601 REDUCE_APPICONS="#define REDUCE_APPICONS"
603 REDUCE_APPICONS="#undef REDUCE_APPICONS"
605 REDUCE_APPICONS="#undef REDUCE_APPICONS"
607 AC_SUBST(REDUCE_APPICONS)
610 dnl Checks for header files.
611 dnl =======================
614 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
615 libintl.h sys/select.h poll.h)
619 dnl Checks for typedefs, structures, and compiler characteristics.
620 dnl ==============================================================
629 dnl Shared Library Support (unfinished)
630 dnl ===================================
633 #AC_ARG_ENABLE(shared,
634 #[ --enable-shared build libraries as shared ], enable_shared=yes,
637 if test "$enable_shared" = yes; then
638 if test "$GCC" = yes; then
640 LDSHARED='$CC -shared'
642 # find system name and corresponding cc options
643 case `(uname -sr || echo unknown) 2>/dev/null` in
645 _CFLAGS="-fast -xcg89 -KPIC -R."
651 _CFLAGS="-ansi -rpath ."
652 LDSHARED='$CC -shared';;
655 LDSHARED='$CC -dy -KPIC -G';;
659 SHAREDLIBS='libz.sl';;
662 LDSHARED='$CC -shared';;
666 AC_MSG_CHECKING([for shared library support])
670 int hello() { printf("hello\n"); }
674 # we must test in two steps (cc then ld), required at least on SunOS 4.x
675 if test "`($CC -c $_CFLAGS $test.c) 2>&1`" = "" &&
676 test "`($LDSHARED -o $test.so $test.o) 2>&1`" = ""; then
677 CFLAGS="$CFLAGS $_CFLAGS"
678 WRASTERLIB='libwraster.so.$(WRASTER_VER)'
679 WINGSLIB='libWINGs.so.$(WINGS_VER)'
680 AC_MSG_RESULT([yes, building shared])
683 WRASTERLIB='libwraster.a'
684 WINGSLIB='libWINGs.a'
685 AC_MSG_RESULT([no, building static])
687 rm -f $test.[co] $test.so
690 #AC_SUBST(WRASTER_VER)
692 #AC_SUBST(WRASTERLIB)
699 dnl Nicolai: Program tests for Documentation Section
700 dnl =================================================
702 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
703 dnl if test "x$MAKEINFO" != "x" ; then
704 dnl DOCTYPES="$DOCTYPES info_doc"
706 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
707 dnl if test "x$TEX" != "x" ; then
708 dnl DOCTYPES="$DOCTYPES dvi_doc"
710 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
711 dnl if test "x$DVIPS" != "x" ; then
712 dnl DOCTYPES="$DOCTYPES ps_doc"
714 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
715 dnl if test "x$PERL" != "x" ; then
716 dnl DOCTYPES="$DOCTYPES html_doc"
718 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
719 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
721 dnl AC_SUBST(DOCTYPES)
723 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \
724 WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \
725 wrlib/Makefile doc/Makefile WindowMaker/Makefile \
726 WindowMaker/Backgrounds/Makefile WindowMaker/Defaults/Makefile \
727 WindowMaker/IconSets/Makefile WindowMaker/Icons/Makefile \
728 WindowMaker/Pixmaps/Makefile WindowMaker/Styles/Makefile \
729 WindowMaker/Themes/Makefile \
730 WindowMaker/Themes/Night.themed/Makefile \
731 WindowMaker/Themes/Checker.themed/Makefile \
732 WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
733 WPrefs.app/po/Makefile )
738 dnl Output some helpfull data for compiling WINGs apps
739 dnl ==================================================
742 echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
743 echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
744 | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
748 dnl Spit out the configuration
749 dnl ==========================
751 supported_gfx="$supported_gfx PPM (built-in)"
753 if test "x$MOFILES" = "x"; then
760 echo "Window Maker was configured as follows:"
762 echo "Installation path prefix: $prefix"
763 echo "Installation path prefix for binaries: $exec_prefix" | sed -e 's|\$(prefix)|'"$prefix|"
764 echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
765 echo "Graphic format libraries: $supported_gfx"
766 echo "Sound support: $sound"
767 echo "Translated message files to install: $mof"
768 if test "x$MOFILES" != "x"; then
769 echo "Installation path of translated messages: $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
771 if test x$kde_on != x; then
772 echo "KDE support enabled"
774 if test x$LITE != x; then
775 echo "Duplicated stuff with KDE will be removed"
777 if test x$gnome_on != x; then
778 echo "GNOME support enabled"
781 if test "$jpeg_not_found" = yes; then
782 echo "JPEG support will not be included because the JPEG library is"
783 echo "not installed correctly or was not found. Background images"
784 echo "from themes will not display as they usually are JPEG files."
788 dnl This is for Emacs. I'm lazy, I know... (nicolai)
789 dnl ================================================
791 dnl compile-command: "autoconf"