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.20.3)
16 dnl Shared Library Versions
22 dnl configure/build bundled libraries
23 dnl ===================================
24 AC_CONFIG_SUBDIRS(libPropList)
27 AM_CONFIG_HEADER(src/config.h)
30 dnl Checks for host/os name
31 dnl =======================
35 dnl Checks for programs.
36 dnl ===================
43 AC_PROG_GCC_TRADITIONAL
46 dnl Checks for library functions.
47 dnl ============================
53 AC_CHECK_FUNCS(gethostname gettimeofday select poll strerror strncasecmp setpgid)
55 if test "$ac_cv_func_gettimeofday" != yes; then
56 echo "The gettimeofday() system call is not available in your system"
57 echo "but it is required by Window Maker. Sorry."
61 if test "x$CPP_PATH" = x; then
62 AC_PATH_PROG(CPP_PATH, cpp, notfound,
63 /lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib:$PATH)
67 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
68 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
69 dnl standard locations
71 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
72 if test "$GCC" = "yes"; then
73 CPP_PATH="gcc -E -x c"
75 if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
76 CPP_PATH="$CPP_PATH -B"
78 echo "cpp, the C preprocessor was not found in your system."
79 echo "Create a symbolic link from it to /lib/cpp and rerun configure"
84 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
97 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
98 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
101 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
103 if test "$XGETTEXT" != ""; then
104 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
105 echo "xgettext isn't GNU version"
110 if test "$LINGUAS" != ""; then
111 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
114 # if test "$LINGUAS" = ""; then
115 # ling=` (cd src/po; /bin/ls *.po) `
117 # lcode=`basename $l .po`
118 # LINGUAS="$LINGUAS $lcode"
121 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
126 echo "xgettext and libintl.a don't both exist; will not build i18n support"
136 dnl The Tower of Babel
137 dnl ==================
139 dnl List of supported locales
140 dnl -------------------------
141 supported_locales="cs de es fr gl it ja ko nl no pt ru se tr fi hr el pl ro"
142 supported_wprefs_locales="pt hr fr ko ja"
144 for lang in $LINGUAS; do
146 for l in $supported_locales; do
147 if test "$l" = "$lang"; then
152 if test "$ok" = 1; then
153 MOFILES="$MOFILES $lang.mo"
155 echo "Locale $lang is not supported."
158 for l in $supported_wprefs_locales; do
159 if test "$l" = "$lang"; then
164 if test "$ok" = 1; then
165 WPMOFILES="$WPMOFILES $lang.mo"
170 dnl Kanji Characters support
171 dnl ========================
174 [ --enable-kanji multibyte character support (kanji, Korean etc.)],,
177 if test "$enable_kanji" = yes; then
178 I18N_MB="#define I18N_MB"
181 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
186 I18N_MB="#undef I18N_MB"
191 dnl XKB keyboard language status
192 dnl ============================
193 AC_ARG_ENABLE(modelock,
194 [ --enable-modelock XKB keyboard language status support],
195 X_CFLAGS="$X_CFLAGS -DXKB_MODELOCK",)
199 dnl Added by Oliver - Support for NLSDIR option, Hi Oliver!
200 dnl ===========================================
202 [ --with-nlsdir=PATH specify where the locale stuff should go ])
204 if test "x$NLSDIR" = "x"; then
205 if test "x$with_nlsdir" != "x"; then
208 NLSDIR='$(prefix)/lib/locale'
212 dnl Put it back once we have some real gnome support...
214 dnl AC_ARG_WITH(gnome,
215 dnl [ --enable-gnome enable support for GNOME extensions ],
216 dnl [enable_gnome=$withval], [enable_gnome=yes])
217 dnl if test "$enable_gnome" = yes; then
218 dnl GNOME="#define GNOME"
220 dnl GNOME="#undef GNOME"
231 dnl ===========================================
232 dnl Stuff that uses X
233 dnl ===========================================
241 XLIBS="$X_EXTRA_LIBS -lX11"
243 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
244 dnl by MANOME Tomonori
245 dnl ===========================================
246 AC_CHECK_LIB(X11, _Xsetlocale, [X_LOCALE="-DX_LOCALE"],, $XLFLAGS $XLIBS)
254 [ --disable-shape disable shaped window extension support],
255 shape=$enableval, shape=yes)
259 if test "$shape" = yes; then
260 AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
261 added_xext=yes SHAPE=-DSHAPE], shape=no, $XLFLAGS $XLIBS)
271 [ --disable-shm disable usage of MIT-SHM extension],
272 shm=$enableval, shm=yes)
274 if test "$shm" = yes; then
275 AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
277 if test "$ok" = yes; then
278 AC_CHECK_FUNC(shmget, ok=yes, ok=no)
281 if test "$ok" = yes; then
282 if test "$added_xext" = no; then
283 XLIBS="-lXext $XLIBS"
292 dnl R6 Style Session Management Support
293 dnl ===================================
301 dnl ==============================================
302 dnl Graphic Format Libraries
303 dnl ==============================================
307 dnl Specify paths to look for graphic format libraries
308 dnl ==================================================
310 AC_ARG_WITH(gfx-libs,
311 [ --with-gfx-libs pass compiler flags to look for gfx libraries],
312 [GFXLFLAGS=$withval], [GFXLFLAGS=""])
314 AC_ARG_WITH(gfx-incs,
315 [ --with-gfx-incs pass compiler flags to look for gfx header files],
316 [GFXFLAGS="$withval" GFX_INC_PATH=$withval],
317 [GFXFLAGS="" GFX_INC_PATH=""])
326 [ --disable-xpm disable use of XPM pixmaps through libXpm],
327 xpm=$enableval, xpm=yes)
329 if test "$xpm" = yes; then
330 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
331 my_libok=yes, my_libok=no,
332 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
334 if test "$my_libok" = yes; then
335 my_old_cppflags=$CPPFLAGS
336 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
337 AC_CHECK_HEADER(X11/xpm.h,
338 [GFXFLAGS="$GFXFLAGS -DUSE_XPM" GFXLIBS="$GFXLIBS -lXpm"
339 supported_gfx="XPM"], supported_gfx="XPM (builtin)")
340 CPPFLAGS=$my_old_cppflags
350 AC_SUBST(X_EXTRA_LIBS)
352 dnl ===============================================
353 dnl End of stuff that uses X
354 dnl ===============================================
359 AC_CHECK_LIB(z, gzread, zlib=yes, zlib=no, $GFX_INC_PATH $GFXLFLAGS $XLFLAGS)
366 [ --disable-png disable PNG support through libpng],
367 png=$enableval, png=yes)
370 if test "$png" = yes -a "$zlib" = yes ; then
371 AC_CHECK_LIB(png, png_get_valid, my_libok=yes, my_libok=no,
372 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS -lz -lm)
374 if test "$my_libok" = yes; then
375 my_old_cppflags=$CPPFLAGS
376 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
377 AC_CHECK_HEADER(png.h,
378 [GFXLIBS="$GFXLIBS -lpng -lz" GFXFLAGS="$GFXFLAGS -DUSE_PNG"
379 supported_gfx="$supported_gfx PNG"], )
380 CPPFLAGS=$my_old_cppflags
389 [ --disable-jpeg disable JPEG support through libjpeg],
390 jpeg=$enableval, jpeg=yes)
392 if test "$jpeg" = yes; then
393 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, my_libok=yes, my_libok=no,
394 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS)
396 if test "$my_libok" = yes; then
397 my_old_cppflags=$CPPFLAGS
398 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
399 AC_TRY_CPP(jpeglib.h,
400 [GFXLIBS="$GFXLIBS -ljpeg" GFXFLAGS="$GFXFLAGS -DUSE_JPEG"
401 supported_gfx="$supported_gfx JPEG"], )
402 CPPFLAGS=$my_old_cppflags
410 dnl giflib uses dangerous function naming... (namespace clashing)
414 [ --disable-gif disable GIF support through libgif or libungif],
415 gif=$enableval, gif=yes)
417 if test "$gif" = yes; then
419 AC_CHECK_LIB(ungif, DGifOpenFileName,
420 [my_libok=yes my_libname=ungif],
421 [retry=yes my_libok=no],
422 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
424 dnl libungif is the same thing as libgif for all practical purposes.
426 if test "$retry" = yes; then
427 AC_CHECK_LIB(gif, DGifOpenFileName,
428 [my_libok=yes my_libname=gif],
430 $GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS)
433 if test "$my_libok" = yes; then
434 my_old_cppflags=$CPPFLAGS
435 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
436 AC_CHECK_HEADER(gif_lib.h,
437 [GFXLIBS="$GFXLIBS -l$my_libname" GFXFLAGS="$GFXFLAGS -DUSE_GIF"
438 supported_gfx="$supported_gfx GIF"], )
439 CPPFLAGS=$my_old_cppflags
448 [ --disable-tiff disable use of TIFF images through libtiff],
449 tif=$enableval, tif=yes)
452 # TIFF can optionally have JPEG and/or zlib support. Must find out
453 # when they are supported so that correct library flags are passed during
454 # detection and linkage
457 # By default use xpm icons if tiff is not found.
461 if test "$tif" = yes; then
463 AC_CHECK_LIB(tiff, TIFFGetVersion,
464 [my_libok=yes my_libname="-ltiff"], my_libok=no,
465 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lm])
469 unset ac_cv_lib_tiff_TIFFGetVersion
470 if test "$my_libok" = no; then
471 if test "$zlib" = "yes"; then
472 AC_CHECK_LIB(tiff, TIFFGetVersion,
473 [my_libok=yes my_libname="-ltiff -lz"], my_libok=no,
474 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lz -lm])
478 if test "$my_libok" = no; then
479 AC_CHECK_LIB(tiff34, TIFFGetVersion,
480 [my_libok=yes my_libname="-ltiff34"], my_libok=no,
481 [$GFX_INC_PATH $GFXLFLAGS $XLFLAGS $XLIBS $GFXLIBS -lm])
484 if test "$my_libok" = yes; then
485 my_old_cppflags=$CPPFLAGS
486 CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS"
487 AC_CHECK_HEADER(tiffio.h,
488 [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="$my_libname $GFXLIBS"
489 ICONEXT="tiff" supported_gfx="$supported_gfx TIFF"], )
490 CPPFLAGS=$my_old_cppflags
502 dnl ==============================================
503 dnl End of Graphic Format Libraries
504 dnl ==============================================
510 [ --enable-debug enable debugging ],, enable_debug=no)
512 if test "$enable_debug" = yes; then
514 # Efence makes things too slow. Add it by hand in the Makefiles
515 # if it is really needed.
516 # AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
521 dnl Sound support - Dan
522 dnl =============================================
525 [ --disable-sound disable sound support ],
526 sound=$enableval, sound=yes)
527 if test "$sound" = yes; then
528 SOUND="#define WMSOUND"
530 SOUND="#undef WMSOUND"
535 # AC_PREFIX_PROGRAM(wmaker)
537 if test "${prefix}" = "NONE"; then
540 if test "${exec_prefix}" = "NONE"; then
541 exec_prefix='$(prefix)'
544 dnl Support for PIXMAPDIR option
545 dnl ============================
546 AC_ARG_WITH(pixmapdir,
547 [ --with-pixmapdir=PATH specify where pixmaps are located [DATADIR/pixmaps]])
549 if test "x$with_pixmapdir" != "x"; then
550 pixmapdir=$with_pixmapdir
552 pixmapdir='$(datadir)/pixmaps'
558 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
559 dnl ==============================================
563 AC_ARG_WITH(appspath,
564 [ --with-appspath=PATH specify the path of the GNUstep applications
565 directory], appspath=$withval )
567 if test "x$appspath" = "x"; then
568 gnustepdir='$(prefix)/GNUstep'
570 if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
571 gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
572 gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
575 with_appspath=$gnustepdir/Apps
578 wprefsdir=$with_appspath/WPrefs.app
583 dnl Enable single appicon per wm instance+class combo -cls
584 dnl =====================================================
585 AC_ARG_ENABLE(single-icon,
586 [ --enable-single-icon use single application icon per WM_INSTANCE+WM_CLASS
588 if test "$enableval" = yes; then
589 REDUCE_APPICONS="#define REDUCE_APPICONS"
591 REDUCE_APPICONS="#undef REDUCE_APPICONS"
593 REDUCE_APPICONS="#undef REDUCE_APPICONS"
595 AC_SUBST(REDUCE_APPICONS)
597 dnl Checks for header files.
598 dnl =======================
601 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h libintl.h sys/select.h)
605 dnl Checks for typedefs, structures, and compiler characteristics.
606 dnl ==============================================================
615 dnl Shared Library Support (unfinished)
616 dnl ===================================
619 #AC_ARG_ENABLE(shared,
620 #[ --enable-shared build libraries as shared ], enable_shared=yes,
623 if test "$enable_shared" = yes; then
624 if test "$GCC" = yes; then
626 LDSHARED='$CC -shared'
628 # find system name and corresponding cc options
629 case `(uname -sr || echo unknown) 2>/dev/null` in
631 _CFLAGS="-fast -xcg89 -KPIC -R."
637 _CFLAGS="-ansi -rpath ."
638 LDSHARED='$CC -shared';;
641 LDSHARED='$CC -dy -KPIC -G';;
645 SHAREDLIBS='libz.sl';;
648 LDSHARED='$CC -shared';;
652 AC_MSG_CHECKING([for shared library support])
656 int hello() { printf("hello\n"); }
660 # we must test in two steps (cc then ld), required at least on SunOS 4.x
661 if test "`($CC -c $_CFLAGS $test.c) 2>&1`" = "" &&
662 test "`($LDSHARED -o $test.so $test.o) 2>&1`" = ""; then
663 CFLAGS="$CFLAGS $_CFLAGS"
664 WRASTERLIB='libwraster.so.$(WRASTER_VER)'
665 WINGSLIB='libWINGs.so.$(WINGS_VER)'
666 AC_MSG_RESULT([yes, building shared])
669 WRASTERLIB='libwraster.a'
670 WINGSLIB='libWINGs.a'
671 AC_MSG_RESULT([no, building static])
673 rm -f $test.[co] $test.so
676 #AC_SUBST(WRASTER_VER)
678 #AC_SUBST(WRASTERLIB)
685 dnl Nicolai: Program tests for Documentation Section
686 dnl =================================================
688 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
689 dnl if test "x$MAKEINFO" != "x" ; then
690 dnl DOCTYPES="$DOCTYPES info_doc"
692 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
693 dnl if test "x$TEX" != "x" ; then
694 dnl DOCTYPES="$DOCTYPES dvi_doc"
696 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
697 dnl if test "x$DVIPS" != "x" ; then
698 dnl DOCTYPES="$DOCTYPES ps_doc"
700 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
701 dnl if test "x$PERL" != "x" ; then
702 dnl DOCTYPES="$DOCTYPES html_doc"
704 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
705 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
707 dnl AC_SUBST(DOCTYPES)
709 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \
710 WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \
711 wrlib/Makefile doc/Makefile WindowMaker/Makefile \
712 WindowMaker/Defaults/Makefile WindowMaker/Styles/Makefile \
713 WindowMaker/Themes/Makefile WindowMaker/Backgrounds/Makefile \
714 WindowMaker/Pixmaps/Makefile WindowMaker/Icons/Makefile \
715 WindowMaker/IconSets/Makefile \
716 WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
717 WPrefs.app/po/Makefile )
722 dnl Output some helpfull data for compiling WINGs apps
723 dnl ==================================================
726 echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
727 echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
732 dnl Spit out the configuration
733 dnl ==========================
735 supported_gfx="$supported_gfx PPM (built-in)"
737 if test "x$MOFILES" = "x"; then
744 echo "Window Maker was configured as follows:"
746 echo "Installation path prefix: $prefix"
747 echo "Installation path prefix for binaries: $exec_prefix" | sed -e 's|\$(prefix)|'"$prefix|"
748 echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
749 echo "Graphic format libraries: $supported_gfx"
750 echo "Sound support: $sound"
751 echo "Translated message files to install: $mof"
752 if test "x$MOFILES" != "x"; then
753 echo "Installation path of translated messages: $NLSDIR"
757 dnl This is for Emacs. I'm lazy, I know... (nicolai)
758 dnl ================================================
760 dnl compile-command: "autoconf"