From 9e5eddfc3d42afc7455cdccc4907ea57a98aeb47 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Wed, 13 Feb 2013 21:33:09 +0000 Subject: build-sys: use pkg-config to locate dependencies This commit alters XRANDR (X Resize And Rotate) extension dependency, which is expected to have at least version 1.4. Earlier old versions of xrandr were supported, at least to some extent. --- Makefile.am | 2 +- configure.ac | 320 ++++++++++++++++++------------------------------- m4/acinclude.m4 | 231 ----------------------------------- src/FbTk/FbString.cc | 2 +- src/FbTk/Makefile.am | 4 +- src/Makefile.am | 21 ++++ src/Screen.cc | 17 ++- src/tests/Makefile.am | 6 + util/Makefile.am | 11 ++ util/fbrun/Makefile.am | 8 ++ 10 files changed, 175 insertions(+), 447 deletions(-) delete mode 100644 m4/acinclude.m4 diff --git a/Makefile.am b/Makefile.am index c98336b..63caee6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ SUBDIRS = doc nls src util data MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = acinclude.m4 $(top_srcdir)/3rd/vim/* $(top_srcdir)/3rd/vim/syntax/* +EXTRA_DIST = $(top_srcdir)/3rd/vim/* $(top_srcdir)/3rd/vim/syntax/* uninstall-hook: rmdir $(DESTDIR)$(pkgdatadir) diff --git a/configure.ac b/configure.ac index a7841b5..c21aa77 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,13 @@ AC_C_INLINE AC_TYPE_PID_T AC_TYPE_SIZE_T +m4_ifndef([PKG_PROG_PKG_CONFIG], + [m4_fatal([Could not locate the pkg-config autoconf macros. These are usually +located in /usr/share/aclocal/pkg.m4. If your macros are in a different +location, try setting the environment variable +export ACLOCAL_FLAGS="-I/other/macro/dir" +before running ./autogen.sh or autoreconf again.])]) +PKG_PROG_PKG_CONFIG AC_CHECK_PROGS(regex_cmd, sed) AS_IF(test "x$regex_cmd" = "x",[AC_MSG_ERROR([error. sed is required to build the data files.])]) @@ -221,19 +228,13 @@ CXXFLAGS="$CXXFLAGS $X_CFLAGS" LIBS="$X_LIBS $LIBS" LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS" - -dnl Check for required functions in -lX11 -AC_CHECK_LIB(X11, XOpenDisplay, LIBS="-lX11 $LIBS", AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])) -LIBS="$X_EXTRA_LIBS $LIBS" - +dnl Check for xpg4 AC_CHECK_LIB(xpg4, setlocale, LIBS="-lxpg4 $LIBS") AC_CHECK_PROGS(gencat_cmd, gencat) AS_IF(test "x$gencat_cmd" = "x",[NLS=""],[]) Xext_lib="" - - dnl Check for Remember options AC_MSG_CHECKING([whether to include remember functionality]) AC_ARG_ENABLE(remember, @@ -242,7 +243,6 @@ AC_MSG_RESULT([$enable_remember]) AS_IF(test "x$enable_remember" = "xyes",[AC_DEFINE(REMEMBER, 1, " compile with remember")],[]) AM_CONDITIONAL(REMEMBER_SRC, test "x$enable_remember" = "xyes") - AC_MSG_CHECKING([whether to have (POSIX) regular expression support]) AC_ARG_ENABLE(regexp, AS_HELP_STRING([--enable-regexp],[regular expression support (default=yes)]),,[enable_regexp=yes]) @@ -256,9 +256,6 @@ AS_IF(test "x$enable_regexp" = "xyes",[ )],[]) AM_CONDITIONAL(REGEXP_SRC, test x$REGEXP_SRC = xtrue) - - - dnl Check for the Slit AC_MSG_CHECKING([whether to include the Slit]) AC_ARG_ENABLE(slit, @@ -267,8 +264,6 @@ AC_MSG_RESULT([$enable_slit]) AS_IF(test "x$enable_slit" = "xyes",[AC_DEFINE(USE_SLIT, 1, " compile with slit")],[]) AM_CONDITIONAL(SLIT_SRC, test "x$enable_slit" = "xyes") - - dnl Check for Systemtray options AC_MSG_CHECKING([whether to include SystemTray]) AC_ARG_ENABLE(systray, @@ -288,8 +283,6 @@ AS_IF(test "x$enable_systray" = "xyes" -a "x$enable_toolbar" != "xyes",[ AS_IF(test "x$enable_toolbar" = "xyes",[AC_DEFINE(USE_TOOLBAR, 1, " compile with toolbar")],[]) AM_CONDITIONAL(TOOLBAR_SRC, test "x$enable_toolbar" = "xyes") - - AC_MSG_CHECKING([whether to support Extended Window Manager Hints]) AC_ARG_ENABLE(ewmh, AS_HELP_STRING([--enable-ewmh],[enable support for Extended Window Manager Hints (default=yes)]),,[enable_ewmh=yes]) @@ -297,8 +290,6 @@ AC_MSG_RESULT([$enable_ewmh]) AS_IF(test "x$enable_ewmh" = "xyes",[AC_DEFINE(USE_EWMH, 1, "use extened window manager hints")],[]) AM_CONDITIONAL(EWMH, test "x$enable_ewmh" = "xyes") - - dnl Check whether to include debugging code DEBUG="" AC_MSG_CHECKING([whether to include verbose debugging code]) @@ -309,8 +300,6 @@ AS_IF(test "x$enable_debug" = "xyes",[ DEBUG="-DDEBUG -Wall" ],[]) AC_SUBST(DEBUG) CXXFLAGS="$CXXFLAGS $DEBUG" - - dnl Check whether to build test programs AC_MSG_CHECKING([whether to build test programs]) AC_ARG_ENABLE(test, @@ -318,8 +307,6 @@ AC_ARG_ENABLE(test, AC_MSG_RESULT([$enable_test]) AM_CONDITIONAL(TEST, test "x$enable_test" = "xyes") - - dnl Check whether to include native language support (i18n) AC_MSG_CHECKING([whether to include NLS support]) AC_ARG_ENABLE(nls, @@ -330,9 +317,6 @@ AS_IF(test "x$enable_nls" = "xyes",[ NLS="-DNLS"],[]) AC_SUBST(NLS) - - - dnl Check for new timed pixmap cache AC_MSG_CHECKING([whether to use a timed pixmap cache]) AC_ARG_ENABLE(timedcache, @@ -341,194 +325,127 @@ AC_MSG_RESULT([$enable_timedcache]) AS_IF(test "x$enable_timedcached" = "xyes",[ AC_DEFINE(TIMEDCACHE, 1, "timed cache")],[]) - - -AC_MSG_CHECKING([whether to have Xft support]) -AM_PATH_XFT(yes, XFT=true, XFT=false) - -AS_IF(test "x$XFT" = "xtrue",[ - AC_TRY_LINK([ - #include - ], [ XftFontClose(0, 0); return 1; ], - [ - - AC_DEFINE(USE_XFT, 1, "antialias support") - AC_MSG_CHECKING([Xft UTF-8 support]) - AC_TRY_LINK([ - #include - ], [ XftDrawStringUtf8(0, 0, 0, 0, 0, 0, 0); return 0; ], - AC_DEFINE(HAVE_XFT_UTF8_STRING, 1, "Xft UTF8 support") - FEATURES="$FEATURES XFT" - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) - ], - [ AC_MSG_RESULT([Could not link with Xft. Install Xft if you want support for it.]) - XFT=false - ])]) - -AM_CONDITIONAL(XFT, test "x$XFT" = "xtrue") - - -AC_MSG_CHECKING([whether to have XRENDER (transparent) support]) -AC_ARG_ENABLE(xrender, - AS_HELP_STRING([--enable-xrender],[XRENDER (transparent) support (default=yes)]),,[enable_xrender=yes]) -AC_MSG_RESULT([$enable_xrender]) -AS_IF(test "x$enable_xrender" = "xyes",[ - AC_CHECK_LIB(Xrender, XRenderCreatePicture, - AC_DEFINE(HAVE_XRENDER, 1, "Xrender support") - LIBS="-lXrender $LIBS") - ],[]) - - -XPM=false -AC_MSG_CHECKING([whether to have XPM (pixmap themes) support]) -AC_ARG_ENABLE(xpm, - AS_HELP_STRING([--enable-xpm],[XPM (pixmap themes) support (default=yes)]),[],[enable_xpm=yes]) -AC_MSG_RESULT([$enable_xpm]) -AS_IF(test "x$enable_xpm" = "xyes",[ - AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, - AC_DEFINE(HAVE_XPM, 1, "Xpm support") - XPM=true - LIBS="-lXpm $LIBS") - ],[]) - -AM_CONDITIONAL(XPM, test "x$XPM" = "xtrue") - -dnl Check whether to use imlib2 -IMLIB2=false -AC_MSG_CHECKING([whether to have IMLIB2 (pixmap themes) support]) -AC_ARG_ENABLE(imlib2, - AS_HELP_STRING([--enable-imlib2], [IMLIB2 (pixmap themes) support (default=yes)]), , [enable_imlib2=yes]) -AC_MSG_RESULT([$enable_imlib2]) -AS_IF(test x$enable_imlib2 = "xyes",[ - AC_PATH_GENERIC(imlib2, 1.0.0,[ - IMLIB2=true - AC_DEFINE(HAVE_IMLIB2, [], [Imlib2 support]) - LIBS="$IMLIB2_LIBS $LIBS" - CXXFLAGS="$CXXFLAGS $IMLIB2_CFLAGS" - FEATURES="$FEATURES IMLIB2" - ], [] - )],[]) - -AM_CONDITIONAL(IMLIB2, test "x$IMLIB2" = "xtrue") - - - AC_MSG_CHECKING([whether to have XMB (multibyte font, utf-8) support]) AC_ARG_ENABLE(xmb, AS_HELP_STRING([--enable-xmb],[XMB (multibyte font, utf-8) support (default=yes)]),,[enable_xmb=yes]) AC_MSG_RESULT([$enable_xmb]) AS_IF([test "x$enable_xmb" = "xyes"],[ AC_DEFINE(USE_XMB, 1, "multibyte support")], []) AM_CONDITIONAL(MULTIBYTE, test "x$enable_xmb" = "xyes") +dnl Check for imlib2 +have_imlib2=no +AC_ARG_ENABLE([imlib2], AS_HELP_STRING([--disable-imlib2], [disable imlib2 support])) +AS_IF([test "x$enable_imlib2" != "xno"], [ + PKG_CHECK_MODULES([IMLIB2], [ imlib2 >= 1.0.0 ], + [AC_DEFINE([HAVE_IMLIB2], [1], [Define if imlib2 is available]) have_imlib2=yes], [have_imlib2=no]) + AS_IF([test "x$have_imlib2" = xno -a "x$enable_imlib2" = xyes], [ + AC_MSG_ERROR([*** imlib2 support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([IMLIB2], [test "$have_imlib2" = "yes"]) + +dnl Check for X11 +PKG_CHECK_MODULES([X11], [ x11 ], + [AC_DEFINE([HAVE_X11], [1], [Define if x11 is available]) have_x11=yes], + [have_x11=no]) +AM_CONDITIONAL([X11], [test "$have_x11" = "yes"], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])) + +have_xft=no +AC_ARG_ENABLE([xft], AS_HELP_STRING([--disable-xft], [disable xft support])) +AS_IF([test "x$enable_xft" != "xno"], [ + PKG_CHECK_MODULES([XFT], [ xft ], + [AC_DEFINE([USE_XFT], [1], [Define if xft is available]) have_xft=yes], [have_xft=no]) + AS_IF([test "x$have_xft" = xno -a "x$enable_xft" = xyes], [ + AC_MSG_ERROR([*** xft support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([XFT], [test "$have_xft" = "yes"]) +AS_IF([test "$have_xft" = "yes"], [ + AC_CHECK_LIB([Xft], [XftDrawStringUtf8], [have_utf8=yes], [have_utf8=no]) + AS_IF([test "$have_utf8" = yes], [ + AC_DEFINE([HAVE_XFT_UTF8_STRING], [1], [Define if you have XftDrawStringUtf8]) + ]) + PKG_CHECK_MODULES([FONTCONFIG], [ fontconfig ], [], AC_MSG_ERROR([Could not find -lfontconfig.])) +]) + +have_xrender=no +AC_ARG_ENABLE([xrender], AS_HELP_STRING([--disable-xrender], [disable xrender support])) +AS_IF([test "x$enable_xrender" != "xno"], [ + PKG_CHECK_MODULES([XRENDER], [ xrender ], + [AC_DEFINE([HAVE_XRENDER], [1], [Define if xrender is available]) have_xrender=yes], [have_xrender=no]) + AS_IF([test "x$have_xrender" = xno -a "x$enable_xrender" = xyes], [ + AC_MSG_ERROR([*** xrender support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([XRENDER], [test "$have_xrender" = "yes"]) + +have_xpm=no +AC_ARG_ENABLE([xpm], AS_HELP_STRING([--disable-xpm], [disable xpm support])) +AS_IF([test "x$enable_xpm" != "xno"], [ + PKG_CHECK_MODULES([XPM], [ xpm ], + [AC_DEFINE([HAVE_XPM], [1], [Define if xpm is available]) have_xpm=yes], [have_xpm=no]) + AS_IF([test "x$have_xpm" = xno -a "x$enable_xpm" = xyes], [ + AC_MSG_ERROR([*** xpm support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([XPM], [test "$have_xpm" = "yes"]) dnl Check for Xinerama support and proper library files. -AC_MSG_CHECKING([whether to build support for the XINERAMA extension]) -AC_ARG_ENABLE(xinerama, - AS_HELP_STRING([--enable-xinerama], [XINERAMA extension support (default=yes)]), ,[enable_xinerama=yes]) - -AS_IF(test "x$enable_xinerama" = "xyes",[ - AC_CHECK_LIB(Xinerama, XineramaQueryScreens, - AC_MSG_CHECKING([for X11/extensions/Xinerama.h]) - AC_TRY_COMPILE( -#include -#include -#include - , XineramaQueryScreens(0, 0), - AC_MSG_RESULT([yes]) - AC_DEFINE(XINERAMA, [1], [Define to 1 if you have XINERAMA]) - LIBS="-lXinerama $LIBS" - FEATURES="$FEATURES XINERAMA", - AC_MSG_RESULT([no])))],[ - AC_MSG_RESULT([no]) - CONFIGOPTS="$CONFIGOPTS --disable-xinerama"]) - +have_xinerama=no +AC_ARG_ENABLE([xinerama], AS_HELP_STRING([--disable-xinerama], [disable xinerama support])) +AS_IF([test "x$enable_xinerama" != "xno"], [ + PKG_CHECK_MODULES([XINERAMA], [ xinerama ], + [AC_DEFINE([XINERAMA], [1], [Define if xinerama is available]) have_xinerama=yes], [have_xinerama=no]) + AS_IF([test "x$have_xinerama" = xno -a "x$enable_xinerama" = xyes], [ + AC_MSG_ERROR([*** xinerama support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([XINERAMA], [test "$have_xinerama" = "yes"]) dnl Check for XShape extension support and proper library files. -AC_MSG_CHECKING([whether to build support for the XSHAPE extension]) -AC_ARG_ENABLE(shape, - AS_HELP_STRING([--enable-shape], [XSHAPE extension support (default=yes)]), , [enable_shape=yes]) -AS_IF(test "x$enable_shape" = "xyes",[ - AC_CHECK_LIB(Xext, XShapeCombineShape, - AC_MSG_CHECKING([for X11/extensions/shape.h]) - AC_TRY_COMPILE( -#include -#include -#include - , long foo = ShapeSet, - AC_MSG_RESULT([yes]) - AC_DEFINE(SHAPE, [1], [Define to 1 if you have SHAPE]) - LIBS="-lXext $LIBS" - FEATURES="$FEATURES SHAPE", - AC_MSG_RESULT([no])))],[ - AC_MSG_RESULT([no]) - CONFIGOPTS="$CONFIGOPTS --disable-shape"]) - - +have_xext=no +AC_ARG_ENABLE([xext], AS_HELP_STRING([--disable-xext], [disable Misc X Extension Library support])) +AS_IF([test "x$enable_xext" != "xno"], [ + PKG_CHECK_MODULES([XEXT], [ xext ], + [AC_DEFINE([SHAPE], [1], [Define if xext is available]) have_xext=yes], [have_xext=no]) + AS_IF([test "x$have_xext" = xno -a "x$enable_xext" = xyes], [ + AC_MSG_ERROR([*** xext support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([XEXT], [test "$have_xext" = "yes"]) dnl Check for RANDR support and proper library files. - -AC_MSG_CHECKING([whether to build support for the XRANDR (X Resize And Rotate) extension]) -AC_ARG_ENABLE(randr, - AS_HELP_STRING([--enable-randr], [XRANDR extension support (default=no)]),,[enable_randr=yes]) - -AS_IF(test "x$enable_randr" = "xyes", [ - AC_MSG_RESULT([yes]) - AC_CHECK_LIB(Xrandr, XRRQueryExtension, [ - AC_MSG_CHECKING([for X11/extensions/Xrandr.h]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[#include -#include -#include - ]], [[XRRQueryExtension(0, 0, 0);]] - )], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_RANDR, [1], [Define to 1 if you have RANDR]) - LIBS="-lXrandr $LIBS" - FEATURES="$FEATURES RANDR" - - AC_MSG_CHECKING([for XRRUpdateConfiguration]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([[#include -#include -#include - ]], [[XRRUpdateConfiguration(0);]] - )], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_RANDR1_2, [1], [Define to 1 if you have RANDR 1.2]) - ], [ - AC_MSG_RESULT([no]) - ]) - ], [ - AC_MSG_RESULT([no]) - ]) - ],[ - AC_MSG_RESULT([no]) - ])],[ - AC_MSG_RESULT([no]) - CONFIGOPTS="$CONFIGOPTS --disable-randr"]) - - - - -AC_MSG_CHECKING([whether to have FRIBIDI support]) -AC_ARG_ENABLE(fribidi, - AS_HELP_STRING([--enable-fribidi], [FRIBIDI support (default=yes)]), , [enable_fribidi=yes]) -AS_IF(test "x$enable_fribidi" = "xyes",[ - AC_MSG_RESULT([yes]) - AC_CHECK_LIB(fribidi, fribidi_version_info, - AC_MSG_CHECKING([for fribidi/fribidi.h]) - AC_TRY_COMPILE( -#include - , fribidi_version_info, - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_FRIBIDI, [1], [Define to 1 if you have FRIBIDI]) - LIBS="-lfribidi $LIBS", - AC_MSG_RESULT([no])))],[ - AC_MSG_RESULT([no]) - CONFIGOPTS="$CONFIGOPTS --disable-fribidi"]) - - +have_xrandr=no +AC_ARG_ENABLE([xrandr], AS_HELP_STRING([--disable-xrandr], [disable xrandr support])) +AS_IF([test "x$enable_xrandr" != "xno"], [ + PKG_CHECK_MODULES([RANDR], [ xrandr >= 1.4.0 ], + [AC_DEFINE([HAVE_RANDR], [1], [Define if xrandr is available]) have_xrandr=yes], [have_xrandr=no]) + AS_IF([test "x$have_xrandr" = xno -a "x$enable_xrandr" = xyes], [ + AC_MSG_ERROR([*** xrandr support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([RANDR], [test "$have_xrandr" = "yes"]) + +have_fribidi=no +AC_ARG_ENABLE([fribidi], AS_HELP_STRING([--disable-fribidi], [disable fribidi support])) +AS_IF([test "x$enable_fribidi" != "xno"], [ + PKG_CHECK_MODULES([FRIBIDI], [ fribidi ], + [AC_DEFINE([HAVE_FRIBIDI], [1], [Define if fribidi is available]) have_fribidi=yes], [have_fribidi=no]) + AS_IF([test "x$have_fribidi" = xno -a "x$enable_fribidi" = xyes], [ + AC_MSG_ERROR([*** fribidi support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([FRIBIDI], [test "$have_fribidi" = "yes"]) + +have_freetype2=no +AC_ARG_ENABLE([freetype2], AS_HELP_STRING([--disable-freetype2], [disable freetype2 support])) +AS_IF([test "x$enable_freetype2" != "xno"], [ + PKG_CHECK_MODULES([FREETYPE2], [ freetype2 ], + [AC_DEFINE([HAVE_FREETYPE2], [1], [Define if freetype2 is available]) have_freetype2=yes], [have_freetype2=no]) + AS_IF([test "x$have_freetype2" = xno -a "x$enable_freetype2" = xyes], [ + AC_MSG_ERROR([*** freetype2 support requested but libraries not found]) + ]) +]) +AM_CONDITIONAL([FREETYPE2], [test "$have_freetype2" = "yes"]) AC_ARG_WITH(menu, @@ -675,9 +592,6 @@ dnl Print results AC_MSG_RESULT([]) AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.]) AC_MSG_RESULT([]) -AC_MSG_RESULT([Features:]) -AC_MSG_RESULT([ $FEATURES]) -AC_MSG_RESULT([]) AC_MSG_RESULT([Using:]) AC_MSG_RESULT([ '$prefix' for installation.]) AC_MSG_RESULT([ '$DEFAULT_MENU' for location menu file.]) diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 deleted file mode 100644 index a233530..0000000 --- a/m4/acinclude.m4 +++ /dev/null @@ -1,231 +0,0 @@ -dnl @synopsis AC_PATH_GENERIC(LIBRARY [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl -dnl Runs a LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS -dnl -dnl The script must support `--cflags' and `--libs' args. -dnl If MINIMUM-VERSION is specified, the script must also support the -dnl `--version' arg. -dnl If the `--with-library-[exec-]prefix' arguments to ./configure are given, -dnl it must also support `--prefix' and `--exec-prefix'. -dnl (In other words, it must be like gtk-config.) -dnl -dnl For example: -dnl -dnl AC_PATH_GENERIC(Foo, 1.0.0) -dnl -dnl would run `foo-config --version' and check that it is at least 1.0.0 -dnl -dnl If so, the following would then be defined: -dnl -dnl FOO_CFLAGS to `foo-config --cflags` -dnl FOO_LIBS to `foo-config --libs` -dnl -dnl At present there is no support for additional "MODULES" (see AM_PATH_GTK) -dnl (shamelessly stolen from gtk.m4 and then hacked around a fair amount) -dnl -dnl @author Angus Lees -dnl @version $Id: ac_path_generic.m4,v 1.1.1.1 2001/07/26 00:46:28 guidod Exp $ - -AC_DEFUN([AC_PATH_GENERIC], -[dnl -dnl we're going to need uppercase, lowercase and user-friendly versions of the -dnl string `LIBRARY' -pushdef([UP], translit([$1], [a-z], [A-Z]))dnl -pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl - -dnl -dnl Get the cflags and libraries from the LIBRARY-config script -dnl -AC_ARG_WITH(DOWN-prefix,[ --with-]DOWN[-prefix=PFX Prefix where $1 is installed (optional)], - DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="") -AC_ARG_WITH(DOWN-exec-prefix,[ --with-]DOWN[-exec-prefix=PFX Exec prefix where $1 is installed (optional)], - DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="") - - if test x$DOWN[]_config_exec_prefix != x ; then - DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix" - if test x${UP[]_CONFIG+set} != xset ; then - UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config - fi - fi - if test x$DOWN[]_config_prefix != x ; then - DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix" - if test x${UP[]_CONFIG+set} != xset ; then - UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config - fi - fi - - AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no) - ifelse([$2], , - AC_MSG_CHECKING(for $1), - AC_MSG_CHECKING(for $1 - version >= $2) - ) - no_[]DOWN="" - if test "$UP[]_CONFIG" = "no" ; then - no_[]DOWN=yes - else - UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`" - UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`" - ifelse([$2], , ,[ - DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \ - --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \ - --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \ - --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])" - DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])" - DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])" - - # Compare wanted version to what config script returned. - # If I knew what library was being run, i'd probably also compile - # a test program at this point (which also extracted and tested - # the version in some library-specific way) - if test "$DOWN[]_config_major_version" -lt \ - "$DOWN[]_wanted_major_version" \ - -o \( "$DOWN[]_config_major_version" -eq \ - "$DOWN[]_wanted_major_version" \ - -a "$DOWN[]_config_minor_version" -lt \ - "$DOWN[]_wanted_minor_version" \) \ - -o \( "$DOWN[]_config_major_version" -eq \ - "$DOWN[]_wanted_major_version" \ - -a "$DOWN[]_config_minor_version" -eq \ - "$DOWN[]_wanted_minor_version" \ - -a "$DOWN[]_config_micro_version" -lt \ - "$DOWN[]_wanted_micro_version" \) ; then - # older version found - no_[]DOWN=yes - echo -n "*** An old version of $1 " - echo -n "($DOWN[]_config_major_version" - echo -n ".$DOWN[]_config_minor_version" - echo ".$DOWN[]_config_micro_version) was found." - echo -n "*** You need a version of $1 newer than " - echo -n "$DOWN[]_wanted_major_version" - echo -n ".$DOWN[]_wanted_minor_version" - echo ".$DOWN[]_wanted_micro_version." - echo "***" - echo "*** If you have already installed a sufficiently new version, this error" - echo "*** probably means that the wrong copy of the DOWN-config shell script is" - echo "*** being found. The easiest way to fix this is to remove the old version" - echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the" - echo "*** correct copy of DOWN-config. (In this case, you will have to" - echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf" - echo "*** so that the correct libraries are found at run-time)" - fi - ]) - fi - if test "x$no_[]DOWN" = x ; then - AC_MSG_RESULT(yes) - ifelse([$3], , :, [$3]) - else - AC_MSG_RESULT(no) - if test "$UP[]_CONFIG" = "no" ; then - echo "*** The DOWN-config script installed by $1 could not be found" - echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the UP[]_CONFIG environment variable to the" - echo "*** full path to DOWN-config." - fi - UP[]_CFLAGS="" - UP[]_LIBS="" - ifelse([$4], , :, [$4]) - fi - AC_SUBST(UP[]_CFLAGS) - AC_SUBST(UP[]_LIBS) - - popdef([UP]) - popdef([DOWN]) -]) -# xft.m4 -# Copyright (c) 2002 Henrik Kinnunen (fluxgen at linuxmail.org) - -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -# AM_PATH_XFT1([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -AC_DEFUN([AM_PATH_XFT1], -[ - AC_CHECK_LIB(Xft, XftFontOpen, - XFT_LIBS="-lXft" - [$1], - [$2] - ) -]) - -# AM_PATH_XFT2([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -AC_DEFUN([AM_PATH_XFT2], -[ - if test x$pkg_exec_prefix != x ; then - xft_args="$xft_args --exec-prefix=$pkg_exec_prefix" - if test x${PKG_CONFIG+set} != xset ; then - PKG_CONFIG=$pkg_exec_prefix/bin/pkg-config - fi - fi - - if test x$xft_prefix != x ; then - xft_args="$xft_args --prefix=$xft_prefix" - if test x${PKG_CONFIG+set} != xset ; then - PKG_CONFIG=$xft_prefix/bin/pkg-config - fi - fi - - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - if test "x$PKG_CONFIG" = "xno" ; then - ifelse([$2], , :, [$2]) - else - XFT_CFLAGS=`$PKG_CONFIG $xftconf_args --cflags xft fontconfig` - XFT_LIBS=`$PKG_CONFIG $xftconf_args --libs xft fontconfig` - ifelse([$1], , :, [$1]) - fi -]) - -# AM_PATH_XFT(default-value, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -# Test for Xft, and define XFT_CFLAGS and XFT_LIBS -AC_DEFUN([AM_PATH_XFT], -[ - AC_ARG_WITH(xft-prefix,[ --with-xft-prefix=path Prefix where Xft is installed (optional)], - xft_prefix="$withval", xft_prefix="") - AC_ARG_WITH(pkg-exec-prefix,[ --with-pkg-exec-prefix=path Exec prefix where pkg-config is installed (optional)], - pkg_exec_prefix="$withval", pkg_exec_prefix="") - AC_ARG_ENABLE(xft, [ --enable-xft Xft (antialias) support (default=$1)], - if test "x$enableval" = "xyes"; then - TRY_XFT=yes - else - TRY_XFT=no - fi - , - TRY_XFT=$1 - ) - - if test "x$TRY_XFT" = "xyes"; then - AC_MSG_RESULT(yes) - AM_PATH_XFT2( - [$2], - # xft2 failed: try xft1 - AM_PATH_XFT1( - [$2], - [$3] - AC_MSG_RESULT([Cant find Xft libraries! Disabling Xft])) - ) - else - AC_MSG_RESULT(no) - [$3] - fi - - CFLAGS="$CFLAGS $XFT_CFLAGS" - CXXFLAGS="$CXXFLAGS $XFT_CFLAGS" - LIBS="$XFT_LIBS $LIBS" -]) diff --git a/src/FbTk/FbString.cc b/src/FbTk/FbString.cc index 5577f32..2bc7516 100644 --- a/src/FbTk/FbString.cc +++ b/src/FbTk/FbString.cc @@ -55,7 +55,7 @@ typedef int iconv_t; #endif // HAVE_ICONV #ifdef HAVE_FRIBIDI - #include + #include #endif #ifdef DEBUG diff --git a/src/FbTk/Makefile.am b/src/FbTk/Makefile.am index 3c34b22..983f923 100644 --- a/src/FbTk/Makefile.am +++ b/src/FbTk/Makefile.am @@ -3,7 +3,7 @@ noinst_LIBRARIES = libFbTk.a AM_CPPFLAGS=-include $(top_builddir)/config.h if XFT -xft_SOURCE= XftFontImp.hh XftFontImp.cc +xft_SOURCE = XftFontImp.hh XftFontImp.cc endif if MULTIBYTE xmb_SOURCE= XmbFontImp.hh XmbFontImp.cc @@ -15,6 +15,8 @@ if IMLIB2 imlib2_SOURCE= ImageImlib2.hh ImageImlib2.cc endif +libFbTk_a_CPPFLAGS = $(FREETYPE2_CFLAGS) $(FRIBIDI_CFLAGS) $(AM_CPPFLAGS) + libFbTk_a_SOURCES = App.hh App.cc \ Color.cc Color.hh Command.hh \ ColorLUT.cc ColorLUT.hh \ diff --git a/src/Makefile.am b/src/Makefile.am index 966546c..283e01d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -119,6 +119,27 @@ if SLIT_SRC SLIT_SOURCE = Slit.cc Slit.hh SlitTheme.hh SlitTheme.cc SlitClient.hh SlitClient.cc endif +fluxbox_CPPFLAGS = \ + $(XRANDR_CFLAGS) \ + $(FRIBIDI_CFLAGS) \ + $(AM_CPPFLAGS) + +fluxbox_LDFLAGS = \ + $(FONTCONFIG_LIBS) \ + $(FREETYPE2_LIBS) \ + $(FRIBIDI_LIBS) \ + $(IMLIB2_LIBS) \ + $(RANDR_LIBS) \ + $(X11_LIBS) \ + $(XEXT_LIBS) \ + $(XFT_LIBS) \ + $(XINERAMA_LIBS) \ + $(XPM_LIBS) \ + $(XRENDER_LIBS) \ + $(X_EXTRA_LIBS) \ + $(X_LIBS) \ + $(X_PRE_LIBS) + fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \ FbAtoms.hh FbAtoms.cc FbWinFrame.hh FbWinFrame.cc \ FbWinFrameTheme.hh FbWinFrameTheme.cc \ diff --git a/src/Screen.cc b/src/Screen.cc index 05d274a..7cdf150 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -392,21 +392,18 @@ BScreen::BScreen(FbTk::ResourceManager &rm, // setup RANDR for this screens root window -#if defined(HAVE_RANDR1_2) +#if defined(HAVE_RANDR) int randr_mask = RRScreenChangeNotifyMask; -#ifdef RRCrtcChangeNotifyMask +# ifdef RRCrtcChangeNotifyMask randr_mask |= RRCrtcChangeNotifyMask; -#endif -#ifdef RROutputChangeNotifyMask +# endif +# ifdef RROutputChangeNotifyMask randr_mask |= RROutputChangeNotifyMask; -#endif -#ifdef RROutputPropertyNotifyMask +# endif +# ifdef RROutputPropertyNotifyMask randr_mask |= RROutputPropertyNotifyMask; -#endif +# endif XRRSelectInput(disp, rootWindow().window(), randr_mask); - -#elif defined(HAVE_RANDR) - XRRScreenChangeSelectInput(disp, rootWindow().window(), True); #endif // HAVE_RANDR diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 62d7604..73f269f 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -11,12 +11,18 @@ noinst_PROGRAMS= \ testRectangleUtil testTexture_SOURCES = texturetest.cc +testTexture_LDFLAGS = $(X_LIBS) $(X11_LIBS) $(FRIBIDI_LIBS) $(XRENDER_LIBS) $(IMLIB2_LIBS) $(XPM_LIBS) $(XFT_LIBS) $(FONTCONFIG_LIBS) testFont_SOURCES = testFont.cc +testFont_LDFLAGS = $(X_LIBS) $(X11_LIBS) $(FRIBIDI_LIBS) $(XRENDER_LIBS) $(XFT_LIBS) $(FONTCONFIG_LIBS) testSignals_SOURCES = testSignals.cc +testSignals_LDFLAGS = $(X_LIBS) $(X11_LIBS) $(FRIBIDI_LIBS) $(XRENDER_LIBS) testKeys_SOURCES = testKeys.cc +testKeys_LDFLAGS = $(X_LIBS) $(X11_LIBS) $(FRIBIDI_LIBS) $(XRENDER_LIBS) $(XFT_LIBS) $(FONTCONFIG_LIBS) testDemandAttention_SOURCES = testDemandAttention.cc +testDemandAttention_LDFLAGS = $(X_LIBS) $(X11_LIBS) $(FRIBIDI_LIBS) $(XRENDER_LIBS) $(XFT_LIBS) $(FONTCONFIG_LIBS) #testResource_SOURCES = Resourcetest.cc testFullscreen_SOURCES = fullscreentest.cc +testFullscreen_LDFLAGS = $(X_LIBS) $(X11_LIBS) $(FRIBIDI_LIBS) $(XRENDER_LIBS) $(XFT_LIBS) $(FONTCONFIG_LIBS) testStringUtil_SOURCES = StringUtiltest.cc testRectangleUtil_SOURCES = testRectangleUtil.cc diff --git a/util/Makefile.am b/util/Makefile.am index 1123f68..63fe66a 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -6,10 +6,21 @@ bin_PROGRAMS= fbsetroot fluxbox-update_configs fluxbox-remote fbsetroot_SOURCES= fbsetroot.cc fbsetroot.hh fbsetroot_LDADD=../src/FbRootWindow.o ../src/FbAtoms.o \ ../src/FbTk/libFbTk.a +fbsetroot_LDFLAGS = \ + $(FONTCONFIG_LIBS) \ + $(FRIBIDI_LIBS) \ + $(X11_LIBS) \ + $(XFT_LIBS) \ + $(XRENDER_LIBS) + fluxbox_update_configs_SOURCES= fluxbox-update_configs.cc fluxbox_update_configs_LDADD= ../src/defaults.o ../src/Resources.o \ ../src/FbTk/libFbTk.a +fluxbox_update_configs_LDFLAGS = \ + $(FRIBIDI_LIBS) \ + $(X11_LIBS) fluxbox_remote_SOURCES= fluxbox-remote.cc +fluxbox_remote_LDFLAGS = $(X11_LIBS) MAINTAINERCLEANFILES= Makefile.in EXTRA_DIST= fbsetbg fluxbox-generate_menu.in \ diff --git a/util/fbrun/Makefile.am b/util/fbrun/Makefile.am index 57fa1f6..92f7c47 100644 --- a/util/fbrun/Makefile.am +++ b/util/fbrun/Makefile.am @@ -3,6 +3,14 @@ AM_CPPFLAGS= -I$(top_srcdir)/src -I$(top_srcdir)/src/FbTk -include $(top_build bin_PROGRAMS= fbrun fbrun_SOURCES= FbRun.hh FbRun.cc main.cc fbrun.xpm fbrun_LDADD= ${FLUXBOX_SRC_DIR}FbTk/libFbTk.a +fbrun_LDFLAGS = \ + $(FONTCONFIG_LIBS) \ + $(FRIBIDI_LIBS) \ + $(X11_LIBS) \ + $(XINERAMA_LIBS) \ + $(XFT_LIBS) \ + $(XPM_LIBS) \ + $(XRENDER_LIBS) ${FLUXBOX_SRC_DIR}FbTk/libFbTk.a: cd ${FLUXBOX_SRC_DIR}FbTk && make -- cgit v0.11.2