2 dnl Window Maker autoconf input.
4 dnl Process with: aclocal; autoconf; automake
9 AC_INIT(src/WindowMaker.h)
13 AM_INIT_AUTOMAKE(WindowMaker, 0.60.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 _bindir=`eval echo $bindir`
63 _bindir=`eval echo $_bindir`
65 _libdir=`eval echo $libdir`
66 _libdir=`eval echo $_libdir`
67 lib_search_path="-L$_libdir"
69 inc_search_path=`eval echo $includedir`
70 inc_search_path="-I`eval echo $inc_search_path`"
74 dnl Check for RedHat bugs
75 dnl =====================
77 WM_CHECK_REDCRAP_BUGS($prefix,$_bindir,$_libdir)
81 dnl Specify paths to look for libraries and headers
82 dnl ===============================================
83 AC_ARG_WITH(libs-from,
84 [ --with-libs-from pass compiler flags to look for libraries],
85 [lib_search_path="$withval $lib_search_path"])
87 AC_ARG_WITH(incs-from,
88 [ --with-incs-from pass compiler flags to look for header files],
89 [inc_search_path="$withval $inc_search_path"])
93 dnl Checks for library functions.
94 dnl ============================
99 AC_CHECK_FUNCS(gethostname select poll strerror strncasecmp setpgid atexit)
103 dnl Loading of dynamic libraries at runtime
104 dnl =======================================
107 AC_CHECK_FUNC(dlopen, [HAVEDL="yes"],
108 AC_CHECK_LIB(dl, dlopen, [DLLIBS="-ldl" HAVEDL="yes"],
111 if test "x$HAVEDL" = xyes; then
112 AC_CHECK_HEADERS(dlfcn.h)
119 if test "x$CPP_PATH" = x; then
120 AC_PATH_PROG(CPP_PATH, cpp, notfound,
121 $PATH:/lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib)
125 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
126 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
127 dnl standard locations
129 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
130 if test "$GCC" = "yes"; then
131 CPP_PATH="gcc -E -x c"
133 if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
134 CPP_PATH="$CPP_PATH -B"
136 echo "cpp, the C preprocessor was not found in your system."
137 echo "Create a symbolic link from it to /lib/cpp and rerun configure"
142 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
146 dnl Checks for header files.
147 dnl =======================
151 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
152 libintl.h sys/select.h poll.h)
156 dnl Checks for typedefs, structures, and compiler characteristics.
157 dnl ==============================================================
175 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
176 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
179 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
181 if test "$XGETTEXT" != ""; then
182 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
183 echo "xgettext isn't GNU version"
188 if test "$LINGUAS" != ""; then
189 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
192 # if test "$LINGUAS" = ""; then
193 # ling=` (cd src/po; /bin/ls *.po) `
195 # lcode=`basename $l .po`
196 # LINGUAS="$LINGUAS $lcode"
199 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
203 echo "xgettext and libintl.a don't both exist; will not build i18n support"
213 dnl The Tower of Babel
214 dnl ==================
216 dnl List of supported locales
217 dnl -------------------------
218 supported_locales="cs de es fr gl it ja ko nl no pt ru se tr fi hr el pl ro da zh_TW.Big5 zh_CN sk"
219 supported_wprefs_locales="pt hr fr ko ja cs zh_TW.Big5 es zh_CN fi it ru"
221 for lang in $LINGUAS; do
223 for l in $supported_locales; do
224 if test "$l" = "$lang"; then
229 if test "$ok" = 1; then
230 MOFILES="$MOFILES $lang.mo"
232 echo "Locale $lang is not supported."
235 for l in $supported_wprefs_locales; do
236 if test "$l" = "$lang"; then
241 if test "$ok" = 1; then
242 WPMOFILES="$WPMOFILES $lang.mo"
247 dnl Kanji Characters support
248 dnl ========================
252 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
259 dnl Added by Oliver - Support for NLSDIR option, Hi Oliver!
260 dnl ===========================================
262 [ --with-nlsdir=PATH specify where the locale stuff should go ])
265 if test "x$NLSDIR" = "x"; then
266 if test "x$with_nlsdir" != "x"; then
269 NLSDIR='$(prefix)/lib/locale'
283 dnl Support for various hint things
284 dnl ===============================
288 [ --enable-gnome enable stuff needed for GNOME ],
289 [if test x$enableval = xyes; then
290 AC_DEFINE(GNOME_STUFF)
296 [ --enable-kde enable support for KDE window manager (kwm) hints ],
297 [if test x$enableval = xyes; then
303 AC_ARG_ENABLE(openlook,
304 [ --enable-openlook enable support for OPEN LOOK(tm) (olwm) hints ],
305 [if test x$enableval = xyes; then
306 AC_DEFINE(OLWM_HINTS)
312 dnl Disable some stuff that are duplicated in kde
313 dnl ---------------------------------------------
315 [ --enable-lite disable some stuff (dont use it) ],
316 [if test x$enableval = xyes; then
324 dnl ===========================================
325 dnl Stuff that uses X
326 dnl ===========================================
330 X_LIBRARY_PATH=$x_libraries
336 XLIBS="-lX11 $X_EXTRA_LIBS"
339 lib_search_path="$lib_search_path $XLFLAGS"
340 inc_search_path="$inc_search_path $XCFLAGS"
343 AC_SUBST(X_LIBRARY_PATH)
347 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
348 dnl by MANOME Tomonori
349 dnl ===========================================
351 AC_ARG_ENABLE(locale,
352 [ --disable-locale disable use of X locale support],
355 if test "$use_locale" = yes; then
356 AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $XLFLAGS $XLIBS)
360 dnl XKB keyboard language status
361 dnl ============================
362 AC_ARG_ENABLE(modelock,
363 [ --enable-modelock XKB keyboard language status support],
364 AC_DEFINE(XKB_MODELOCK))
372 [ --disable-shape disable shaped window extension support],
373 shape=$enableval, shape=yes)
377 if test "$shape" = yes; then
378 AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
380 AC_DEFINE(SHAPE)], shape=no, $XLFLAGS $XLIBS)
388 [ --disable-shm disable usage of MIT-SHM extension],
389 shm=$enableval, shm=yes)
391 if test "$shm" = yes; then
392 AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
394 if test "$ok" = yes; then
395 AC_CHECK_FUNC(shmget, ok=yes, ok=no)
398 if test "$ok" = yes; then
399 if test "$added_xext" = no; then
400 XLIBS="-lXext $XLIBS"
407 dnl R6 Style Session Management Support
408 dnl ===================================
417 dnl Check for libPropList
418 dnl =====================
422 WM_CHECK_LIB(PropList, PLGetString, $X_EXTRA_LIBS)
423 if test "x$ac_cv_lib_PropList_PLGetString" = xyes; then
424 WM_CHECK_HEADER(proplist.h)
425 if test "x$ac_cv_header_proplist_h" = xyes; then
430 if test "x$LIBPL" = "x"; then
432 echo "ERROR!!! libPropList is not installed, or could not be found."
433 echo " Window Maker requires libPropList to build."
434 echo " Please read INSTALL to find where you can find libPropList,"
435 echo " and install it first."
436 echo " If you already have it installed, try using the"
437 if test "x$ac_cv_lib_PropList_PLGetString" != xyes; then
438 echo " --with-libs-from flag to tell configure where the library"
439 echo " is installed and"
441 echo " --with-incs-from flag to tell configure where the header"
442 echo " files are installed"
450 dnl ==============================================
451 dnl Graphic Format Libraries
452 dnl ==============================================
462 [ --disable-xpm disable use of XPM pixmaps through libXpm],
463 xpm=$enableval, xpm=yes)
465 if test "$xpm" = yes; then
466 WM_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [$XLFLAGS $XLIBS])
468 if test "x$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = xyes; then
469 WM_CHECK_HEADER(X11/xpm.h)
470 if test "x$ac_cv_header_X11_xpm_h" = xyes; then
471 GFXLIBS="$GFXLIBS -lXpm"
475 supported_gfx="builtin-XPM"
486 AC_SUBST(X_EXTRA_LIBS)
488 dnl ===============================================
489 dnl End of stuff that uses X
490 dnl ===============================================
497 [ --disable-png disable PNG support through libpng],
498 png=$enableval, png=yes, png=no)
501 if test "$png" = yes ; then
502 WM_CHECK_LIB(png, png_get_valid, [-lz -lm])
504 if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
505 WM_CHECK_HEADER(png.h)
506 if test "x$ac_cv_header_png_h" = xyes; then
507 GFXLIBS="$GFXLIBS -lpng -lz"
508 supported_gfx="$supported_gfx PNG"
520 [ --disable-jpeg disable JPEG support through libjpeg],
521 jpeg=$enableval, jpeg=yes, jpeg=no)
523 if test "$jpeg" = yes; then
524 WM_CHECK_LIB(jpeg, jpeg_destroy_compress)
526 if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = xyes; then
530 WM_CHECK_HEADER(jpeglib.h)
531 if test "x$ac_cv_header_jpeglib_h" = xyes; then
532 GFXLIBS="$GFXLIBS -ljpeg"
533 supported_gfx="$supported_gfx JPEG"
544 [ --disable-gif disable GIF support through libgif or libungif],
545 gif=$enableval, gif=yes, gif=no)
547 if test "$gif" = yes; then
549 WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
550 if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
554 dnl libungif is the same thing as libgif for all practical purposes.
556 if test "x$my_libname" = x; then
557 WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
558 if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
563 if test "$my_libname" != x; then
564 WM_CHECK_HEADER(gif_lib.h)
565 if test "x$ac_cv_header_gif_lib_h" = xyes; then
566 GFXLIBS="$GFXLIBS $my_libname"
567 supported_gfx="$supported_gfx GIF"
578 [ --disable-tiff disable use of TIFF images through libtiff],
579 tif=$enableval, tif=yes, tif=no)
582 # TIFF can optionally have JPEG and/or zlib support. Must find out
583 # when they are supported so that correct library flags are passed during
584 # detection and linkage
587 # By default use xpm icons if tiff is not found.
591 if test "$tif" = yes; then
593 WM_CHECK_LIB(tiff, TIFFGetVersion, [-lm])
594 if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
600 unset ac_cv_lib_tiff_TIFFGetVersion
601 if test "x$my_libname" = x; then
602 WM_CHECK_LIB(tiff, TIFFGetVersion, [$ljpeg -lz -lm])
603 if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
604 my_libname="-ltiff -lz"
608 if test "x$my_libname" = x; then
609 WM_CHECK_LIB(tiff34, TIFFGetVersion, [$ljpeg -lm])
610 if test "x$ac_cv_lib_tiff34_TIFFGetVersion" = xyes; then
611 my_libname="-ltiff34"
616 if test "x$my_libname" != x; then
617 WM_CHECK_HEADER(tiffio.h)
618 if test "x$ac_cv_header_tiffio_h" = xyes; then
619 GFXLIBS="$my_libname $GFXLIBS"
621 supported_gfx="$supported_gfx TIFF"
627 LIBRARY_SEARCH_PATH="$lib_search_path"
628 HEADER_SEARCH_PATH="$inc_search_path"
630 AC_SUBST(LIBRARY_SEARCH_PATH)
631 AC_SUBST(HEADER_SEARCH_PATH)
638 dnl ==============================================
639 dnl End of Graphic Format Libraries
640 dnl ==============================================
646 [ --enable-debug enable debugging ],, enable_debug=no)
648 if test "$enable_debug" = yes; then
650 # Efence makes things too slow. Add it by hand in the Makefiles
651 # if it is really needed.
652 # AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
657 dnl Sound support - Dan
658 dnl =============================================
661 [ --disable-sound disable sound support ],
662 sound=$enableval, sound=yes)
663 if test "$sound" = yes; then
668 # AC_PREFIX_PROGRAM(wmaker)
670 dnl Support for PIXMAPDIR option
671 dnl ============================
672 AC_ARG_WITH(pixmapdir,
673 [ --with-pixmapdir=PATH specify where pixmaps are located [DATADIR/pixmaps]])
675 if test "x$with_pixmapdir" != "x"; then
676 pixmapdir=$with_pixmapdir
678 pixmapdir=`eval echo ${datadir}/pixmaps`
681 AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir")
683 pkgdatadir=`eval echo $datadir`
684 AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker")
686 _sysconfdir=`eval echo $sysconfdir`
687 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$_sysconfdir/WindowMaker")
690 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
691 dnl ==============================================
695 AC_ARG_WITH(appspath,
696 [ --with-appspath=PATH specify the directory for GNUstep applications], appspath=$withval )
698 if test "x$appspath" = "x"; then
699 gnustepdir='$(prefix)/GNUstep'
701 if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
702 gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
703 gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
706 with_appspath=$gnustepdir/Apps
709 wprefsdir=$with_appspath/WPrefs.app
715 dnl Enable single appicon per wm instance+class combo -cls
716 dnl =====================================================
717 AC_ARG_ENABLE(single-icon,
718 [ --enable-single-icon use single application icon per WM_INSTANCE+WM_CLASS
720 if test "$enableval" = yes; then
721 AC_DEFINE(REDUCE_APPICONS)
725 dnl Enable User Defined Menu thing
726 dnl ==================================
727 AC_ARG_ENABLE(usermenu,
728 [ --enable-usermenu user defined menus for applications
730 if test "$enableval" = yes; then
737 dnl Nicolai: Program tests for Documentation Section
738 dnl =================================================
740 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
741 dnl if test "x$MAKEINFO" != "x" ; then
742 dnl DOCTYPES="$DOCTYPES info_doc"
744 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
745 dnl if test "x$TEX" != "x" ; then
746 dnl DOCTYPES="$DOCTYPES dvi_doc"
748 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
749 dnl if test "x$DVIPS" != "x" ; then
750 dnl DOCTYPES="$DOCTYPES ps_doc"
752 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
753 dnl if test "x$PERL" != "x" ; then
754 dnl DOCTYPES="$DOCTYPES html_doc"
756 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
757 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
759 dnl AC_SUBST(DOCTYPES)
761 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \
762 WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \
763 wrlib/Makefile doc/Makefile WindowMaker/Makefile contrib/Makefile \
764 WindowMaker/Backgrounds/Makefile WindowMaker/Defaults/Makefile \
765 WindowMaker/IconSets/Makefile WindowMaker/Icons/Makefile \
766 WindowMaker/Pixmaps/Makefile WindowMaker/Styles/Makefile \
767 WindowMaker/Themes/Makefile \
768 WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
769 WPrefs.app/po/Makefile )
774 dnl Output some helpfull data for compiling WINGs apps
775 dnl ==================================================
778 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
779 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
780 dnl | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
782 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
785 cat <<EOF >get-wraster-flags
791 WCFLAGS="-I\$prefix/include $inc_search_path"
792 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
793 WLIBS="-lwraster $GFXLIBS $XLIBS -lm"
795 usage="Usage: get-wraster-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
797 if test \$# -eq 0; then
798 echo "\${usage}" 1>&2
802 while test \$# -gt 0; do
814 echo "\${usage}" 1>&2
824 sed 's/#lp#/[/g' get-wraster-flags | sed 's/#rp#/]/g' > wrlib/get-wraster-flags
826 chmod 755 wrlib/get-wraster-flags
827 rm -f get-wraster-flags
831 dnl Spit out the configuration
832 dnl ==========================
834 supported_gfx="$supported_gfx builtin-PPM"
836 if test "x$MOFILES" = "x"; then
844 echo "Window Maker was configured as follows:"
846 echo "Installation path prefix: $prefix"
847 echo "Installation path prefix for binaries: $_bindir"
848 echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
849 echo "Graphic format libraries: $supported_gfx"
850 echo "Sound support: $sound"
851 echo "Translated message files to install: $mof"
852 if test "x$MOFILES" != "x"; then
853 echo "Installation path of translated messages: $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
856 WM_PRINT_REDCRAP_BUG_STATUS
858 if test "x$ac_cv_header_jpeglib_h" != xyes; then
859 echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
861 echo "JPEG support will not be included because the JPEG library is"
862 echo "not installed correctly or was not found. Background images"
863 echo "from themes will not display as they usually are JPEG files."
865 echo "To fix, download and install the jpeg library and/or make sure you"
866 echo "installed all jpeg related packages, like jpeg-devel."
868 echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
872 dnl This is for Emacs. I'm lazy, I know... (nicolai)
873 dnl ================================================
875 dnl compile-command: "autoconf"