- s/sprintf/snprintf
[wmaker-crm.git] / configure.in
blob4064330f74ea8bf7ac2a137a1f037af2c12ce692
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.65.1)
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)
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 dnl AC_HEADER_STDC
153 AC_HEADER_SYS_WAIT
154 AC_HEADER_TIME
155 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h\
156                 libintl.h sys/select.h poll.h malloc.h)
160 dnl Checks for typedefs, structures, and compiler characteristics.
161 dnl ==============================================================
162 AC_DECL_SYS_SIGLIST
163 AC_C_CONST
164 #AC_TYPE_SIZE_T
165 #AC_TYPE_PID_T
166 AC_TYPE_SIGNAL
168     
170 dnl gettext
171 dnl =======
174 dnl AM_GNU_GETTEXT
178 INTLIBS=""
180 AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"], 
181         AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
182                          INTLIBS="" ))
184 AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)
186 if test "$XGETTEXT" != ""; then 
187     if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
188         echo "xgettext isn't GNU version"
189         XGETTEXT=""
190     fi
193 if test "$LINGUAS" != ""; then
194     if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
195         AC_DEFINE(I18N)
196         PO=""
197 #       if test "$LINGUAS" = ""; then
198 #           ling=` (cd src/po; /bin/ls *.po) `
199 #           for l in $ling; do
200 #               lcode=`basename $l .po`
201 #               LINGUAS="$LINGUAS $lcode"
202 #           done
203 #       fi
204         echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
205     else
206         LINGUAS=""
207         PO=""
208         echo "xgettext and libintl.a don't both exist; will not build i18n support"
209     fi
210 else
211         INTLIBS=""
212         MOFILES=""
213         WPMOFILES=""
214         PO=""
218 dnl The Tower of Babel
219 dnl ==================
221 dnl List of supported locales
222 dnl -------------------------
223 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"
224 supported_wprefs_locales="pt hr fr ko ja cs zh_TW.Big5 es zh_CN fi it ru de bg hu sk"
225 supported_wings_locales="sk"
227 for lang in $LINGUAS; do
228         ok=0
229         for l in $supported_locales; do
230                 if test "$l" = "$lang"; then
231                         ok=1
232                         break
233                 fi
234         done
235         if test "$ok" = 1; then
236                 MOFILES="$MOFILES $lang.mo"
237         else
238                 echo "Locale $lang is not supported."
239         fi
240         ok=0
241         for l in $supported_wprefs_locales; do
242                 if test "$l" = "$lang"; then
243                         ok=1
244                         break
245                 fi
246         done
247         if test "$ok" = 1; then
248                 WPMOFILES="$WPMOFILES $lang.mo"
249         fi
250         ok=0
251         for l in $supported_wings_locales; do
252                 if test "$l" = "$lang"; then
253                         ok=1
254                         break
255                 fi
256         done
257         if test "$ok" = 1; then
258                 WINGSMOFILES="$WINGSMOFILES $lang.mo"
259         fi
260 done
263 dnl Kanji Characters support
264 dnl ========================
266 case $host_os in
267         freebsd*)
268                 AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);;
269         *)
270         ;;
271 esac
275 dnl Added by Oliver - Support for NLSDIR option,   Hi Oliver!
276 dnl ===========================================
277 AC_ARG_WITH(nlsdir, 
278         [  --with-nlsdir=PATH      specify where the locale stuff should go ])
281 if test "x$NLSDIR" = "x"; then
282         if test "x$with_nlsdir" != "x"; then
283                 NLSDIR=$with_nlsdir
284         else
285                 NLSDIR='$(prefix)/lib/locale'
286         fi
291 AC_SUBST(DLLIBS)
292 AC_SUBST(INTLIBS)
293 AC_SUBST(NLSDIR)
294 AC_SUBST(MOFILES)
295 AC_SUBST(WPMOFILES)
296 AC_SUBST(WINGSMOFILES)
297 AC_SUBST(supported_locales)
301 dnl Support for various hint things
302 dnl ===============================
305 AC_ARG_ENABLE(gnome,
306   [  --enable-gnome       enable stuff needed for GNOME ],
307   [if test x$enableval = xyes; then
308     AC_DEFINE(GNOME_STUFF)
309     gnome_on=yes
310   fi])
313 AC_ARG_ENABLE(kde,
314   [  --enable-kde                 enable support for KDE window manager (kwm) hints ],
315   [if test x$enableval = xyes; then
316     AC_DEFINE(KWM_HINTS)
317     kde_on=yes
318   fi])
321 AC_ARG_ENABLE(openlook,
322   [  --enable-openlook    enable support for OPEN LOOK(tm) (olwm) hints ],
323   [if test x$enableval = xyes; then
324     AC_DEFINE(OLWM_HINTS)
325     openlook_on=yes
326   fi])
330 dnl Disable some stuff that are duplicated in kde
331 dnl ---------------------------------------------
332 AC_ARG_ENABLE(lite,
333   [  --enable-lite                disable some stuff (dont use it) ],
334   [if test x$enableval = xyes; then
335         LITE=yes
336         AC_DEFINE(LITE)
337         AC_SUBST(LITE)
338   fi])
343 dnl Networking stuff
346 NETLIBS=""
348 AC_CHECK_FUNC(connect,,
349         AC_CHECK_LIB(socket, connect, NETLIBS="$NETLIBS -lsocket"))
351 AC_CHECK_FUNC(gethostbyname,,
352         AC_CHECK_LIB(nsl, gethostbyname, NETLIBS="$NETLIBS -lnsl"))
354 AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON),
355      for lib in resolv socket inet bsd; do
356         AC_CHECK_LIB($lib, inet_aton, [AC_DEFINE(HAVE_INET_ATON)
357                      NETLIBS="$NETLIBS -l$lib"; break],, $NETLIBS)
358      done)
360 AC_SUBST(NETLIBS)
363 dnl ===========================================
364 dnl             Stuff that uses X
365 dnl ===========================================
367 AC_PATH_XTRA
369 if test $no_x; then
370     AC_MSG_ERROR([The path for the X11 files not found!
371 Make sure you have X and it's headers and libraries (the -devel packages
372 in Linux) installed.])
375 X_LIBRARY_PATH=$x_libraries
377 XCFLAGS="$X_CFLAGS"
379 XLFLAGS="$X_LIBS"
381 XLIBS="-lX11 $X_EXTRA_LIBS"
384 lib_search_path="$lib_search_path $XLFLAGS"
385 inc_search_path="$inc_search_path $XCFLAGS"
388 AC_SUBST(X_LIBRARY_PATH)
392 dnl Decide which locale function to use, setlocale() or _Xsetlocale()
393 dnl by MANOME Tomonori 
394 dnl ===========================================
395 use_locale=yes
396 AC_ARG_ENABLE(locale, 
397 [  --disable-locale       disable use of X locale support],
398                 use_locale=no)
400 if test "$use_locale" = yes; then
401   AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $XLFLAGS $XLIBS)
405 dnl Check whether XInternAtoms() exist
406 dnl ==================================
407 AC_CHECK_LIB(X11, XInternAtoms, AC_DEFINE(HAVE_XINTERNATOMS),,$XLFLAGS $XLIBS)
410 dnl XKB keyboard language status
411 dnl ============================
412 AC_ARG_ENABLE(modelock,
413 [  --enable-modelock      XKB keyboard language status support],
414                 AC_DEFINE(XKB_MODELOCK))
418 dnl Shape support
419 dnl =============
420 shape=yes
421 AC_ARG_ENABLE(shape, 
422 [  --disable-shape        disable shaped window extension support],
423                 shape=$enableval, shape=yes)
425 added_xext=no
427 if test "$shape" = yes; then
428         AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS"
429                 added_xext=yes
430                 AC_DEFINE(SHAPE)], shape=no, $XLFLAGS $XLIBS)
434 dnl XINERAMA support
435 dnl ================
436 xinerama=yes
437 AC_ARG_ENABLE(xinerama, 
438 [  --disable-xinerama     disable XInerama extension support],
439                 xinerama=$enableval, xinerama=yes)
441 if test "$xinerama" = yes; then
442         AC_CHECK_LIB(Xext, XineramaQueryScreens, [XLIBS="-lXext $XLIBS"
443                 added_xext=yes
444                 AC_DEFINE(XINERAMA)], xinerama=no, $XLFLAGS $XLIBS)
449 dnl MIT-SHM support
450 dnl ===============
451 shm=yes
452 AC_ARG_ENABLE(shm,
453 [  --disable-shm           disable usage of MIT-SHM extension],
454                 shm=$enableval, shm=yes)
456 if test "$shm" = yes; then
457         AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS)
459         if test "$ok" = yes; then
460         AC_CHECK_FUNC(shmget, ok=yes, ok=no)
461         fi
463         if test "$ok" = yes; then
464                 if test "$added_xext" = no; then
465                         XLIBS="-lXext $XLIBS"
466                 fi
467                 AC_DEFINE(XSHM)
468         fi
472 dnl R6 Style Session Management Support
473 dnl ===================================
477 #AC_DEFINE(R6SM)
478 #AC_SUBST(XSMPLIBS)
482 dnl Check for libPropList
483 dnl =====================
485 LIBPL=""
487 WM_CHECK_LIB(PropList, PLGetString, $X_EXTRA_LIBS)
488 if test "x$ac_cv_lib_PropList_PLGetString" = xyes; then
489     WM_CHECK_HEADER(proplist.h)
490     if test "x$ac_cv_header_proplist_h" = xyes; then
491         LIBPL="-lPropList"
492     fi
495 if test "x$LIBPL" = "x"; then
496    echo
497    echo "ERROR!!! libPropList is not installed, or could not be found."
498    echo "         Window Maker requires libPropList to build."
499    echo "         Please read INSTALL to find where you can find libPropList,"
500    echo "         and install it first."
501    if test x$host_os = xlinux; then
502    echo "         If you're using some prepackaged version of libPropList,"
503    echo "         make sure you install it's \"development\" package as well."
504    fi
505    echo "         If you already have it installed, try using the"
506    if test "x$ac_cv_lib_PropList_PLGetString" != xyes; then
507    echo "         --with-libs-from flag to tell configure where the library"
508    echo "         is installed and"
509    fi
510    echo "         --with-incs-from flag to tell configure where the header"
511    echo "         files are installed"
512    exit 1
515 lPLVersion="0.10.1"
517 WM_CHECK_PROPLIST_VERSION($lPLVersion, goodlPL=yes, goodlPL=no)
519 if test "$goodlPL" = no; then
520    echo
521    echo "ERROR!!! libPropList is an old version. Please consider upgrading"
522    echo "         to at least version ${lPLVersion}. Older versions have bugs that"
523    echo "         may cause Window Maker to crash randomly."
524    echo "         If your libPropList is older than 0.9.2 it will also prevent"
525    echo "         Window Maker from compiling because new functions were"
526    echo "         introduced since that version."
527    echo "         Please read INSTALL to find where you can find libPropList,"
528    echo "         and upgrade it before you proceed."
529    exit 1
532 AC_SUBST(LIBPL)
535 dnl ==============================================
536 dnl         Graphic Format Libraries
537 dnl ==============================================
543 dnl XPM Support
544 dnl ===========
545 xpm=yes
546 AC_ARG_ENABLE(xpm, 
547 [  --disable-xpm                  disable use of XPM pixmaps through libXpm],
548         xpm=$enableval, xpm=yes)
550 if test "$xpm" = yes; then
551     WM_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [$XLFLAGS $XLIBS])
553     if test "x$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = xyes; then
554         WM_CHECK_HEADER(X11/xpm.h)
555         if test "x$ac_cv_header_X11_xpm_h" = xyes; then
556                 GFXLIBS="$GFXLIBS -lXpm"
557                 supported_gfx="XPM"
558                 AC_DEFINE(USE_XPM)
559         else
560                 supported_gfx="builtin-XPM"
561         fi
562     fi
565 # for wmlib
566 AC_SUBST(XCFLAGS)
567 # for test
568 AC_SUBST(XLFLAGS)
569 AC_SUBST(XLIBS)
571 AC_SUBST(X_EXTRA_LIBS)
573 dnl ===============================================
574 dnl             End of stuff that uses X
575 dnl ===============================================
579 dnl Hermes Support
580 dnl ==============
582 AC_ARG_ENABLE(hermes,
583   [  --disable-hermes     disable Hermes support for wrlib ],
584      hermes=$enableval, hermes=yes)
586 if test x$hermes = xyes; then
587    WM_CHECK_LIB(Hermes, Hermes_ConverterRequest, [])
588    
589    if test x$ac_cv_lib_Hermes_Hermes_ConverterRequest = xyes; then
590       WM_CHECK_HEADER(Hermes/Hermes.h)
591       if test x$ac_cv_header_Hermes_Hermes_h = xyes; then
592          GFXLIBS="$GFXLIBS -lHermes"
593          AC_DEFINE(HAVE_HERMES)
594          hermes_support=yes
595       fi
596    fi
601 dnl PNG Support
602 dnl ===========
603 png=yes
604 AC_ARG_ENABLE(png, 
605 [  --disable-png                  disable PNG support through libpng],
606         png=$enableval, png=yes, png=no)
609 if test "$png" = yes ; then
610     WM_CHECK_LIB(png, png_get_valid, [-lz -lm])
612     if test "x$ac_cv_lib_png_png_get_valid" = xyes; then
613         WM_CHECK_HEADER(png.h)
614         if test "x$ac_cv_header_png_h" = xyes; then
615             GFXLIBS="$GFXLIBS -lpng -lz" 
616             supported_gfx="$supported_gfx PNG"
617             AC_DEFINE(USE_PNG)
618         fi
619     fi
623 dnl JPEG Support
624 dnl ============
625 jpeg=yes
626 ljpeg=""
627 AC_ARG_ENABLE(jpeg,
628 [  --disable-jpeg         disable JPEG support through libjpeg],
629         jpeg=$enableval, jpeg=yes, jpeg=no)
631 if test "$jpeg" = yes; then
632     WM_CHECK_LIB(jpeg, jpeg_destroy_compress)
634     if test "x$ac_cv_lib_jpeg_jpeg_destroy_compress" = xyes; then
636         ljpeg="-ljpeg"
638         WM_CHECK_HEADER(jpeglib.h)
639         if test "x$ac_cv_header_jpeglib_h" = xyes; then
640             GFXLIBS="$GFXLIBS -ljpeg"
641             supported_gfx="$supported_gfx JPEG"
642             AC_DEFINE(USE_JPEG)
643         fi
644     fi
648 dnl GIF Support
649 dnl ============
650 gif=yes
651 AC_ARG_ENABLE(gif,
652 [  --disable-gif           disable GIF support through libgif or libungif],
653         gif=$enableval, gif=yes, gif=no)
655 if test "$gif" = yes; then
656     my_libname=""
657     WM_CHECK_LIB(ungif, DGifOpenFileName, [$XLFLAGS $XLIBS])
658     if test "x$ac_cv_lib_ungif_DGifOpenFileName" = xyes; then
659         my_libname=-lungif
660     fi
662 dnl libungif is the same thing as libgif for all practical purposes.
664     if test "x$my_libname" = x; then
665         WM_CHECK_LIB(gif, DGifOpenFileName, [$XLFLAGS $XLIBS])
666         if test "x$ac_cv_lib_gif_DGifOpenFileName" = xyes; then
667             my_libname=-lgif
668         fi
669     fi
671     if test "$my_libname" != x; then
672         WM_CHECK_HEADER(gif_lib.h)
673         if test "x$ac_cv_header_gif_lib_h" = xyes; then
674             GFXLIBS="$GFXLIBS $my_libname"
675             supported_gfx="$supported_gfx GIF"
676             AC_DEFINE(USE_GIF)
677         fi
678     fi
683 dnl TIFF Support
684 dnl ============
685 AC_ARG_ENABLE(tiff, 
686 [  --disable-tiff         disable use of TIFF images through libtiff],
687         tif=$enableval, tif=yes, tif=no)
690 # TIFF can optionally have JPEG and/or zlib support. Must find out
691 # when they are supported so that correct library flags are passed during
692 # detection and linkage
695 # By default use xpm icons if tiff is not found.
696 ICONEXT="xpm"
699 if test "$tif" = yes; then
700     my_libname=""
701     WM_CHECK_LIB(tiff, TIFFGetVersion, [-lm])
702     if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
703         my_libname="-ltiff"
704     fi
706 dnl Retry with zlib
708     unset ac_cv_lib_tiff_TIFFGetVersion
709     if test "x$my_libname" = x; then
710         WM_CHECK_LIB(tiff, TIFFGetVersion, [$ljpeg -lz -lm])
711         if test "x$ac_cv_lib_tiff_TIFFGetVersion" = xyes; then
712             my_libname="-ltiff -lz"
713         fi
714     fi
716     if test "x$my_libname" = x; then
717         WM_CHECK_LIB(tiff34, TIFFGetVersion, [$ljpeg -lm])
718         if test "x$ac_cv_lib_tiff34_TIFFGetVersion" = xyes; then
719             my_libname="-ltiff34"
720         fi
721     fi
724     if test "x$my_libname" != x; then
725         WM_CHECK_HEADER(tiffio.h)
726         if test "x$ac_cv_header_tiffio_h" = xyes; then
727             GFXLIBS="$my_libname $GFXLIBS"
728             ICONEXT="tiff"
729             supported_gfx="$supported_gfx TIFF"
730             AC_DEFINE(USE_TIFF)     
731         fi
732     fi
735 LIBRARY_SEARCH_PATH="$lib_search_path"
736 HEADER_SEARCH_PATH="$inc_search_path"
738 AC_SUBST(LIBRARY_SEARCH_PATH)
739 AC_SUBST(HEADER_SEARCH_PATH)
742 AC_SUBST(GFXLIBS)
743 AC_SUBST(ICONEXT)
746 dnl ==============================================
747 dnl         End of Graphic Format Libraries
748 dnl ==============================================
751 # AC_PREFIX_PROGRAM(wmaker)
753 dnl Support for PIXMAPDIR option
754 dnl ============================
755 AC_ARG_WITH(pixmapdir,
756 [  --with-pixmapdir=PATH   specify where pixmaps are located [DATADIR/pixmaps]])
758 if test "x$with_pixmapdir" != "x"; then
759         pixmapdir=$with_pixmapdir
760 else
761         pixmapdir=`eval echo ${datadir}/pixmaps`
764 AC_DEFINE_UNQUOTED(PIXMAPDIR, "$pixmapdir")
766 pkgdatadir=`eval echo $datadir`
767 AC_DEFINE_UNQUOTED(PKGDATADIR, "$pkgdatadir/WindowMaker")
769 _sysconfdir=`eval echo $sysconfdir`
770 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$_sysconfdir")
773 dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app
774 dnl ==============================================
776 appspath=""
778 AC_ARG_WITH(appspath,
779 [  --with-appspath=PATH    specify the directory for GNUstep applications], appspath=$withval )
781 if test "x$appspath" = "x"; then
782     gnustepdir='$(prefix)/GNUstep'
784     if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then
785         gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s|^${prefix}|prefix|"`
786         gnustepdir=`echo $gnustepdir | sed -e 's|^prefix|${prefix}|'`
787     fi
789     with_appspath=$gnustepdir/Apps
792 wprefsdir=$with_appspath/WPrefs.app
794 AC_SUBST(wprefsdir)
797 dnl Enable User Defined Menu thing
798 dnl ==================================
799 AC_ARG_ENABLE(usermenu,
800 [  --enable-usermenu       user defined menus for applications
802 if test "$enableval" = yes; then
803         AC_DEFINE(USER_MENU)
809 dnl Nicolai:  Program tests for Documentation Section
810 dnl =================================================
811 dnl DOCTYPES=""
812 dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH)
813 dnl if test "x$MAKEINFO" != "x" ; then
814 dnl       DOCTYPES="$DOCTYPES info_doc"
815 dnl fi
816 dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH)
817 dnl if test "x$TEX" != "x" ; then
818 dnl       DOCTYPES="$DOCTYPES dvi_doc"
819 dnl fi
820 dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH)
821 dnl if test "x$DVIPS" != "x" ; then
822 dnl       DOCTYPES="$DOCTYPES ps_doc"
823 dnl fi
824 dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH)
825 dnl if test "x$PERL" != "x" ; then
826 dnl       DOCTYPES="$DOCTYPES html_doc"
827 dnl fi
828 dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH)
829 dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH)
830   
831 dnl AC_SUBST(DOCTYPES)
833 AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile \
834         WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/Makefile \
835         WINGs/Examples/Makefile WINGs/Resources/Makefile WINGs/Tests/Makefile \
836         WINGs/Extras/Makefile WINGs/po/Makefile \
837         wmlib/Makefile wrlib/Makefile src/Makefile src/wconfig.h doc/Makefile \
838         doc/sk/Makefile \
839         WindowMaker/Makefile WindowMaker/Backgrounds/Makefile \
840         WindowMaker/Defaults/Makefile WindowMaker/IconSets/Makefile \
841         WindowMaker/Icons/Makefile WindowMaker/Pixmaps/Makefile \
842         WindowMaker/Styles/Makefile WindowMaker/Themes/Makefile \
843         WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \
844         WPrefs.app/po/Makefile \
845         contrib/Makefile contrib/WindowMaker.spec )
846 #       plugins/Makefile plugins/libwmfun/Makefile)
851 dnl Output some helpful data for compiling wraster and WINGs/WUtil apps
852 dnl ===================================================================
855 dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags
856 dnl echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\
857 dnl     | sed -e 's|\$(prefix)|'"$prefix|" >> WINGs-flags
859 dnl The #lp# and #rp# stuff below is a hack because [ and ] get lost when
860 dnl parsed by m4
862 cat <<EOF >get-wraster-flags
863 #!/bin/sh
865 prefix="$prefix"
866 exec_prefix=\$prefix
868 WCFLAGS="-I\$prefix/include $inc_search_path"
869 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
870 WLIBS="-lwraster $GFXLIBS $XLIBS -lm"
872 usage="Usage: get-wraster-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
874 if test \$# -eq 0; then
875       echo "\${usage}" 1>&2
876       exit 1
879 while test \$# -gt 0; do
880   case \$1 in
881     --cflags)
882         echo \$WCFLAGS
883         ;;
884     --ldflags|--lflags)
885         echo \$WLFLAGS
886         ;;
887     --libs)
888         echo \$WLIBS
889         ;;
890     *)
891         echo "\${usage}" 1>&2
892         exit 1
893         ;;
894   esac
895   shift
896 done
901 cat <<EOF >get-wings-flags
902 #!/bin/sh
904 prefix="$prefix"
905 exec_prefix=\$prefix
907 WCFLAGS="-I\$prefix/include $inc_search_path"
908 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
909 WLIBS="-lWINGs -lwraster $GFXLIBS $XLIBS -lm $NETLIBS -lPropList"
911 usage="Usage: get-wings-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
913 if test \$# -eq 0; then
914       echo "\${usage}" 1>&2
915       exit 1
918 while test \$# -gt 0; do
919   case \$1 in
920     --cflags)
921         echo \$WCFLAGS
922         ;;
923     --ldflags|--lflags)
924         echo \$WLFLAGS
925         ;;
926     --libs)
927         echo \$WLIBS
928         ;;
929     *)
930         echo "\${usage}" 1>&2
931         exit 1
932         ;;
933   esac
934   shift
935 done
940 cat <<EOF >get-wutil-flags
941 #!/bin/sh
943 prefix="$prefix"
944 exec_prefix=\$prefix
946 WCFLAGS="-I\$prefix/include $inc_search_path"
947 WLFLAGS="-L\$exec_prefix/lib $lib_search_path"
948 WLIBS="-lWUtil $NETLIBS -lPropList"
950 usage="Usage: get-wutil-flags #lp#--cflags#rp# #lp#--ldflags#rp# #lp#--libs#rp#"
952 if test \$# -eq 0; then
953       echo "\${usage}" 1>&2
954       exit 1
957 while test \$# -gt 0; do
958   case \$1 in
959     --cflags)
960         echo \$WCFLAGS
961         ;;
962     --ldflags|--lflags)
963         echo \$WLFLAGS
964         ;;
965     --libs)
966         echo \$WLIBS
967         ;;
968     *)
969         echo "\${usage}" 1>&2
970         exit 1
971         ;;
972   esac
973   shift
974 done
979 sed 's/#lp#/[/g' get-wraster-flags | sed 's/#rp#/]/g' > wrlib/get-wraster-flags
980 sed 's/#lp#/[/g' get-wings-flags | sed 's/#rp#/]/g' > WINGs/get-wings-flags
981 sed 's/#lp#/[/g' get-wutil-flags | sed 's/#rp#/]/g' > WINGs/get-wutil-flags
983 chmod 755 wrlib/get-wraster-flags WINGs/get-wings-flags WINGs/get-wutil-flags
985 rm -f get-wraster-flags get-wings-flags get-wutil-flags
989 dnl Spit out the configuration
990 dnl ==========================
992 supported_gfx="$supported_gfx builtin-PPM"
994 if test "x$MOFILES" = "x"; then
995         mof=none
996 else
997         mof=$MOFILES
1001 echo
1002 echo "Window Maker was configured as follows:"
1003 echo
1004 echo "Installation path prefix: $prefix"
1005 echo "Installation path prefix for binaries: $_bindir"
1006 echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
1007 echo "Graphic format libraries: $supported_gfx"
1008 if test x$hermes_support = xyes; then
1009     echo "Hermes support for wrlib enabled"
1011 dnl echo "Sound support: yes"
1012 echo "Translated message files to install: $mof"
1013 if test "x$MOFILES" != "x"; then
1014         echo "Installation path of translated messages: $NLSDIR" | sed -e 's|\$(prefix)|'"$prefix|"
1017 dnl WM_PRINT_REDCRAP_BUG_STATUS
1019 if test "x$ac_cv_header_jpeglib_h" != xyes; then
1020 echo "WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"
1021 echo
1022 echo "JPEG support will not be included because the JPEG library is"
1023 echo "not installed correctly or was not found. Background images"
1024 echo "from themes will not display as they usually are JPEG files."
1025 echo
1026 echo "To fix, download and install the jpeg library and/or make sure you"
1027 echo "installed all jpeg related packages, SPECIALLY the development packages"
1028 echo "like jpeg-devel (if you use some prepackaged version of libjpeg)."
1029 echo
1030 echo "WARNING   WARNING   WARNING   WARNING   WARNING   WARNING   WARNING"
1034 dnl This is for Emacs.  I'm lazy, I know... (nicolai)
1035 dnl ================================================
1036 dnl Local Variables:
1037 dnl compile-command: "autoconf"
1038 dnl End: