dnl dnl Window Maker autoconf input. dnl dnl Process with: aclocal; autoconf; automake dnl dnl dnl Shared library generation stuff taken from configure script from zlib dnl AC_INIT(src/WindowMaker.h) AM_INIT_AUTOMAKE(WindowMaker, 0.20.2) dnl Shared Library Versions WINGS_VER=0.0.1 WRASTER_VER=0.0.1 dnl configure/build bundled libraries dnl =================================== AC_CONFIG_SUBDIRS(libPropList) 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 pl ro" supported_wprefs_locales="pt hr fr ko ja" 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 [ --enable-gnome enable support for GNOME extensions ], dnl [enable_gnome=$withval], [enable_gnome=yes]) dnl if test "$enable_gnome" = yes; then dnl GNOME="#define GNOME" dnl else dnl GNOME="#undef GNOME" dnl fi dnl AC_SUBST(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, my_libok=yes, my_libok=no, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS) if test "$my_libok" = yes; then my_old_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GFX_INC_PATH $XCFLAGS" AC_CHECK_HEADER(X11/xpm.h, [GFXFLAGS="$GFXFLAGS -DUSE_XPM" GFXLIBS="$GFXLIBS -lXpm" supported_gfx="XPM"], supported_gfx="XPM (builtin)") CPPFLAGS=$my_old_cppflags fi 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 # assume libz is present... #AC_ARG_ENABLE(png, #[ --disable-png disable PNG support through libpng], # png=$enableval, png=yes) if test "$png" = yes -a "$zlib" = yes ; then AC_CHECK_LIB(png, png_get_valid, my_libok=yes, my_libok=no, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS -lz -lm) if test "$my_libok" = yes; then my_old_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GFX_INC_PATH" AC_CHECK_HEADER(png.h, [GFXLIBS="$GFXLIBS -lpng -lz" GFXFLAGS="$GFXFLAGS -DUSE_PNG" supported_gfx="$supported_gfx PNG"], ) CPPFLAGS=$my_old_cppflags 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, my_libok=yes, my_libok=no, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS) if test "$my_libok" = yes; then my_old_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GFX_INC_PATH" AC_TRY_CPP(jpeglib.h, [GFXLIBS="$GFXLIBS -ljpeg" GFXFLAGS="$GFXFLAGS -DUSE_JPEG" supported_gfx="$supported_gfx JPEG"], ) CPPFLAGS=$my_old_cppflags fi 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, [my_libok=yes my_libname=ungif], [retry=yes my_libok=no], $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, [my_libok=yes my_libname=gif], my_libok=no, $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS) fi if test "$my_libok" = yes; then my_old_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GFX_INC_PATH" AC_CHECK_HEADER(gif_lib.h, [GFXLIBS="$GFXLIBS -l$my_libname" GFXFLAGS="$GFXFLAGS -DUSE_GIF" supported_gfx="$supported_gfx GIF"], ) CPPFLAGS=$my_old_cppflags 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 my_libname="" AC_CHECK_LIB(tiff, TIFFGetVersion, [my_libok=yes my_libname="-ltiff"], my_libok=no, [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lm]) dnl dnl Retry with zlib dnl if test "$my_libok" = no; then if test "$zlib" = "yes"; then AC_CHECK_LIB(tiff, TIFFGetVersion, [my_libok=yes my_libname="-ltiff -lz"], my_libok=no, [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lz -lm]) fi fi if test "$my_libok" = no; then AC_CHECK_LIB(tiff34, TIFFGetVersion, [my_libok=yes my_libname="-ltiff34"], my_libok=no, [$GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS -lm]) fi if test "$my_libok" = yes; then my_old_cppflags=$CPPFLAGS CPPFLAGS="$CPPFLAGS $GFX_INC_PATH" AC_CHECK_HEADER(tiffio.h, [GFXFLAGS="$GFXFLAGS -DUSE_TIFF" GFXLIBS="$my_libname $GFXLIBS" ICONEXT="tiff" supported_gfx="$supported_gfx TIFF"], ) CPPFLAGS=$my_old_cppflags 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 Always use the included libPropList, even if it is dnl already installed. dnl ===================================================== #LIBPL_LIBS="-L${top_builddir}/libPropList -lPropList" #LIBPL_INC_PATH="-I${top_srcdir}/libPropList" # # #PLPATH=`pwd`/libPropList # #if test -f $PLPATH/libPropList.a; then # echo "using bundled libPropList, already compiled." # 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 Window Maker (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 Window Maker 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 Window Maker configuration..." # echo # fi # fi #fi # #AC_SUBST(LIBPL_LIBS) #AC_SUBST(LIBPL_INC_PATH) dnl Debugging 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 ============================================= sound=yes AC_ARG_ENABLE(sound, [ --disable-sound disable sound support ], sound=$enableval, sound=yes) if test "$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 ============================================== appspath="" AC_ARG_WITH(appspath, [ --with-appspath=PATH specify the path of the GNUstep applications directory]) if test "x$appspath" = "x"; then gnustepdir="${prefix}/GNUstep" if test "x$GNUSTEP_LOCAL_ROOT" != "x" ; then gnustepdir=`echo "$GNUSTEP_LOCAL_ROOT" | sed -e "s%${prefix}%\${prefix}%"` fi appspath=$gnustepdir/Apps fi wprefsdir=$appspath/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 ], 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 Shared Library Support (unfinished) dnl =================================== enable_shared=no #AC_ARG_ENABLE(shared, #[ --enable-shared build libraries as shared ], enable_shared=yes, # enable_shared=no) if test "$enable_shared" = yes; then if test "$GCC" = yes; then _CFLAGS="-fPIC" LDSHARED='$CC -shared' else # find system name and corresponding cc options case `(uname -sr || echo unknown) 2>/dev/null` in SunOS\ 5*) _CFLAGS="-fast -xcg89 -KPIC -R." LDSHARED='$CC -G';; SunOS\ 4*) _CFLAGS="-PIC" LDSHARED="ld";; IRIX*) _CFLAGS="-ansi -rpath ." LDSHARED='$CC -shared';; SCO_SV\ 3.2*) _CFLAGS="-dy -KPIC " LDSHARED='$CC -dy -KPIC -G';; HP-UX*) _CFLAGS="+z" LDSHARED="ld -b" SHAREDLIBS='libz.sl';; *) _CFLAGS="" LDSHARED='$CC -shared';; esac fi AC_MSG_CHECKING([for shared library support]) test=tmptest$$ cat > $test.c <&1`" = "" && test "`($LDSHARED -o $test.so $test.o) 2>&1`" = ""; then CFLAGS="$CFLAGS $_CFLAGS" WRASTERLIB='libwraster.so.$(WRASTER_VER)' WINGSLIB='libWINGs.so.$(WINGS_VER)' AC_MSG_RESULT([yes, building shared]) else LDSHARED='$CC' WRASTERLIB='libwraster.a' WINGSLIB='libWINGs.a' AC_MSG_RESULT([no, building static]) fi rm -f $test.[co] $test.so fi #AC_SUBST(WRASTER_VER) #AC_SUBST(WINGS_VER) #AC_SUBST(WRASTERLIB) # AC_SUBST(WINGSLIB) # AC_SUBST(LDSHARED) 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 \ 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 ========================== supported_gfx="$supported_gfx PPM (built-in)" if test "x$MOFILES" = "x"; then mof=none else mof=$MOFILES fi echo echo "Window Maker 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: $supported_gfx" echo "Sound support: $sound" echo "Translated message files to install: $mof" if test "x$MOFILES" != "x"; then echo "Installation path of translated messages: $NLSDIR" fi dnl This is for Emacs. I'm lazy, I know... (nicolai) dnl ================================================ dnl Local Variables: dnl compile-command: "autoconf" dnl End: