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.61.1)
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__ "/'
34 AM_CONFIG_HEADER(src/config.h)
37 dnl Checks for host/os name
38 dnl =======================
42 dnl Checks for programs.
43 dnl ===================
46 dnl AC_PROG_MAKE_SET -- already done by AM_INIT_AUTOMAKE
48 dnl AC_PROG_INSTALL -- already done by AM_INIT_AUTOMAKE
50 AC_PROG_GCC_TRADITIONAL
56 dnl move this earlier in the script... anyone know why this is handled
57 dnl in such a bizarre way?
59 test "x$prefix" = xNONE && prefix=$ac_default_prefix
60 dnl Let make expand exec_prefix.
61 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
64 _bindir=`eval echo $bindir`
65 _bindir=`eval echo $_bindir`
67 _libdir=`eval echo $libdir`
68 _libdir=`eval echo $_libdir`
69 lib_search_path="-L$_libdir"
71 inc_search_path=`eval echo $includedir`
72 inc_search_path="-I`eval echo $inc_search_path`"
76 dnl Check for RedHat bugs
77 dnl =====================
79 dnl WM_CHECK_REDCRAP_BUGS($prefix,$_bindir,$_libdir)
83 dnl Specify paths to look for libraries and headers
84 dnl ===============================================
85 AC_ARG_WITH(libs-from,
86 [ --with-libs-from pass compiler flags to look for libraries],
87 [lib_search_path="$withval $lib_search_path"])
89 AC_ARG_WITH(incs-from,
90 [ --with-incs-from pass compiler flags to look for header files],
91 [inc_search_path="$withval $inc_search_path"])
95 dnl Checks for library functions.
96 dnl ============================
101 AC_CHECK_FUNCS(gethostname select poll strerror strncasecmp setpgid atexit)
105 dnl Loading of dynamic libraries at runtime
106 dnl =======================================
109 AC_CHECK_FUNC(dlopen, [HAVEDL="yes"],
110 AC_CHECK_LIB(dl, dlopen, [DLLIBS="-ldl" HAVEDL="yes"],
113 if test "x$HAVEDL" = xyes; then
114 AC_CHECK_HEADERS(dlfcn.h)
121 if test "x$CPP_PATH" = x; then
122 AC_PATH_PROG(CPP_PATH, cpp, notfound,
123 $PATH:/lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib)
127 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
128 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
129 dnl standard locations
131 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
132 if test "$GCC" = "yes"; then
133 CPP_PATH="gcc -E -x c"
135 if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
136 CPP_PATH="$CPP_PATH -B"
138 echo "cpp, the C preprocessor was not found in your system."
139 echo "Create a symbolic link from it to /lib/cpp and rerun configure"
144 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
148 dnl Checks for header files.
149 dnl =======================
153 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
154 libintl.h sys/select.h poll.h)
158 dnl Checks for typedefs, structures, and compiler characteristics.
159 dnl ==============================================================
177 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
178 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
181 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
183 if test "$XGETTEXT" != ""; then
184 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
185 echo "xgettext isn't GNU version"
190 if test "$LINGUAS" != ""; then
191 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
194 # if test "$LINGUAS" = ""; then
195 # ling=` (cd src/po; /bin/ls *.po) `
197 # lcode=`basename $l .po`
198 # LINGUAS="$LINGUAS $lcode"
201 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
205 echo "xgettext and libintl.a don't both exist; will not build i18n support"
215 dnl The Tower of Babel
216 dnl ==================
218 dnl List of supported locales
219 dnl -------------------------
220 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"
221 supported_wprefs_locales="pt hr fr ko ja cs zh_TW.Big5 es zh_CN fi it ru de"
223 for lang in $LINGUAS; do
225 for l in $supported_locales; do
226 if test "$l" = "$lang"; then
231 if test "$ok" = 1; then
232 MOFILES="$MOFILES $lang.mo"
234 echo "Locale $lang is not supported."
237 for l in $supported_wprefs_locales; do
238 if test "$l" = "$lang"; then
243 if test "$ok" = 1; then
244 WPMOFILES="$WPMOFILES $lang.mo"
249 dnl Kanji Characters support
250 dnl ========================
254 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
261 dnl Added by Oliver - Support for NLSDIR option, Hi Oliver!
262 dnl ===========================================
264 [ --with-nlsdir=PATH specify where the locale stuff should go ])
267 if test "x$NLSDIR" = "x"; then
268 if test "x$with_nlsdir" != "x"; then
271 NLSDIR='$(prefix)/lib/locale'
285 dnl Support for various hint things
286 dnl ===============================
290 [ --enable-gnome enable stuff needed for GNOME ],
291 [if test x$enableval = xyes; then
292 AC_DEFINE(GNOME_STUFF)
298 [ --enable-kde enable support for KDE window manager (kwm) hints ],
299 [if test x$enableval = xyes; then
305 AC_ARG_ENABLE(openlook,
306 [ --enable-openlook enable support for OPEN LOOK(tm) (olwm) hints ],
307 [if test x$enableval = xyes; then
308 AC_DEFINE(OLWM_HINTS)
314 dnl Disable some stuff that are duplicated in kde
315 dnl ---------------------------------------------
317 [ --enable-lite disable some stuff (dont use it) ],
318 [if test x$enableval = xyes; then
332 AC_CHECK_FUNC(connect,,
333 AC_CHECK_LIB(socket, connect, NETLIBS="$NETLIBS -lsocket"))
335 AC_CHECK_FUNC(gethostbyname,,
336 AC_CHECK_LIB(nsl, gethostbyname, NETLIBS="$NETLIBS -lnsl"))
338 AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON),
339 for lib in resolv socket inet bsd; do
340 AC_CHECK_LIB($lib, inet_aton, [AC_DEFINE(HAVE_INET_ATON)
341 NETLIBS="$NETLIBS -l$lib"; break],, $NETLIBS)
347 dnl ===========================================
348 dnl Stuff that uses X
349 dnl ===========================================
354 AC_MSG_ERROR([The path for the X11 files not found!
355 Make sure you have X and it's headers and libraries (the -devel packages
356 in Linux) installed.])
359 X_LIBRARY_PATH=$x_libraries
365 XLIBS="-lX11 $X_EXTRA_LIBS"
368 lib_search_path="$lib_search_path $XLFLAGS"
369 inc_search_path="$inc_search_path $XCFLAGS"
372 AC_SUBST(X_LIBRARY_PATH)
376 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
377 dnl by MANOME Tomonori
378 dnl ===========================================
380 AC_ARG_ENABLE(locale,
381 [ --disable-locale disable use of X locale support],
384 if test "$use_locale" = yes; then
385 AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $XLFLAGS $XLIBS)
389 dnl XKB keyboard language status
390 dnl ============================
391 AC_ARG_ENABLE(modelock,
392 [ --enable-modelock XKB keyboard language status support],
393 AC_DEFINE(XKB_MODELOCK))
401 [ --disable-shape disable shaped window extension support],
402 shape=$enableval, shape=yes)
406 if test "$shape" = yes; then
407 AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
409 AC_DEFINE(SHAPE)], shape=no, $XLFLAGS $XLIBS)
417 [ --disable-shm disable usage of MIT-SHM extension],
418 shm=$enableval, shm=yes)
420 if test "$shm" = yes; then
421 AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
423 if test "$ok" = yes; then
424 AC_CHECK_FUNC(shmget, ok=yes, ok=no)
427 if test "$ok" = yes; then
428 if test "$added_xext" = no; then
429 XLIBS="-lXext $XLIBS"
436 dnl R6 Style Session Management Support
437 dnl ===================================
446 dnl Check for libPropList
447 dnl =====================
451 WM_CHECK_LIB(PropList, PLGetString, $X_EXTRA_LIBS)
452 if test "x$ac_cv_lib_PropList_PLGetString" = xyes; then
453 WM_CHECK_HEADER(proplist.h)
454 if test "x$ac_cv_header_proplist_h" = xyes; then
459 if test "x$LIBPL" = "x"; then
461 echo "ERROR!!! libPropList is not installed, or could not be found."
462 echo " Window Maker requires libPropList to build."
463 echo " Please read INSTALL to find where you can find libPropList,"
464 echo " and install it first."
465 if test x$W_SYSTEM = xLinux; then
466 echo " If you're using some prepackaged version of libPropList,"
467 echo " make sure you install it's \"development\" package as well."
469 echo " If you already have it installed, try using the"
470 if test "x$ac_cv_lib_PropList_PLGetString" != xyes; then
471 echo " --with-libs-from flag to tell configure where the library"
472 echo " is installed and"
474 echo " --with-incs-from flag to tell configure where the header"
475 echo " files are installed"
483 dnl ==============================================
484 dnl Graphic Format Libraries
485 dnl ==============================================
495 [ --disable-xpm disable use of XPM pixmaps through libXpm],
496 xpm=$enableval, xpm=yes)
498 if test "$xpm" = yes; then
499 WM_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [$XLFLAGS $XLIBS])
501 if test "x$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = xyes; then
502 WM_CHECK_HEADER(X11/xpm.h)
503 if test "x$ac_cv_header_X11_xpm_h" = xyes; then
504 GFXLIBS="$GFXLIBS -lXpm"
508 supported_gfx="builtin-XPM"
519 AC_SUBST(X_EXTRA_LIBS)
521 dnl ===============================================
522 dnl End of stuff that uses X
523 dnl ===============================================
530 [ --disable-png disable PNG support through libpng],
531 png=$enableval, png=yes, png=no)
534 if test "$png" = yes ; then
535 WM_CHECK_LIB(png, png_get_valid, [-lz -lm])
537 if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
538 WM_CHECK_HEADER(png.h)
539 if test "x$ac_cv_header_png_h" = xyes; then
540 GFXLIBS="$GFXLIBS -lpng -lz"
541 supported_gfx="$supported_gfx PNG"
553 [ --disable-jpeg disable JPEG support through libjpeg],
554 jpeg=$enableval, jpeg=yes, jpeg=no)
556 if test "$jpeg" = yes; then
557 WM_CHECK_LIB(jpeg, jpeg_destroy_compress)
559 if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = xyes; then
563 WM_CHECK_HEADER(jpeglib.h)
564 if test "x$ac_cv_header_jpeglib_h" = xyes; then
565 GFXLIBS="$GFXLIBS -ljpeg"
566 supported_gfx="$supported_gfx JPEG"
577 [ --disable-gif disable GIF support through libgif or libungif],
578 gif=$enableval, gif=yes, gif=no)
580 if test "$gif" = yes; then
582 WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
583 if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
587 dnl libungif is the same thing as libgif for all practical purposes.
589 if test "x$my_libname" = x; then
590 WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
591 if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
596 if test "$my_libname" != x; then
597 WM_CHECK_HEADER(gif_lib.h)
598 if test "x$ac_cv_header_gif_lib_h" = xyes; then
599 GFXLIBS="$GFXLIBS $my_libname"
600 supported_gfx="$supported_gfx GIF"
611 [ --disable-tiff disable use of TIFF images through libtiff],
612 tif=$enableval, tif=yes, tif=no)
615 # TIFF can optionally have JPEG and/or zlib support. Must find out
616 # when they are supported so that correct library flags are passed during
617 # detection and linkage
620 # By default use xpm icons if tiff is not found.
624 if test "$tif" = yes; then
626 WM_CHECK_LIB(tiff, TIFFGetVersion, [-lm])
627 if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
633 unset ac_cv_lib_tiff_TIFFGetVersion
634 if test "x$my_libname" = x; then
635 WM_CHECK_LIB(tiff, TIFFGetVersion, [$ljpeg -lz -lm])
636 if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
637 my_libname="-ltiff -lz"
641 if test "x$my_libname" = x; then
642 WM_CHECK_LIB(tiff34, TIFFGetVersion, [$ljpeg -lm])
643 if test "x$ac_cv_lib_tiff34_TIFFGetVersion" = xyes; then
644 my_libname="-ltiff34"
649 if test "x$my_libname" != x; then
650 WM_CHECK_HEADER(tiffio.h)
651 if test "x$ac_cv_header_tiffio_h" = xyes; then
652 GFXLIBS="$my_libname $GFXLIBS"
654 supported_gfx="$supported_gfx TIFF"
660 LIBRARY_SEARCH_PATH="$lib_search_path"
661 HEADER_SEARCH_PATH="$inc_search_path"
663 AC_SUBST(LIBRARY_SEARCH_PATH)
664 AC_SUBST(HEADER_SEARCH_PATH)
671 dnl ==============================================
672 dnl End of Graphic Format Libraries
673 dnl ==============================================
679 [ --enable-debug enable debugging ],, enable_debug=no)
681 if test "$enable_debug" = yes; then
683 # Efence makes things too slow. Add it by hand in the Makefiles
684 # if it is really needed.
685 # AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
687 DFLAGS="-DWITHOUT_NANA"
692 dnl Sound support - Dan
693 dnl =============================================
696 [ --disable-sound disable sound support ],
697 sound=$enableval, sound=yes)
698 if test "$sound" = yes; then
703 # AC_PREFIX_PROGRAM(wmaker)
705 dnl Support for PIXMAPDIR option
706 dnl ============================
707 AC_ARG_WITH(pixmapdir,
708 [ --with-pixmapdir=PATH specify where pixmaps are located [DATADIR/pixmaps]])
710 if test "x$with_pixmapdir" != "x"; then
711 pixmapdir=$with_pixmapdir
713 pixmapdir=`eval echo ${datadir}/pixmaps`
716 AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir")
718 pkgdatadir=`eval echo $datadir`
719 AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker")
721 _sysconfdir=`eval echo $sysconfdir`
722 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$_sysconfdir")
725 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
726 dnl ==============================================
730 AC_ARG_WITH(appspath,
731 [ --with-appspath=PATH specify the directory for GNUstep applications], appspath=$withval )
733 if test "x$appspath" = "x"; then
734 gnustepdir='$(prefix)/GNUstep'
736 if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
737 gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
738 gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
741 with_appspath=$gnustepdir/Apps
744 wprefsdir=$with_appspath/WPrefs.app
750 dnl Enable single appicon per wm instance+class combo -cls
751 dnl =====================================================
752 AC_ARG_ENABLE(single-icon,
753 [ --enable-single-icon use single application icon per WM_INSTANCE+WM_CLASS
755 if test "$enableval" = yes; then
756 AC_DEFINE(REDUCE_APPICONS)
760 dnl Enable User Defined Menu thing
761 dnl ==================================
762 AC_ARG_ENABLE(usermenu,
763 [ --enable-usermenu user defined menus for applications
765 if test "$enableval" = yes; then
772 dnl Nicolai: Program tests for Documentation Section
773 dnl =================================================
775 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
776 dnl if test "x$MAKEINFO" != "x" ; then
777 dnl DOCTYPES="$DOCTYPES info_doc"
779 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
780 dnl if test "x$TEX" != "x" ; then
781 dnl DOCTYPES="$DOCTYPES dvi_doc"
783 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
784 dnl if test "x$DVIPS" != "x" ; then
785 dnl DOCTYPES="$DOCTYPES ps_doc"
787 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
788 dnl if test "x$PERL" != "x" ; then
789 dnl DOCTYPES="$DOCTYPES html_doc"
791 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
792 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
794 dnl AC_SUBST(DOCTYPES)
796 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \
797 WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \
798 wrlib/Makefile doc/Makefile WindowMaker/Makefile contrib/Makefile \
799 WindowMaker/Backgrounds/Makefile WindowMaker/Defaults/Makefile \
800 WindowMaker/IconSets/Makefile WindowMaker/Icons/Makefile \
801 WindowMaker/Pixmaps/Makefile WindowMaker/Styles/Makefile \
802 WindowMaker/Themes/Makefile \
803 WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
804 WPrefs.app/po/Makefile )
809 dnl Output some helpful data for compiling wraster and WINGs/WUtil apps
810 dnl ===================================================================
813 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
814 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
815 dnl | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
817 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
820 cat <<EOF >get-wraster-flags
826 WCFLAGS="-I\$prefix/include $inc_search_path"
827 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
828 WLIBS="-lwraster $GFXLIBS $XLIBS -lm"
830 usage="Usage: get-wraster-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
832 if test \$# -eq 0; then
833 echo "\${usage}" 1>&2
837 while test \$# -gt 0; do
849 echo "\${usage}" 1>&2
859 cat <<EOF >get-wings-flags
865 WCFLAGS="-I\$prefix/include $inc_search_path"
866 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
867 WLIBS="-lWINGs -lwraster $GFXLIBS $XLIBS -lm $NETLIBS -lPropList"
869 usage="Usage: get-wings-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
871 if test \$# -eq 0; then
872 echo "\${usage}" 1>&2
876 while test \$# -gt 0; do
888 echo "\${usage}" 1>&2
898 cat <<EOF >get-wutil-flags
904 WCFLAGS="-I\$prefix/include $inc_search_path"
905 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
906 WLIBS="-lWUtil $NETLIBS -lPropList"
908 usage="Usage: get-wutil-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
910 if test \$# -eq 0; then
911 echo "\${usage}" 1>&2
915 while test \$# -gt 0; do
927 echo "\${usage}" 1>&2
937 sed 's/#lp#/[/g' get-wraster-flags | sed 's/#rp#/]/g' > wrlib/get-wraster-flags
938 sed 's/#lp#/[/g' get-wings-flags | sed 's/#rp#/]/g' > WINGs/get-wings-flags
939 sed 's/#lp#/[/g' get-wutil-flags | sed 's/#rp#/]/g' > WINGs/get-wutil-flags
941 chmod 755 wrlib/get-wraster-flags WINGs/get-wings-flags WINGs/get-wutil-flags
943 rm -f get-wraster-flags get-wings-flags get-wutil-flags
947 dnl Spit out the configuration
948 dnl ==========================
950 supported_gfx="$supported_gfx builtin-PPM"
952 if test "x$MOFILES" = "x"; then
960 echo "Window Maker was configured as follows:"
962 echo "Installation path prefix: $prefix"
963 echo "Installation path prefix for binaries: $_bindir"
964 echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
965 echo "Graphic format libraries: $supported_gfx"
966 echo "Sound support: $sound"
967 echo "Translated message files to install: $mof"
968 if test "x$MOFILES" != "x"; then
969 echo "Installation path of translated messages: $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
972 dnl WM_PRINT_REDCRAP_BUG_STATUS
974 if test "x$ac_cv_header_jpeglib_h" != xyes; then
975 echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
977 echo "JPEG support will not be included because the JPEG library is"
978 echo "not installed correctly or was not found. Background images"
979 echo "from themes will not display as they usually are JPEG files."
981 echo "To fix, download and install the jpeg library and/or make sure you"
982 echo "installed all jpeg related packages, SPECIALLY the development packages"
983 echo "like jpeg-devel (if you use some prepackaged version of libjpeg)."
985 echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
989 dnl This is for Emacs. I'm lazy, I know... (nicolai)
990 dnl ================================================
992 dnl compile-command: "autoconf"