123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569 |
- ############################################################################
- # JWM autoconf.
- ############################################################################
- AC_INIT(jwm, 2.2.0, joewing@joewing.net)
- AC_PREREQ(2.57)
- AC_CONFIG_SRCDIR([src])
- AC_CONFIG_SRCDIR([po])
- AC_CONFIG_HEADER([config.h])
- AC_LANG(C)
- AC_PROG_CC
- AC_PROG_CPP
- AC_PROG_INSTALL
- AC_PROG_MKDIR_P
- PACKAGE=jwm
- ############################################################################
- # Check if we need _XOPEN_SOURCE
- ############################################################################
- AC_MSG_CHECKING([if _XOPEN_SOURCE should be defined])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- #define _XOPEN_SOURCE 600L
- #include <unistd.h>
- ]])], [use_xopen_source="yes"], [use_xopen_source="no"])
- AC_MSG_RESULT([$use_xopen_source])
- if test $use_xopen_source = "yes"; then
- AC_DEFINE(_XOPEN_SOURCE, 600L, [Define for single UNIX conformance])
- # Needed for IRIX 6.2 so that struct timeval is declared.
- AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for timeval on IRIX 6.2])
- # Needed for Solaris 2.5.1 so that struct timeval is declared.
- AC_DEFINE(__EXTENSIONS__, 1, [Define for timeval on Solaris 2.5.1])
- fi
- ############################################################################
- # Check for X11
- ############################################################################
- AC_PATH_X
- if test ! "$no_x" = "yes" ; then
- if test ! x"$x_libraries" = x ; then
- LDFLAGS="$LDFLAGS -L$x_libraries"
- fi
- if test ! x"$x_includes" = x ; then
- CFLAGS="$CFLAGS -I$x_includes"
- fi
- else
- AC_MSG_ERROR([Could not find X11])
- fi
- AC_CHECK_LIB([X11], XOpenDisplay,
- [ LDFLAGS="$LDFLAGS -lX11" ],
- [ AC_MSG_ERROR([libX11 not found]) ])
- AC_CHECK_LIB([X11], Xutf8TextPropertyToTextList,
- [ AC_DEFINE(USE_XUTF8, 1, [Define to use Xutf8TextPropertyToTextList]) ],
- [ AC_MSG_WARN([Xutf8TextPropertyToTextList not found in libX11]) ])
- ############################################################################
- # Check for necessary include files.
- ############################################################################
- AC_CHECK_HEADERS([stdarg.h stdio.h stdlib.h ctype.h], [],
- [ AC_MSG_ERROR([one or more necessary header files not found]) ])
- AC_CHECK_HEADERS([sys/select.h signal.h unistd.h time.h sys/wait.h sys/time.h])
- AC_CHECK_HEADERS([alloca.h locale.h libintl.h])
- AC_CHECK_HEADERS([X11/Xlib.h], [],
- [ AC_MSG_ERROR([Xlib.h could not be found]) ])
- AC_CHECK_HEADERS([X11/Xutil.h X11/cursorfont.h X11/Xproto.h \
- X11/Xatom.h X11/keysym.h X11/Xresource.h], [], [],
- [
- #include <X11/Xlib.h>
- ])
- AC_CHECK_FUNCS([unsetenv putenv setlocale])
- ############################################################################
- # Check for pkg-config.
- ############################################################################
- AC_DEFUN([JWM_PKGCONFIG_EXISTS],
- [
- AC_MSG_CHECKING([for pkg-config])
- if which pkg-config >/dev/null ; then
- PKGCONFIG=pkg-config
- AC_MSG_RESULT($PKGCONFIG)
- else
- PKGCONFIG=""
- AC_MSG_RESULT([no])
- fi
- ])
- AC_DEFUN([JWM_PKGCONFIG],
- [
- AC_REQUIRE([JWM_PKGCONFIG_EXISTS])
- if test "x$PKGCONFIG" != "x" ; then
- AC_MSG_CHECKING([if pkg-config knows about $2])
- if `$PKGCONFIG $2` ; then
- $1="yes"
- else
- $1="no"
- fi
- AC_MSG_RESULT($$1)
- else
- $1="no"
- fi
- ])
- JWM_PKGCONFIG([use_pkgconfig_png], [libpng])
- JWM_PKGCONFIG([use_pkgconfig_jpeg], [libjpeg])
- JWM_PKGCONFIG([use_pkgconfig_cairo], [cairo])
- JWM_PKGCONFIG([use_pkgconfig_rsvg], [librsvg-2.0])
- JWM_PKGCONFIG([use_pkgconfig_freetype2], [freetype2])
- JWM_PKGCONFIG([use_pkgconfig_xft], [xft])
- JWM_PKGCONFIG([use_pkgconfig_xrender], [xrender])
- JWM_PKGCONFIG([use_pkgconfig_fribidi], [fribidi])
- ############################################################################
- # Check if confirm dialogs should be used.
- ############################################################################
- AC_ARG_ENABLE(confirm,
- AC_HELP_STRING([--disable-confirm], [disable confirm dialogs]) )
- if test "$enable_confirm" = "no" ; then
- AC_DEFINE(DISABLE_CONFIRM, 1, [Define to disable confirm dialogs])
- else
- enable_confirm="yes"
- fi
- ############################################################################
- # Check if icon support was requested.
- ############################################################################
- AC_ARG_ENABLE(icons,
- AC_HELP_STRING([--disable-icons], [disable icon support]) )
- if test "$enable_icons" != "no" ; then
- enable_icons="yes"
- AC_DEFINE(USE_ICONS, 1, [Define to enable icon support] )
- else
- enable_png="no"
- enable_xpm="no"
- enable_rsvg="no"
- enable_cairo="no"
- enable_jpeg="no"
- fi
- ############################################################################
- # Check if PNG support was requested and available.
- ############################################################################
- AC_ARG_ENABLE(png,
- AC_HELP_STRING([--disable-png], [disable PNG images]) )
- if test "$enable_png" != "no" ; then
- if test "$use_pkgconfig_png" = "yes" ; then
- PNG_CFLAGS=`$PKGCONFIG --cflags libpng`
- PNG_LDFLAGS=`$PKGCONFIG --libs libpng`
- elif which libpng-config >/dev/null ; then
- PNG_CFLAGS=`libpng-config --cflags`
- PNG_LDFLAGS=`libpng-config --libs`
- else
- PNG_LDFLAGS="-lpng -lz -lm"
- fi
- fi
- if test "$enable_png" != "no" ; then
- AC_CHECK_LIB(png, png_read_image,
- [ LDFLAGS="$LDFLAGS $PNG_LDFLAGS"
- CFLAGS="$CFLAGS $PNG_CFLAGS"
- enable_png="yes"
- AC_DEFINE(USE_PNG, 1, [Define to use libpng]) ],
- [ enable_png="no"
- AC_MSG_WARN([unable to use libpng, PNG support disabled]) ],
- [ $PNG_LDFLAGS ])
- fi
- ############################################################################
- # Check if Cairo support was requested and available.
- ############################################################################
- AC_ARG_ENABLE(cairo,
- AC_HELP_STRING([--disable-cairo], [disable Cairo support]) )
- if test "$enable_cairo" != "no" ; then
- if test "$use_pkgconfig_cairo" = "yes" ; then
- CAIRO_CFLAGS=`$PKGCONFIG --cflags cairo`
- CAIRO_LDFLAGS=`$PKGCONFIG --libs cairo`
- elif which cairo-config >/dev/null ; then
- CAIRO_CFLAGS=`cairo-config --cflags`
- CAIRO_LDFLAGS=`cairo-config --libs`
- else
- CAIRO_LDFLAGS="-lcairo"
- fi
- fi
- if test "$enable_cairo" != "no" ; then
- AC_CHECK_LIB(cairo, cairo_create,
- [ enable_cairo="yes" ],
- [ enable_cairo="no"
- AC_MSG_WARN([unable to use Cairo, Cairo support disabled]) ],
- [ $CAIRO_LDFLAGS ])
- fi
- if test "$enable_cairo" = "no" ; then
- if test "$enable_rsvg" != "no" ; then
- AC_MSG_WARN([disabling rsvg because Cairo is disabled])
- enable_rsvg="no"
- fi
- fi
- ############################################################################
- # Check if librsvg support was requested and available.
- ############################################################################
- AC_ARG_ENABLE(rsvg,
- AC_HELP_STRING([--disable-rsvg], [disable rsvg support]) )
- if test "$enable_rsvg" != "no" ; then
- if test "$use_pkgconfig_rsvg" = "yes" ; then
- RSVG_CFLAGS=`$PKGCONFIG --cflags librsvg-2.0`
- RSVG_LDFLAGS=`$PKGCONFIG --libs librsvg-2.0`
- else
- RSVG_LDFLAGS="-lrsvg-2.0"
- fi
- fi
- if test "$enable_rsvg" != "no" ; then
- AC_CHECK_LIB(rsvg-2, rsvg_handle_render_cairo,
- [ LDFLAGS="$LDFLAGS $RSVG_LDFLAGS"
- CFLAGS="$CFLAGS $RSVG_CFLAGS"
- enable_rsvg="yes"
- AC_DEFINE(USE_RSVG, 1, [Define to use rsvg]) ],
- [ enable_rsvg="no"
- AC_MSG_WARN([unable to use rsvg, rsvg support disabled]) ],
- [ $RSVG_LDFLAGS ])
- fi
- if test "$enable_rsvg" = "no" ; then
- if test "$enable_cairo" != "no" ; then
- AC_MSG_WARN([disabling Cairo because rsvg is disabled])
- enable_cairo="no"
- fi
- fi
- if test "$enable_rsvg" = "yes" ; then
- LDFLAGS="$LDFLAGS $CAIRO_LDFLAGS"
- CFLAGS="$CFLAGS $CAIRO_CFLAGS"
- AC_DEFINE(USE_CAIRO, 1, [Define to use Cairo]) ],
- fi
- ############################################################################
- # Check if JPEG support was requested and available.
- ############################################################################
- AC_ARG_ENABLE(jpeg,
- AC_HELP_STRING([--disable-jpeg], [disable JPEG images]) )
- if test "$enable_jpeg" != "no" ; then
- if test "$use_pkgconfig_jpeg" = "yes" ; then
- JPEG_CFLAGS=`$PKGCONFIG --cflags libjpeg`
- JPEG_LDFLAGS=`$PKGCONFIG --libs libjpeg`
- else
- JPEG_LDFLAGS="-ljpeg"
- fi
- fi
- if test "$enable_jpeg" != "no" ; then
- AC_CHECK_LIB(jpeg, jpeg_start_decompress,
- [ LDFLAGS="$LDFLAGS $JPEG_LDFLAGS"
- CFLAGS="$CFLAGS $JPEG_CFLAGS"
- enable_jpeg="yes"
- AC_DEFINE(USE_JPEG, 1, [Define to use libjpeg]) ],
- [ enable_jpeg="no"
- AC_MSG_WARN([unable to use libjpeg, JPEG support disabled]) ],
- [ $JPEG_LDFLAGS ])
- fi
- ############################################################################
- # Check if XFT support was requested and available.
- ############################################################################
- AC_ARG_ENABLE(xft, AC_HELP_STRING([--disable-xft], [disable Xft]) )
- if test "$enable_xft" != "no"; then
- if test "$use_pkgconfig_freetype2" = "yes" ; then
- FT2_CFLAGS=`$PKGCONFIG --cflags freetype2`
- FT2_LDFLAGS=`$PKGCONFIG --libs freetype2`
- elif which freetype-config >/dev/null ; then
- FT2_CFLAGS=`freetype-config --cflags`
- FT2_LDFLAGS=`freetype-config --libs`
- else
- FT2_CFLAGS=""
- FT2_LDFLAGS=""
- fi
- if test "$use_pkgconfig_xft" = "yes" ; then
- XFT_CFLAGS=`$PKGCONFIG --cflags xft`
- XFT_LDFLAGS=`$PKGCONFIG --libs xft`
- elif which xft-config >/dev/null ; then
- XFT_CFLAGS=`xft-config --cflags`
- XFT_LDFLAGS=`xft-config --libs`
- else
- XFT_LDFLAGS="-lXft"
- fi
- fi
- if test "$enable_xft" != "no" ; then
- AC_CHECK_LIB(Xft, XftFontOpenName,
- [ LDFLAGS="$LDFLAGS $XFT_LDFLAGS $FT2_LDFLAGS"
- CFLAGS="$CFLAGS $XFT_CFLAGS $FT2_CFLAGS"
- enable_xft="yes"
- AC_DEFINE(USE_XFT, 1, [Define to enable Xft]) ],
- [ enable_xft="no"
- AC_MSG_WARN([unable to use Xft]) ],
- [ $XFT_LDFLAGS $FT2_LDFLAGS ])
- fi
- if test "$enable_xft" != "no" ; then
- AC_CHECK_HEADER([ft2build.h], [], [], [
- #include <X11/Xlib.h>
- ])
- fi
- ############################################################################
- # Check if support for the XRENDER extension was requested and available.
- ############################################################################
- AC_ARG_ENABLE(xrender,
- AC_HELP_STRING([--disable-xrender], [disable XRender]) )
- if test "$enable_xrender" != "no"; then
- if test "$use_pkgconfig_xrender" = "yes" ; then
- XRENDER_CFLAGS=`$PKGCONFIG --cflags xrender`
- XRENDER_LDFLAGS=`$PKGCONFIG --libs xrender`
- else
- XRENDER_LDFLAGS="-lXrender"
- fi
- AC_CHECK_HEADERS([X11/extensions/Xrender.h], [],
- [
- enable_xrender="no";
- AC_MSG_WARN([unable to use X11/extensions/Xrender.h])
- ], [
- #include <X11/Xlib.h>
- ])
- fi
- if test "$enable_xrender" != "no" ; then
- AC_CHECK_LIB(Xrender, XRenderComposite,
- [ LDFLAGS="$LDFLAGS $XRENDER_LDFLAGS"
- CFLAGS="$CFLAGS $XRENDER_CFLAGS"
- enable_xrender="yes"
- AC_DEFINE(USE_XRENDER, 1, [Define to enable the XRender extension]) ],
- [ enable_xrender="no"
- AC_MSG_WARN([unable to use the XRender extension]) ],
- [ $XRENDER_LDFLAGS ])
- fi
- ############################################################################
- # Check if FriBidi support was requested and available.
- ############################################################################
- AC_ARG_ENABLE(fribidi,
- AC_HELP_STRING([--disable-fribidi],
- [disable bi-directional unicode support]) )
- if test "$enable_fribidi" != "no" ; then
- if test "$use_pkgconfig_fribidi" = "yes" ; then
- FRIBIDI_CFLAGS=`$PKGCONFIG --cflags fribidi`
- FRIBIDI_LDFLAGS=`$PKGCONFIG --libs fribidi`
- elif which fribidi-config >/dev/null ; then
- FRIBIDI_CFLAGS=`fribidi-config --cflags`
- FRIBIDI_LDFLAGS=`fribidi-config --libs`
- else
- FRIBIDI_LDFLAGS="-lfribidi"
- fi
- fi
- if test "$enable_fribidi" != "no" ; then
- AC_CHECK_LIB(fribidi, fribidi_charset_to_unicode,
- [ LDFLAGS="$LDFLAGS $FRIBIDI_LDFLAGS"
- CFLAGS="$CFLAGS $FRIBIDI_CFLAGS"
- enable_fribidi="yes"
- AC_DEFINE(USE_FRIBIDI, 1, [Define to use FriBidi]) ],
- [ enable_fribidi="no"
- AC_MSG_WARN([unable to use FriBidi]) ],
- [ $FRIBIDI_LDFLAGS ])
- fi
- ############################################################################
- # Check if XPM support was requested and available.
- ############################################################################
- AC_ARG_ENABLE(xpm,
- AC_HELP_STRING([--disable-xpm], [disable XPM images]) )
- if test "$enable_xpm" != "no"; then
- # We need to use the XPM libraries in Motif-2.1 on IRIX.
- if test `uname` = "IRIX" -o `uname` = "IRIX64" ; then
- CFLAGS="$CFLAGS -I/usr/Motif-2.1/include"
- LDFLAGS="$LDFLAGS -L/usr/Motif-2.1/lib"
- fi
- AC_CHECK_HEADERS([X11/xpm.h], [],
- [ enable_xpm="no";
- AC_MSG_WARN([unable to use X11/xpm.h]) ])
- fi
- if test "$enable_xpm" != "no"; then
- AC_CHECK_DECL(XpmAllocColor, [],
- [ enable_xpm="no"
- AC_MSG_WARN([XPM library too old]) ],
- [
- #include <X11/xpm.h>
- ])
- fi
- if test "$enable_xpm" != "no"; then
- AC_CHECK_LIB(Xpm, XpmReadFileToImage,
- [ LDFLAGS="$LDFLAGS -lXpm";
- enable_xpm="yes"
- AC_DEFINE(USE_XPM, 1, [Define to enable XPM support]) ],
- [ enable_xpm="no"
- AC_MSG_WARN([unable to use libXpm]) ])
- fi
- ############################################################################
- # Check if support for the shape extension was requested and available.
- ############################################################################
- AC_ARG_ENABLE(shape,
- AC_HELP_STRING([--disable-shape], [disable use of the X shape extension]) )
- if test "$enable_shape" != "no"; then
- AC_CHECK_LIB(Xext, XShapeCombineRectangles,
- [ LDFLAGS="$LDFLAGS -lXext"
- enable_shape="yes"
- AC_DEFINE(USE_SHAPE, 1, [Define to enable the X shape extension]) ],
- [ enable_shape="no"
- AC_MSG_WARN([unable to use the X shape extension]) ])
- fi
- ############################################################################
- # Check if support for Xmu was requested and available.
- # Note that Xmu appears to be broken on IRIX (drawing rounded rectangles
- # larger than 800 pixels in either direction causes problems).
- ############################################################################
- AC_ARG_ENABLE(xmu,
- AC_HELP_STRING([--disable-xmu], [disable Xmu support]),
- [],
- [ if test `uname` = "IRIX" -o `uname` = "IRIX64" ; then
- AC_MSG_WARN([disabling Xmu (it is broken on IRIX)])
- enable_xmu="no"
- fi
- ])
- if test "$enable_xmu" != "no"; then
- AC_CHECK_LIB(Xmu, XmuDrawRoundedRectangle,
- [ LDFLAGS="$LDFLAGS -lXmu"
- enable_xmu="yes"
- AC_DEFINE(USE_XMU, 1, [Define to use Xmu]) ],
- [ enable_xmu="no"
- AC_MSG_WARN([unable to use Xmu]) ])
- fi
- ############################################################################
- # Check if support for Xinerama was requested and available.
- ############################################################################
- AC_ARG_ENABLE(xinerama,
- AC_HELP_STRING([--disable-xinerama], [disable Xinerama support]) )
- if test "$enable_xinerama" != "no"; then
- AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
- [ LDFLAGS="$LDFLAGS -lXinerama"
- enable_xinerama="yes"
- AC_DEFINE(USE_XINERAMA, 1, [Define to enable Xinerama]) ],
- [ enable_xinerama="no"
- AC_MSG_WARN([unable to use Xinerama]) ])
- fi
- ############################################################################
- # Check if support for gettext was requested and available.
- ############################################################################
- # Use m4_pattern_allow to work around gettext's use of AM_PROG_MKDIR_P.
- m4_pattern_allow([AM_PROG_MKDIR_P])
- AM_GNU_GETTEXT([external])
- LDFLAGS="$LDFLAGS $LIBINTL"
- ############################################################################
- # Check if debug mode was requested.
- ############################################################################
- AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--enable-debug], [use this to debug JWM]) )
- if test "$enable_debug" = "yes"; then
- AC_DEFINE(DEBUG, 1, [Define to debug JWM])
- CFLAGS="$CFLAGS -Wall -g -DDEBUG"
- LDFLAGS="$LDFLAGS -g"
- else
- enable_debug="no"
- fi
- ############################################################################
- # Create the output files.
- ############################################################################
- if test "$prefix" = "NONE" ; then
- PREFIX="$ac_default_prefix"
- prefix="$ac_default_prefix"
- else
- PREFIX="$prefix"
- fi
- if test "$exec_prefix" = "NONE" ; then
- exec_prefix="$PREFIX"
- fi
- if test "$sysconfdir" = "" ; then
- sysconfdir="$ac_default_sysconfdir"
- fi
- if test "$mandir" = "" ; then
- mandir="$ac_default_mandir"
- fi
- if test "$LOCALEDIR" = "" ; then
- localedir=`eval echo \""$datadir"/locale\"`
- localedir=`eval echo \""$localedir"\"`
- CFLAGS="$CFLAGS -DLOCALEDIR=\\\"$localedir\\\""
- fi
- BINDIR=`eval echo \""$bindir"\"`
- SYSCONF=`eval echo \""$sysconfdir"\"`
- MANDIR=`eval echo \""$mandir"\"`
- MANDIR=`eval echo \""$MANDIR"\"`
- AC_DEFINE_UNQUOTED(SYSTEM_CONFIG, "$SYSCONF/system.jwmrc",
- [default system configuration path])
- AC_SUBST(CFLAGS)
- AC_SUBST(LDFLAGS)
- AC_SUBST(VERSION, "$PACKAGE_VERSION")
- AC_SUBST(INSTVERSION, `echo $PACKAGE_VERSION | tr -d .`)
- AC_SUBST(BINDIR, "$BINDIR")
- AC_SUBST(MANDIR, "$MANDIR")
- AC_SUBST(DATE, `date "+%Y-%m-%d"`)
- AC_SUBST(SYSCONF, "$SYSCONF")
- AC_SUBST(PACKAGE, "$PACKAGE")
- AC_OUTPUT(
- po/Makefile.in
- Makefile
- src/Makefile
- jwm.1
- )
- ############################################################################
- # Display the status.
- ############################################################################
- echo "Compiler: $CC"
- echo "Compile flags: $CFLAGS"
- echo "Link flags: $LDFLAGS"
- echo
- echo "Options"
- echo
- echo " Confirm: $enable_confirm"
- echo " Icon: $enable_icons"
- echo " Cairo: $enable_cairo"
- echo " RSVG: $enable_rsvg"
- echo " PNG: $enable_png"
- echo " JPEG: $enable_jpeg"
- echo " XPM: $enable_xpm"
- echo " XFT: $enable_xft"
- echo " XRender: $enable_xrender"
- echo " FriBidi: $enable_fribidi"
- echo " Shape: $enable_shape"
- echo " Xmu: $enable_xmu"
- echo " Xinerama: $enable_xinerama"
- echo " Debug: $enable_debug"
- echo
|