2 dnl WindowMaker autoconf input.
4 dnl Process with: aclocal; autoconf; automake
7 AC_INIT(src/WindowMaker.h)
9 AM_INIT_AUTOMAKE(WindowMaker, 0.20.1)
14 AM_CONFIG_HEADER(src/config.h)
17 dnl Checks for host/os name
18 dnl =======================
22 dnl Checks for programs.
23 dnl ===================
30 AC_PROG_GCC_TRADITIONAL
33 dnl Checks for library functions.
34 dnl ============================
40 AC_CHECK_FUNCS(gethostname gettimeofday select poll strerror strncasecmp setpgid)
43 AC_PATH_PROG(CPP_PATH, cpp, notfound,
44 /lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib:$PATH)
47 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
48 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
49 dnl standard locations
51 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
52 if test "$GCC" = "yes"; then
53 CPP_PATH="gcc -E -x c"
55 if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
56 CPP_PATH="$CPP_PATH -B"
58 echo "cpp, the C preprocessor was not found in your system."
59 echo "Create a symbolic link from it to /lib/cpp and rerun configure"
64 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
77 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"],
78 AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
81 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
83 if test "$XGETTEXT" != ""; then
84 if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
85 echo "xgettext isn't GNU version"
90 if test "$LINGUAS" != ""; then
91 if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
94 # if test "$LINGUAS" = ""; then
95 # ling=` (cd src/po; /bin/ls *.po) `
97 # lcode=`basename $l .po`
98 # LINGUAS="$LINGUAS $lcode"
101 echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
106 echo "xgettext and libintl.a don't both exist; will not build i18n support"
116 dnl The Tower of Babel
117 dnl ==================
119 dnl List of supported locales
120 dnl -------------------------
121 supported_locales="cs de es fr gl it ja ko nl no pt ru se tr fi hr el"
122 supported_wprefs_locales="pt hr fr ko"
124 for lang in $LINGUAS; do
126 for l in $supported_locales; do
127 if test "$l" = "$lang"; then
132 if test "$ok" = 1; then
133 MOFILES="$MOFILES $lang.mo"
135 echo "Locale $lang is not supported."
138 for l in $supported_wprefs_locales; do
139 if test "$l" = "$lang"; then
144 if test "$ok" = 1; then
145 WPMOFILES="$WPMOFILES $lang.mo"
150 dnl Kanji Characters support
151 dnl ========================
154 [ --enable-kanji multibyte character support (kanji, Korean etc.)],,
157 if test "$enable_kanji" = yes; then
158 I18N_MB="#define I18N_MB"
161 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
166 I18N_MB="#undef I18N_MB"
171 dnl Added by Oliver - Support for NLSDIR option, Hi Oliver!
172 dnl ===========================================
174 [ --with-nlsdir=PATH specify where the locale stuff should go ])
176 if test "x$NLSDIR" = "x"; then
177 if test "x$with_nlsdir" != "x"; then
180 NLSDIR="/usr/lib/locale"
184 dnl Put it back once we have some real gnome support...
186 dnl AC_ARG_WITH(gnome,
187 dnl [ --with-gnome enable support for GNOME extensions ],
188 dnl [with_gnome=$withval], [with_gnome=yes])
189 dnl AC_MSG_CHECKING([for GNOME support])
190 dnl if test "x$with_gnome" = "xyes"; then
191 dnl HAVE_GNOME="#define MWM_HINTS"
192 dnl AC_MSG_RESULT(yes)
194 dnl HAVE_GNOME="#undef MWM_HINTS"
195 dnl AC_MSG_RESULT(no)
197 dnl AC_SUBST(HAVE_GNOME)
206 dnl ===========================================
207 dnl Stuff that uses X
208 dnl ===========================================
216 XLIBS="$X_EXTRA_LIBS -lX11"
218 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
219 dnl by MANOME Tomonori
220 dnl ===========================================
221 AC_CHECK_LIB(X11, _Xsetlocale, [X_LOCALE="-DX_LOCALE"],, $XLFLAGS $XLIBS)
229 [ --disable-shape disable shaped window extension support],
230 shape=$enableval, shape=yes)
234 if test "$shape" = yes; then
235 AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
236 added_xext=yes SHAPE=-DSHAPE], shape=no, $XLFLAGS $XLIBS)
246 [ --disable-shm disable usage of MIT-SHM extension],
247 shm=$enableval, shm=yes)
249 if test "$shm" = yes; then
250 AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
252 if test "$ok" = yes; then
253 AC_CHECK_FUNC(shmget, ok=yes, ok=no)
256 if test "$ok" = yes; then
257 if test "$added_xext" = no; then
258 XLIBS="-lXext $XLIBS"
266 dnl ==============================================
267 dnl Graphic Format Libraries
268 dnl ==============================================
271 dnl Specify paths to look for graphic format libraries
272 dnl ==================================================
273 AC_ARG_WITH(gfx-libs,
274 [ --with-gfx-libs pass compiler flags to look for gfx libraries],
275 [GFXLIBS="$withval" GFX_LIB_PATH=$withval],
276 [GFXLIBS="" GFX_LIB_PATH=""])
278 AC_ARG_WITH(gfx-incs,
279 [ --with-gfx-incs pass compiler flags to look for gfx header files],
280 [GFXFLAGS="$withval" GFX_INC_PATH=$withval],
281 [GFXFLAGS="" GFX_INC_PATH=""])
290 [ --disable-xpm disable use of XPM pixmaps through libXpm],
291 xpm=$enableval, xpm=yes)
293 if test "$xpm" = yes; then
294 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
295 [GFXFLAGS="$GFXFLAGS -DUSE_XPM" GFXLIBS="$GFXLIBS -lXpm"],,
296 $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS)
305 AC_SUBST(X_EXTRA_LIBS)
307 dnl ===============================================
308 dnl End of stuff that uses X
309 dnl ===============================================
314 AC_CHECK_LIB(z, gzread, zlib=yes, zlib=no, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS)
321 [ --disable-png disable PNG support through libpng],
322 png=$enableval, png=yes)
325 if test "$png" = yes; then
326 if test "$zlib" = yes; then
327 AC_CHECK_LIB(png, png_get_valid,
328 [GFXLIBS="$GFXLIBS -lpng -lz" GFXFLAGS="$GFXFLAGS -DUSE_PNG"
329 supported_gfx="$supported_gfx PNG"],,
330 $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS -lz -lm)
339 [ --disable-jpeg disable JPEG support through libjpeg],
340 jpeg=$enableval, jpeg=yes)
342 if test "$jpeg" = yes; then
343 AC_CHECK_LIB(jpeg, jpeg_destroy_compress,
344 [GFXLIBS="$GFXLIBS -ljpeg" GFXFLAGS="$GFXFLAGS -DUSE_JPEG"
345 supported_gfx="$supported_gfx JPEG"],,
346 $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS)
353 dnl giflib uses dangerous function naming... (namespace clashing)
357 [ --disable-gif disable GIF support through libgif or libungif],
358 gif=$enableval, gif=yes)
360 if test "$gif" = yes; then
362 AC_CHECK_LIB(ungif, DGifOpenFileName,
363 [GFXLIBS="$GFXLIBS -lungif" GFXFLAGS="$GFXFLAGS -DUSE_GIF"
364 supported_gfx="$supported_gfx GIF"],retry=yes,
365 $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS)
367 dnl libungif is the same thing as libgif for all practical purposes.
369 if test "$retry" = yes; then
370 AC_CHECK_LIB(gif, DGifOpenFileName,
371 [GFXLIBS="$GFXLIBS -lgif" GFXFLAGS="$GFXFLAGS -DUSE_GIF"
372 supported_gfx="$supported_gfx GIF"],,
373 $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS)
382 [ --disable-tiff disable use of TIFF images through libtiff],
383 tif=$enableval, tif=yes)
386 # TIFF can optionally have JPEG and/or zlib support. Must find out
387 # when they are supported so that correct library flags are passed during
388 # detection and linkage
391 # By default use xpm icons if tiff is not found.
395 if test "$tif" = yes; then
396 AC_CHECK_LIB(tiff, TIFFGetVersion,
397 [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="-ltiff $GFXLIBS"
399 [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lm])
403 if test ! "$ICONEXT" = "tiff"; then
404 if test "$zlib" = "yes"; then
405 AC_CHECK_LIB(tiff, TIFFGetVersion,
406 [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="-ltiff -lz $GFXLIBS"
408 [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lz -lm])
412 if test ! "$ICONEXT" = "tiff"; then
413 AC_CHECK_LIB(tiff34, TIFFGetVersion,
414 [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="-ltiff34 $GFXLIBS"
416 [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lm])
427 dnl ==============================================
428 dnl End of Graphic Format Libraries
429 dnl ==============================================
431 dnl =====================================================
432 dnl Check for libPropList
433 dnl =====================================================
435 PLPATH=`pwd`/libPropList
438 if test -f $PLPATH/libPropList.a; then
439 echo Using compiled libPropList
441 LIBPL_LIBS="-L$PLPATH -lPropList"
442 LIBPL_INC_PATH="-I$PLPATH"
444 AC_CHECK_LIB(PropList, PLGetString,
445 [LIBPL_LIBS=-lPropList LIBPL_INC_PATH="" needtobuild=no],
446 [LIBPL_LIBS="-L$PLPATH -lPropList"
447 LIBPL_INC_PATH="-I$PLPATH"
452 if test "$needtobuild" = yes; then
453 if test -f libPropList/libPropList.a; then
454 echo "using included libPropList"
456 echo "********** WARNING *************"
457 echo "libPropList is not installed in your system."
458 echo "You need to build it before building WindowMaker (if you already"
459 echo "did that, remove config.cache and rerun configure)."
460 echo "Please read the INSTALL file for detailed instructions."
461 echo "Press <Return> to continue configuring WindowMaker or"
462 echo "type b and <Return> to build it now."
464 if test "$foo" = b; then
466 echo "Building libPropList..."
468 if test ! -d libPropList; then
469 gzip -d -c libPropList.tar.gz | tar xf -
472 if (cd libPropList; ./configure); then
473 if (cd libPropList; make); then
477 if test "$ok" = no; then
478 echo "********** WARNING **********"
479 echo "An error occurred while building libPropList"
480 echo "Please build it manually."
481 echo "Press <Return> to continue."
485 echo "resuming WindowMaker configuration..."
492 AC_SUBST(LIBPL_INC_PATH)
498 [ --enable-debug enable debugging ],, enable_debug=no)
500 if test "$enable_debug" = yes; then
502 # Efence makes things too slow. Add it by hand in the Makefiles
503 # if it is really needed.
504 # AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence")
509 dnl --Sound support - Dan
510 dnl =============================================
512 [ --enable-sound enable sound support ],, enable_sound=no)
513 if test "$enable_sound" = yes; then
514 SOUND="#define WMSOUND"
516 SOUND="#undef WMSOUND"
521 # AC_PREFIX_PROGRAM(wmaker)
523 if test "${prefix}" = "NONE"; then
526 if test "${exec_prefix}" = "NONE"; then
527 exec_prefix="${prefix}"
530 dnl Support for PIXMAPDIR option
531 dnl ============================
532 AC_ARG_WITH(pixmapdir,
533 [ --with-pixmapdir=PATH specify where pixmaps are located [DATADIR/pixmaps]])
535 if test "x$with_pixmapdir" != "x"; then
536 pixmapdir=$with_pixmapdir
538 pixmapdir="${datadir}/pixmaps"
544 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
545 dnl ==============================================
547 gnustepdir="${prefix}/GNUstep"
549 if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
550 gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s%${prefix}%\${prefix}%"`
553 appsdir=$gnustepdir/Apps
555 wprefsdir=$appsdir/WPrefs.app
560 dnl Enable single appicon per wm instance+class combo -cls
561 dnl =====================================================
562 AC_ARG_ENABLE(single-icon,
563 [ --enable-single-icon use single application icon per WM_INSTANCE+WM_CLASS (unsupported) ],
564 if test "$enableval" = yes; then
565 REDUCE_APPICONS="#define REDUCE_APPICONS"
567 REDUCE_APPICONS="#undef REDUCE_APPICONS"
569 REDUCE_APPICONS="#undef REDUCE_APPICONS"
571 AC_SUBST(REDUCE_APPICONS)
573 dnl Checks for header files.
574 dnl =======================
577 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h libintl.h sys/select.h)
581 dnl Checks for typedefs, structures, and compiler characteristics.
582 dnl ==============================================================
590 dnl Some decisions....
591 dnl ==================
592 if test "$GCC" = "yes"; then
594 # for i in $CFLAGS; do
595 # if test "$i" != "-g" ; then
596 # ceflagues="$ceflagues $i"
599 # CFLAGS="$ceflagues -Wall -Wno-implicit-int -finline-functions"
600 CFLAGS="$CFLAGS -Wall -Wno-implicit-int -Wcast-align"
605 dnl Nicolai: Program tests for Documentation Section
606 dnl =================================================
608 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
609 dnl if test "x$MAKEINFO" != "x" ; then
610 dnl DOCTYPES="$DOCTYPES info_doc"
612 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
613 dnl if test "x$TEX" != "x" ; then
614 dnl DOCTYPES="$DOCTYPES dvi_doc"
616 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
617 dnl if test "x$DVIPS" != "x" ; then
618 dnl DOCTYPES="$DOCTYPES ps_doc"
620 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
621 dnl if test "x$PERL" != "x" ; then
622 dnl DOCTYPES="$DOCTYPES html_doc"
624 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
625 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
627 dnl AC_SUBST(DOCTYPES)
629 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \
630 WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \
631 wrlib/Makefile doc/Makefile WindowMaker/Makefile \
632 WindowMaker/Defaults/Makefile WindowMaker/Styles/Makefile \
633 WindowMaker/Themes/Makefile WindowMaker/Backgrounds/Makefile \
634 WindowMaker/Pixmaps/Makefile WindowMaker/Icons/Makefile \
635 WindowMaker/IconSets/Makefile \
636 WindowMaker/Sounds/Makefile \
637 WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
638 WPrefs.app/po/Makefile )
643 dnl Output some helpfull data for compiling WINGs apps
644 dnl ==================================================
647 echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
648 echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
653 dnl Spit out the configuration
654 dnl ==========================
658 for i in $GFXFLAGS; do
661 formats="$formats GIF"
664 formats="$formats TIFF"
667 formats="$formats PNG"
670 formats="$formats JPEG"
676 echo "WindowMaker was configured as follows:"
678 echo "Installation path prefix: $prefix"
679 echo "Installation path prefix for binaries: $exec_prefix"
680 echo "Installation path for WPrefs.app: $wprefsdir"
681 echo "Graphic format libraries: $formats"
682 if test "x$MOFILES" = "x"; then
687 echo "Translated message files to install: $mof"
688 if test "x$MOFILES" != "x"; then
689 echo "Installation path of translated messages: $NLSDIR"
692 echo "What!? WPrefs.app won't be installed where you want it?"
693 echo "May I point to you to the INSTALL file?"
696 dnl This is for Emacs. I'm lazy, I know... (nicolai)
697 dnl ================================================
699 dnl compile-command: "autoconf"