WINGs: Remove private snprintf() implementation
[wmaker-crm.git] / configure.ac
blobd48cc9915f715cbb94c1cdaae2f929b09fbdf8cf
1 dnl
2 dnl Window Maker autoconf input.
3 dnl
4 dnl Process with:
5 dnl               aclocal
6 dnl               autoheader
7 dnl               autoconf
8 dnl               libtoolize --force --automake
9 dnl               automake -a --gnu --include-deps
10 dnl
11 dnl
14 AC_INIT(WindowMaker, 0.94.0-crm)
15 AC_CONFIG_SRCDIR(src/WindowMaker.h)
16 AC_CONFIG_MACRO_DIR([m4])
17 AM_CONFIG_HEADER(src/config.h)
18 AM_INIT_AUTOMAKE([1.11 silent-rules])
20 dnl Checks for host/os name
21 dnl =======================
22 dnl AC_CANONICAL_HOST -- already done by AC_PROG_LIBTOOL
24 dnl Checks for programs.
25 dnl ===================
26 AC_ISC_POSIX
27 AC_PROG_CC
28 AC_PROG_LN_S
29 AC_PROG_GCC_TRADITIONAL
30 AC_PROG_LIBTOOL
32 AX_CFLAGS_GCC_OPTION(-Wall)
33 AX_CFLAGS_GCC_OPTION(-Wextra -Wno-sign-compare)
35 dnl Platform-specific Makefile setup
36 dnl ================================
38 case "${host}" in
39         *-*-linux*|*-*-cygwin*)
40                 WM_OSDEP="linux"
41         ;;
42         *-*-freebsd*)
43                 WM_OSDEP="bsd"
44                 CFLAGS="$CFLAGS -DFREEBSD"
45         ;;
46         *-*-netbsd*)
47                 WM_OSDEP="bsd"
48                 CFLAGS="$CFLAGS -DNETBSD"
49         ;;
50         *-*-openbsd*)
51                 WM_OSDEP="bsd"
52         CFLAGS="$CFLAGS -DOPENBSD"
53         ;;
54         *-*-dragonfly*)
55                 WM_OSDEP="bsd"
56                 CFLAGS="$CFLAGS -DDRAGONFLYBSD"
57         ;;
58         *-apple-darwin*)
59                 WM_OSDEP="darwin"
60         ;;
61         *-*-solaris*)
62                 WM_OSDEP="stub"         # solaris.c when done
63         ;;
64         *)
65                 WM_OSDEP="stub"
66                 CFLAGS="-DSTUB_HINT=\\\"${host}\\\""
67         ;;
68 esac
69 AC_SUBST(WM_OSDEP)
72 dnl the prefix
73 dnl ==========
74 dnl
75 dnl move this earlier in the script... anyone know why this is handled
76 dnl in such a bizarre way?
78 test "x$prefix" = xNONE && prefix=$ac_default_prefix
79 dnl Let make expand exec_prefix.
80 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
83 _bindir=`eval echo $bindir`
84 _bindir=`eval echo $_bindir`
86 _libdir=`eval echo $libdir`
87 _libdir=`eval echo $_libdir`
88 lib_search_path="-L$_libdir"
90 inc_search_path=`eval echo $includedir`
91 inc_search_path="-I`eval echo $inc_search_path`"
93 dnl ===============================================
94 dnl Specify paths to look for libraries and headers
95 dnl ===============================================
96 AC_ARG_WITH(libs-from, AS_HELP_STRING([--with-libs-from], [pass compiler flags to look for libraries]),
97         [lib_search_path="$withval $lib_search_path"])
99 AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags to look for header files]),
100         [inc_search_path="$withval $inc_search_path"])
102 dnl ============================
103 dnl Checks for library functions
104 dnl ============================
105 dnl not used anywhere
106 dnl AC_FUNC_MEMCMP  
107 AC_FUNC_VPRINTF
108 AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp \
109                setsid atexit mallinfo mkstemp)
111 dnl Check for inotify
112 dnl =================
113 AC_CHECK_HEADERS(sys/inotify.h, AC_DEFINE(HAVE_INOTIFY, 1, Check for inotify))
115 dnl Check CPP
116 dnl =========
117 if test "x$CPP_PATH" = x; then
118     AC_PATH_PROG(CPP_PATH, cpp, notfound, 
119                 $PATH:/lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib)
123 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
124 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
125 dnl standard locations
127 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
128     if test "$GCC" = "yes"; then
129         CPP_PATH="gcc -E -x c"
130     else 
131         if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
132             CPP_PATH="$CPP_PATH -B"
133         else
134             echo "cpp, the C preprocessor was not found in your system."
135             echo "Create a symbolic link from it to /lib/cpp and rerun configure"
136             exit
137         fi
138     fi
140 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH", [define to the path to cpp])
144 dnl Checks for header files.
145 dnl =======================
146 AC_HEADER_SYS_WAIT
147 AC_HEADER_TIME
148 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h \
149                  libintl.h sys/select.h poll.h malloc.h ctype.h string.h \
150                  strings.h)
154 dnl Checks for typedefs, structures, and compiler characteristics.
155 dnl ==============================================================
156 AC_DECL_SYS_SIGLIST
157 AC_C_CONST
158 #AC_TYPE_SIZE_T
159 #AC_TYPE_PID_T
160 AC_TYPE_SIGNAL
164 dnl Compiler/architecture specific optimizations
165 dnl ============================================
168 dnl GCC/as with MMX support
169 dnl -----------------------
171 # until we fix it, leave it disabled
172 asm_support=no
173 mmx_support=no
175 check_for_mmx_support=yes
176 AC_ARG_ENABLE(mmx, AS_HELP_STRING([--disable-mmx], [disable compilation of MMX inline assembly]),
177    [if test x$enableval != xyes; then
178     check_for_mmx_support=no
179     fi])
181 if test "$ac_cv_prog_gcc" = yes -a "$check_for_mmx_support" = yes; then
182 case $host_cpu in
183 *i?86*)
185     # gcc-3.3 or newer complains about some of our stuff without this
186     NOSTRICTALIASING="-fno-strict-aliasing"
188     AC_CACHE_CHECK(whether gcc supports x86 inline asm,
189                    ac_cv_c_inline_asm,
190                    [AC_TRY_LINK(,[{int x; asm volatile("movl %%eax, %%ebx\n\t pushal\n\t popal"::
191                           "m" (x),"m" (x),"m" (x),"m" (x),"m" (x),"m" (x),
192                           "m" (x),"m" (x),"m" (x),"m" (x),"m" (x),"m" (x));}],
193                    ac_cv_c_inline_asm=yes,
194                    ac_cv_c_inline_asm=no)])
196     if test "x$ac_cv_c_inline_asm" = xyes; then
197        AC_DEFINE(ASM_X86, 1, [define if processor is x86 (normally detected by configure)])
198        asm_support=yes
200        AC_CACHE_CHECK(whether gcc supports MMX(tm) inline asm,
201                       ac_cv_c_inline_mmx,
202                       [AC_TRY_LINK(,[asm ("movq %mm0, %mm1");],
203                       ac_cv_c_inline_mmx=yes,
204                       ac_cv_c_inline_mmx=no)])
206        if test "x$ac_cv_c_inline_mmx" = xyes; then
207           AC_DEFINE(ASM_X86_MMX, 1, [define if processor is x86 with MMX(tm) support (normally autodetected by configure)])
208           mmx_support=yes
209        fi
210     fi
211     ;;
212 esac
214 AC_SUBST(NOSTRICTALIASING)
217 dnl pkg-config
218 dnl ==========
219 dnl AC_ARG_VAR(PKGCONFIG, [pkg-config command])
220 AC_CHECK_PROG(PKGCONFIG, pkg-config, pkg-config) 
222 dnl gettext
223 dnl =======
225 dnl AM_GNU_GETTEXT
227 INTLIBS=""
229 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"], 
230         AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
231                          INTLIBS="" ))
233 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
235 if test "$XGETTEXT" != ""; then 
236     if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
237         echo "xgettext isn't GNU version"
238         XGETTEXT=""
239     fi
242 if test "$LINGUAS" != ""; then
243     if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
244         AC_DEFINE(I18N, 1, [Internationalization (I18N) support (set by configure)])
245         PO=""
246         echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
247     else
248         LINGUAS=""
249         PO=""
250         echo "xgettext and libintl.a don't both exist; will not build i18n support"
251     fi
252 else
253         INTLIBS=""
254         MOFILES=""
255         WPMOFILES=""
256         UTILMOFILES=""
257         PO=""
261 dnl The Tower of Babel
262 dnl ==================
264 dnl List of supported locales
265 dnl =========================
266 supported_locales="be bg bs ca cs da de el es et fi fr gl hr hu hy it ja ko ms nl no pl pt ro ru sk sv tr zh_CN zh_TW"
267 supported_wprefs_locales="bg ca cs de es et fi fr hr hu it ja ko pt ru sk zh_CN zh_TW"
268 supported_wings_locales="bg ca cs de fr sk"
269 supported_util_locales="de"
271 for lang in $LINGUAS; do
272         ok=0
273         for l in $supported_locales; do
274                 if test "$l" = "$lang"; then
275                         ok=1
276                         break
277                 fi
278         done
279         if test "$ok" = 1; then
280                 MOFILES="$MOFILES $lang.mo"
281         else
282                 echo "Locale $lang is not supported."
283         fi
284         ok=0
285         for l in $supported_wprefs_locales; do
286                 if test "$l" = "$lang"; then
287                         ok=1
288                         break
289                 fi
290         done
291         if test "$ok" = 1; then
292                 WPMOFILES="$WPMOFILES $lang.mo"
293         fi
294         ok=0
295         for l in $supported_util_locales; do
296                 if test "$l" = "$lang"; then
297                         ok=1
298                         break
299                 fi
300         done
301         if test "$ok" = 1; then
302                 UTILMOFILES="$UTILMOFILES $lang.mo"
303         fi
304         ok=0
305         for l in $supported_wings_locales; do
306                 if test "$l" = "$lang"; then
307                         ok=1
308                         break
309                 fi
310         done
311         if test "$ok" = 1; then
312                 WINGSMOFILES="$WINGSMOFILES $lang.mo"
313         fi
314 done
317 dnl Added by Oliver - Support for NLSDIR option
318 dnl ===========================================
319 AC_ARG_WITH(nlsdir, AS_HELP_STRING([--with-nlsdir=PATH], [specify where the locale stuff should go]))
321 if test "x$NLSDIR" = "x"; then
322         if test "x$with_nlsdir" != "x"; then
323                 NLSDIR=$with_nlsdir
324         else
325                 NLSDIR='$(prefix)/lib/locale'
326         fi
329 AC_SUBST(INTLIBS)
330 AC_SUBST(NLSDIR)
331 AC_SUBST(MOFILES)
332 AC_SUBST(WPMOFILES)
333 AC_SUBST(UTILMOFILES)
334 AC_SUBST(WINGSMOFILES)
335 AC_SUBST(supported_locales)
337 dnl ===========================================
338 dnl             Stuff that uses X
339 dnl ===========================================
341 AC_PATH_XTRA
343 if test $no_x; then
344     AC_MSG_ERROR([The path for the X11 files not found!
345 Make sure you have X and it's headers and libraries (the -devel packages
346 in Linux) installed.])
349 X_LIBRARY_PATH=$x_libraries
350 XCFLAGS="$X_CFLAGS"
351 XLFLAGS="$X_LIBS"
352 XLIBS="-lX11 -lXmu $X_EXTRA_LIBS"
354 lib_search_path="$lib_search_path $XLFLAGS"
355 inc_search_path="$inc_search_path $XCFLAGS"
357 AC_SUBST(X_LIBRARY_PATH)
359 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
360 dnl by MANOME Tomonori 
361 dnl ===========================================
362 use_locale=yes
363 AC_ARG_ENABLE(locale, AS_HELP_STRING([--disable-locale], [disable use of X locale support]),
364               use_locale=no)
366 if test "$use_locale" = yes; then
367         AC_CHECK_LIB(X11, _Xsetlocale,
368                 AC_DEFINE(X_LOCALE, 1, [define if you want support for X window's X_LOCALE (set by configure)]),,
369                 $XLFLAGS $XLIBS)
372 dnl Check whether XInternAtoms() exist
373 dnl ==================================
374 AC_CHECK_LIB(X11, XInternAtoms, 
375              AC_DEFINE(HAVE_XINTERNATOMS, 1, [define if your X server has XInternAtoms() (set by configure)]),,
376              $XLFLAGS $XLIBS)
378 dnl Check whether XConvertCase() exist
379 dnl ==================================
380 AC_CHECK_LIB(X11, XConvertCase, 
381              AC_DEFINE(HAVE_XCONVERTCASE, 1, [define if your X server has XConvertCase() (set by configure)]),,
382              $XLFLAGS $XLIBS)
384 dnl XKB keyboard language status
385 dnl ============================
386 AC_ARG_ENABLE(modelock, AS_HELP_STRING([--enable-modelock], [XKB keyboard language status support]),
387                 AC_DEFINE(XKB_MODELOCK, 1, [whether XKB language MODELOCK should be enabled]))
389 dnl Shape support
390 dnl =============
391 shape=yes
392 AC_ARG_ENABLE(shape, AS_HELP_STRING([--disable-shape], [disable shaped window extension support]),
393                 shape=$enableval, shape=yes)
394 added_xext=no
396 if test "$shape" = yes; then
397         AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
398                 added_xext=yes
399                 AC_DEFINE(SHAPE, 1, [define if you want support for shaped windows (set by configure)])], 
400                 shape=no, $XLFLAGS $XLIBS)
403 dnl XRandR support
404 dnl =============
405 xrandr=yes
406 AC_ARG_ENABLE(XRandR, AS_HELP_STRING([--disable-xrandr], [disable XRandR window extension support]),
407                 xrandr=$enableval, xrandr=yes)
408 added_xext=no
410 if test "$xrandr" = yes; then
411         AC_CHECK_LIB(Xrandr, XRRQueryExtension, [XLIBS="-lXrandr $XLIBS"
412                 added_xext=yes
413                 AC_DEFINE(HAVE_XRANDR, 1, [define if you want support for XRandR (set by configure)])],
414                 xrandr=no, $XLFLAGS $XLIBS)
418 dnl libWINGS uses math functions, check whether usage requires linking
419 dnl against libm
421 AC_CHECK_FUNC(atan,[mathneedslibm=no;LIBM=],[mathneedslibm=dunno])
422 if test "x$mathneedslibm" = "xdunno" ; then
423         AC_CHECK_LIB(m, atan, [LIBM=-lm])
425 AC_SUBST(LIBM)
429 dnl libWINGS uses FcPatternDel from libfontconfig
431 AC_MSG_CHECKING([for fontconfig library])
432 FCLIBS=`$PKGCONFIG fontconfig --libs`
433 if test "x$FCLIBS" = "x" ; then
434         AC_MSG_RESULT([not found])
435 else
436         AC_MSG_RESULT([found])
438 AC_SUBST(FCLIBS)
441 dnl Xft2 antialiased font support
442 dnl =============================
444 xft=yes
445 XFTLIBS=""
447 if test "x$PKGCONFIG" != x -a "`$PKGCONFIG xft; echo $?`" = 0; then
448         XFTCONFIG="$PKGCONFIG xft"
449         pkgconfig_xft=yes
450 else
451         AC_CHECK_PROG(XFTCONFIG, xft-config, xft-config)
454 AC_MSG_CHECKING([for the Xft2 library])
456 if test "x$XFTCONFIG" != x; then
457         XFTLIBS=`$XFTCONFIG --libs`
458         XFTFLAGS=`$XFTCONFIG --cflags`
459         AC_MSG_RESULT([found])
460 else
461         AC_MSG_RESULT([not found])
462         echo
463         echo "ERROR!!! libXft2 is not installed or could not be found."
464         echo "         Xft2 is a requirement for building Window Maker."
465         echo "         Please install it (along with fontconfig) before continuing."
466         echo
467         exit 1
470 minXFT="2.1.0"
471 goodxft="no"
474 dnl The macro below will use $XFTFLAGS (defined above) to find Xft.h
476 WM_CHECK_XFT_VERSION($minXFT, goodxft=yes, goodxft=no)
478 if test "$goodxft" = no; then
479         echo
480         echo "ERROR!!! libXft on this system is an old version."
481         echo "         Please consider upgrading to at least version ${minXFT}."
482         echo
483         exit 1
486 AC_SUBST(XFTFLAGS)
487 AC_SUBST(XFTLIBS)
490 dnl XINERAMA support
491 dnl ================
492 xinerama=no
493 AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--enable-xinerama], [enable Xinerama extension support]),
494                 xinerama=$enableval, xinerama=no)
496 if test "$xinerama" = yes; then
497         AC_CHECK_LIB(Xinerama, XineramaQueryScreens, 
498                 [XLIBS="-lXinerama $XLIBS"
499                 xfxine=yes],
500                 xfxine=no, $XLFLAGS $XLIBS)
502         AC_CHECK_LIB(Xext, XineramaGetInfo,
503                 [sunxine=yes
504                 ], sunxine=no, $XLFLAGS $XLIBS)
506         if test "$xfxine" = yes; then
507                 xine=1
508         fi
510         if test "$sunxine" = yes; then
511             xine=1
512             AC_DEFINE(SOLARIS_XINERAMA, 1, 
513                 [define if you want support for the XINERAMA extension and are in Solaris (set by configure)])
514         fi
516         if test "$xine" = 1; then
517             AC_DEFINE(XINERAMA, 1, 
518                 [define if you want support for the XINERAMA extension (set by configure)])
519         fi
524 dnl MIT-SHM support
525 dnl ===============
526 shm=yes
527 AC_ARG_ENABLE(shm, AS_HELP_STRING([--disable-shm], [disable usage of MIT-SHM extension]),
528                 shm=$enableval, shm=yes)
530 if test "$shm" = yes; then
531         AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
533         if test "$ok" = yes; then
534         AC_CHECK_FUNC(shmget, ok=yes, ok=no)
535         fi
537         if test "$ok" = yes; then
538                 if test "$added_xext" = no; then
539                         XLIBS="-lXext $XLIBS"
540                 fi
541                 AC_DEFINE(XSHM, 1, [define if X's shared memory extension is available (set by configure)])
542         fi
546 dnl R6 Style Session Management Support
547 dnl ===================================
551 #AC_DEFINE(R6SM)
552 #AC_SUBST(XSMPLIBS)
556 dnl ==============================================
557 dnl         Graphic Format Libraries
558 dnl ==============================================
560 dnl XPM Support
561 dnl ===========
562 xpm=yes
563 AC_ARG_ENABLE(xpm, AS_HELP_STRING([--disable-xpm], [disable use of XPM pixmaps through libXpm]),
564         xpm=$enableval, xpm=yes)
566 if test "$xpm" = yes; then
567     WM_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [$XLFLAGS $XLIBS])
569     if test "x$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = xyes; then
570         WM_CHECK_HEADER(X11/xpm.h)
571         if test "x$ac_cv_header_X11_xpm_h" = xyes; then
572                 GFXLIBS="$GFXLIBS -lXpm"
573                 supported_gfx="XPM"
574                 AC_DEFINE(USE_XPM, 1, [define if XPM libraries are available (set by configure)])
575         else
576                 supported_gfx="builtin-XPM"
577         fi
578     fi
581 AC_SUBST(XLFLAGS)
582 AC_SUBST(XLIBS)
583 AC_SUBST(X_EXTRA_LIBS)
585 dnl ===============================================
586 dnl             End of stuff that uses X
587 dnl ===============================================
589 dnl PNG Support
590 dnl ===========
591 png=yes
592 AC_ARG_ENABLE(png, AS_HELP_STRING([--disable-png], [disable PNG support through libpng]),
593         png=$enableval, png=yes, png=no)
595 if test "$png" = yes ; then
596     WM_CHECK_LIB(png, png_get_valid, [-lz -lm])
598     if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
599         WM_CHECK_HEADER(png.h)
600         if test "x$ac_cv_header_png_h" = xyes; then
601             GFXLIBS="$GFXLIBS -lpng -lz" 
602             supported_gfx="$supported_gfx PNG"
603             AC_DEFINE(USE_PNG, 1, [define if PNG libraries are available (set by configure)])
604         fi
605     fi
609 dnl JPEG Support
610 dnl ============
611 jpeg=yes
612 ljpeg=""
613 AC_ARG_ENABLE(jpeg, AS_HELP_STRING([--disable-jpeg], [disable JPEG support through libjpeg]),
614         jpeg=$enableval, jpeg=yes, jpeg=no)
616 if test "$jpeg" = yes; then
617     WM_CHECK_LIB(jpeg, jpeg_destroy_compress)
619     if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = xyes; then
621         ljpeg="-ljpeg"
623         WM_CHECK_HEADER(jpeglib.h)
624         if test "x$ac_cv_header_jpeglib_h" = xyes; then
625             GFXLIBS="$GFXLIBS -ljpeg"
626             supported_gfx="$supported_gfx JPEG"
627             AC_DEFINE(USE_JPEG, 1, [define if JPEG libraries are available (set by configure)])
628         fi
629     fi
633 dnl GIF Support
634 dnl ============
635 gif=yes
636 AC_ARG_ENABLE(gif, AS_HELP_STRING([--disable-gif], [disable GIF support through libgif or libungif]),
637         gif=$enableval, gif=yes, gif=no)
639 if test "$gif" = yes; then
640     my_libname=""
641     WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
642     if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
643         my_libname=-lungif
644     fi
646 dnl libungif is the same thing as libgif for all practical purposes.
648     if test "x$my_libname" = x; then
649         WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
650         if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
651             my_libname=-lgif
652         fi
653     fi
655     if test "$my_libname" != x; then
656         WM_CHECK_HEADER(gif_lib.h)
657         if test "x$ac_cv_header_gif_lib_h" = xyes; then
658             GFXLIBS="$GFXLIBS $my_libname"
659             supported_gfx="$supported_gfx GIF"
660             AC_DEFINE(USE_GIF, 1, [define if GIF libraries are available (set by configure)])
661         fi
662     fi
667 dnl TIFF Support
668 dnl ============
669 AC_ARG_ENABLE(tiff, 
670 AS_HELP_STRING([--disable-tiff], [disable use of TIFF images through libtiff]),
671         tif=$enableval, tif=yes, tif=no)
674 # TIFF can optionally have JPEG and/or zlib support. Must find out
675 # when they are supported so that correct library flags are passed during
676 # detection and linkage
679 # By default use xpm icons if tiff is not found.
680 ICONEXT="xpm"
683 if test "$tif" = yes; then
684     my_libname=""
685     WM_CHECK_LIB(tiff, TIFFGetVersion, [-lm])
686     if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
687         my_libname="-ltiff"
688     fi
690 dnl Retry with zlib
692     unset ac_cv_lib_tiff_TIFFGetVersion
693     if test "x$my_libname" = x; then
694         WM_CHECK_LIB(tiff, TIFFGetVersion, [$ljpeg -lz -lm])
695         if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
696             my_libname="-ltiff -lz"
697         fi
698     fi
700     if test "x$my_libname" = x; then
701         WM_CHECK_LIB(tiff34, TIFFGetVersion, [$ljpeg -lm])
702         if test "x$ac_cv_lib_tiff34_TIFFGetVersion" = xyes; then
703             my_libname="-ltiff34"
704         fi
705     fi
708     if test "x$my_libname" != x; then
709         WM_CHECK_HEADER(tiffio.h)
710         if test "x$ac_cv_header_tiffio_h" = xyes; then
711             GFXLIBS="$my_libname $GFXLIBS"
712             ICONEXT="tiff"
713             supported_gfx="$supported_gfx TIFF"
714             AC_DEFINE(USE_TIFF, 1, [define if TIFF libraries are available (set by configure)])     
715         fi
716     fi
719 LIBRARY_SEARCH_PATH="$lib_search_path"
720 HEADER_SEARCH_PATH="$inc_search_path"
722 AC_SUBST(LIBRARY_SEARCH_PATH)
723 AC_SUBST(HEADER_SEARCH_PATH)
726 AC_SUBST(GFXLIBS)
727 AC_SUBST(ICONEXT)
730 dnl ==============================================
731 dnl         End of Graphic Format Libraries
732 dnl ==============================================
736 dnl stdlib.h is checked here, because of conflict in jpeglib.h
737 AC_CHECK_HEADERS(stdlib.h)
739 # AC_PREFIX_PROGRAM(wmaker)
741 dnl Support for PIXMAPDIR option
742 dnl ============================
743 AC_ARG_WITH(pixmapdir, AS_HELP_STRING([--with-pixmapdir=PATH], [specify where pixmaps are located [DATADIR/pixmaps]]))
745 if test "x$with_pixmapdir" != "x"; then
746         pixmapdir=$with_pixmapdir
747 else
748         pixmapdir=`eval echo ${datadir}/pixmaps`
751 AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir", [define an extra path for pixmaps (set by configure)])
753 pkgdatadir=`eval echo $datadir`
754 AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker", [where shared data is stored (defined by configure)])
756 _sysconfdir=`eval echo $sysconfdir`
757 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$_sysconfdir", [where the configuration is stored (defined by configure)])
760 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
761 dnl ==============================================
763 AC_ARG_WITH(appspath, AS_HELP_STRING([--with-gnustepdir=PATH], [specify the directory for GNUstep applications]))
765 if test "x`echo $with_gnustepdir | grep ^/`" != "x"; then
766     appspath=$with_gnustepdir
769 if test "x$appspath$GNUSTEP_LOCAL_ROOT" = "x"; then
770     wprefs_base_dir=${prefix}
771     wprefs_datadir="${datadir}/WPrefs"
772     wprefs_bindir="${bindir}"
773 else
774     gnustepdir=$appspath
776     if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
777         gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
778         gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
779     fi
781     wprefs_base_dir=$gnustepdir/Applications
782     wprefs_datadir=$wprefs_base_dir/WPrefs.app
783     wprefs_bindir=$wprefs_base_dir/WPrefs.app
786 AC_SUBST(wprefs_datadir)
787 AC_SUBST(wprefs_bindir)
790 dnl Enable User Defined Menu thing
791 dnl ==================================
792 AC_ARG_ENABLE(usermenu, AS_HELP_STRING([--enable-usermenu], [user defined menus for applications]),
793 if test "$enableval" = yes; then
794         AC_DEFINE(USER_MENU, 1, [define if you want user defined menus for applications])
798 AC_OUTPUT(Makefile po/Makefile util/Makefile util/po/Makefile \
799         WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/Makefile \
800         WINGs/Examples/Makefile WINGs/Resources/Makefile WINGs/Tests/Makefile \
801         WINGs/Extras/Makefile WINGs/po/Makefile \
802         wrlib/Makefile wrlib/tests/Makefile \
803         src/Makefile src/wconfig.h \
804         doc/Makefile doc/sk/Makefile doc/cs/Makefile \
805         doc/ru/Makefile \
806         WindowMaker/Makefile WindowMaker/Backgrounds/Makefile \
807         WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile \
808         WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile \
809         WindowMaker/Styles/Makefile WindowMaker/Themes/Makefile \
810         WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
811         WPrefs.app/po/Makefile )
814 dnl Output some helpful data for compiling wraster and WINGs/WUtil apps
815 dnl ===================================================================
817 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
818 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
819 dnl     | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
821 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
822 dnl parsed by m4
824 cat <<EOF >get-wraster-flags
825 #!/bin/sh
827 WCFLAGS="$inc_search_path"
828 WLFLAGS="$lib_search_path"
829 WLIBS="-lwraster $GFXLIBS $XLIBS -lm"
831 usage="Usage: get-wraster-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
833 if test \$# -eq 0; then
834       echo "\${usage}" 1>&2
835       exit 1
838 while test \$# -gt 0; do
839   case \$1 in
840     --cflags)
841         echo \$WCFLAGS
842         ;;
843     --ldflags|--lflags)
844         echo \$WLFLAGS
845         ;;
846     --libs)
847         echo \$WLIBS
848         ;;
849     *)
850         echo "\${usage}" 1>&2
851         exit 1
852         ;;
853   esac
854   shift
855 done
860 cat <<EOF > wrlib/wrlib.pc
861 Name: wrlib
862 Description: Image manipulation and conversion library
863 Version: $VERSION
864 Libs: $lib_search_path -lwraster $GFXLIBS $XLIBS -lm
865 Cflags: $inc_search_path
868 cat <<EOF >get-wings-flags
869 #!/bin/sh
871 WCFLAGS="$inc_search_path"
872 WLFLAGS="$lib_search_path"
873 WLIBS="-lWINGs -lWUtil -lwraster $GFXLIBS $XFTLIBS $XLIBS -lm $INTLIBS"
875 usage="Usage: get-wings-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
877 if test \$# -eq 0; then
878       echo "\${usage}" 1>&2
879       exit 1
882 while test \$# -gt 0; do
883   case \$1 in
884     --cflags)
885         echo \$WCFLAGS
886         ;;
887     --ldflags|--lflags)
888         echo \$WLFLAGS
889         ;;
890     --libs)
891         echo \$WLIBS
892         ;;
893     *)
894         echo "\${usage}" 1>&2
895         exit 1
896         ;;
897   esac
898   shift
899 done
904 cat <<EOF > WINGs/WINGs.pc
905 Name: WINGs
906 Description: Small widget set with the NeXTStep(TM) look and feel
907 Version: $VERSION
908 Requires: wrlib
909 Libs: $lib_search_path -lWINGs $XFTLIBS $XLIBS -lm $INTLIBS
910 Cflags: $inc_search_path
913 cat <<EOF >get-wutil-flags
914 #!/bin/sh
916 WCFLAGS="-I`eval echo ${includedir}`"
917 WLFLAGS="-L${_libdir}"
918 WLIBS="-lWUtil $INTLIBS"
920 usage="Usage: get-wutil-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
922 if test \$# -eq 0; then
923       echo "\${usage}" 1>&2
924       exit 1
927 while test \$# -gt 0; do
928   case \$1 in
929     --cflags)
930         echo \$WCFLAGS
931         ;;
932     --ldflags|--lflags)
933         echo \$WLFLAGS
934         ;;
935     --libs)
936         echo \$WLIBS
937         ;;
938     *)
939         echo "\${usage}" 1>&2
940         exit 1
941         ;;
942   esac
943   shift
944 done
949 sed 's/#lp#/[/g' get-wraster-flags | sed 's/#rp#/]/g' > wrlib/get-wraster-flags
950 sed 's/#lp#/[/g' get-wings-flags | sed 's/#rp#/]/g' > WINGs/get-wings-flags
951 sed 's/#lp#/[/g' get-wutil-flags | sed 's/#rp#/]/g' > WINGs/get-wutil-flags
953 chmod 755 wrlib/get-wraster-flags WINGs/get-wings-flags WINGs/get-wutil-flags
955 rm -f get-wraster-flags get-wings-flags get-wutil-flags
959 dnl Spit out the configuration
960 dnl ==========================
962 supported_gfx="$supported_gfx builtin-PPM"
964 if test "x$MOFILES" = "x"; then
965         mof=None
966 else
967         mof=`echo $MOFILES`
970 if test "x$MOFILES" = "x"; then
971         languages=None
972 else
973         languages=`echo $MOFILES | sed 's/.mo//g'`
976 echo
977 echo "Window Maker was configured as follows:"
978 echo
979 echo "Installation path prefix            : $prefix"
980 echo "Installation path for binaries      : $_bindir"
981 echo "Installation path for WPrefs.app    : $wprefs_base_dir" | sed -e 's|\${prefix}|'"$prefix|"
982 echo "Supported graphic format libraries  : $supported_gfx"
983 echo "Use assembly routines for wrlib     : $asm_support"
984 echo "Use inline MMX(tm) x86 assembly     : $mmx_support"
985 echo "Antialiased text support in WINGs   : $xft"
986 echo "Xinerama extension support          : $xinerama"
987 echo "XRandR extension support            : $xrandr"
988 echo "Translated message files to install : $mof"
989 dnl echo "Supported languages beside English  : $languages"
990 if test "x$MOFILES" != "x"; then
991         echo "Installation path for translations  : $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
993 echo
995 dnl WM_PRINT_REDCRAP_BUG_STATUS
997 if test "x$ac_cv_header_jpeglib_h" != xyes; then
998 echo "WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"
999 echo
1000 echo "JPEG support will not be included because the JPEG library is"
1001 echo "not installed correctly or was not found. Background images"
1002 echo "from themes will not display as they usually are JPEG files."
1003 echo
1004 echo "To fix, download and install the jpeg library and/or make sure you"
1005 echo "installed all jpeg related packages, SPECIALLY the development packages"
1006 echo "like jpeg-devel (if you use some prepackaged version of libjpeg)."
1007 echo
1008 echo "WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"
1012 dnl This is for Emacs.  I'm lazy, I know... (nicolai)
1013 dnl ================================================
1014 dnl Local Variables:
1015 dnl compile-command: "autoconf"
1016 dnl End: