added snprintf.c to be linked in WINGs
[wmaker-crm.git] / configure.ac
blobdfaed03e4bf6155348e5fb86c8bec5950fc5e7b7
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(src/WindowMaker.h)
18 AM_INIT_AUTOMAKE(WindowMaker, 0.66.0)
20 AM_PROG_LIBTOOL
22 # by Marcelo Magallon <mmagallo@efis.ucr.ac.cr>
23 # Turn around -rpath problem with libtool 1.0c
24 # This define should be improbable enough to not conflict with anything
25 case ${host} in
26   *-pc-linux-gnu)
27     AC_MSG_RESULT([Fixing libtool for -rpath problems.])
28     sed < libtool > libtool-2 \
29     's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
30     mv libtool-2 libtool
31     chmod 755 libtool
32   ;;
33 esac
36 AM_CONFIG_HEADER(src/config.h)
39 dnl Checks for host/os name
40 dnl =======================
41 AC_CANONICAL_HOST
44 dnl Checks for programs.
45 dnl ===================
46 AC_ISC_POSIX
47 AC_PROG_CC
48 dnl AC_PROG_MAKE_SET -- already done by AM_INIT_AUTOMAKE
49 #AC_PROG_RANLIB
50 dnl AC_PROG_INSTALL -- already done by AM_INIT_AUTOMAKE
51 AC_PROG_LN_S
52 AC_PROG_GCC_TRADITIONAL
55 dnl the prefix
56 dnl ==========
57 dnl
58 dnl move this earlier in the script... anyone know why this is handled
59 dnl in such a bizarre way?
61 test "x$prefix" = xNONE && prefix=$ac_default_prefix
62 dnl Let make expand exec_prefix.
63 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
66 _bindir=`eval echo $bindir`
67 _bindir=`eval echo $_bindir`
69 _libdir=`eval echo $libdir`
70 _libdir=`eval echo $_libdir`
71 lib_search_path="-L$_libdir"
73 inc_search_path=`eval echo $includedir`
74 inc_search_path="-I`eval echo $inc_search_path`"
77 dnl
78 dnl Check for RedHat bugs
79 dnl =====================
81 dnl WM_CHECK_REDCRAP_BUGS($prefix,$_bindir,$_libdir)
84 dnl
85 dnl Specify paths to look for libraries and headers
86 dnl ===============================================
87 AC_ARG_WITH(libs-from,
88 [  --with-libs-from       pass compiler flags to look for libraries],
89         [lib_search_path="$withval $lib_search_path"])
91 AC_ARG_WITH(incs-from,
92 [  --with-incs-from       pass compiler flags to look for header files],
93         [inc_search_path="$withval $inc_search_path"])
97 dnl Checks for library functions.
98 dnl ============================
99 dnl not used anywhere
100 dnl AC_FUNC_MEMCMP  
101 AC_FUNC_VPRINTF
102 AC_FUNC_ALLOCA
103 AC_CHECK_FUNCS(gethostname select poll strerror strcasecmp strncasecmp setpgid atexit mallinfo snprintf vsnprintf asprintf vasprintf mkstemp)
107 dnl Loading of dynamic libraries at runtime
108 dnl =======================================
109 DLLIBS=""
111 AC_CHECK_FUNC(dlopen, [HAVEDL="yes"], 
112         AC_CHECK_LIB(dl, dlopen, [DLLIBS="-ldl" HAVEDL="yes"],
113                          DLLIBS="" ))
115 if test "x$HAVEDL" = xyes; then
116     AC_CHECK_HEADERS(dlfcn.h)
121 dnl Check CPP
122 dnl =========
123 if test "x$CPP_PATH" = x; then
124     AC_PATH_PROG(CPP_PATH, cpp, notfound, 
125                 $PATH:/lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib)
129 dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax
130 dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the
131 dnl standard locations
133 if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then
134     if test "$GCC" = "yes"; then
135         CPP_PATH="gcc -E -x c"
136     else 
137         if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then
138             CPP_PATH="$CPP_PATH -B"
139         else
140             echo "cpp, the C preprocessor was not found in your system."
141             echo "Create a symbolic link from it to /lib/cpp and rerun configure"
142             exit
143         fi
144     fi
146 AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH")
150 dnl Checks for header files.
151 dnl =======================
152 AC_HEADER_SYS_WAIT
153 AC_HEADER_TIME
154 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h libintl.h sys/select.h poll.h malloc.h ctype.h stdlib.h string.h strings.h)
158 dnl Checks for typedefs, structures, and compiler characteristics.
159 dnl ==============================================================
160 AC_DECL_SYS_SIGLIST
161 AC_C_CONST
162 #AC_TYPE_SIZE_T
163 #AC_TYPE_PID_T
164 AC_TYPE_SIGNAL
166     
168 dnl gettext
169 dnl =======
172 dnl AM_GNU_GETTEXT
176 INTLIBS=""
178 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"], 
179         AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
180                          INTLIBS="" ))
182 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
184 if test "$XGETTEXT" != ""; then 
185     if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
186         echo "xgettext isn't GNU version"
187         XGETTEXT=""
188     fi
191 if test "$LINGUAS" != ""; then
192     if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
193         AC_DEFINE(I18N)
194         PO=""
195 #       if test "$LINGUAS" = ""; then
196 #           ling=` (cd src/po; /bin/ls *.po) `
197 #           for l in $ling; do
198 #               lcode=`basename $l .po`
199 #               LINGUAS="$LINGUAS $lcode"
200 #           done
201 #       fi
202         echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
203     else
204         LINGUAS=""
205         PO=""
206         echo "xgettext and libintl.a don't both exist; will not build i18n support"
207     fi
208 else
209         INTLIBS=""
210         MOFILES=""
211         WPMOFILES=""
212         PO=""
216 dnl The Tower of Babel
217 dnl ==================
219 dnl List of supported locales
220 dnl -------------------------
221 supported_locales="cs de es et fr gl it ja ko nl no pt ru sv tr fi hr el pl ro da zh_TW.Big5 zh_CN sk bg hu"
222 supported_wprefs_locales="pt hr fr ko ja cs zh_TW.Big5 es zh_CN fi it ru de bg hu sk"
223 supported_wings_locales="sk"
225 for lang in $LINGUAS; do
226         ok=0
227         for l in $supported_locales; do
228                 if test "$l" = "$lang"; then
229                         ok=1
230                         break
231                 fi
232         done
233         if test "$ok" = 1; then
234                 MOFILES="$MOFILES $lang.mo"
235         else
236                 echo "Locale $lang is not supported."
237         fi
238         ok=0
239         for l in $supported_wprefs_locales; do
240                 if test "$l" = "$lang"; then
241                         ok=1
242                         break
243                 fi
244         done
245         if test "$ok" = 1; then
246                 WPMOFILES="$WPMOFILES $lang.mo"
247         fi
248         ok=0
249         for l in $supported_wings_locales; do
250                 if test "$l" = "$lang"; then
251                         ok=1
252                         break
253                 fi
254         done
255         if test "$ok" = 1; then
256                 WINGSMOFILES="$WINGSMOFILES $lang.mo"
257         fi
258 done
261 dnl Kanji Characters support
262 dnl ========================
264 case $host_os in
265         freebsd*)
266                 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
267         *)
268         ;;
269 esac
273 dnl Added by Oliver - Support for NLSDIR option,   Hi Oliver!
274 dnl ===========================================
275 AC_ARG_WITH(nlsdir, 
276         [  --with-nlsdir=PATH      specify where the locale stuff should go ])
279 if test "x$NLSDIR" = "x"; then
280         if test "x$with_nlsdir" != "x"; then
281                 NLSDIR=$with_nlsdir
282         else
283                 NLSDIR='$(prefix)/lib/locale'
284         fi
289 AC_SUBST(DLLIBS)
290 AC_SUBST(INTLIBS)
291 AC_SUBST(NLSDIR)
292 AC_SUBST(MOFILES)
293 AC_SUBST(WPMOFILES)
294 AC_SUBST(WINGSMOFILES)
295 AC_SUBST(supported_locales)
299 dnl Support for various hint things
300 dnl ===============================
303 AC_ARG_ENABLE(gnome,
304   [  --enable-gnome       enable stuff needed for GNOME ],
305   [if test x$enableval = xyes; then
306     AC_DEFINE(GNOME_STUFF)
307     gnome_on=yes
308   fi])
311 AC_ARG_ENABLE(kde,
312   [  --enable-kde                 enable support for KDE window manager (kwm) hints ],
313   [if test x$enableval = xyes; then
314     AC_DEFINE(KWM_HINTS)
315     kde_on=yes
316   fi])
319 AC_ARG_ENABLE(openlook,
320   [  --enable-openlook    enable support for OPEN LOOK(tm) (olwm) hints ],
321   [if test x$enableval = xyes; then
322     AC_DEFINE(OLWM_HINTS)
323     openlook_on=yes
324   fi])
328 dnl Disable some stuff that are duplicated in kde
329 dnl ---------------------------------------------
330 AC_ARG_ENABLE(lite,
331   [  --enable-lite                disable some stuff (dont use it) ],
332   [if test x$enableval = xyes; then
333         LITE=yes
334         AC_DEFINE(LITE)
335         AC_SUBST(LITE)
336   fi])
341 dnl Networking stuff
344 NETLIBS=""
346 AC_CHECK_FUNC(connect,,
347         AC_CHECK_LIB(socket, connect, NETLIBS="$NETLIBS -lsocket"))
349 AC_CHECK_FUNC(gethostbyname,,
350         AC_CHECK_LIB(nsl, gethostbyname, NETLIBS="$NETLIBS -lnsl"))
352 AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON),
353      for lib in resolv socket inet bsd; do
354         AC_CHECK_LIB($lib, inet_aton, [AC_DEFINE(HAVE_INET_ATON)
355                      NETLIBS="$NETLIBS -l$lib"; break],, $NETLIBS)
356      done)
358 AC_SUBST(NETLIBS)
361 dnl ===========================================
362 dnl             Stuff that uses X
363 dnl ===========================================
365 AC_PATH_XTRA
367 if test $no_x; then
368     AC_MSG_ERROR([The path for the X11 files not found!
369 Make sure you have X and it's headers and libraries (the -devel packages
370 in Linux) installed.])
373 X_LIBRARY_PATH=$x_libraries
375 XCFLAGS="$X_CFLAGS"
377 XLFLAGS="$X_LIBS"
379 XLIBS="-lX11 $X_EXTRA_LIBS"
382 lib_search_path="$lib_search_path $XLFLAGS"
383 inc_search_path="$inc_search_path $XCFLAGS"
386 AC_SUBST(X_LIBRARY_PATH)
390 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
391 dnl by MANOME Tomonori 
392 dnl ===========================================
393 use_locale=yes
394 AC_ARG_ENABLE(locale, 
395 [  --disable-locale       disable use of X locale support],
396                 use_locale=no)
398 if test "$use_locale" = yes; then
399   AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $XLFLAGS $XLIBS)
403 dnl Check whether XInternAtoms() exist
404 dnl ==================================
405 AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE(HAVE_XINTERNATOMS),,$XLFLAGS $XLIBS)
407 dnl Check whether XConvertCase() exist
408 dnl ==================================
409 AC_CHECK_LIB(X11, XConvertCase, AC_DEFINE(HAVE_XCONVERTCASE),,$XLFLAGS $XLIBS)
412 dnl XKB keyboard language status
413 dnl ============================
414 AC_ARG_ENABLE(modelock,
415 [  --enable-modelock      XKB keyboard language status support],
416                 AC_DEFINE(XKB_MODELOCK))
420 dnl Shape support
421 dnl =============
422 shape=yes
423 AC_ARG_ENABLE(shape, 
424 [  --disable-shape        disable shaped window extension support],
425                 shape=$enableval, shape=yes)
427 added_xext=no
429 if test "$shape" = yes; then
430         AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
431                 added_xext=yes
432                 AC_DEFINE(SHAPE)], shape=no, $XLFLAGS $XLIBS)
436 dnl XINERAMA support
437 dnl ================
438 xinerama=no
439 #AC_ARG_ENABLE(xinerama, 
440 #[  --disable-xinerama    disable XInerama extension support],
441 #               xinerama=$enableval, xinerama=yes)
443 if test "$xinerama" = yes; then
444         AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [XLIBS="-lXinerama $XLIBS"
445                 AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
450 dnl MIT-SHM support
451 dnl ===============
452 shm=yes
453 AC_ARG_ENABLE(shm,
454 [  --disable-shm           disable usage of MIT-SHM extension],
455                 shm=$enableval, shm=yes)
457 if test "$shm" = yes; then
458         AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
460         if test "$ok" = yes; then
461         AC_CHECK_FUNC(shmget, ok=yes, ok=no)
462         fi
464         if test "$ok" = yes; then
465                 if test "$added_xext" = no; then
466                         XLIBS="-lXext $XLIBS"
467                 fi
468                 AC_DEFINE(XSHM)
469         fi
473 dnl R6 Style Session Management Support
474 dnl ===================================
478 #AC_DEFINE(R6SM)
479 #AC_SUBST(XSMPLIBS)
483 dnl Check for libPropList
484 dnl =====================
486 LIBPL=""
488 WM_CHECK_LIB(PropList, PLGetString, $X_EXTRA_LIBS)
489 if test "x$ac_cv_lib_PropList_PLGetString" = xyes; then
490     WM_CHECK_HEADER(proplist.h)
491     if test "x$ac_cv_header_proplist_h" = xyes; then
492         LIBPL="-lPropList"
493     fi
496 if test "x$LIBPL" = "x"; then
497    echo
498    echo "ERROR!!! libPropList is not installed, or could not be found."
499    echo "         Window Maker requires libPropList to build."
500    echo "         Please read INSTALL to find where you can find libPropList,"
501    echo "         and install it first."
502    if test x$host_os = xlinux; then
503    echo "         If you're using some prepackaged version of libPropList,"
504    echo "         make sure you install it's \"development\" package as well."
505    fi
506    echo "         If you already have it installed, try using the"
507    if test "x$ac_cv_lib_PropList_PLGetString" != xyes; then
508    echo "         --with-libs-from flag to tell configure where the library"
509    echo "         is installed and"
510    fi
511    echo "         --with-incs-from flag to tell configure where the header"
512    echo "         files are installed"
513    exit 1
516 lPLVersion="0.10.1"
518 WM_CHECK_PROPLIST_VERSION($lPLVersion, goodlPL=yes, goodlPL=no)
520 if test "$goodlPL" = no; then
521    echo
522    echo "ERROR!!! libPropList is an old version. Please consider upgrading"
523    echo "         to at least version ${lPLVersion}. Older versions have bugs that"
524    echo "         may cause Window Maker to crash randomly."
525    echo "         If your libPropList is older than 0.9.2 it will also prevent"
526    echo "         Window Maker from compiling because new functions were"
527    echo "         introduced since that version."
528    echo "         Please read INSTALL to find where you can find libPropList,"
529    echo "         and upgrade it before you proceed."
530    exit 1
533 AC_SUBST(LIBPL)
536 dnl ==============================================
537 dnl         Graphic Format Libraries
538 dnl ==============================================
544 dnl XPM Support
545 dnl ===========
546 xpm=yes
547 AC_ARG_ENABLE(xpm, 
548 [  --disable-xpm                  disable use of XPM pixmaps through libXpm],
549         xpm=$enableval, xpm=yes)
551 if test "$xpm" = yes; then
552     WM_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [$XLFLAGS $XLIBS])
554     if test "x$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = xyes; then
555         WM_CHECK_HEADER(X11/xpm.h)
556         if test "x$ac_cv_header_X11_xpm_h" = xyes; then
557                 GFXLIBS="$GFXLIBS -lXpm"
558                 supported_gfx="XPM"
559                 AC_DEFINE(USE_XPM)
560         else
561                 supported_gfx="builtin-XPM"
562         fi
563     fi
566 # for wmlib
567 AC_SUBST(XCFLAGS)
568 # for test
569 AC_SUBST(XLFLAGS)
570 AC_SUBST(XLIBS)
572 AC_SUBST(X_EXTRA_LIBS)
574 dnl ===============================================
575 dnl             End of stuff that uses X
576 dnl ===============================================
580 dnl Hermes Support
581 dnl ==============
583 AC_ARG_ENABLE(hermes,
584   [  --disable-hermes     disable Hermes support for wrlib ],
585      hermes=$enableval, hermes=yes)
587 if test x$hermes = xyes; then
588    WM_CHECK_LIB(Hermes, Hermes_ConverterRequest, [])
589    
590    if test x$ac_cv_lib_Hermes_Hermes_ConverterRequest = xyes; then
591       WM_CHECK_HEADER(Hermes/Hermes.h)
592       if test x$ac_cv_header_Hermes_Hermes_h = xyes; then
593          GFXLIBS="$GFXLIBS -lHermes"
594          AC_DEFINE(HAVE_HERMES)
595          hermes_support=yes
596       fi
597    fi
602 dnl PNG Support
603 dnl ===========
604 png=yes
605 AC_ARG_ENABLE(png, 
606 [  --disable-png                  disable PNG support through libpng],
607         png=$enableval, png=yes, png=no)
610 if test "$png" = yes ; then
611     WM_CHECK_LIB(png, png_get_valid, [-lz -lm])
613     if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
614         WM_CHECK_HEADER(png.h)
615         if test "x$ac_cv_header_png_h" = xyes; then
616             GFXLIBS="$GFXLIBS -lpng -lz" 
617             supported_gfx="$supported_gfx PNG"
618             AC_DEFINE(USE_PNG)
619         fi
620     fi
624 dnl JPEG Support
625 dnl ============
626 jpeg=yes
627 ljpeg=""
628 AC_ARG_ENABLE(jpeg,
629 [  --disable-jpeg         disable JPEG support through libjpeg],
630         jpeg=$enableval, jpeg=yes, jpeg=no)
632 if test "$jpeg" = yes; then
633     WM_CHECK_LIB(jpeg, jpeg_destroy_compress)
635     if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = xyes; then
637         ljpeg="-ljpeg"
639         WM_CHECK_HEADER(jpeglib.h)
640         if test "x$ac_cv_header_jpeglib_h" = xyes; then
641             GFXLIBS="$GFXLIBS -ljpeg"
642             supported_gfx="$supported_gfx JPEG"
643             AC_DEFINE(USE_JPEG)
644         fi
645     fi
649 dnl GIF Support
650 dnl ============
651 gif=yes
652 AC_ARG_ENABLE(gif,
653 [  --disable-gif           disable GIF support through libgif or libungif],
654         gif=$enableval, gif=yes, gif=no)
656 if test "$gif" = yes; then
657     my_libname=""
658     WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
659     if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
660         my_libname=-lungif
661     fi
663 dnl libungif is the same thing as libgif for all practical purposes.
665     if test "x$my_libname" = x; then
666         WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
667         if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
668             my_libname=-lgif
669         fi
670     fi
672     if test "$my_libname" != x; then
673         WM_CHECK_HEADER(gif_lib.h)
674         if test "x$ac_cv_header_gif_lib_h" = xyes; then
675             GFXLIBS="$GFXLIBS $my_libname"
676             supported_gfx="$supported_gfx GIF"
677             AC_DEFINE(USE_GIF)
678         fi
679     fi
684 dnl TIFF Support
685 dnl ============
686 AC_ARG_ENABLE(tiff, 
687 [  --disable-tiff         disable use of TIFF images through libtiff],
688         tif=$enableval, tif=yes, tif=no)
691 # TIFF can optionally have JPEG and/or zlib support. Must find out
692 # when they are supported so that correct library flags are passed during
693 # detection and linkage
696 # By default use xpm icons if tiff is not found.
697 ICONEXT="xpm"
700 if test "$tif" = yes; then
701     my_libname=""
702     WM_CHECK_LIB(tiff, TIFFGetVersion, [-lm])
703     if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
704         my_libname="-ltiff"
705     fi
707 dnl Retry with zlib
709     unset ac_cv_lib_tiff_TIFFGetVersion
710     if test "x$my_libname" = x; then
711         WM_CHECK_LIB(tiff, TIFFGetVersion, [$ljpeg -lz -lm])
712         if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
713             my_libname="-ltiff -lz"
714         fi
715     fi
717     if test "x$my_libname" = x; then
718         WM_CHECK_LIB(tiff34, TIFFGetVersion, [$ljpeg -lm])
719         if test "x$ac_cv_lib_tiff34_TIFFGetVersion" = xyes; then
720             my_libname="-ltiff34"
721         fi
722     fi
725     if test "x$my_libname" != x; then
726         WM_CHECK_HEADER(tiffio.h)
727         if test "x$ac_cv_header_tiffio_h" = xyes; then
728             GFXLIBS="$my_libname $GFXLIBS"
729             ICONEXT="tiff"
730             supported_gfx="$supported_gfx TIFF"
731             AC_DEFINE(USE_TIFF)     
732         fi
733     fi
736 LIBRARY_SEARCH_PATH="$lib_search_path"
737 HEADER_SEARCH_PATH="$inc_search_path"
739 AC_SUBST(LIBRARY_SEARCH_PATH)
740 AC_SUBST(HEADER_SEARCH_PATH)
743 AC_SUBST(GFXLIBS)
744 AC_SUBST(ICONEXT)
747 dnl ==============================================
748 dnl         End of Graphic Format Libraries
749 dnl ==============================================
752 # AC_PREFIX_PROGRAM(wmaker)
754 dnl Support for PIXMAPDIR option
755 dnl ============================
756 AC_ARG_WITH(pixmapdir,
757 [  --with-pixmapdir=PATH   specify where pixmaps are located [DATADIR/pixmaps]])
759 if test "x$with_pixmapdir" != "x"; then
760         pixmapdir=$with_pixmapdir
761 else
762         pixmapdir=`eval echo ${datadir}/pixmaps`
765 AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir")
767 pkgdatadir=`eval echo $datadir`
768 AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker")
770 _sysconfdir=`eval echo $sysconfdir`
771 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$_sysconfdir")
774 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
775 dnl ==============================================
777 appspath=""
779 AC_ARG_WITH(appspath,
780 [  --with-appspath=PATH    specify the directory for GNUstep applications], appspath=$withval )
782 if test "x$appspath" = "x"; then
783     gnustepdir='$(prefix)/GNUstep'
785     if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
786         gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
787         gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
788     fi
790     with_appspath=$gnustepdir/Apps
793 wprefsdir=$with_appspath/WPrefs.app
795 AC_SUBST(wprefsdir)
798 dnl Enable User Defined Menu thing
799 dnl ==================================
800 AC_ARG_ENABLE(usermenu,
801 [  --enable-usermenu       user defined menus for applications
803 if test "$enableval" = yes; then
804         AC_DEFINE(USER_MENU)
810 dnl Nicolai:  Program tests for Documentation Section
811 dnl =================================================
812 dnl DOCTYPES=""
813 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
814 dnl if test "x$MAKEINFO" != "x" ; then
815 dnl       DOCTYPES="$DOCTYPES info_doc"
816 dnl fi
817 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
818 dnl if test "x$TEX" != "x" ; then
819 dnl       DOCTYPES="$DOCTYPES dvi_doc"
820 dnl fi
821 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
822 dnl if test "x$DVIPS" != "x" ; then
823 dnl       DOCTYPES="$DOCTYPES ps_doc"
824 dnl fi
825 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
826 dnl if test "x$PERL" != "x" ; then
827 dnl       DOCTYPES="$DOCTYPES html_doc"
828 dnl fi
829 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
830 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
831   
832 dnl AC_SUBST(DOCTYPES)
834 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile \
835         WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/Makefile \
836         WINGs/Examples/Makefile WINGs/Resources/Makefile WINGs/Tests/Makefile \
837         WINGs/Extras/Makefile WINGs/po/Makefile \
838         wmlib/Makefile wrlib/Makefile src/Makefile src/wconfig.h \
839         doc/Makefile doc/sk/Makefile \
840         WindowMaker/Makefile WindowMaker/Backgrounds/Makefile \
841         WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile \
842         WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile \
843         WindowMaker/Styles/Makefile WindowMaker/Themes/Makefile \
844         WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
845         WPrefs.app/po/Makefile \
846         contrib/Makefile contrib/WindowMaker.spec )
847 #       plugins/Makefile plugins/libwmfun/Makefile)
852 dnl Output some helpful data for compiling wraster and WINGs/WUtil apps
853 dnl ===================================================================
856 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
857 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
858 dnl     | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
860 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
861 dnl parsed by m4
863 cat <<EOF >get-wraster-flags
864 #!/bin/sh
866 prefix="$prefix"
867 exec_prefix=\$prefix
869 WCFLAGS="-I\$prefix/include $inc_search_path"
870 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
871 WLIBS="-lwraster $GFXLIBS $XLIBS -lm"
873 usage="Usage: get-wraster-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
875 if test \$# -eq 0; then
876       echo "\${usage}" 1>&2
877       exit 1
880 while test \$# -gt 0; do
881   case \$1 in
882     --cflags)
883         echo \$WCFLAGS
884         ;;
885     --ldflags|--lflags)
886         echo \$WLFLAGS
887         ;;
888     --libs)
889         echo \$WLIBS
890         ;;
891     *)
892         echo "\${usage}" 1>&2
893         exit 1
894         ;;
895   esac
896   shift
897 done
902 cat <<EOF >get-wings-flags
903 #!/bin/sh
905 prefix="$prefix"
906 exec_prefix=\$prefix
908 WCFLAGS="-I\$prefix/include $inc_search_path"
909 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
910 WLIBS="-lWINGs -lwraster $GFXLIBS $XLIBS -lm $NETLIBS -lPropList"
912 usage="Usage: get-wings-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
914 if test \$# -eq 0; then
915       echo "\${usage}" 1>&2
916       exit 1
919 while test \$# -gt 0; do
920   case \$1 in
921     --cflags)
922         echo \$WCFLAGS
923         ;;
924     --ldflags|--lflags)
925         echo \$WLFLAGS
926         ;;
927     --libs)
928         echo \$WLIBS
929         ;;
930     *)
931         echo "\${usage}" 1>&2
932         exit 1
933         ;;
934   esac
935   shift
936 done
941 cat <<EOF >get-wutil-flags
942 #!/bin/sh
944 prefix="$prefix"
945 exec_prefix=\$prefix
947 WCFLAGS="-I\$prefix/include $inc_search_path"
948 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
949 WLIBS="-lWUtil $NETLIBS -lPropList"
951 usage="Usage: get-wutil-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
953 if test \$# -eq 0; then
954       echo "\${usage}" 1>&2
955       exit 1
958 while test \$# -gt 0; do
959   case \$1 in
960     --cflags)
961         echo \$WCFLAGS
962         ;;
963     --ldflags|--lflags)
964         echo \$WLFLAGS
965         ;;
966     --libs)
967         echo \$WLIBS
968         ;;
969     *)
970         echo "\${usage}" 1>&2
971         exit 1
972         ;;
973   esac
974   shift
975 done
980 sed 's/#lp#/[/g' get-wraster-flags | sed 's/#rp#/]/g' > wrlib/get-wraster-flags
981 sed 's/#lp#/[/g' get-wings-flags | sed 's/#rp#/]/g' > WINGs/get-wings-flags
982 sed 's/#lp#/[/g' get-wutil-flags | sed 's/#rp#/]/g' > WINGs/get-wutil-flags
984 chmod 755 wrlib/get-wraster-flags WINGs/get-wings-flags WINGs/get-wutil-flags
986 rm -f get-wraster-flags get-wings-flags get-wutil-flags
990 dnl Spit out the configuration
991 dnl ==========================
993 supported_gfx="$supported_gfx builtin-PPM"
995 if test "x$MOFILES" = "x"; then
996         mof=none
997 else
998         mof=$MOFILES
1002 echo
1003 echo "Window Maker was configured as follows:"
1004 echo
1005 echo "Installation path prefix: $prefix"
1006 echo "Installation path prefix for binaries: $_bindir"
1007 echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
1008 echo "Graphic format libraries: $supported_gfx"
1009 if test x$hermes_support = xyes; then
1010     echo "Hermes support for wrlib enabled"
1012 dnl echo "Sound support: yes"
1013 echo "Translated message files to install: $mof"
1014 if test "x$MOFILES" != "x"; then
1015         echo "Installation path of translated messages: $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
1018 dnl WM_PRINT_REDCRAP_BUG_STATUS
1020 if test "x$ac_cv_header_jpeglib_h" != xyes; then
1021 echo "WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"
1022 echo
1023 echo "JPEG support will not be included because the JPEG library is"
1024 echo "not installed correctly or was not found. Background images"
1025 echo "from themes will not display as they usually are JPEG files."
1026 echo
1027 echo "To fix, download and install the jpeg library and/or make sure you"
1028 echo "installed all jpeg related packages, SPECIALLY the development packages"
1029 echo "like jpeg-devel (if you use some prepackaged version of libjpeg)."
1030 echo
1031 echo "WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"
1035 dnl This is for Emacs.  I'm lazy, I know... (nicolai)
1036 dnl ================================================
1037 dnl Local Variables:
1038 dnl compile-command: "autoconf"
1039 dnl End: