dnl dnl WindowMaker autoconf input. dnl dnl Process with: aclocal; autoconf; automake AC_INIT(src/WindowMaker.h) AM_INIT_AUTOMAKE(WindowMaker, 0.20.1) AM_CONFIG_HEADER(src/config.h) dnl Checks for host/os name dnl ======================= AC_CANONICAL_HOST dnl Checks for programs. dnl =================== AC_ISC_POSIX AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_GCC_TRADITIONAL dnl Checks for library functions. dnl ============================ dnl not used anywhere dnl AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_FUNC_ALLOCA AC_CHECK_FUNCS(gethostname gettimeofday select poll strerror strncasecmp setpgid) AC_PATH_PROG(CPP_PATH, cpp, notfound, /lib:/usr/bin:/bin:/usr/lib:/usr/ccs/lib:$PATH) dnl dnl Tell stupid Solaris cpp that the files it will process have C++ like syntax dnl RedHat 5.x is broken too, so it won't make a symlink from cpp to the dnl standard locations dnl if test "$CPP_PATH" = "/usr/ccs/lib/cpp" -o "$CPP_PATH" = "notfound" ; then if test "$GCC" = "yes"; then CPP_PATH="gcc -E -x c" else if test "$CPP_PATH" = "/usr/ccs/lib/cpp"; then CPP_PATH="$CPP_PATH -B" else echo "cpp, the C preprocessor was not found in your system." echo "Create a symbolic link from it to /lib/cpp and rerun configure" exit fi fi fi AC_DEFINE_UNQUOTED(CPP_PATH, "$CPP_PATH") dnl gettext dnl ======= dnl AM_GNU_GETTEXT INTLIBS="" AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"], AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"], INTLIBS="" )) AC_CHECK_PROG(XGETTEXT, xgettext, xgettext) if test "$XGETTEXT" != ""; then if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then echo "xgettext isn't GNU version" XGETTEXT="" fi fi if test "$LINGUAS" != ""; then if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then I18N="-DI18N" PO="" # if test "$LINGUAS" = ""; then # ling=` (cd src/po; /bin/ls *.po) ` # for l in $ling; do # lcode=`basename $l .po` # LINGUAS="$LINGUAS $lcode" # done # fi echo "xgettext and gettext() exist; will build i18n support for $LINGUAS" else I18N="" LINGUAS="" PO="" echo "xgettext and libintl.a don't both exist; will not build i18n support" fi else INTLIBS="" MOFILES="" WPMOFILES="" PO="" fi dnl The Tower of Babel dnl ================== dnl List of supported locales dnl ------------------------- supported_locales="cs de es fr gl it ja ko nl no pt ru se tr fi hr el" supported_wprefs_locales="pt hr fr ko" for lang in $LINGUAS; do ok=0 for l in $supported_locales; do if test "$l" = "$lang"; then ok=1 break fi done if test "$ok" = 1; then MOFILES="$MOFILES $lang.mo" else echo "Locale $lang is not supported." fi ok=0 for l in $supported_wprefs_locales; do if test "$l" = "$lang"; then ok=1 break fi done if test "$ok" = 1; then WPMOFILES="$WPMOFILES $lang.mo" fi done dnl Kanji Characters support dnl ======================== I18n=no AC_ARG_ENABLE(kanji, [ --enable-kanji multibyte character support (kanji, Korean etc.)],, enable_kanji=no) if test "$enable_kanji" = yes; then I18N_MB="#define I18N_MB" case $host_os in freebsd*) AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);; *) ;; esac else I18N_MB="#undef I18N_MB" fi AC_SUBST(I18N_MB) dnl Added by Oliver - Support for NLSDIR option, Hi Oliver! dnl =========================================== AC_ARG_WITH(nlsdir, [ --with-nlsdir=PATH specify where the locale stuff should go ]) if test "x$NLSDIR" = "x"; then if test "x$with_nlsdir" != "x"; then NLSDIR=$with_nlsdir else NLSDIR="/usr/lib/locale" fi fi dnl Put it back once we have some real gnome support... dnl dnl AC_ARG_WITH(gnome, dnl [ --with-gnome enable support for GNOME extensions ], dnl [with_gnome=$withval], [with_gnome=yes]) dnl AC_MSG_CHECKING([for GNOME support]) dnl if test "x$with_gnome" = "xyes"; then dnl HAVE_GNOME="#define MWM_HINTS" dnl AC_MSG_RESULT(yes) dnl else dnl HAVE_GNOME="#undef MWM_HINTS" dnl AC_MSG_RESULT(no) dnl fi dnl AC_SUBST(HAVE_GNOME) AC_SUBST(I18N) AC_SUBST(INTLIBS) AC_SUBST(NLSDIR) AC_SUBST(MOFILES) AC_SUBST(WPMOFILES) dnl =========================================== dnl Stuff that uses X dnl =========================================== AC_PATH_XTRA XCFLAGS="$X_CFLAGS" XLFLAGS="$X_LIBS" XLIBS="$X_EXTRA_LIBS -lX11" dnl Decide which locale function to use, setlocale() or _Xsetlocale() dnl by MANOME Tomonori dnl =========================================== AC_CHECK_LIB(X11, _Xsetlocale, [X_LOCALE="-DX_LOCALE"],, $XLFLAGS $XLIBS) AC_SUBST(X_LOCALE) dnl Shape support dnl ============= shape=yes AC_ARG_ENABLE(shape, [ --disable-shape disable shaped window extension support], shape=$enableval, shape=yes) added_xext=no if test "$shape" = yes; then AC_CHECK_LIB(Xext, XShapeSelectInput, [XLIBS="-lXext $XLIBS" added_xext=yes SHAPE=-DSHAPE], shape=no, $XLFLAGS $XLIBS) fi AC_SUBST(SHAPE) dnl MIT-SHM support dnl =============== shm=yes AC_ARG_ENABLE(shm, [ --disable-shm disable usage of MIT-SHM extension], shm=$enableval, shm=yes) if test "$shm" = yes; then AC_CHECK_LIB(Xext, XShmAttach, ok=yes, ok=no, $XLFLAGS $XLIBS) if test "$ok" = yes; then AC_CHECK_FUNC(shmget, ok=yes, ok=no) fi if test "$ok" = yes; then if test "$added_xext" = no; then XLIBS="-lXext $XLIBS" fi XSHM=-DXSHM fi fi AC_SUBST(XSHM) dnl ============================================== dnl Graphic Format Libraries dnl ============================================== dnl dnl Specify paths to look for graphic format libraries dnl ================================================== AC_ARG_WITH(gfx-libs, [ --with-gfx-libs pass compiler flags to look for gfx libraries], [GFXLIBS="$withval" GFX_LIB_PATH=$withval], [GFXLIBS="" GFX_LIB_PATH=""]) AC_ARG_WITH(gfx-incs, [ --with-gfx-incs pass compiler flags to look for gfx header files], [GFXFLAGS="$withval" GFX_INC_PATH=$withval], [GFXFLAGS="" GFX_INC_PATH=""]) dnl XPM Support dnl =========== xpm=yes AC_ARG_ENABLE(xpm, [ --disable-xpm disable use of XPM pixmaps through libXpm], xpm=$enableval, xpm=yes) if test "$xpm" = yes; then AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [GFXFLAGS="$GFXFLAGS -DUSE_XPM" GFXLIBS="$GFXLIBS -lXpm"],, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS) fi AC_SUBST(XLIBS) AC_SUBST(XCFLAGS) AC_SUBST(XLFLAGS) AC_SUBST(X_EXTRA_LIBS) dnl =============================================== dnl End of stuff that uses X dnl =============================================== dnl test for zlib dnl ============= AC_CHECK_LIB(z, gzread, zlib=yes, zlib=no, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS) dnl PNG Support dnl =========== png=yes AC_ARG_ENABLE(png, [ --disable-png disable PNG support through libpng], png=$enableval, png=yes) if test "$png" = yes; then if test "$zlib" = yes; then AC_CHECK_LIB(png, png_get_valid, [GFXLIBS="$GFXLIBS -lpng -lz" GFXFLAGS="$GFXFLAGS -DUSE_PNG" supported_gfx="$supported_gfx PNG"],, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS -lz -lm) fi fi dnl JPEG Support dnl ============ jpeg=yes AC_ARG_ENABLE(jpeg, [ --disable-jpeg disable JPEG support through libjpeg], jpeg=$enableval, jpeg=yes) if test "$jpeg" = yes; then AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [GFXLIBS="$GFXLIBS -ljpeg" GFXFLAGS="$GFXFLAGS -DUSE_JPEG" supported_gfx="$supported_gfx JPEG"],, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS) fi dnl GIF Support dnl ============ dnl dnl giflib uses dangerous function naming... (namespace clashing) dnl jpeg=yes AC_ARG_ENABLE(gif, [ --disable-gif disable GIF support through libgif or libungif], gif=$enableval, gif=yes) if test "$gif" = yes; then retry=no AC_CHECK_LIB(ungif, DGifOpenFileName, [GFXLIBS="$GFXLIBS -lungif" GFXFLAGS="$GFXFLAGS -DUSE_GIF" supported_gfx="$supported_gfx GIF"],retry=yes, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS) dnl dnl libungif is the same thing as libgif for all practical purposes. dnl if test "$retry" = yes; then AC_CHECK_LIB(gif, DGifOpenFileName, [GFXLIBS="$GFXLIBS -lgif" GFXFLAGS="$GFXFLAGS -DUSE_GIF" supported_gfx="$supported_gfx GIF"],, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS) fi fi dnl TIFF Support dnl ============ AC_ARG_ENABLE(tiff, [ --disable-tiff disable use of TIFF images through libtiff], tif=$enableval, tif=yes) # # TIFF can optionally have JPEG and/or zlib support. Must find out # when they are supported so that correct library flags are passed during # detection and linkage # # # By default use xpm icons if tiff is not found. ICONEXT="xpm" # if test "$tif" = yes; then AC_CHECK_LIB(tiff, TIFFGetVersion, [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="-ltiff $GFXLIBS" ICONEXT="tiff"],, [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lm]) dnl dnl Retry with zlib dnl if test ! "$ICONEXT" = "tiff"; then if test "$zlib" = "yes"; then AC_CHECK_LIB(tiff, TIFFGetVersion, [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="-ltiff -lz $GFXLIBS" ICONEXT="tiff"],, [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lz -lm]) fi fi if test ! "$ICONEXT" = "tiff"; then AC_CHECK_LIB(tiff34, TIFFGetVersion, [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="-ltiff34 $GFXLIBS" ICONEXT="tiff"],, [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lm]) fi fi AC_SUBST(GFXFLAGS) AC_SUBST(GFXLIBS) AC_SUBST(ICONEXT) dnl ============================================== dnl End of Graphic Format Libraries dnl ============================================== dnl ===================================================== dnl Check for libPropList dnl ===================================================== PLPATH=`pwd`/libPropList if test -f $PLPATH/libPropList.a; then echo Using compiled libPropList needtobuild=no LIBPL_LIBS="-L$PLPATH -lPropList" LIBPL_INC_PATH="-I$PLPATH" else AC_CHECK_LIB(PropList, PLGetString, [LIBPL_LIBS=-lPropList LIBPL_INC_PATH="" needtobuild=no], [LIBPL_LIBS="-L$PLPATH -lPropList" LIBPL_INC_PATH="-I$PLPATH" needtobuild=yes]) fi if test "$needtobuild" = yes; then if test -f libPropList/libPropList.a; then echo "using included libPropList" else echo "********** WARNING *************" echo "libPropList is not installed in your system." echo "You need to build it before building WindowMaker (if you already" echo "did that, remove config.cache and rerun configure)." echo "Please read the INSTALL file for detailed instructions." echo "Press to continue configuring WindowMaker or" echo "type b and to build it now." read foo if test "$foo" = b; then echo echo "Building libPropList..." echo if test ! -d libPropList; then gzip -d -c libPropList.tar.gz | tar xf - fi ok=no if (cd libPropList; ./configure); then if (cd libPropList; make); then ok=yes fi fi if test "$ok" = no; then echo "********** WARNING **********" echo "An error occurred while building libPropList" echo "Please build it manually." echo "Press to continue." read foo fi echo echo "resuming WindowMaker configuration..." echo fi fi fi AC_SUBST(LIBPL_LIBS) AC_SUBST(LIBPL_INC_PATH) dnl Paranoia setup dnl ============== AC_ARG_ENABLE(debug, [ --enable-debug enable debugging ],, enable_debug=no) if test "$enable_debug" = yes; then DFLAGS="-g -DDEBUG" # Efence makes things too slow. Add it by hand in the Makefiles # if it is really needed. # AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence") fi AC_SUBST(DFLAGS) dnl --Sound support - Dan dnl ============================================= AC_ARG_ENABLE(sound, [ --enable-sound enable sound support ],, enable_sound=no) if test "$enable_sound" = yes; then SOUND="#define WMSOUND" else SOUND="#undef WMSOUND" fi AC_SUBST(SOUND) # AC_PREFIX_PROGRAM(wmaker) if test "${prefix}" = "NONE"; then prefix="/usr/local" fi if test "${exec_prefix}" = "NONE"; then exec_prefix="${prefix}" fi dnl Support for PIXMAPDIR option dnl ============================ AC_ARG_WITH(pixmapdir, [ --with-pixmapdir=PATH specify where pixmaps are located [DATADIR/pixmaps]]) if test "x$with_pixmapdir" != "x"; then pixmapdir=$with_pixmapdir else pixmapdir="${datadir}/pixmaps" fi AC_SUBST(pixmapdir) dnl Support for GNUSTEP_LOCAL_ROOT, for WPrefs.app dnl ============================================== gnustepdir="${prefix}/GNUstep" if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s%${prefix}%\${prefix}%"` fi appsdir=$gnustepdir/Apps wprefsdir=$appsdir/WPrefs.app AC_SUBST(wprefsdir) dnl Enable single appicon per wm instance+class combo -cls dnl ===================================================== AC_ARG_ENABLE(single-icon, [ --enable-single-icon use single application icon per WM_INSTANCE+WM_CLASS (unsupported) ], if test "$enableval" = yes; then REDUCE_APPICONS="#define REDUCE_APPICONS" else REDUCE_APPICONS="#undef REDUCE_APPICONS" fi, REDUCE_APPICONS="#undef REDUCE_APPICONS" ) AC_SUBST(REDUCE_APPICONS) dnl Checks for header files. dnl ======================= dnl AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h sys/types.h libintl.h sys/select.h) dnl Checks for typedefs, structures, and compiler characteristics. dnl ============================================================== AC_DECL_SYS_SIGLIST AC_C_CONST AC_TYPE_SIZE_T AC_TYPE_PID_T AC_HEADER_TIME dnl Some decisions.... dnl ================== if test "$GCC" = "yes"; then # ceflagues="" # for i in $CFLAGS; do # if test "$i" != "-g" ; then # ceflagues="$ceflagues $i" # fi # fi # CFLAGS="$ceflagues -Wall -Wno-implicit-int -finline-functions" CFLAGS="$CFLAGS -Wall -Wno-implicit-int -Wcast-align" fi dnl dnl Nicolai: Program tests for Documentation Section dnl ================================================= dnl DOCTYPES="" dnl AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ,$PATH) dnl if test "x$MAKEINFO" != "x" ; then dnl DOCTYPES="$DOCTYPES info_doc" dnl fi dnl AC_CHECK_PROG(TEX, tex, tex, ,$PATH) dnl if test "x$TEX" != "x" ; then dnl DOCTYPES="$DOCTYPES dvi_doc" dnl fi dnl AC_CHECK_PROG(DVIPS, dvips, dvips, ,$PATH) dnl if test "x$DVIPS" != "x" ; then dnl DOCTYPES="$DOCTYPES ps_doc" dnl fi dnl AC_CHECK_PROG(PERL, perl, perl, ,$PATH) dnl if test "x$PERL" != "x" ; then dnl DOCTYPES="$DOCTYPES html_doc" dnl fi dnl AC_PATH_PROG(PERL_PATH, perl, perl, ,$PATH) dnl AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, ,$PATH) dnl AC_SUBST(DOCTYPES) AC_OUTPUT(Makefile po/Makefile util/Makefile test/Makefile wmlib/Makefile \ WINGs/Makefile WINGs/Resources/Makefile src/Makefile src/wconfig.h \ wrlib/Makefile doc/Makefile WindowMaker/Makefile \ WindowMaker/Defaults/Makefile WindowMaker/Styles/Makefile \ WindowMaker/Themes/Makefile WindowMaker/Backgrounds/Makefile \ WindowMaker/Pixmaps/Makefile WindowMaker/Icons/Makefile \ WindowMaker/IconSets/Makefile \ WindowMaker/Sounds/Makefile \ WPrefs.app/Makefile WPrefs.app/tiff/Makefile WPrefs.app/xpm/Makefile \ WPrefs.app/po/Makefile ) dnl dnl Output some helpfull data for compiling WINGs apps dnl ================================================== dnl echo "WFLAGS=\"$LIBPL_INC_PATH -I$prefix/include\"" > WINGs-flags echo "WLIBS=\"-L$exec_prefix/lib -lWINGs -lwraster $LIBPL_LIBS $GFXLIBS -lm\""\ >> WINGs-flags dnl dnl Spit out the configuration dnl ========================== formats="XPM PPM" a=0 for i in $GFXFLAGS; do case "$i" in -DUSE_GIF) formats="$formats GIF" ;; -DUSE_TIFF) formats="$formats TIFF" ;; -DUSE_PNG) formats="$formats PNG" ;; -DUSE_JPEG) formats="$formats JPEG" ;; esac done echo echo "WindowMaker was configured as follows:" echo echo "Installation path prefix: $prefix" echo "Installation path prefix for binaries: $exec_prefix" echo "Installation path for WPrefs.app: $wprefsdir" echo "Graphic format libraries: $formats" if test "x$MOFILES" = "x"; then mof=none else mof=$MOFILES fi echo "Translated message files to install: $mof" if test "x$MOFILES" != "x"; then echo "Installation path of translated messages: $NLSDIR" fi echo "What!? WPrefs.app won't be installed where you want it?" echo "May I point to you to the INSTALL file?" dnl This is for Emacs. I'm lazy, I know... (nicolai) dnl ================================================ dnl Local Variables: dnl compile-command: "autoconf" dnl End: